Skip to content

Reference software UI: Nuklear + canvas_ity + pugl editors (desktop, WASM, MCU)#162

Open
jcelerier wants to merge 4 commits into
ui-split-2-ui-corefrom
ui-split-3-soft-ui
Open

Reference software UI: Nuklear + canvas_ity + pugl editors (desktop, WASM, MCU)#162
jcelerier wants to merge 4 commits into
ui-split-2-ui-corefrom
ui-split-3-soft-ui

Conversation

@jcelerier

@jcelerier jcelerier commented Jul 6, 2026

Copy link
Copy Markdown
Member

The bundled reference editor on top of the UI base layer: plug-ins with a declarative struct ui (halp layout DSL, custom paint() widgets) get a real editor in CLAP/VST2/VST3 with no GPU, no external UI framework: Nuklear (widgets, command queue) rendered through canvas_ity (software vector rasterizer) into an RGBA8 framebuffer, windowed via pugl (host-parented child windows, XPutImage/StretchDIBits/CALayer blits).

What's in

  • Soft runtime (binding/ui/soft/): headless-first — surface<T> is "push events, pull pixels" (tests, WASM, MCUs); window_editor<T> is the pugl desktop shell. Real dirty tracking (idle frames ~free), HiDPI incl. live fractional re-scale, instrument theme, font registry.
  • Backend wiring: avnd_target_soft_ui() on CLAP/VST2/VST3 targets; the editor seam from PR 2 picks it up via AVND_SOFT_UI_EDITOR.
  • Previews: avnd_make_ui_preview runs any UI standalone, no host.
  • WASM: the same runtime renders into a Canvas2D (Module.SoftUI); the standalone page's canvas editor drives the same worklet instance as the DOM UI.
  • MCU: ESP32 shell + PlatformIO Inkplate 2 (e-paper) project running the helpers UI on hardware.
  • Tests: headless soft-UI suite (layout, gestures, bus, HiDPI) + end-to-end editor tests through all three bindings on Win32 and X11 (embed, injected drags, IRunLoop protocol, fractional content scale). 107/107 on Linux.

Validation (Linux, clang 19 — see LINUX_VALIDATION.md)

  • 107/107 ctest; clap-validator 83/84 fully pass (84th = known clap-validator bug); Steinberg validator zero crashes; pluginval strictness 10 SUCCESS on the UI plug-ins (real X11 embedding); WASM headless test passes.
  • Perf notes and measured render costs are recorded in LINUX_VALIDATION.md §6.

Part 3/3; stacks on #161.

🤖 Generated with Claude Code

jcelerier and others added 4 commits July 6, 2026 18:13
… shell

The reference editor for declarative layouts (halp DSL Tier A, custom
paint() widgets Tier B): Nuklear runs the widget pass into a command
queue replayed through canvas_ity (software vector rasterizer, one
antialiased pipeline for widgets, text and custom painting) into an
RGBA8 framebuffer.

- headless-first: surface<T> is 'push events, pull pixels' (WASM, MCUs,
  tests); window_editor<T> wraps it in a pugl child view for the
  plug-in editor contract (host-parented, timer-driven, plain
  XPutImage/StretchDIBits/CALayer blits, no GPU).
- idle frames are ~free: runtime.tick() returns a real dirty flag, the
  theme background covers the previous frame so there is no full clear,
  and a 16-tick heartbeat bounds staleness under host automation.
- avnd_target_soft_ui() wires a target; avnd_make_ui_preview() runs any
  UI standalone; test_soft_ui covers layout, interaction gestures, bus
  round-trip, HiDPI (integer + live fractional re-scale) headlessly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ditor tests

Targets with a declarative `struct ui` now get the reference editor in
all three bindings (avnd_target_soft_ui; the prototype emits the
Nuklear/canvas_ity implementation once per plug-in). End-to-end editor
tests drive the same ClapUiPlug through each binding on Win32 and X11:
embed in a real parent window, injected mouse drag, one gesture per
drag, params/automation flow, message-bus round trip; the VST3 one also
asserts the Linux IRunLoop timer protocol and a fractional
setContentScaleFactor mid-session.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The same soft runtime renders into a Canvas2D via putImageData
(Module.SoftUI, bound with embind); the standalone page's canvas editor
drives the same worklet instance as the generated DOM UI (params,
outputs and dirty tracking unified). Headless coverage via node:
gesture protocol, dirty tracking, external sync. Never add --embed-file
to these modules: the same binary runs inside AudioWorkletGlobalScope
where emscripten's FS init aborts — fonts ship next to the module.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ux validation notes

surface<T> flushed to an LCD/e-paper is the whole port: the ESP32 shell
and a PlatformIO Inkplate 2 project run the same helpers UI on real
hardware. LINUX_VALIDATION.md records the full Linux/X11 validation
round of this stack (validators, pluginval, editor tests) and the
render-perf measurements for future work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jcelerier jcelerier force-pushed the ui-split-3-soft-ui branch from 18d4e35 to 35fc40a Compare July 6, 2026 22:18
@jcelerier jcelerier force-pushed the ui-split-2-ui-core branch from 5afa08b to 02e4ebc Compare July 6, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant