Repository navigation
Alicorn v0.2.2
Alicorn is an experimental native GUI runtime for Odin. This release collects
the authoring, hosted-runtime, rendering, diagnostics, and validation work after
v0.2.1. The SDL_GPU renderer remains the default and the visual reference; the
new WebGPU renderer is opt-in.
Highlights
- Opt-in WebGPU renderer (PR #209).
Native SDL3 and browser hosts can present the same retained Runtime through a
shared WebGPU renderer with its own compositor, text/icon/image/material
paths, retained caches, and device-loss recovery. It is selected by importing
alicorn:ui/webgpuor by building the browser target; the defaultui.run,
the numbered SDL_GPU examples (01-14 and15_host_owned_sdl_gpu), and the
headless checks keep using SDL_GPU and do not require wgpu-native. Windows
D3D12/Vulkan, macOS Metal CI, Linux lavapipe CI, and headless Chromium
SwiftShader exercise the shared fixtures. Phase 4 — In progress. Windows
Scratchpad interactive parity and performance validated; sustained
dogfooding, Punks, physical macOS/Linux sessions and WebGPU application
packaging remain outstanding. SDL_GPU removal has not started. - Retained positioned text.
ui.positioned_textplaces ordinary Text nodes
at explicit surface-local coordinates, so rulers, meters, and timelines can
label retained geometry without spacer cells or a parallel label-row layout.
Alignment, baseline placement, clipping, and opacity are explicit; shaping is
retained across moves, and labels stay decorative and out of tab order unless
the application opts into semantics. - Hosted application parity. The hosted Runtime and
ui/webgpu.runnow
expose native menus, integrated titlebar chrome, file dialogs, deferred close,
a per-surface scheduler, synchronous clipboard, file drag-out/drop-in, and one
secondary window with its own chrome and services. Diagnostics (F10 HUD, F11
bounds, F12 capture), live resize, high-DPI transitions, motion scheduling,
theme/font fidelity, tab drag previews, topmost re-entry, and interactive
Scratchpad runs are validated on Windows against the SDL_GPU reference. - Live resize and drag parity. Both SDL3 renderers share one modal-loop
dispatch core. The hosted WebGPU path now presents during a resize or move
drag instead of stretching the last frame, adopts geometry at the window
message, and suppresses re-entrant presentation while a native drag-out is
modal. - Fit-content authoring diagnostics. The #206 investigation found no
panel-specific measurement defect: a padded fit-content container whose scope
closes early measures its padding only. The runtime now names that condition
in its measure trace, regression fixtures pin both the correct tree and the
misuse symptom, andAGENTS.mddocuments the deferred-scope invocation rule. - Broader authoring surface. Per-corner surface radii, two-stop semantic
gradients, bounded circle/arc/Bezier primitives, complete custom Button
presentation, retained interaction scopes, and cluster-aware Unicode fallback
are available to ordinary applications and third-party components.
Added
- Added
ui.positioned_textand the lower-levelalicorn.position_childseam.
horizontalselects.Start,.Center, or.End;verticalselects
.Top,.Middle,.Bottom, or.Baseline. A suppliedwidthorheightis
a hard box,max_widthbounds wrapping, andclipintersects the owner's
rectangle. Positioned children reuse retained shaping, paint commands,
clipping, and semantics, and do not contribute to a fit-content owner's
measured size..Grid,.Split, adaptive owners, and context menus keep
their specialized layout policy and ignore placement. - Added a fit-content measurement trace and fixtures for issue #206. The trace
names a padded fit-content scope that realized no children, and the fixtures
compareui.panelandui.columnacross first frame, retained frames,
resize, viewport sweeps, incremental-versus-fresh solves, and fractional DPI. - Added the opt-in native WebGPU entry
alicorn:ui/webgpu(webgpu.run) and
the browserui.runpath forjs_wasm32. Both reuse the shared
renderer/webgpurenderer,host/presentationsurface presenter,
host/sdl3native host, andhost/webbrowser host. The example set gains
host-owned SDL_GPU presentation (15_host_owned_sdl_gpu), the WebGPU
feasibility fixture (15_webgpu_feasibility), native WebGPU UI
(16_native_webgpu_ui), and browser WebGPU UI (17_browser_webgpu_ui). - Added a shared WebGPU renderer with solid, text, icon, image, material,
custom-surface, compositor, cropped-viewport, and bounded backdrop-effect
paths over retained CPU geometry and shared WGSL sources. Retained caches
survive surface translation and text revisions without rebuilding meshes. - Added browser host capabilities: demand-driven frame scheduling, canvas
sizing/DPR, pointer/wheel/keyboard/textarea input, text composition, focus
mirroring, bounded DOM/ARIA projection, an asynchronous permission-gated
clipboard service, bfcache preservation, and bounded adapter/device retry. - Added native WebGPU device-loss recovery that drains callbacks, preserves the
Hosted_Runtime and input state, recreates primary and secondary surfaces, and
reattaches both presenters. A test-only wgpu-native export can induce D3D12
backend removal for the third loss rung. Opt-in presenter timings and retained
renderer counters expose CPU stages without changing presentation. - Added the application callback surface to
Hosted_Runtime_Config,
ui.run, andui/webgpu.run:on_after_frame,on_close_requested,
on_menu_command,on_dialog,on_file_drop, andon_tick.
ui/webgpu.runuses application-owned root rendering, matching
native/sdl_gpu;ui.runkeeps the host-owned-root contract. - Added
Hosted_Host_Serviceswithwindows,dialogs,quit,clipboard,
file_drag, and a per-surfacescheduler, plusUI_Host_Servicesinjection
into theui.runentry points. The hosted scheduler mirrors the reference's
replaceable Frequent/Opportunistic deadlines and 150 ms opportunistic
deferral. - Added one shared native menu model (
runtime/menus.odin) andhost/menus
adapters, one shared dialog bridge (host/sdl3/dialogs), a hosted chrome
contract and content inset, integrated titlebar chrome for hosted SDL3, and a
secondary window with independent chrome, menus, dialogs, close policy, and
input. - Added the shared
host/sdl3/live_resizedispatch core: SDL exposure redraws,
opt-in queued-resize geometry, a Windows modal move/size timer, primary and
secondary slots, and re-entrancy guards. Both SDL3 renderers plug their frame
policy into the same mechanism. - Added renderer-neutral developer diagnostics to the hosted path:
host/diagnosticssupplies the F10 runtime HUD, F11 retained bounds, and F12
capture bundle, including backend identity and capture-on-failure, to every
ui/webgpu.runsurface. - Added
host/fontsdesktop font seeding and the 15th built-in icon,
More_Horizontal. The SDL_GPU reference,ui.run's native path, and hosted
ui/webgpu.runinstall the same bundled and platform/DirectWrite stack. The
inspector records each text run's resolved faces, unresolved coverage, and
fallback glyphs. - Added bounded per-corner surface radii, opt-in horizontal and vertical
two-stop semantic gradients, and circle/arc/cubic-Bezier shape primitives.
Radii and gradients keep the existing vertex, clipping, and material paths. - Added
Buttoncustom presentation, third-party component recipes, retained
interaction scopes, dynamic image byte buffers, and cluster-aware Unicode
fallback with generation-scoped reshaping. - Added optional per-output presentation revisions for hosts that render
disjoint retained subtrees into separate targets, plus retained point markers,
a bounded rectangle batch, typed semantic-surface color motion, and a
presenter encode-before-acquire window. - Added the matched backend capture harness
tools/compare_backends.ps1with
ppm_diff.py,theme_contrast.py, and their tests, plus Windows runners for
chrome, resize, topmost, DPI, and tab-drag evidence and physical-session
WebGPU runbooks for macOS, Linux, and Windows high DPI.
Changed
- Updated Alicorn's pinned native SDL version to 3.4.20 across macOS builds,
Windows static-link preparation, runtime validation, and package provenance. - Native WebGPU is strictly opt-in at build time. The entry moved from
ui.run_webgputoalicorn:ui/webgpu, and every nativealicorn:ui
consumer no longer compiles the WebGPU host or requires wgpu-native. The
WGPU_SHAREDdefine selects shared rather than static wgpu-native linkage for
the WebGPU examples and fixtures. - The hosted SDL3/WebGPU path now keeps SDL display scale separate from the
drawable-to-logical pixel density. Application descriptions receive display
scale, while presentation derives independent X/Y scales from the drawable. - The Win32 topmost-promotion guard that preserves an integrated-frame window's
rectangle on mouse entry moved intohost/sdl3/window_frame. The hosted
chrome had dropped it; the native SDL_GPU host now delegates to the same
predicate instead of carrying a private copy. - Repository links in current documentation, the changelog, and the website now
use the canonicalCarnival-Science/Alicornname. Historical CI runs, pinned
commit links, and dependency provenance keep their original URLs.
Fixed
- Fixed hosted retained-motion scheduling.
Hosted_Runtimesampled motion on
every step, so pointer storms and submission-completion wakes drove an
animation faster than the display cadence (a 1 ms turn storm presented
200 frames in 400 ms where the reference presents about 24). Each
surface now owns one motion deadline; only a due step samples, and a settled
surface publishes no deadline. A settled window went from 525-1138
idle loop turns per 1.2 s to 7. - Fixed hosted font-initialization parity. The hosted path loaded only bundled
faces, so text outside bundled coverage (for example U+22EF in Scratchpad's
Pinned "more actions" control) boxed only there. Both desktop hosts now seed
the same font stack, and the pinned Scratchpad frame is byte-identical. - Fixed hosted WebGPU output-transfer parity. The reference presents linear-sRGB
theme channels through a non-sRGB swapchain, while the hosted hosts selected
an sRGB surface and applied a second transfer function. Backgrounds, surfaces,
and per-glyph syntax spans were lightened; a light-theme editor read as plain
text. Hosted SDL3 and browser presentations now select a non-sRGB format
first, and a settled Scratchpad frame matches the reference byte for byte. - Fixed hosted pointer dispatch to match
native/sdl_gpuarbitration. The
hosted route now applies interaction scopes first, suppresses application
callbacks while a drag or context menu consumes input, and keeps a captured
split handle's callback, so editor selection and drag gestures behave like
the reference. - Fixed tab drag reorder previews on both hosts. A tab bar that left
drag_preview_modeat its default drew an empty 96x28 card because a tab's
name lives in a child text node.Drag_Preview_Modenow has anAutozero
value that resolves toSource_Subtree, lifting the real tab contour, label,
and state while hiding the source slot;.Labelmode borrows the first
painted descendant text run when the source has no label. - Fixed syntax highlighting disappearing while typing on the hosted path.
Hosted descriptions dropped text paint spans across an edit sequence; the
hosted description path and the retained edit path now preserve spans, and a
regression pins span presentation across a sequence of edits. - Fixed hosted WebGPU first-frame rejection for workbench-like scenes. The
WebGPU solid pass treated a conservative split-quad vertex reservation as an
exact contract and returnedRender_Failurebefore submitting. It now uses
the emitted count and grows the buffer only when emission exceeds the
reservation; encode failures log their stage. - Fixed hosted topmost re-entry. An
ALWAYS_ON_TOPintegrated-chrome child
moved up and to the left on every mouse entry because the hosted port never
carried the Win32 rectangle guard. The shared predicate now prevents the
historical(-8,-31)drift in both renderers. - Fixed hosted high-DPI monitor transitions. Display scale and pixel density
now follow the SDL_GPU reference through syntheticWM_DPICHANGEDand
WM_DISPLAYCHANGEsequences, with per-window independence, text
re-rasterization, chrome re-sync, and hit-test agreement. - Fixed hosted live resize and window movement. The hosted path previously
adopted a new size only on mouse release and stretched the old frame during
the drag. Shared dispatch now presents during the modal loop and adopts
geometry at the window message; measured latency is recorded below. - Fixed hosted close, menu, and dialog integration: a deferred close now
returnsClose_Deferred, menu commands arrive under the native-command
cause, and both SDL3 hosts share one dialog implementation. Windows
Content_Title_Barwindows keep their system decorations where required. - Fixed the hosted opaque
key_codecontract with a typedApplication_Key
route, so application key handling sees the same values as the reference. - Fixed macOS appearance preferences so a change refreshes every open window,
not only the one that received the notification. - Fixed browser focus and accessibility lifetime edges: focus is restored after
semantic node removal, accessibility payloads are released safely, and the
WebGPU host survives bfcache restoration. Keyboard-focusable controls now
advertise the AccessKitFocusaction, so UI Automation reports
IsKeyboardFocusablecorrectly. - Fixed the Odin browser binding's eight rejected-Promise callback chains in
generated build copies; one-shot callbacks can no longer run a success and an
error handler for the same request. Also restoredjs_wasm32guards, passed
the Alicorn collection to point-marker validation, and kept CI SDL rpaths out
of macOS bundles. - Fixed the browser package-boundary build. The shared presenter called
wgpu-native'sDevicePolleven onjs_wasm32, where Odin's JS bindings
deliberately do not declare it (wgpuDevicePoll(mode, timeout)is a
native-only API), sotools/check_web_ui_package.ps1failed with
DevicePoll is not declared by wgpu. The poll seam now splits by target:
native keeps the byte-identicalDevicePollretirement path used by modal
move/resize loops, and the browser target defines the same symbol as a
documented no-op because browser WebGPU delivers queue completion through the
event loop and the presenter'sQueueOnSubmittedWorkDonecallback. - Fixed magnetic tab dragging to stay inside the strip and to avoid vertical
autoscroll during the gesture; disabled buttons no longer emitPress
actions; custom segmented-control labels center correctly; stroked path end
caps are bounded; and canceled marker mask uploads retry.
Performance and measurement
- Retained solid meshes are now stored in local coordinates and reused across
surface translation and text revisions. A settled scene no longer rebuilds
every solid mesh when the paint stream shifts. - The hosted live-resize path cut D3D12's message-to-present stretch window
from 7.3 ms to 2.6 ms at p50 (65%) and 55% at p95, with zero mesh rebuilds
during the drag. Hosted presented 74-75 frames where the reference
presented 58 because the reference also redraws exposures that change
nothing. Vulkan's remaining 4.7 ms is swapchain recreation. - The matched-description workload matrix ran one scene through both renderers
with asserted description counts: identical, transform, color, localized
layout, 1k/10k scroll, multi-window, and settled idle. It records 131
expectations (129 pass, 2 fail), CPU p50/p95/p99, retained-work counters, and
the SDL_GPU solid re-upload finding. - The app-level WebGPU-versus-SDL_GPU comparison uses one executable, one UI
description, and one event loop; only the renderer differs. These are
workload- and machine-specific observations, not a general performance claim.
See the workload matrix
and app-level comparison.
Validation
- Hosted Scratchpad runs on Windows D3D12 and Vulkan match the SDL_GPU
reference for syntax spans and drag selection, tab drag previews, theme color
fidelity, motion scheduling, live resize, topmost re-entry, file
drag-out/drop-in, and font parity. The DPI fixture adds synthetic
WM_DPICHANGED/WM_DISPLAYCHANGEtransitions for geometry, text, hit
testing, and chrome. Several settled frames are byte-identical rather than
merely close. See the validation index. - Native WebGPU interaction was exercised with real
SendInput/SendKeysand
UIA on D3D12 and Vulkan: ASCII and Unicode text, Tab/Shift+Tab, UIA Invoke,
wake callbacks, and an auxiliary window's open/resize/close. Screenshot
evidence, not speech output, remains the accessibility boundary. - The CI feasibility matrix covers macOS arm64 Metal, Linux x64 lavapipe, and
headless Chromium SwiftShader. A live Windows Chromium-family run passed the
core/compositor/effects/material readback matrix on hardware with
fallback=false. - Headless suites, examples, smokes, and the Scratchpad validator passed for
the recorded commits. The current record is in
webgpu-migration.mdand the dated validation
reports; no aggregate test count is a compatibility promise.
Dependencies and toolchain
- Odin baseline:
dev-2026-11. Native WebGPU builds require the pinned
wgpu-nativev29.0.1.1matching Odin'svendor:wgpubindings. Browser builds
needwasm-ldand-extra-linker-flags:"--export-table". - The native host uses SDL 3.4.20; text shaping and rasterization remain on
vendored Runa 1.5.3; the AccessKit C ABI remains 0.23.1 with the separately
pinned Odin binding. - Linux font fallback continues to use Fontconfig. Linux still has no AccessKit
adapter, and this release does not claim broad Linux desktop validation.
Scope and known limitations
- WebGPU is opt-in and experimental. SDL_GPU remains the default, complete
renderer and the parity reference. Phase 4 — In progress. Windows Scratchpad
interactive parity and performance validated; sustained dogfooding, Punks,
physical macOS/Linux sessions and WebGPU application packaging remain
outstanding. Phase 5 (SDL_GPU removal) has not started, and this release does
not replace the production renderer. - Hosted parity evidence is Windows-based. Browser evidence is Chromium-family;
Firefox and Safari are untested. Browser native menus, dialog/close behavior,
and drag-out are not implemented, the browser clipboard remains asynchronous,
and physical browser IME, clipboard permission, and assistive-technology
behavior are unverified. - Physical macOS and Linux WebGPU runs are pending; those platforms have CI
smoke evidence only. Genuine driver/OS device loss has not been triggered;
the recorded recovery evidence is callback-path and harness-induced. - The hosted sRGB surface-format correction is reference parity through
non-sRGB swapchains, not a true sRGB output pipeline. A genuine sRGB
output-transfer path is a separate tracked change and is not part of v0.2.2. - One harness caveat remains for the current toolchain: Windows PowerShell 5.1
can turn the AccessKit binding check's stderr progress into a terminating
error intools/test.ps1. Run the individual stages directly, or use
PowerShell 7, when reproducing a local run. The browser package-boundary
build now compiles ondev-2026-11-nightly:08539cd; see the Fixed section. - Alicorn remains experimental and API-unstable. This release does not promise
production readiness or long-term API compatibility.
Full changelog: v0.2.1...v0.2.2