Deep reviewrev 1571ad5 on dev7 November 2026

Rune, end to end.

Rune is Anomaly's Rust UI framework with its own renderer, text, layout storage and springs. It aims at SwiftUI-on-iPhone feel at 120 Hz on Mac, Windows, Linux, the web and iOS, and coding agents write almost all of it.

This report covers what it is for, how a frame moves from input to pixels, where each subsystem stands, how the plan compares with the code, and how I would make it a better system. It draws on 52 agents' reading and verification of the repository and on tests I ran myself.

  • ~290k
    lines of Rust across 14 crates
  • 176k
    lines in the core crate alone
  • 1,630
    commits in 17 days of public history
  • 3,055
    tests, all headless on a virtual clock
  • 5
    tests failing at HEAD, added by its last commit
  • 0
    required CI checks on the branch apps pin
A dark coding-agent session window drawn by Rune: a sidebar of sessions, a transcript with tool calls and a prompt box.
The README's hero still: OpenCode Desktop recreated in Rune, rendered on 22 October. That example left this repo on 26 October.
01

The verdict

The edges and the core algorithms are right. The middle has no enforced boundaries, and nothing checks the whole system before apps pick it up.

Rune moves faster than any human team could: 1,630 commits and about 290,000 lines of Rust in 17 days of public history. Its central designs are sound, and several are better than its peers'. Springs are closed-form and keep their velocity when interrupted. Layout is solved once at the target state, so views never run for animation. Text goes through a deterministic port of CoreGraphics' rasterizer. On Apple, its own Metal backend cut a HUD frame from 1,395 to 894 thousand instructions. An idle window draws nothing. The speed claims in its research notes come from paired, measured runs, and the notes also record the ideas that were tried and dropped.

The weaknesses are structural coupling, not wrong algorithms. A single generic Runtime<S> with 251 fields holds app state, the presented scene and the paint inputs together. Windows, overlays, the web and iOS embedding each have their own frame loop. Platform behaviour is defined by winit's types and patched from outside, under a dependency that is not pinned. And no required check stands between a commit and the apps that pin dev.

The plan's centrepiece, a render thread fed by a serializable command channel, was never built. I would not build it next. First I would close the loop: a required merge gate, per-frame telemetry and an API guard. Then I would fix the two cliffs users feel, text input and long-field typing. After that I would give the runtime named boundaries: one SurfaceHost for every host, a RuntimeCore of owned subsystems, and a retained, Send paint list. That paint list is the biggest single-thread win, and it is also exactly the snapshot a presenter thread would need. So building the thread becomes a decision taken on measurements, not a rewrite.

Right, and worth keeping

  • The app model: one state type, plain fn(&S, &mut Cx) -> El views, a type-erased element tree and queued &mut S handlers. Agents get short errors, no re-entrancy and nothing to forget to notify.
  • Closed-form springs with exact retarget velocity, and layout solved once at the target state, so views never re-run for animation, hover or scroll.
  • The pure-Rust port of CoreGraphics' glyph pipeline, which renders text the same on every OS and keeps headless output deterministic.
  • The own-or-keep record: Rune's own Metal backend on Apple, wgpu on DX12, Vulkan and WebGPU, Taffy and Parley kept. Each call is backed by numbers.
  • An idle window that draws nothing, and a measurement culture of paired, alternating --profile perf runs.
  • Every app binary doubles as an agent harness: PNG snapshots, element and accessibility trees, scripted input, motion traces.

Missing, and worth fixing first

  • Nothing gates a merge. Five tests failed at HEAD while this review ran, and apps pin dev revs.
  • One 251-field Runtime<S> holds app state, the presented scene and paint inputs. Four hosts each copy the frame loop, so fixes land in some hosts and not others.
  • Text input is whatever winit forwards: four IME events, no document context, none in overlays. The editor reshapes the whole field per keystroke.
  • The paint walk visits every node on every animating frame. It is most of a scroll frame on large trees and the reason the board scroll misses budget.
  • There is no failure model. GPU device loss is silent, panics end apps differently per entry point, and untrusted model output reaches unbounded decoders.
  • PLAN.md still describes a render thread and command channel that were never built, so the agents who read it design against an architecture that does not exist.
Scorecard: where Rune is now, and where the roadmap takes itTen dimensions scored 1–10 by the judge after spot-checking the evidence. Hover or focus a row for the reasoning.
Performance and feel6 → 8
Rendering7 → 8
Text and IME4 → 8
Layout7 → 8
Motion8 → 9
Platform reach4 → 7
Accessibility5 → 7
Architecture and modularity4 → 7
API ergonomics6 → 8
Agent tooling and verification5 → 8
NowTarget after the roadmap
Source: judgment stage (notes/99-judgment.md). Scores are judgments, not measurements.
02

What Rune is

Rune is a Rust UI framework that owns its renderer, its glyph rasterizer, its layout storage, its animation runtime and, on macOS, its GPU backend. Its bar is the feel of SwiftUI on a ProMotion iPhone: 120 Hz, interruptible springs, nothing that pops, jumps or clips hard. It targets macOS, Windows, Linux, the web and iOS, with one look on all of them. That look comes from the app's theme rather than the OS: the core ships no brand, and OpenCode's theme, generated from @opencode/ui, is the first theme built on it.

Anomaly builds it for its own products. The flagship test is to recreate OpenCode Desktop, today an Electron app, and beat it on look and feel on three desktops. Hex's Settings window was the first real screen. Kit's Mac surfaces (HUDs, launchers, pills) and a private iOS client come next. The public page at anoma.ly/rune is itself a Rune app compiled to wasm.

The reason is in PLAN.md's first section. The same small surfaces had been rebuilt three times in ten days: GPUI, then hand-written Metal, then a SwiftUI helper process. Each time the blockers were the same. There was no backdrop blur or glass, animation waited behind the main thread, and window and focus behaviour was wrong for HUDs. Text looked thin, there were no springs, and the upstream fork was frozen.

Agents write it, and agents check it. Every Rune app binary is also its own test harness. --snap renders a PNG, --tree prints the element and accessibility trees, --script drives input by key path and --trace records motion. All of them run offscreen on a virtual clock with the real renderer. The README asks contributors to have their agent open an issue rather than send a pull request.

Why not an existing framework

OptionWhy the plan set it aside
GPUI (Zed)Redraws the whole window on every dirty frame, has no layer compositing or group opacity, animates by re-running views on the main thread, and panics on re-entrant borrows. Kit's fork was frozen at 0.2.2. The plan lifts GPUI's best parts (rope, BoundsTree, line cache, IME code) under Apache-2.0 instead of forking it.
SlintViews live in a markup DSL, and the licence is GPL or commercial. Hex's native branch had stalled on it.
FlutterNot Rust. Its web engine is a fork, and its iOS text does not feel native.
SwiftUI / AppKitApple-only, while Hex and OpenCode also ship on Windows and Linux.
RuneOwn the renderer, glyph rasterizer, layout storage and springs. Depend on foundational crates (Taffy, Parley, AccessKit, wgpu, winit), never on another UI framework.

The app model

An app is plain Rust. One state type S, a view function that returns a keyed element tree, and handlers that change &mut S between frames. There are no macros, no signals and no component objects. The view states targets; the runtime diffs by key path, lays out at the target, and animates the difference on springs. This is the README's own example:

fn view(s: &State, _: &mut Cx<State>) -> El {
    let t = tok::theme(true);
    let label = text(if s.on { "Lights on" } else { "Lights off" })
        .font(type_::TITLE).color(t.text);
    let knob = el().key("knob").size(18.0, 18.0).radius(9.0).fill(t.knob)
        .absolute(if s.on { 18.0 } else { 2.0 }, 2.0);       // a target, not an animation
    let switch = el().key("switch").role("switch").label("Lights").checked(s.on)  // identity + accessibility
        .focusable(true).size(38.0, 22.0).radius(11.0)
        .fill(if s.on { tok::accent(0, true) } else { t.control_off })
        .motion(motion::SNAPPY)                                  // how changes move
        .on_press(|s: &mut State| s.on = !s.on)                // queued, gets &mut State
        .child(knob);
    col().w_full().h_full().center().gap(16.0).fill(t.bg).child(label).child(switch)
}

The tenets, and how they held

Tenet (PLAN.md §2)StatusEvidence
Feel is the product: 120 Hz, interruptible springs, nothing popsHeldMotion gate in cargo test, closed-form springs, pixel snapping. Glass windows run near 80 fps, not 120.
Animation never runs through app codePartlyViews never re-run for animation, but motion shares the one thread with app work, so a busy commit drops frames.
Everything observableHeldThrough CLI flags and files (--snap, --tree, --trace). There is no inspector socket.
One way to do things; small explicit APIs; no macro DSLPartlyNo DSL. But El has 313 builder methods and lib.rs re-exports 268 items.
Native behaviour, one lookPartlyOne themed look holds. Text input comes through winit's four-event IME stream.
Owned, not wrappedHeldNo other UI framework underneath; an own Metal backend on Apple.
Fast path plus reference path, differential-tested on every changePartlyrune-ref covers 10 of 14 instance kinds, springs have an RK4 oracle, rune-taffy a parity test. None runs on every change.
Data-oriented: no Rc/RefCell, zero allocation per frameSlipped173 Rc and 121 RefCell lines in core. Non-committing frames are allocation-tested; commits allocate.
Edits are safe because checks are instantPartlyInstant locally for the crates an agent runs. No CI gate.
Perf measured by counts, so gates are exactPartlyThe counters exist (FrameStats, frame profiles). No scene has a committed budget.
03

Where it stands

Public history starts on 22 October with a 52,000-line import and reaches 1,630 commits by 7 November. Commits peaked at 252 in one day. They have slowed since 1 November as work moved to squash-merged pull requests (#1 to #190), but the code kept growing. Commits land at every hour of the day in similar numbers, which is the signature of a fleet of agents, not a team in one time zone. About 90% carry one author identity.

Commits per dayAuthor dates. 7 November is a partial day.
0100200300Oct 2224262830Nov 1357
Show the numbers
DayCommits
Oct 22166
23252
24151
25141
26125
27161
2849
29140
30187
3140
Nov 130
224
318
446
531
664
75
Source: git log on dev, rev 1571ad57.
Rust lines in the repositoryAll .rs files at the last commit of each day.
0100K200K300KOct 232629Nov 147292k
Source: git ls-tree and cat-file per day.
Commits by hour of dayAuthor-local hour across all 1,630 commits. Activity barely dips overnight.
0255075100000306091215182123
Source: git log --date=format:%H.

Size

One crate holds most of the code. crates/rune has 176,200 lines in 780 files, about 103,000 of them production code. It contains the element API, the runtime, layout glue, the text system and rasterizer, the renderer, the native Metal backend, every platform shell, media, accessibility, tooling, the playground and hot reload. The other thirteen crates are leaves below it or libraries above it.

Lines per crateHover a bar for both parts.
rune176,200
rune-kit40,152
rune-mermaid13,283
rune-motion9,192
rune-fx8,753
rune-light5,937
rune-taffy4,446
rune-knobs3,288
rune-ref2,020
procwatch1,116
rune-perf859
rune-mac581
rune-staging309
rune-register168
Source, including inline test modulesSeparate test files
Source: wc over *.rs per crate; test files are tests.rs, *_tests.rs and tests/.
Inside the core cratecrates/rune grouped by capability. runtime/ alone is 45,715 lines in 175 files.
runtime/commit, input, paint, scroll, selection, motion glue, virtual rows, web runtime, tests45,715
Platform and windowsplatform, window, overlay, native surfaces, menus, tray, clipboard, shortcuts, dialogs28,311
Top-level module filesapp.rs, el.rs, render.rs, memo.rs, overlay.rs, image.rs and 35 more21,645
Integration tests (tests/)120 test files18,353
Tooling, playground, motion gatetooling, playground, motion_gate, rewind14,276
Text and editingtext, edit13,974
Rendering and GPUgpu (incl. native Metal), render, frame12,011
El APIel, memo, latest, app6,375
Benches and examples6,255
Mediavideo, recorder, image5,244
Input and accessibilityinput, a11y4,041
Source: wc over crates/rune/src subdirectories.

Tests

The suite is large and fully headless: 3,055 #[test] functions, plus 19 GUI test binaries, all driven through the public frame API on a virtual clock. I ran the command AGENTS.md documents, cargo test -p rune -p rune-kit --features rune-kit/markdown, on this Mac at rev 1571ad57.

Passed

2,559
including 1,675 in the rune library

Failed

5
all in rune-kit Markdown

Ignored

66
22.5 min wall time, cold build
Regression found during the review

All five failures come from the last commit on dev, #190 (“Markdown: images, link icons and parameter colours…”). I ran the same five test targets on its parent, #189 (f2174a24), and all 198 tests pass. At #190, 193 pass and 5 fail: an_open_span_never_shows_its_markers, table_font_and_padding_set_the_cells…, review_autolinks_skip_images_emails_and_unsafe_schemes, link_and_image_urls_are_not_matched… and a_selection_survives_its_message…. No workflow runs these tests, so nothing stopped the commit from reaching the branch apps pin.

Measured performance

Small apps sit far under budget, and the project has a strong habit of measuring and then fixing what it measures. The misses are specific. Long text fields cost a full reshape per keystroke. A long card in the board app still scrolls over budget because the paint walk visits every node. Glass windows are capped near 80 fps by a pacing rule whose fix is already measured.

Frame and keystroke costs against one 120 Hz frameCPU time per frame or per keystroke. Bars past the line miss a 120 Hz frame.
Settings window frame, meanREADME “Measured”, 23 Oct, before native Metal0.13 ms
Agent client while streaming, p95research/371.59 ms
5 KB text field, one keystrokeresearch/27, 382.2 ms
Chat typing frame after fixes, p95research 31–382.36 ms
Chat resize frame after fixes, p50research 31–382.79 ms
50 KB text field, one keystrokeresearch/27, 32, 3812 ms · over
Board long-card scroll, p95research/37 (82 frames over budget)15.2 ms · over
200 KB text field, one keystrokeresearch/27, 3245.7 ms · over
Sources: README and research notes 27, 31–38, as cited per row. Taken on Apple silicon with --profile perf. Headless numbers leave out GPU upload and presentation.
Measured wins already in the codeEach row on its own scale: the grey dot is before, the blue dot after.
Chat resize frame, p50research 31–382.79 from 17.6 ms −84%
Chat typing frame, p95research 31–382.36 from 13 ms −82%
Markdown same-content commit, p50research/380.167 from 0.851 ms −80%
Markdown commit allocationsresearch/3810 from 5687 allocs −99.8%
50 KB resize frameshape/break key split4.6 from 16.1 ms −71%
Board open-card frames over budgetresearch/371 from 108 frames −99.1%
Cold layer-blur pipeline compileresearch/3445 from 727 ms −94%
HUD frame CPU, wgpu → native Metalresearch/34894 from 1395 kinstr −36%
BeforeAfter
Sources: research notes 31–38 and 34.
Other numbersValueContext
Launch, open to content~300 ms312 ms cold, 299 ms warm; window on screen at 277 ms
Idle cost0 presents77 presents per 20 s fell to 0; timer-woken frames skip when unchanged
hello app memory33 MB footprintRSS 92.5 MB against PLAN's 50 MiB RSS target
Glass windows~80 fpsthe display-link gate measures from the last present; the measured fix has not landed
Web build (rune-www)1.74 MB gzip4.22 MB raw wasm, fonts and resvg off; no size budget tracked
Hot reload, save to GPU~8 sa spike measured 989 ms; the goal is 300 ms
Stripped binary9.3 MBmeasured 23 October, before native Metal
04

How it works

Rune is one large core crate with leaves below it and libraries above it. Below sit rune-motion (springs and the presented Scene, with no dependencies), rune-taffy (Rune's dense layout store over Taffy 0.15) and rune-staging (GPU upload chunks). Above sit rune-kit with about 40 components named after @opencode/ui, the OpenCode theme, rune-knobs, rune-mermaid, and the public site. rune-fx and rune-light plug in at runtime through the Compositor hook and effect slots; they depend on rune only for tests. rune-ref is an independent CPU oracle of the instance stream.

How the crates fit togetherArrows point from a crate to what it depends on. Hover a box for details. rune-kit also pulls rune-mermaid in behind its mermaid feature.
rune-wwwthe public site, a wasm appexamples/30 apps and labsHex · OpenCode Desktop · Kit surfacesoutside the repo; pin dev revsrune-kit40.2k · ~40 componentsrune-theme-opencodetokens from @opencode/uirune-knobs3.3k · live valuesrune-mermaid13.3k · 17 diagram kindsrune-fx8.8k · effectsrune-light5.9k · SDF light, GIrune176.2k lines · 780 files · the monolithic coreruntime 45.7ktext 9.0kplatform 7.9ktooling 6.6kel 5.8kgpu + Metal 5.4kedit 5.0krender 4.7kwindow 4.5kmotion_gate 3.6koverlay 3.4kplayground 2.8kvideo 2.7ka11y 2.2krune-motion9.2k · springs, Scenerune-taffy4.4k · LayoutStorerune-staginguploadsprocwatchopt. · metricswinit 0.30 · wgpu 30 · taffy 0.15parley 0.12 · swash · accesskit 0.25rune-refCPU oracle of instancesfx and light plug in throughthe Compositor hookConsumersComponents and effectsCoreLeaf crates and upstream
Source: the Cargo.toml files; line counts from wc.

One frame, start to finish

Every stage of a frame runs in sequence on the platform main thread. Other threads exist only at the edges, and they feed the main thread by waking it.

A frame's path, by threadBlue outlines run only when something changed. Orange outlines run on every animating frame and visit every node. Hover a step for what it does.
Side threads (wake only)Main thread · winit event loopGPU and OS1Event arriveswindow/events.rs · input/time.rs2Hit test, queue an Actionruntime/input/hit.rs · action.rs3Redraw admissionwindow/draw.rs · platform/display_link.rs4Clock, poll, handlersframe/clock.rs · runtime/frame.rs5Commit: measureruntime/commit/{measure,flatten,relayout}.rs6Commit: apply the diffruntime/commit/apply.rs7Motion steprune-motion scene.rs · motion/tracks.rs8Paint walkruntime/paint/build.rs9Acquire the drawablewindow/pacing.rs · gpu/metal/surface.rs10Upload and encoderender/upload.rs · render.rs · render/layers.rs11Submit and presentwindow/draw.rs · gpu/metal/submit.rs12Loop control, accessibility syncwindow.rs about_to_wait · a11yCVDisplayLinkstores target time, wakesAppHandle · Latest · AccessKitpost work, wake mainImage decoders≤4 per ImageCachePresent workermacOS overlays on wgpu onlyOS inputNSEvent, Win32, Wayland, X11DrawableCAMetalLayer · swapchainGPU queueMetal · DX12 · Vulkan · WebGPUCompletion, presentedTimeMetal's own threadonly when something changedevery animating frame · O(nodes)
Source: synthesis of the runtime, renderer and platform notes, checked against the files named.
The same path in detail, step by step
  1. OS input event arriveswinit 0.30 ApplicationHandler::window_event, crates/rune/src/window.rs:290 -> window/events.rs host.window_event · main (event loop)input::time::arrived stamps the event (NSEvent timestamp on macOS, receipt time elsewhere). Hosts: window::Host, overlay::Overlay, web Browser, LayerHost.
  2. Translate to Runtime input and hit testruntime/input/{pointer,keys,physical,gesture,touch}.rs; hit test in runtime/input/hit.rs:146-239 · mainResolves the target synchronously against the LAST built frame's hits list (paint order), updates capture/hover/press, then pushes Action{path, at} into the ActionQueue (runtime/input/action.rs). Some modifier/key-up observations dispatch synchronously at rest. request_redraw follows.
  3. Cross-thread wakesplatform/display_link.rs:70 tick; app.rs:645-664 AppHandle::update/wake; live.rs; latest/pool.rs; a11y/mod.rs Inbox · CVDisplayLink thread, app threads, Latest pool, AccessKit threads -> mainCVDisplayLink stores the target host time atomically and wakes once via EventLoopProxy (WakeEvent::DisplayTick), never calling request_redraw. AppHandle posts WakeEvent::App per call; window/lifecycle.rs:85-97 drain runs update closures on main. Live<T> values are atomics sampled at paint.
  4. Redraw admissionwindow/draw.rs:64-170 Host::draw · mainSkips covered/minimized windows, honours backoff, asks the display link next_frame (Tick/Now/Wait with half-period admission), and for a timer-woken resting window builds first and returns without acquiring when Presented::unchanged.
  5. Advance clock and frame_stepframe/clock.rs:91 FrameClock::advance -> runtime/frame.rs:335 frame_split -> frame.rs:374-638 frame_step · mainSplits the gap into catch_up (old motion only, MAX_GAP 250 ms) and dt (<=1/120 s). Applies hot patches, catch_up_motion, due timers, poll(&mut S), then drains queued Actions: run_action calls handlers with &mut S and a Tx; routed key/IME/paste after a state change forces a commit first; live_only skips the commit.
  6. Commit: measureruntime/commit.rs:79 commit; commit/relayout.rs:49 measure_commit; commit/measure.rs:357 measure_view; commit/flatten.rs; commit/relayout.rs:212 solve · mainChooses resize-only relayout, virtual-row remount, or a full measure. Full measure runs view(&S,&mut Cx), build_tree (key repair, virtual windows), memo, flatten into Vec<Node> with LayoutStore::sync_node, then Taffy compute_layout with the Parley measure callback, aspect_fit refit, anchor placement, text layout. settle_layout_reads adds up to 2 more measures; focus and caret re-measures can add more (worst case 9 view runs).
  7. Commit: applyruntime/commit/apply.rs:7-869 · mainThe only phase that touches Scene: per-node diff by key, mount/retarget frame, colour and opacity tracks in rune_motion::Scene, presence, flights, growth stacks, scroll states, exits, memo spans, has_* flags, LayoutStore compaction.
  8. Motion stepruntime/frame.rs:658-749 step_motion; crates/rune-motion/src/scene.rs:684 Scene::frame, store.rs:450 tick; growth.rs; runtime/motion/tracks.rs:155 step_scroll · mainSamples analytic tracks at the frame time, prunes exits, steps growth (1/240 s substeps), scroll momentum/glides, reveals and on_scroll_offset callbacks.
  9. Paint walkruntime/paint/build.rs:5 build() · mainWalks every node in paint order, emits 128-byte Instances (14 kinds), glyphs via glyph replay cache and atlas (CoreGraphics-port rasterizer in text/macos/smoothing.rs on a miss), images into the per-runtime ImageAtlas, registers hits, refreshes hover, queues on_layout/on_drawn/on_visible reports for the next frame.
  10. Acquire drawablewindow/pacing.rs acquire -> surface.get_current_texture; gpu/metal/surface.rs nextDrawable on native Metal · mainmacOS checks occlusion first so nextDrawable never waits out a missing vsync; misses back off 250 ms to 2 s. Outdated/Lost are reconfigured, never recreated.
  11. Upload and encoderender/upload.rs:187 prepare (rune-staging), render.rs:968 draw, render/layers.rs, render/backdrop_blur.rs; or compose.rs Compositor::render · mainUpload images and surfaces, diff instance spans in 64-instance blocks, batch by bind group, plan and encode isolated layers, then the frame pass with effect slots and backdrop blur splits. On native Metal buffer writes are memcpy into shared memory.
  12. Submit and presentwindow/draw.rs:280-286; gpu/metal/submit.rs; overlay/frame.rs:100-121; frame/present_worker.rs · main (windows always; overlays on native Metal); rune present worker (macOS overlays on wgpu only)renderer.submit then queue.present, inside a CATransaction when native materials show. Native Metal holds the drawable's command buffer, presents and commits one CB, and paces to IN_FLIGHT=2 via MTLSharedEvent.
  13. Loop control and a11y syncwindow.rs:297-308 about_to_wait; a11y Adapter::sync · mainControlFlow::Poll while any host animates, else Wait or WaitUntil(next deadline). AccessKit tree is rebuilt only if its stamp changed (one comparison when idle).
  14. GPU completiongpu/metal/submit.rs retire; frame/present_time.rs presented handler · Metal completion / Metal's threadKeep-lists retire when the shared event passes their stamp; present timestamps feed --native traces. No command-buffer status check and no device-loss handling.
  15. Web variantplatform/web.rs:509-562 RedrawRequested; platform/web/bridge.js · browser main threadwinit rAF drives the same runtime; sync_input pushes the IME mirror, a11y JSON and page band to the DOM; acquire, draw, present every requested frame (no quiet skip on timer wakes); any acquisition failure ends the app.

Threads: the plan and the code

PLAN.md §3 against the code at rev 1571ad5The plan's “one boundary that matters” does not exist yet.
What PLAN.md §3 describesnot builtApp sidemodels, view fnskeyed diffTaffy at targetParley shapinghandlers (&mut)Render threadpresented treespring tracksscroll physicsscene → instancesencode → presentdiffshitsA serializable command channel between the two.Would let motion survive a busy app, enable split-process iPhone dev, and record replays for free.What the code doesrev 1571ad5Main thread (winit event loop)poll · handlers (&mut S)view → flatten → Taffy + Parleyapply → Scene (springs)motion step · paint walkupload · encodesubmit · presentdisplay linktick → wakeworker poolsLatest, decoders → wakepresent workermacOS overlays, wgpuEvery frame stage runs in sequence on one thread. On a default Macbuild (native Metal) no frame stage leaves it.

One winit event loop owns every window and overlay. Each host holds its Runtime<S>, its window, the shared GPU and its renderer together. Runtime<S> is not Send: handlers are Rc<dyn Fn>, nodes hold Rc text layouts, and the presented Scene is a field of the same struct. So view, commit, layout, shaping, glyph rasterization, motion sampling, the paint walk, uploads, encoding and presentation all run one after another on one thread.

That is less bad than it sounds, and the project knows why. Views never run for animation. The frame clock charges late-frame gaps to running motion, so a busy frame drops frames without moving anything to the wrong place. Research notes 32 to 38 found that missed frames came from rebuilding too much, not from Taffy or Parley, and fixed that on the main thread. Real-app interactions now mostly fit in 8.3 ms. But the plan's promise that a busy app cannot stall motion is not true today. There are also 71 thread_local! blocks in the core. Because every surface shares the main thread, “per thread” means “shared by every window”, which is how some kit caches leak between windows.

The mechanisms that matter

Commit and elision

A commit takes one of three paths. A resize that changed only the viewport lays out the last tree again without running the view. A scrolled virtual list remounts only the rows that enter. Anything else runs the full measure: the view, key repair, memo replay, and flattening into a Vec<Node> and Rune's LayoutStore. Then a Taffy solve with Parley measuring text, and up to two more passes if a layout read changed. Only then does apply diff the result into the Scene's springs. The types enforce the order: Measurement cannot reach the Scene, and apply accepts only Measured.

Invalidation is coarse: any handler that runs re-runs the whole view. Elision comes from four sources: memo, reused flattened subtrees, virtual_rows, and Tx::live_only for handlers that only move a live value. Research note 38 measured what this buys: a same-content Markdown commit fell from 0.851 to 0.167 ms, and from 5,687 allocations to 10. Workloads that don't use memo still pay 2.7–3.3 ms per commit.

Motion

Every animated property is an analytic spring in rune-motion. Spring::new(duration, bounce) maps exactly like SwiftUI's Spring(duration:bounce:): ω = 2π/duration and ζ = 1 − bounce. A retarget keeps the current velocity, so an interrupted animation bends instead of restarting. Layout is solved once at the target, and only the edges that move are animated; an edge that stays put never moves. A motion gate inside cargo test checks presented geometry, painted properties and pixels against 27 rule kinds.

Three of Rune's spring tokens, sampled the way the renderer sees themStep response of motion::SNAP, Spring::BOUNCY and motion::DRIFT, one dot every three frames at 120 Hz. Hover a dot for its value.
00.5101224364860frames at 120 Hz (8.33 ms each)BOUNCY0.5 s · bounce 0.3SNAP0.25 s · bounce 0DRIFT0.85 s · bounce 0
Computed from the mapping in crates/rune-motion/src/spring.rs:7-14 and the token values in tokens.rs.

Paint and GPU

The paint walk emits 128-byte instances of 14 kinds into one uber-shader pass. Clips and soft edges are computed per instance in the shader. Uploads diff the instance stream in 64-instance blocks. On macOS, Rune's own Metal backend has been the default since 31 October. It is about 3,400 lines, plugged in under wgpu's custom backend, and records one command buffer per frame with two frames in flight and precompiled pipelines. Research note 34 measured a HUD frame at 894 thousand instructions, against 1,395 on wgpu and 808 for a hand-written Swift version, with 7.1 heap allocations per frame against 65. Windows uses wgpu on DX12, Linux on Vulkan, and the web on WebGPU.

Text

Parley shapes and breaks lines with HarfRust and fontique on every platform, so line breaks match across operating systems. Glyphs are rasterized by a pure-Rust port of CoreGraphics' pipeline, within 3/255 of CoreText. A separate shape key and break key let a resize re-break lines without reshaping, which cut a 50 KB resize frame from 16.1 to 4.6 ms. Editing is the weak spot. TextEdit stores a String, reshapes the whole field on every keystroke and keeps full-text undo snapshots.

Layout

Taffy solves flex, grid and block layout over Rune's own LayoutStore: 216 bytes per slot, differential-tested against upstream TaffyTree. On a 500-row list it holds retained layout in 1.10 MB instead of 5.52 MB. Virtual lists keep flat prefix sums. The plan's sum-tree index for million-row lists was never built.

Accessibility and the agent's view

Since 4 November every window and overlay exposes an AccessKit tree to UI Automation, NSAccessibility and AT-SPI. The tree is built lazily and fingerprinted, so an idle turn costs one comparison. Assistive actions run the same handlers as pointer and keyboard, and --tree prints the same tree for agents. The web uses its own, thinner DOM mirror.

05

Plan against code

PLAN.md still calls itself the source of truth, but it was last edited on 30 October. The crate README's “Measured” and “Differences from PLAN.md” sections date from 23 October. The internal site repeats at least ten claims the code contradicts. Checked line by line against the code, the plan breaks down like this:

Done · 3 Exceeded · 2 Partial · 12 Diverged · 7 Not started · 9

Some divergences are improvements the plan never recorded. The native Metal backend, the web target that powers the public site, and an offline motion gate richer than the planned live linter all go beyond it. Others are the plan's load-bearing parts: the render thread, own platform shells, a rope for text, and CI gates.

PLAN.md saysStatusThe code at 1571ad5
Render thread owns the presented tree, connected by a serializable command channel (PLAN §3, tenet 2, PLAN.md:30)Not startedEverything runs on the main thread; Scene is a Runtime field; apply calls Scene directly; on default macOS no frame stage leaves the main thread
Split-process iPhone dev mode; channel doubles as replay log (S4)Not startedNothing in code
wgpu everywhere first; raw Metal later only where measured, via wgpu-hal escape hatchesExceededOwn ~3.3-3.4k-line Metal backend under wgpu::custom, default on macOS since 2026-10-31, opt-in on iOS; decided by research/34; PLAN text not updated
winit to start; own thin shells as soon as text input landsDivergedText editing landed long ago; still winit 0.30 on every desktop and web, patched from outside
Each platform's text protocol directly (NSTextInputClient, TSF, text-input-v3, UITextInput)Partialwinit IME on desktops; web sliding 512-UTF-16 textarea (matches research/05); nothing on iOS
Zed sum_tree + rope for text storageNot startedTextEdit.text is a public String; undo stores full snapshots (128 steps / 1 MiB)
Typed Model<T> stores with cx.read scope trackingDivergedOne &S per app, manual memo(id, version); automatic skipping only for virtual rows and pure Markdown
Taffy over Rune's own arena through its traits, one treeDonerune-taffy LayoutStore implements Taffy's traits; a parallel arena bridged by node_idx
Sum-tree height index for 1M-row listsDivergedFlat prefix sums rebuilt on change; largest bench 10k rows; 1M target unproven
Six primitives with a GPU clip table, Slug text, vello sparse stripsDivergedOne 128-byte uber-quad with 14 kinds and inline clips; vectors CPU ear-clipped; no Slug or vello
Dither every gradient and shadowNot startedNo dither in core shaders; only rune-fx (TPDF) and rune-light (IGN) dither
Linear-light blending, Display P3DivergedsRGB-encoded blending is the default since 2026-10-29; no P3
Native glass underlays synced in the drawable's CATransaction (S2)PartialEl::system_material ships; synced misses 1.8% of frames, but Glass runs near 80 fps; pacing fix not landed
AccessKit, and the a11y tree is the agent inspector treePartialAccessKit on macOS, Windows and Linux since 2026-11-04; web uses its own DOM mirror; scripts drive by key path, not the a11y tree; no iOS/Android adapters
Inspector socket, mk CLI, pixel-to-file:line provenance, bug reports as replaysPartialPer-binary CLI flags and a --hot-control file in hot builds; no socket and no input recorder; rune-ref blame only
Hot reload: tokens <=50 ms, live literals <=100 ms, Rust ~1 s measured, goal 300 msPartialSubsecond path ~8 s save-to-GPU for Settings; no live literals, token watcher or shader reload; rune-knobs stands in for tokens
No Rc/RefCell; zero allocation per frame (tenet 7)Diverged121 RefCell and 173 Rc< lines in core; non-committing frames alloc-tested, commits allocate
Background pool for image decode, shaping, flattening and file IONot startedPer-cache decoder threads and per-clip poster threads; shaping and rasterization synchronous on main
Motion linter rules live in debug builds every frameDivergedOffline motion_gate inside cargo test plus scripts/motion-audit; richer than planned but not live
GPU-evaluated spring tracksPartialRenderer::with_springs spike is public API but unused by the runtime
CI runs deterministic correctness every change; Miri on every PR; gungraun and allocation gatesNot startedOne advisory www.yml (rune-www tests, rune with default features off, Linux + wasm); no required checks; no Miri/shuttle/loom; gungraun scripted but never run
A lint fails on raw style literals in app codeNot startedNo such lint; the kit itself bypasses tokens
Pre-rendered first frame (<=50 ms) with bit-identical handoffPartialNot built natively (first frame drawn inside window creation instead); web --html static export plays this role
M0.5 smoke test and M1 theming, gallery, docs site, playgroundDoneDone except the inspector socket and CI goldens
M2 Hex Settings on three desktops, own shells start, CI goldensPartialHex consumes Rune on all three desktops; no own shells; no CI goldens
M3 OpenCode Desktop main screens against a live server with synthetic fixturesPartialWas examples/opencode until d1634c68 (2026-10-26); now outside the repo; kit parts solid, composites (palette, prompt input, tool rows) missing
M5 web over WebGPU; a11y mirroring and WebGL fallback as follow-upsExceededwww is a Rune app with document mode, DOM a11y mirror, static export and an opt-in WebGL2 feature; no EditContext
M6 iOS shell, UITextInput, RuneView, first embedded surfacePartialLayerHost embedding and native Metal on iOS; no shell, text input or a11y
M7 AndroidNot startedcfg skips only
Perf: at rest zero ticks and GPU submissionsDoneMet: 77 presents per 20 s to 0; timer-woken frames skip when unchanged
Perf: Mac idle <=50 MiB RSS for helloPartialhello footprint 33-34 MB but RSS 92.5-95.1 MB; quoted 70 MB is a settings window's footprint
Perf: 1M-row list p95 <=1-2 ms; 100 MB file viewport <=250 msNot startedNo 1M-row or 100 MB workload exists; String editor reshapes whole field
CPU reference lane in integer/libm, no FMA (research/14)Partialrune-ref follows it exactly but covers 10 of 14 kinds; rune-motion math uses FMA where hardware has it
06

Subsystem by subsystem

Eighteen readers each took one area of the repository, and four more covered gaps a critic found. Each area's issue claims were then re-checked against the code by a separate skeptic. Of 300 claims, 225 held as stated, 75 held with corrections, and none were refuted. Each card shows the verdict next to the claim. Corrections are quoted when the verifier changed something.

Maturity scale:spikeprototypeworkingsolidproduction
SubsystemMaturityWhat it isBiggest issue
Runtime core (El, Cx/Tx, commit, memo, frame loop)working to solidKeyed whole-view re-run with memo, flattened reuse, resize relayout and virtual-row remount fast paths; 630 runtime tests251-field Runtime<S> god object with an ordering-sensitive 265-line frame_step; coarse invalidation (any handler re-runs the view)
Layout (rune-taffy, virtual rows, growth, anchors, layout reads)solidDense 216 B/slot LayoutStore over Taffy 0.15, differential-tested against upstream; padding-based virtual listsMeasure hash omits text blocks/exact_lines (stale height after Tab in a list item); one picture element disables both no-view fast paths
Motion (rune-motion + runtime glue, scroll, growth, flights)crate solid; runtime integration working but heuristicClosed-form springs, SoA allocation-free store, presence with revive, edge-based layout motion, frame-clock catch-upGrowth, scroll, slides and flights live outside the analytic store; screen-travel X progress ignores anim.x; full paint rebuild every animating frame
Renderer (uber shader, layers, uploads, backdrops)working to solid128-byte instance with 14 kinds, inline per-instance clips, span-diffed uploads, dual-filter backdrop blursRGB colorspace tag dropped on every reconfigure (including ~1 s after launch); no transient GPU memory budget; no device-loss handling
Native Metal backendworking (macOS default since 2026-10-31)~3.3-3.4k non-test lines under wgpu::custom; one command buffer per frame, in-place shared-memory writesValidates nothing, panics on descriptor-level features (depth, MSAA, indirect; 50 unsupported! sites), no macOS 13 floor
Text (Parley, CoreGraphics-port rasterizer, caches, editing)solid for display; O(n) editorShape/break key split, glyph replay cache, CG pipeline within 3/255 on every OSWhole-field reshape and two full snapshot clones per keystroke (12-19 ms at 50 KB); IME bounded by winit; per-window font/atlas duplication
Input, focus, accessibilityworking to solid (AccessKit 3 days old)Queued path-addressed actions, AppKit-faithful focus and hover rules, lazy fingerprinted AccessKit treeLinear path scans and O(n) hover passes per move; overlays lack wheel, IME and secure input; modal opened mid-drag drops Phase::Up
Platform shells and windowsmacOS solid; Windows working; Linux working with prototype parts; web prototype-working; iOS spikewinit 0.30 everywhere, patched from outside with class patching, isa swizzles and subclassesHard-coded winit internals while winit is a caret dependency; four hosts duplicate the frame loop; Wayland layer surfaces rebuilt with blocking roundtrips on every show
Media (images, video, audio, recording, native surfaces)working on macOS; thin elsewhereLinear-light mips on worker threads, in-pass zero-copy IOSurface video, AVFoundation playback and recordingAny drawn NativeSurface ends a web app; no byte budget across image copies; video presents at display rate; untrusted SVG unbounded
Agent tooling, headless, playground, perf infrastructuresolidSame renderer offscreen on a virtual clock with scripts, traces, trees, video, strips and static HTML; in-window storybookFive headless loops and two script dispatchers (desktop resize silently ignored); determinism same-machine only; none of it runs in CI
Hot reloadprototype to workingSubsecond behind a syntax guard with panic fallback; ~8 s save-to-GPUFar from the 300 ms goal; impl-method edits restart; hot feature never compiled by the documented commands
rune-ref reference rendererworking to solid for covered kindsStrict-f32 scalar oracle with proptest metamorphic tests and a GPU differential laneNo oracle for kinds 5, 6, 7, 13 or blurred layers; generator emits kinds 0-4 only; gungraun gate never run; backend under test implicit
Web target and wwwprototype to workingFull-viewport, embedded and document modes; sliding 512-unit textarea IME; DOM reading mirror; --html static first paintMirror and export hrefs unfiltered (javascript: sink); document mode has no browser test; 4.22 MB raw wasm with no budget
rune-kit core components and themingworkingAbout 40 components named after @opencode/ui, Kit token schema, blend-aware tokens, 26 a11y goldensCombobox/PopupList build every row per commit; token bypasses and duplicated rows; exhaustive theme literals break external themes
rune-kit content (Markdown, diff, syntax, Mermaid)Markdown, syntax and diff solid; Mermaid working to solidIncremental streaming Markdown with tail settling, hand-written linear scanners, Myers diff view, 17 Mermaid diagram typesStreaming Markdown is O(message) per delta and never memo-cached; Mermaid scene cache is a 16-entry FIFO with no byte bound
Effects, lighting, knobs, theme tokensrune-fx working to solid; rune-light prototype to working; theme workingEffect slots in painter order, lazy parallel pipelines, SDF lighting and radiance-cascade GI, browser-resolved tokensLighting compositors predate the sRGB-blend default; three blur pyramids with different calibration; rune-light has 4 tests and no resize
Examples and developer experienceAPI working; examples prototype as teaching material30 example apps and excellent debug diagnostics that name call sites and fixesNo example uses virtual_rows, memo, live_only, on_ready, prewarm_gpu or Latest; flagship app outside the repo
Engineering system (tests, CI, lints, changelog)ratchets good; CI absent as a gate3,055 headless tests, file-size ratchet paid from 176 exceptions to 0, changelog fragmentsOne advisory, two-day-old CI workflow with default features off and no required checks; 205 unfolded fragments; unformatted code
Failure model (panics, errors, logging, recovery)prototype as a policy; working as islandsPer-resource catches for image codecs, Mermaid, overlays and FFI sinksPanics end shipped apps differently per entry point (macOS launch and AppKit-callback panics abort); device loss silent; log is a dev-dependency only
Process state and memory budgeteach cache solid; process-level prototypeAbout 30 caches with their own bounds and a shared device across surfacesNo subsystem accounting, grow-only GPU pools, image atlas page 0 pinned, thread-scoped kit caches leak across windows, target metric mismatched
Trust boundariesworkingStrong outbound URL checker, linear fail-closed HTML sanitizer, keyed pill fingerprints, zeroized secretsUnbounded SVG, Markdown depth, native image path, web fetch and media URL sinks on the flagship's model-output path
M3 flagship readinessparts working to solid; composites missingShell, transcript growth motion, Markdown, diff and pickers exist in rune-kitexamples/opencode removed on 2026-10-26 with stale hero stills; no command palette, prompt input or tool rows; desktop services for an Electron replacement absent

Purpose and research

Vision and roadmap · Research 01–17 · Research 18–38

01

Vision, purpose, tenets, roadmap and status

working

Rune is Anomaly's agent-built Rust GPU UI framework meant to feel like SwiftUI at 120 Hz on every platform, proven by recreating OpenCode Desktop. Its desktop and web runtime works and moves very fast, but the plan's render-thread/command-channel core, its own shells/IME, CI gates and several perf targets are missing, and PLAN, the crate README and the site have drifted from the code.

Summary (729 words)

Rune is a Rust UI framework that owns its renderer (one instanced uber-quad pass with 14 instance kinds), its text rasterisation (Parley shaping plus a port of CoreGraphics' glyph pipeline, calibrated against CoreText), its Taffy-based layout integration and its analytic-spring animation. It targets SwiftUI-on-ProMotion feel (120 Hz, interruptible springs, nothing pops) on macOS, Windows, Linux, the web and iOS, and it is written and checked by agents through headless rendering (--snap/--tree/--script/--trace). It exists because Anomaly's own surfaces were rebuilt three times in ten days on GPUI, Metal and SwiftUI. GPUI redraws whole windows, animates through main-thread view re-renders and has no layer compositing. Slint means a DSL and GPL/commercial licensing. SwiftUI is Apple-only. Flutter's web engine is a fork and its iOS text feels off. The users are Anomaly's own products: the flagship test is recreating OpenCode Desktop (an Electron/Chromium app) and beating it, the first real screen is Hex's Settings on three desktops, then Kit's Mac surfaces, the private iOS client by embedding, and Android last. The core ships no brand; OpenCode's theme is generated from @opencode/ui's Storybook and lives in themes/opencode.

Against PLAN's milestones: M0.5 (settings smoke test) is done. M1 (theming, kit gallery, docs site, playground, motion traces) is mostly done, but there is no inspector socket and no CI goldens. M2 (Hex Settings) is partial: Hex consumes Rune and AccessKit landed 2026-11-04, but there are no own shells or native IME. M3 (OpenCode Desktop) is started and active: parity fixes land daily and real-transcript perf studies exist, with the app outside the repo. M4 has its infrastructure (overlays, system materials, launcher example). M5 (web) is substantially built: the public anoma.ly/rune page is itself a Rune wasm app with a DOM mirror and static --html export. M6 has started on the embedding path (LayerHost on a CAMetalLayer, Metal backend on iOS) without UITextInput or split mode. M7 has not started. Spikes: S1 and S5 are done, S3 has a probe, S2 is answered by research/26 but PLAN still lists it open, S1b is unmet (the productised hot reload takes about 8 s save-to-GPU, against a 989 ms spike and a 300 ms goal), and S4 has not started.

The biggest gap is architectural. PLAN §3's "one boundary that matters", a serializable command channel between the app side and a render thread, does not exist. Animation runs on the main thread at frame time. Views still never re-run for animation, but the claim that a busy app can't stall motion is false. That also blocks split-process iPhone dev and channel replay. Instead, research 32-38 measured that missed frames come from rebuilding too much, not from Taffy or Parley, and optimised the main-thread path. Real-app frames are now mostly under 8.3 ms, with one known miss in a long-card scroll. Research 34 put Rune's own Metal backend in as the macOS default (2026-10-31), and research 35 kept wgpu on Vulkan and DX12. Text input still goes through winit's IME, and TextEdit stores a String, so the plan's own shells, the rope and the 100 MB file target were never attempted.

Tenets: the feel and motion rules hold strongly (motion audit, motion_gate, pixel snapping). Observability holds via CLI and files rather than a socket. The no-DSL rule holds, but the API is not small: 1,783 pub fns in core and 415 on El. The data-oriented rule slips, with 121 RefCell and 173 Rc in core. The fast-plus-reference rule is partial: rune-ref covers 7 of 14 kinds, springs have an RK4 oracle, and rune-taffy has a parity test.

Of the named risks, text quality is retired on macOS, while text input stays open. The OpenCode-look risk is worked actively but not quantified. Scope materialised as breadth: about 290 kLOC, 14 crates, Mermaid, GI lighting and video. Accessibility is largely retired on desktop.

Velocity: 1,630 commits in 17 days of public history (it starts with a 52 kLOC import on 2026-10-22). That is about 96 a day, peaking at 252, then slowing to 1,045, 485 and 100 per week as work moves to squash-merged PRs (up to #190). There are 476 changelog bullets plus 205 unfolded fragments. There is no CI for core tests: only site/www deploy and cargo test -p rune-www. The crate README's "Measured" and "Differences from PLAN.md" sections date from 2026-10-23, PLAN.md was last edited 2026-10-30, and the internal site repeats at least ten claims the code contradicts.

Why this maturity: Real apps (Hex, an OpenCode Desktop recreation, chat, notes, a task board) run on it on three desktops and the web, with 3,054 tests and measured perf work. But it is pre-release with no core CI, no render thread or command channel, IME still on winit, hot reload at about 8 s, several PLAN perf targets missed or unmeasured, and docs that lag the code by up to two weeks.

Issues, most severe first
High
No CI gate for core correctness
Only site and www deploy workflows exist; nothing runs rune/rune-kit tests, goldens, the motion audit, alloc tests, Miri or gungraun on push or PR, despite PLAN promising CI correctness on every change
.github/workflows/{site,www}.yml; www.yml:84 runs only cargo test -p rune-www; PLAN.md:428-429, 503-504
✓ Confirmed
High
Planned render thread and command channel not built
Animation runs on the main thread; a blocked main thread stalls motion, contradicting tenet 2 as the site states it; this also blocks split-process iPhone dev and channel replay
crates/rune/README.md:2817-2818; PLAN.md:100-134; site/src/content.tsx:59-63; no channel code in crates/rune/src
✓ Confirmed
Medium
Docs drifted from code across PLAN, crate README and site
README 'Differences' says no own Metal, no glass, no AccessKit, vertical-only scrolling, three fragment paths; the site says linear-light blending, a socket inspector, a render thread, borrowed GPUI rope/IME, macOS on wgpu, Windows/Linux next and iOS planned; PLAN lists S2 open
crates/rune/README.md:2805-2821 (unchanged since 2026-10-23); site/src/content.tsx:204-208, 311, 335-337, 371; site/src/pages.tsx:111, 119-124, 197-205; PLAN.md:552
✓ Confirmed
Medium
IME and long-text editing still on winit and String
PLAN calls IME the single riskiest area and planned own protocols when text input landed; text input landed but IME still goes through winit. A 50 KB note costs about 12 ms per keystroke
crates/rune/src/window.rs:11,20; crates/rune/src/edit.rs:46-48; research/27-long-note-editing.md:6-9; PLAN.md:32, 211-218; WEB.md:256-258
✓ Confirmed
Medium
Hot reload far from target
Productised subsecond path measures about 8 s save-to-GPU for Settings vs the 989 ms spike and the 300 ms goal; it depends on a remote build-worker setup; no live literals, token watcher or shader reload
crates/rune/README.md:2679-2687, 2797-2799; PLAN.md:291-298
≈ Partly The 8 s, 989 ms and 300 ms figures are right, and there are no live literals, no token watcher and no shader reload. But 'depends on a remote build-worker setup' is overstated: --local / RUNE_DEV_LOCAL=1 runs everything on one machine. Nothing in the repo blames the 8 s on the worker round trip.
5 more verified issues
Medium
Perf targets missed or unmeasured
Launch about 300 ms vs 150 ms p50; idle 70 MB vs 50 MiB; binary 9.3 MB stripped (stale) vs 5 MiB; no 1M-row or 100 MB file workload committed
crates/rune/README.md:645, 688, 2805; PLAN.md:505-520
≈ Partly The missing 1M-row and 100 MB workloads are confirmed. But the targets are for a hello app on pinned reference devices, and the measurements are of a small or settings app on a loaded laptop. The README itself says absolute times were high because the machine was busy. So 'not measured to target conditions' is proven, not 'missed'.
Medium
API surface contradicts 'one way to do things'
1,783 pub fns in core, 415 on El, 296 lib.rs export lines, about eleven overlapping scroll requests on Tx
rg '^\s*pub fn ' crates/rune/src; crates/rune/README.md:126-133, 369; CHANGELOG.md scroll_center entry
≈ Partly 1,783 counts literal pub fn lines, including ones in crate-private modules, so it overstates the exported API. The 296 lib.rs lines are right (28 pub mod + 268 pub use). '415 on El' is wrong: 415 is every pub fn in el.rs + el/**, including 61 on Tx. The impl El blocks hold 313. Tx has 14 scroll_* methods plus keep_on_screen, not about eleven.
Medium
Reference renderer covers half the instance kinds
rune-ref evaluates kinds 0-4, 10 and 11; segment, triangle, image, layer, effect and backdrop blur have no CPU oracle
crates/rune-ref/src/shader.rs:167-251; crates/rune/src/render.rs:24-68
≈ Partly rune-ref does composite layers (kinds 8 and 9, with rounded clip, turn and pivot) and accepts effect slots (12) as no-ops, so it accepts 10 of the 14 kinds. No oracle exists for segment (5), triangle (6), image (7), backdrop blur (13), or blurred layers.
Low
Data-oriented tenet slipping
PLAN says no Rc/RefCell; core non-test code has 121 RefCell and 173 Rc<
PLAN.md:83-84; rg counts (el.rs 27 Rc, memo.rs 19)
✓ Confirmed
Low
Stray tracked file and changelog hygiene
pack.new at repo root is a copy of rune-fx pack.rs; CHANGELOG header promises per-entry revs (2 of 476 have them); 205 unfolded fragments
git log -- pack.new (2d92d377); CHANGELOG.md:3-4; ls changelog/unreleased
≈ Partly pack.new is a near-copy of rune-fx pack.rs: both are 368 lines and 14 lines differ (the KIND_* constants are pub(crate) in one, private in the other). It came in with 2d92d377. The 205 fragments are right (plus a README). But 4 of 476 bullets carry a rev, not 2.
Strengths
  • A clear, well-argued vision with research notes behind each decision (35 notes, 9,355 lines), and decisions that follow measured evidence (Metal owned only after research/34; Taffy/Parley kept after research/32/37)
  • Feel tenet carried into code: analytic springs with an RK4 oracle, per-edge layout motion, presence, reduced motion, pixel snapping that eases in, and a motion audit with about 15 finding kinds plus an in-test motion_gate
  • Real consumers drive the work (Hex, an OpenCode Desktop recreation, chat, notes, a task board), with paired-median real-app perf studies (research/33, 37, 38) that cut team-chat resize p50 from 17.6 to 2.79 ms and eliminated over-budget frames in most interactions
  • Idle cost met: a settings window went from 77 presents/20 s to 0; a resting window handles input about 0.3 ms after the event
  • Web target is real enough to run the public homepage as a Rune app with a semantic DOM mirror and static HTML first paint
  • AccessKit on all three desktops with a lazy tree and diffed updates; the a11y tree doubles as the automation surface
  • Structure discipline enforced by scripts with zero exceptions on file size and folder shape; 3,054 tests
  • Very high velocity: 1,630 commits in 17 days, 680+ app-visible changes logged
Key concepts
  • Flagship test: Recreate OpenCode Desktop (Chromium/Electron) in Rune and beat it on look and feel across three desktops against real server data (PLAN.md:573-581); lives outside the repo, shown in demo/opencode
  • Tenets: Feel is the product; animation never through app code; everything observable; one way to do things; native behaviour, one look; owned not wrapped; optimise for perf/correctness/change speed over readability (PLAN.md:69-98)
  • Command channel / render thread: PLAN's central architecture: a serializable app-to-render-thread protocol enabling busy-app-proof animation, split-process iPhone dev and replay. Not implemented; animation runs on the main thread
  • Unbranded theming: rune::Theme as data, rune-kit Kit token schema, OpenCode theme generated from @opencode/ui Storybook via themes/opencode/tools/theme.mjs
  • Fast path plus reference path: Tenet 7: each hard subsystem has a CPU oracle; realised as rune-ref (7 of 14 kinds), the spring RK4 test and the rune-taffy parity test
  • Agent-native verification: Every app renders headless (--snap/--tree/--script/--video/--html), motion audit and motion_gate, AccessKit tree as the agent tree; no inspector socket
  • Measure-then-own: Dependencies replaced only on measurement: own Metal (research/34), keep wgpu on Vulkan/DX12 (research/35), keep Taffy/Parley (research/32, 37)
  • Milestones M0-M7: Spikes; smoke test; theming/gallery/site; Hex Settings; OpenCode Desktop; Kit Mac surfaces; Web; iOS; Android
Opportunities
Add a core CI jobimpact higheffort low
Run cargo check --workspace --all-targets and cargo test -p rune -p rune-kit --features rune-kit/markdown on Linux with lavapipe (VK_ICD_FILENAMES already documented), plus scripts/file-size.sh and the alloc tests
Reconcile PLAN, crate README and site with the codeimpact mediumeffort low
Mark S2 done, record the Metal decision in PLAN §4.2, rewrite 'Differences from PLAN.md' and 'Measured', fix the site's stale principles and statuses; agents read these first
Decide the render-thread question explicitlyimpact higheffort highre-architecture
Either build the app-to-render command channel starting with live values, scroll offsets, drags and Scene tracks, or retire the wording and extend the GPU-evaluated springs spike (gpu/springs.rs) so transform/opacity motion survives a blocked main thread at one uniform write per frame
Own IME on macOS and Windows, plus per-paragraph text layoutimpact higheffort highre-architecture
Implement NSTextInputClient/TSF directly and a composite multi-paragraph TextLayout (research/32) or rope so typing reshapes one paragraph; this unblocks M2/M3 composers and fields
Count-based perf gates in CIimpact mediumeffort medium
Gate instances, allocations, glyphs and layout nodes per scene (PLAN tenet 7), with the motion-audit gate as a hard failure
Extend rune-ref to all instance kindsimpact mediumeffort medium
Add CPU oracles for images, segments/triangles (icons, Mermaid), layers and backdrop blur
Publish kit-diff similarity reportsimpact mediumeffort low
Commit per-story similarity/off numbers from scripts/kit-diff.py so risk 2 (matching OpenCode's look) is tracked quantitatively
Native pre-rendered first frameimpact mediumeffort high
Bring the web --html first-paint idea to native (a cached first frame per appearance/size) to close the 300 ms vs 150/50 ms launch gap
Numbers, key files, roadmap and the verifier's additions
Numbers
Public history
1,630 commits, 2026-10-22 to 2026-11-07 (17 days), starting from a 52,432-line import
Commits per week
1,045 (Oct 22-28), 485 (Oct 29-Nov 4), 100 (Nov 5-7)
Peak day
252 commits (2026-10-23)
Line churn
+420k/-126k (Oct 22-31), +63k/-12k (Nov 1-7)
Authors
10; top author 1,472 of 1,630 commits
PR-numbered commits
56, up to #190
Changelog
476 bullets in CHANGELOG.md ## dev plus 205 unreleased fragments
Rust lines
about 289,640 total; crates/rune 176,200 in 780 files; rune-kit 40,152; rune-mermaid 13,283
Tests
3,054 #[test] (rune 2,147, rune-kit 450, rune-mermaid 138, rune-motion 93)
Crates
14 in crates/ plus themes/opencode; 29 examples
Public API
1,783 pub fn in crates/rune/src; 415 on El; 296 pub use/mod lines in lib.rs
Research notes
35 files, 9,355 lines
PLAN.md edits
9 commits, last 2026-10-30
Launch (Mac, from open)
about 300 ms content on screen (target p50 150 ms)
Key files
PLAN.md Direction: short version and layer table (L6-43), why (L45-67), tenets (L69-98), architecture (L100-134), hot reload (L279-329), agent tooling (L331-362), guarantees (L364-396), design language (L474-498), perf targets (L500-521), risks (L523-542), milestones (L544-589), Anomaly fit (L591-599), open questions (L601-609), web status (L611-617)
README.md Public pitch: native GPU Rust UI for macOS/Windows/Linux/web, headless agent loop, pin dev revs, no PRs, MIT
AGENTS.md Repo rules: dev is fast-forward-only, changelog fragments, file-size/folder-shape caps, literal-built types, perf rules, public-repo hygiene
crates/rune/README.md Main doc and feature inventory; 'What exists' (L8-298), Launching fast with measured launch numbers (L643-717), Accessibility (L2259-2299), Live Rust editing (L2664-2799, about 8 s save-to-GPU), stale 'Measured' (L2801-2810) and 'Differences from PLAN.md' (L2812-2821)
WEB.md Web target: winit canvas, async GPU, sliding textarea, web_document mode with DOM mirror, --html static export; explicitly defers PLAN's own-shell switch (L253-259)
site/src/content.tsx Internal site's principles, layers, decisions, milestones (statuses L464-550) and risks; has several stale claims (L59-63, L204-208, L311, L335-337, L371)
site/README.md Site hosting (anoma.ly/team/rune behind Cloudflare Access); says PLAN.md is the source of truth
www/app/src/sections.rs Public homepage, itself a Rune wasm app; the current public pitch including OpenCode as the test and five platforms
CHANGELOG.md 476 app-visible changes under one '## dev' section; the header claims per-entry revs, but only 2 have them
changelog/unreleased/ 205 unfolded fragments since 2026-10-29; shows recent direction (Metal default, iOS embed, AccessKit, web document, Windows chrome, OpenCode parity)
Roadmap items
  • Next per PLAN/site: finish M2 (Hex Settings on Mac, Windows, Linux with own shells and native text input), then M3 (OpenCode Desktop main screens side by side and clearly better)
  • Code trajectory this week: Windows chrome (popup menus, custom titlebar, dark menus, shared textures), OpenCode/@opencode/ui parity (form controls, Markdown CSS, scroll bars, file icons), web document pages and static export, accessibility polish
  • Unscheduled in plan but implied: S1b fast patch to 300 ms, S4 split mode, inspector socket, live literals, CI gates, pre-rendered first frame, 1M-row and 100 MB workloads
  • M5 follow-ups named in PLAN §13: real-device Safari keyboard, WebGL fallback, EditContext
  • M6: iOS shell and UITextInput beyond the existing LayerHost embedding; M7 Android
Found by the verifier
Medium
CI never compiles Rune's default features or macOS/Windows code
The only Rust CI job (www) builds rune with default-features = false, on ubuntu only. rune-kit also turns them off. The macOS default Metal backend, the AccessKit adapters, dbus, svg and ogg-audio, and all of this week's Windows work (popup menus, titlebar, DirectComposition) get no compile check before they land on dev, a branch that apps pin.
www/app/Cargo.toml:17; crates/rune-kit/Cargo.toml:9; crates/rune/Cargo.toml:8; .github/workflows/www.yml:40,84
Low
The WebGL2 fallback exists, but WEB.md and PLAN say it does not
An opt-in webgl feature tries WebGPU, then WebGL2 with downlevel limits. WEB.md says 'It has no WebGL fallback', and PLAN §13 lists it as follow-up work. The notes repeat this stale claim in the M5 row. This is code ahead of its docs, the reverse of the drift the notes catalogue.
crates/rune/Cargo.toml:13-14; crates/rune/src/platform/web.rs:238-270; git 61f46dce (2026-10-29); WEB.md:230; PLAN.md:616
Low
S2 and native Glass are overstated as done: Glass misses 120 Hz
research/26 shows synced NSGlassEffectView keeps 120 Hz cadence on only 70% of frames, and runs at about 60 Hz when the main thread is busy for 8 ms. NSGlassEffectView layout costs 0.8-2 ms a frame. The pacing change that reaches 120 Hz is 'not landed'. M4's optional Liquid Glass therefore has an open frame-rate problem that the notes' 'done/exceeded' verdict hides.
research/26-system-material-sync.md:25-31,40-60
Medium
Launch numbers can't support a '2x miss' and point away from the proposed fix
The only native launch numbers come from 5 rounds on a loaded laptop, and the README says absolute times were high because the machine was busy. No quiet-machine or reference-device number exists. Within those numbers, the window reaching the screen (277 ms cold) dominates; content follows only 22-35 ms later. The launch problem is therefore process, AppKit and window creation, which a pre-rendered first frame cannot remove.
crates/rune/README.md:645,705-712; PLAN.md:502,507
02

Research notes 01-17: decisions and rejected alternatives

working

16 founding notes (87k words, all written 2026-10-21) design a render-thread, Model<T>, own-shell, raw-Metal framework. The code kept the motion semantics, the text quality work and the CPU reference lane, but runs animation on the main thread over winit with a single app state, Vec prefix sums and String text buffers.

Summary (575 words)

Research 01-17 is Rune's day-0 design record. All 16 files (no 10) are dated 2026-10-21 inside and landed in the first commit 484b7667 on 2026-10-22. None has changed since 2026-10-23, while the repo grew to 1,630 commits. Round 1 (01-11) surveys and picks the stack: don't fork GPUI or warpui (01); depend on taffy, parley, accesskit and kurbo/peniko, with an own wgpu uber-shader (02); Apple's spring(duration,bounce) with merge-with-velocity and hosted system materials (03); Rust with a thin HAL, raw Metal on Apple and wgpu elsewhere, and UberQuad+Slug+sparse strips (04); harfrust/skrifa/fontique/parley, a SumTree rope, AccessKit as the agent tree, Taffy with a SumTree list index (05); a keyed retained tree over Model<T> stores with read tracking and a render thread that owns analytic spring tracks (06, the core); a data-driven view-reload tier (07); a measured Subsecond spike, 989 ms median (08); an inspector protocol and numeric perf budgets (09); own shells instead of winit, platform order macOS→iOS→web (11). Round 2 (12-17) was written against a PLAN draft, mostly from recall because web search was down. It adds vello_cpu as oracle, a pyramid blur, GPU-evaluated springs, a pre-rendered first frame, an integer/libm reference lane with gungraun, present-time sampling, the impulse velocity estimator, A2UI surfaces, dirty classes, and a frame arena in El.

PLAN.md already overrides several picks: wgpu first, winit first, the desktop trio first, one look everywhere, no view DSL, own rune-ref instead of vello_cpu, motion blur wanted.

I checked 34 decisions against the code: 17 match, 3 exceeded, 4 partial, 8 diverged, 3 not started. - **Matches:** the spring math and tokens, analytic layers, reduced motion per class, present-time stepping, edge layout animation, presence, the motion-trace format, the pyramid backdrop blur, precompiled metallib (232→85 ms cold), glass in the drawable's CATransaction, the embedded host, and the strict rune-ref lane with gungraun. - **Exceeded:** CoreGraphics smoothing recovered in Rust, a compact Taffy store with a baseline, and edge pixel-snap. - **Diverged:** there is no render thread (the README says animation runs on the main thread; research 31 says all work is on main). There is no Model<T> or read tracking (a single S, the whole view re-runs each commit, manual memo versions). El uses String/Vec/Rc instead of an arena. Virtual lists use Vec prefix sums plus one key() call per row per commit. TextEdit is a String. swash is kept. Ellipsis is available and fade is opt-in. The core shader has no dither. winit still owns IME, CVDisplayLink is used, and three drawables run in steady state. - **Not started:** effect-spring clamping, impulse estimator and late latch, Slug/vello, live literals, split-process iPhone mode, inspector socket, A2UI/catalog/rune check, pre-rendered first frame.

Measured outcomes move the risk away from where the notes put it (GPU, glyph raster) to view rebuild and paint walks: team chat 14.8 ms per keystroke, 83% in view; glyph raster ≤0.9%. Live Rust edit is ~8 s median against the 300 ms goal. The stripped binary is 9.3 MB against ≤5 MiB. Headless launch is 50-111 ms against ≤200 ms, which meets the target. The corpus is strong on rejected-alternative reasoning and arithmetic, and 08 has reproducible evidence. It is weak on unverifiable external numbers, version drift (taffy 0.9 vs 0.15; skrifa 0.42/0.49 vs 0.44 locked), unresolved contradictions (CAMetalDisplayLink, additive animation) and over-confident sizing (Metal ~1,600 LoC estimate vs 4,655 actual). The README "Differences from PLAN.md" section is stale: it says there is no AccessKit and no own Metal backend, and both now exist.

Why this maturity: As a design record the notes are complete and reasoned. Round-2 sourcing is admittedly recall-based, and one spike (08) has real evidence. The notes are frozen since 2026-10-23 and partly superseded by PLAN and notes 18-38. Many core architectural picks (render thread, Model<T>, own shells, SumTree, rope) were not implemented, and no status tracking ties notes to code.

Issues, most severe first
High
Render-thread premise never built
Tenet 2's hitch immunity doesn't exist. Main-thread stalls stop motion, and round-2 adopt-now items (late latch, shuttle handoff, SPSC replay ring) lose their premise.
crates/rune/README.md:2817-2818; research/31-layout-text-cost.md:257; crates/rune/src/frame/present_worker.rs:1-6; research/33-real-bottlenecks.md:128-131 (263 ms blocking keystroke)
✓ Confirmed
High
No per-scope read tracking; whole view re-runs every commit
Diverges from 06's Model<T>/cx.read. Reuse depends on hand-written memo versions with a documented stale-handler hazard, and view rebuild is the measured top cost.
crates/rune/src/memo.rs:3,15-19,578; examples/hello/src/main.rs:12; research/33-real-bottlenecks.md:119-127 (14.8 ms keystroke, 83% view)
≈ Partly True: there is a single S and a manual memo(id, version) with a documented stale-handler hazard. But memo records Cx::layout/layout_with/layout_size/caret reads itself. Research 38 added a partial virtual_rows remount that skips the view when state is unchanged (CommitWhy::VIRTUAL) and automatic Markdown::render caching. 38 also records why plain Rust can't skip arbitrary helpers without reactive handles or a view macro. The 14.8 ms keystroke figure from research 33 predates these fixes: research 37 measures team-chat typing at p95 13.0 -> 2.36 ms and resize at 30.9 -> 5.40 ms. View rebuild is no longer the measured top cost.
High
Virtual list is O(n) per commit
One key() call per row per commit, a String per key, and a Vec prefix sum rebuilt on change, against 05/06's SumTree and 09's 1M-row ≤1 ms target. No million-row bench exists.
crates/rune/src/el/virtual_rows.rs:42; crates/rune/src/el/virtual_list.rs:20-40
≈ Partly The per-row key() scan is skipped when state is unchanged or when El::virtual_rows_version matches ('commits in time independent of its length'). Keys are Cow<str> and are compared borrowed; they become owned Strings only when keys change. The O(n) work that remains: a full prefix-sum rebuild on any height, key, estimate or gap change, and set_keys re-hashing every key. Each row is stored twice as a String (Vec<String> plus HashMap<String,Row>). No 1M bench exists; the largest has 10,000 rows. The 1M target is unproven, not impossible as built.
High
IME still through winit
05/11 documented winit's missing NSTextInputClient document context. PLAN's own-shell trigger ('as soon as text input lands') has passed, and text input is PLAN's top risk.
crates/rune/Cargo.toml:67; crates/rune/src/edit/input.rs:327-335; PLAN.md:32,525-528
✓ Confirmed
Medium
Text editing on String, not a rope
Blocks the 100 MB editor target and fast UTF-16 IME offsets that 05 required.
crates/rune/src/edit.rs:46-48
✓ Confirmed
6 more verified issues
Medium
No in-repo Rust CI
Tenet-7 gates (goldens, differential tests, gungraun, motion-audit) are not enforced on push.
.github/workflows contains only site.yml and www.yml
≈ Partly www.yml runs on every PR and push that touches crates/**. It runs cargo test -p rune-www and a wasm32 build, so Rune is compiled on Linux and wasm on each crate change. What is missing: the rune and rune-kit test suites, file-size.sh, rune-ref, gungraun and motion_gate. motion_gate is an in-process Rust test API driven by scripts/motion-audit/gate.
Medium
Motion math fuses FMA
Traces are bit-identical only within an ISA class, against 14's no-FMA exact-lane rule.
crates/rune-motion/src/math.rs:1-20
≈ Partly True, and the doc comment states the trade on purpose (bit-identical only within 'the same kind' of machine). 14's no-FMA rule is for the canonical CPU-reference pixel lane. rune-ref follows that rule (strict f32, no mul_add, -fp-contract=off) and does not depend on rune-motion. Impact: motion traces differ between Apple silicon and baseline x86-64 CI hosts. Severity is low-medium.
Medium
No dithering in the core uber shader
01/04/12 and PLAN §4.3 require dithering on every gradient and shadow, but only rune-fx dithers. Any Chromium-parity reason is unrecorded.
crates/rune/src/shader.wgsl (500 lines, erf at 116-127, no dither); crates/rune-fx/src/shaders/common.wgsl:10
✓ Confirmed
Low
Stale README 'Differences from PLAN.md'
It says there is no AccessKit and no own Metal backend; both now exist.
crates/rune/README.md:2812-2821 vs crates/rune/src/a11y/, crates/rune/src/gpu/backend.rs:1-2
✓ Confirmed
Low
Research corpus internal inconsistencies
Version drift (taffy 0.9 vs 0.15; skrifa 0.42/0.49 vs 0.44 locked), conflicting LoC counts between 01 and 11, contradictions (CAMetalDisplayLink adopt vs avoid; additive animation), and an over-confident Metal LoC estimate (1,600 vs 4,655).
research/02 §6, research/05 §9.2, Cargo.lock; research/01 §1 vs research/11 §1; research/04 §4 vs crates/rune/src/gpu/metal/
✓ Confirmed
Low
El is heap-heavy against tenet 7
String keys, Vec children and Rc closures. 17 warned that a frame-arena signature is expensive to retrofit later.
crates/rune/src/el.rs:121-155,479,494
✓ Confirmed
Strengths
  • Every note records rejected alternatives with reasons, so later reversals stay cheap to judge
  • Research 08 is a reproducible spike: raw JSON in spikes/hot-patch/evidence/ reproduces the 989.0 ms median and 1150.1 ms p95, and its traps directly shaped crates/rune/src/hot.rs (HotFn::current boundaries)
  • Spring, scroll and projection arithmetic in 03/06 checks out (k=157.9 for d=0.5; rubber band 51.6/174.5 pt; 499 pt projection) and rune-motion implements it verbatim
  • 09 and 07 label evidence classes and measurement endpoints (container memory ≠ RSS; CLI log ≠ presented frame)
  • Research 06 is a near-complete buildable spec whose semantics (tokens, presence, reduced motion, edges, traces) largely shipped in rune-motion
  • Round-2 notes mark every source [read]/[recall], and PLAN repeats the cite-check warning
Key concepts
  • Render thread owns presented tree: 06/PLAN tenet 2: a per-display thread samples analytic tracks so motion survives main-thread hitches. Not built: animation runs on the main thread (README:2817).
  • Analytic spring track / sample-and-restart: Each property is segments {t0,x0,v0,target,curve}; retarget samples exact (x,v) at apply time. Implemented in rune-motion Layer/AnimationStore, which also supports CA-style additive layers.
  • Spring(duration,bounce): ω=2π/d, ζ=1−b (b≥0) or 1/(1+b); identical to SwiftUI and Flutter. Matches spring.rs:30-77.
  • Edge-based layout animation: Animate left/right/top/bottom separately so stationary edges never jiggle; width leads by 0.78×. Implemented.
  • Fast path + reference path (tenet 7): Every hard subsystem has an obviously correct slow twin for differential tests. Realized as rune-ref (renderer) and baseline_store (layout).
  • Model<T> with read-tracked scopes: 06's state pick; replaced in code by one app state S, a whole-view rebuild per commit and manual memo(id, version).
  • Pre-rendered first frame + bit-identical handoff: 13's rank-1 startup trick, PLAN §6b ≤50 ms target; not started.
  • Two pixel lanes: Exact hash lane on a CPU integer/libm renderer plus per-primitive tolerance lanes for GPUs (WGSL allows FMA/reassociation).
Opportunities
Move rune-motion store + scene build + encode to a render threadimpact higheffort highre-architecture
AnimationStore is already SoA, allocation-free per tick and id-addressed. Put it behind a commit queue so motion survives main-thread stalls, and unlock late-latch input and GPU springs.
Automatic memo or per-scope read trackingimpact higheffort highre-architecture
Record what each memo or view scope reads (17 §3 version stamps) or split S into tracked sub-models (06 §1.3). This removes hand-written versions and the stale-handler class.
Sum-tree list index with integer keysimpact higheffort medium
Replace the Vec prefix sums and String keys. Call key() only for the mounted window and anchors, to reach the 1M-row target.
Own NSTextInputClient view beside winitimpact higheffort medium
Follow the system-material host-view pattern to get document-context IME before a full shell rewrite.
Rope-backed TextEditimpact mediumeffort high
Vendor Zed sum_tree/rope as 01/05 recommended. Needed for large files and O(log n) UTF-16 offsets.
Add Rust CI for tests, file-size checks, rune-ref differential tests and motion-auditimpact higheffort low
Makes tenet 7's 'checks are instant' real on every push.
Research→status table in PLAN; fix the stale README sectionimpact mediumeffort low
Show which adopt-now items shipped, diverged or were dropped, with reasons.
Explicit dithering decisionimpact loweffort low
Add IGN/TPDF dither behind a theme flag in the uber shader and rune-ref, with goldens.
Numbers, key files, roadmap and the verifier's additions
Numbers
Notes in scope
16 (01-09, 11-17; no 10)
Total size
6,009 lines / 87,023 words
Largest note
06-reactivity-animation.md: 981 lines, 9,446 words
Notes with first-party measurements
1 (08; evidence JSON reproduces 989.0 ms median, 1150.1 ms p95)
Decisions sampled against code
34: 17 match, 3 exceeded, 4 partial, 8 diverged, 3 not started
Early notes cited from code
only 06 (6 files in crates/rune-motion)
Repo commits since notes landed
1,630 total; notes last touched 2026-10-23
Own Metal backend size vs estimate
4,655 LoC actual vs ~1,600 predicted (04)
Live Rust edit latency
~8 s median (README:2798) vs 989 ms spike vs 300 ms goal
Stripped binary
9.3 MB vs ≤5 MiB target (09)
Headless launch to pixels
50-111 ms (research/37) vs ≤200 ms p95 target
Settings frame CPU
mean 0.13 ms, p95 0.29 ms, 174 instances, 1 draw call
Precompiled metallib effect
Renderer::new 232→85 ms cold, 3.4→0.6 ms warm
#[test] counts
rune src 1,714; rune-motion 93; rune-ref 23
Key files
research/06-reactivity-animation.md Core spec: state model, render-thread animation runtime, commit protocol, presence, traces; the only early note cited from code (rune-motion)
research/08-spike-hot-patch.md Only first-party measured note; Subsecond 989 ms median, evidence in spikes/hot-patch/evidence/
research/04-language-gpu-renderer.md Language, GPU HAL, 6-primitive renderer, latency pipeline; most promotional tone
research/05-text-ime-a11y-layout.md Text stack, SumTree rope, IME per platform, AccessKit, Taffy + list index
research/11-platform-shells.md No-winit decision, shell trait sketch, platform order and LoC/week estimates
research/09-agent-native-and-perf-targets.md Inspector protocol and the numeric perf budgets PLAN §8 adopts
research/14-research-determinism-verification.md CPU reference lane rules (libm, no FMA), gungraun, record/replay
research/17-research-perf-architecture.md GPU spring tracks, dirty classes, frame arena in El, SPSC ring
PLAN.md Distilled consumer; lines 20-34 and 398-472 show where it overrode the notes
crates/rune/README.md What got built; lines 2797-2821 hold measured numbers and a stale 'Differences from PLAN.md'
Roadmap items
  • Mark each research 01-17 decision as shipped/diverged/dropped in a PLAN status table, and record why the render thread and Model<T> were not built
  • Fix crates/rune/README.md:2812-2821 (stale AccessKit/Metal claims)
  • Add Rust CI running cargo test, file-size checks, rune-ref differential tests and motion-audit scenarios
  • Replace VirtualList prefix sums and String keys with a sum tree and lazy keys; add a 1M-row bench per research 09 §C3
  • Prototype a render thread around rune-motion's AnimationStore with a commit queue; measure motion under an injected main-thread stall (06 open Q1)
  • Design automatic memo invalidation (read-version stamps) to cut whole-view rebuilds
  • Own NSTextInputClient view with document context next to winit; then decide the shell migration
  • Decide the dithering and effect-spring overshoot clamp explicitly, with goldens
Found by the verifier
Medium
Present worker is overlay-only and off on the default backend, so main windows present on the main thread
The notes (§5 #8 and the threading summary) treat the 'rune present' worker as the frame thread. In fact it is used only by overlays on macOS, and only when the frame is not drawn by Rune's native Metal backend, which is the macOS default ('too cheap to hand to a present thread'). Main windows finish, submit and present on the event-loop thread. The off-main-thread share of a frame on the default path is zero, which makes issue 1 stronger.
crates/rune/src/overlay/frame.rs:100-121; crates/rune/src/gpu.rs:33-36; crates/rune/src/window/draw.rs:280-286; crates/rune/src/gpu/backend.rs:29
Medium
01's sRGB layer-colorspace fix may be undone on every surface reconfigure
pin_contents_top_left tags the CAMetalLayer sRGB once, after the first configure. Its comment says untagged contents look oversaturated on wide-gamut displays and that 'wgpu's reconfigures keep the tag'. But both Rune's native backend and wgpu-hal 30.0.1 (for SurfaceColorSpace::Srgb) set the layer colorspace to nil on every configure. Rune reconfigures on every resize and when launch drawables settle about 1 s after launch. If nil really is untagged, as Kit's GPUI fix #2 in research 01 implies, the notes' 'matches' status for fix #2 holds only until the first resize. Plausible; needs a runtime check on a P3 display.
crates/rune/src/platform/macos.rs:182-196; crates/rune/src/window/create.rs:139-141; crates/rune/src/gpu/metal/surface.rs:111; ~/.cargo registry wgpu-hal-30.0.1/src/metal/surface.rs:286-327; crates/rune/src/window/win.rs:53; crates/rune/src/window/draw.rs:341-343
Medium
Predictions-vs-measurements and issue 2 use superseded numbers and ignore recorded decisions
§6 and issue 2 cite research 33's 14.8 ms keystroke and its view-dominated profile as current. Research 37 later measured team-chat typing at p95 13.0 -> 2.36 ms and resize at 30.9 -> 5.40 ms. Research 38 landed partial virtual_rows remount and automatic Markdown caching, and records why automatic read tracking needs reactive handles or a view macro. The notes' open question about per-scope tracking already has an answer in the repo.
research/37-what-to-own-next.md:51-55; research/38-view-rerun-and-commit-cost.md:20-34,48-55; crates/rune/src/runtime/commit/remount.rs:161
Low
05's web IME decision (512-unit sliding textarea) did ship, and the notes list it nowhere
The notes call the IME decision a full divergence. The web runtime builds a textarea context of at most 512 UTF-16 units around the selection and maps anchor and focus to UTF-16 offsets, which is 05's recommendation. Only desktop and iOS go through winit's IME with no document context.
crates/rune/src/runtime/web/runtime.rs:24-36,59-93; research/05-text-ime-a11y-layout.md (sliding 512-char textarea)
03

Research notes 18-38 and spikes: perf findings, engine plan, own-GPU plan

solid

A two-week, well-measured perf arc concluded "keep Taffy/Parley/wgpu-off-Apple, own Metal on macOS, fix Rune's own commit path". Most of it landed: native Metal is the macOS default, memo/motion/rewrap/remount fixes are in. The proven per-paragraph text layout never landed, and many citations have rotted.

Summary (674 words)

Scope: 16 notes (18, 23-35, 37, 38; numbers 19-22 and 36 are missing), 3,346 lines and about 36k words, plus about 3.3k lines of spike code and evidence. They were written 2026-10-22 to 11-05. Together they are Rune's performance and engine-ownership decision record.

Quality oracles: - 23 calibrated text against CoreText. dc72bff1 superseded it with a port of CoreGraphics' pipeline and colour-keyed dilation; off macOS, TEXT_GAMMA [1.12, 0.45]. - 24 built rune-ref, a CPU reference renderer. It found a glyph texel bug (83-level error) and gates at 2 levels with zero outliers. - 25 chose hand-written highlighters, capped at 32 KiB and 8,192 tokens. - 26 measured glass sync: glass is 1.8% off when synced vs 29% unsynced. Glass runs at about 80 fps because of the display link's half-period check; the fix was never landed.

Benches: - 27, typing in a long note: 12 ms at 50 KB and 45.7 ms at 200 KB. Paint culling cut a 200 KB scroll from 5.45 to 0.09 ms. - 28, re-breaking at a new width instead of reshaping: a 50 KB resize went from 16.1 to 4.6 ms. - 29, scroll CPU: 4-22% less. - 30, overlay GPU: Rune with wgpu costs 1,555 kinstr/frame and 6 command buffers, vs 850 for hand-written Metal. - 31, attribution: Taffy is 5-16% of a frame. Parley is at most 20% except where shaping dominates (typing 15.5 ms, cold open 18.3 ms). Rune's own code is 87% of a 5,283-node commit (45,657 allocations, 57.9 MB live).

Plan 32: keep Taffy and Parley, and rank 12 fixes. Its spike found: - Paragraph stacking is exact under three rules, and typing drops 15.2 to 0.10 ms ("go"). - A per-word shaper cache wins only 1.46-1.57x on real files ("kill").

Status in code: - Done: lazy motion tracks (#2), the resize fast path, extended to virtual lists (#4), hashing each text once (#5), re-breaking in place (#6), compact style via the new rune-taffy crate plus the hot/cold split (#7), and flattened memo reuse (#8). - Partly done: #3 (has_virtual; paths are moved, not kept in a table). - Not started: per-paragraph TextLayout and range undo (#1), the single-build trak / ResolvedStyle cache (#9), virtualized Markdown (#10), and the aspect_fit/fit_anchored passes (#11).

38's numbers match this split. The commit-side projections were met or beaten: stack 3.25 ms, md-same 0.167 ms. Typing (19 ms) and md-open (17.5 ms) are unchanged.

Real apps: - 33 found that frames miss the budget by rebuilding too much, not because of the engines. - 37 re-measured and found every miss fixed except the board's long-card scroll (82 frames over). Its verdict was "nothing left worth owning": fix Node copies, per-frame scans and window_tree. All of those landed. - 38 landed partial virtual_rows remount, automatic Markdown memo, node moves on resize, an elision cache, and a resting-node skip in apply.

GPU: - 34 decided to own Metal through wgpu::custom and keep wgpu elsewhere. The spike reached 894 kinstr, 1 command buffer and 7 allocations per frame. - Within 3 days the backend became the macOS default: crates/rune/src/gpu/metal/, 3,378 non-test lines and 19 tests. Precompiled metallibs cut a cold layer blur from 727 to 45 ms, and lazy rune-fx pipelines cut a cold first glow from 1.8 s to 71 ms. MTLBinaryArchive was rejected with numbers. - iOS stays wgpu by default. Gating wgpu's Metal backend behind a fallback feature and upstreaming the wgpu patches were not done. - 35 shows a native Vulkan/DX12 backend would save less than 0.09 ms a frame (software drivers).

Hot-patch: the spike measured 989 ms median from save to new output, against a 300 ms target. It still became the optional hot feature.

Main risks: - Many notes cite paths and lines that the 10-30 module folds moved (runtime.rs went from about 7,480 lines to 1,077). - The new default backend panics on depth, MSAA and similar features, which the fallback can't detect. - There is no CI. - Headless runs are unpaced. - The Metal backend is near its own 3,500-line abandon trigger.

Why this maturity: The research is carefully measured and the code mostly followed it. Native Metal is the default, and the commit, memo, motion and rewrap fixes have tests. Not production: no CI runs any gate, the Linux gate never ran, the highest-value text fix is unimplemented, the default backend panics on common GPU features, and many citations are stale.

Issues, most severe first
High
Proven per-paragraph text layout never implemented
Spike showed exact stacking and 150x faster typing (15.2 to 0.10 ms), but plan 32 #1 was never started. Typing in one 50 KB field is still about 19 ms, and undo still stores two full snapshots per step. PLAN §4.6 claims rope/sum_tree storage, but TextEdit.text is a plain String.
38 table: edit 18.980 -> 19.009 ms; crates/rune/src/edit.rs:48 pub text: String; crates/rune/src/edit/history.rs:12-19,64-71; no crates/rune/src/text/composite.rs
✓ Confirmed
Medium
Research citations rotted after module folds
32/33/37 cite runtime.rs line ranges up to 6,994 and files (runtime/measure.rs, flatten.rs, virtual_list.rs, display_link.rs) that moved; runtime.rs is now 1,077 lines and text.rs 887. 34 cites spike paths never on dev. 23 cites a missing note 19 and a missing script.
wc -l crates/rune/src/runtime.rs = 1077; research/33-real-bottlenecks.md cites crates/rune/src/runtime/measure.rs:164-189 (missing); research/34 cites gpu/metal_spike.rs, gpu/metal/command.rs, examples/metal_spike_dispatch.rs (missing); research/23-text-quality.md:197 'Research/19'
≈ Partly 32 and 33 do cite code that is gone, but 37 cites no .rs file at all. 34's metal/command.rs:487 points at wgpu-hal's file, not Rune's, and 34's gpu/mod.rs, gpu/metal/command.rs and gpu/metal_spike.rs are proposed design sketches, not citations. The truly dead spike paths are crates/rune/src/gpu_metal/ and crates/rune/examples/metal_spike_dispatch.rs, which exist only in b013a125 on origin/spike/metal (not an ancestor of HEAD). display_link.rs still exists at platform/display_link.rs. The runtime.rs 1,077 and text.rs 887 line counts are correct, and so are the missing note 19 and scripts/text-bench.py (deleted in d1634c68).
Medium
Default native Metal backend panics on descriptor-level features
Depth/stencil, MSAA, more than 4 colour targets, bundles and indirect draws are not wgpu::Features. The automatic fallback therefore can't detect them, and an app compositor that uses them panics on macOS by default.
crates/rune/src/gpu/backend.rs:112-124 (fallback only on Features); crates/rune/src/gpu/metal/mod.rs:113 FEATURES = TIMESTAMP_QUERY|IMMEDIATES, :158-162 unsupported! panic; 51 unsupported! sites
✓ Confirmed
Medium
Headless loop is unpaced on wgpu
The headless loop polls the device only when a compositor exists, so wgpu can queue up to 2,048 command buffers. Headless footprint numbers are then misleading, as 33 and 34 found.
crates/rune/src/tooling/headless.rs:387-390; research/34 'Memory: Metal vs wgpu'; research/33 'Memory'
✓ Confirmed
Medium
Glass capped near 80 fps; pacing fix not landed
26 measured 99% cadence with frame-start gating plus a GPU wait. The display link still gates on half a period, and the native backend presents with waitUntilScheduled under transactions, as wgpu does.
crates/rune/src/platform/display_link.rs:240-244; crates/rune/src/gpu/metal/submit.rs:279-283; research/26 'Getting Glass to 120 Hz (not landed)'
✓ Confirmed
7 more verified issues
Medium
No CI; Linux instruction gate never run; oracle coverage partial
rune-ref's gates, motion-audit and the perf benches run only by hand. The gungraun Linux gate has never executed. The rune-ref generator emits only kinds 0-4.
.github/workflows contains only site.yml, www.yml; research/24 'No Linux worker was available'; crates/rune-ref/src/generate.rs:29 b[0] % 5
≈ Partly There is some CI. www.yml runs on every crates/** push and PR, builds Rune for wasm and native Linux, and runs cargo test -p rune-www. None of the rune, rune-kit, rune-ref, motion-audit or bench gates run, so the substance holds. Layer kinds 8-12 have hand-written tests. The fuzz generator emits only kinds 0-4.
Medium
Cold open still shaping-bound; plan items 9-11 open
ranged_builder is still used, a trak mismatch reshapes the whole layout, Markdown isn't virtualized, and aspect_fit/fit_anchored force extra root solves.
crates/rune/src/text.rs:660, :753, :776-777; crates/rune/src/runtime/commit/relayout.rs:220-244; 38 md-open 17.674 -> 17.543 ms
✓ Confirmed
Low
Note 23's text raster policy is superseded
Note 23 says Rune uses swash emboldening with a luminance exponent, and it rejected luminance-keyed rasters. The code now ports CoreGraphics' pipeline, with colour-keyed dilation on macOS and a different exponent off macOS. The note still reads as current.
dc72bff1; crates/rune/src/text/macos/smoothing.rs; crates/rune/src/text.rs:96-98 TEXT_GAMMA [1.12,0.45], :385-387, :397-404
✓ Confirmed
Low
Doc/changelog say wgpu custom is macOS-only; code enables it on all Apple targets
34's 'Default on macOS' section and the metal-default changelog fragment claim iOS builds are unchanged, but Cargo enables wgpu's custom feature for target_vendor=apple. That was already true at the commit that wrote the claim.
crates/rune/Cargo.toml:110-121; changelog/unreleased/2026-10-31-metal-default.md; git show ad605f9c:crates/rune/Cargo.toml line 109-111
✓ Confirmed
Low
Metal backend near its own abandon trigger
34 says to abandon if gpu/metal exceeds 3,500 non-test LOC; it is at 3,378 raw lines with depth/MSAA still unimplemented.
find crates/rune/src/gpu/metal -name '*.rs' ! -name '*tests.rs' | xargs wc -l -> 3378
≈ Partly 3,378 raw lines in 17 non-test files is right, and it matches the repo's file-size.sh notion of non-test lines. Without blank lines and comments the count is 2,766 (79% of the trigger), and it includes a 97-line bench module and a 94-line generated builtin_table.rs. So 'near' depends on how note 34's 'LOC' is measured.
Low
Metal Phase 1/2 gates and upstream patches unrecorded
There are no recorded upload_bench or multi-pass command-buffer gate results, and no evidence the wgpu patches were sent upstream. The lazy-CB patch still contains the three bugs 34 named.
research/34 has results only for Phase 0 and Phase 3; research/overlay-cpu/ last changed in 7109faca; Cargo.lock wgpu 30.0.1 with no [patch]
≈ Partly a634ece5's commit message does record upload_bench kinstr numbers (steady upload 227 -> 208 on Metal, 337 -> 318 on wgpu), but nothing measures against note 34's 15/22 µs gates or the multi-pass gate. The upstream and patch parts are confirmed: the patch is unchanged since 7109faca, and wgpu 30.0.1 is unpatched.
Low
Paint walk visits every node each frame
There is no subtree skip, plus an ancestor walk per node while layers are open. 37 measured the paint walk at 25-62% of a scroll frame.
crates/rune/src/runtime/paint/build.rs:104 for paint_index in 0..n_nodes, :125-136; research/37 verdict #4 'Later'
✓ Confirmed
Strengths
  • Methodology is unusually rigorous: paired alternating runs, medians with outliers kept, retired-instruction counts when CPU frequency varies, explicit 'what headless leaves out' sections, reproduction commands per note
  • Plans state numeric kill/go triggers and the spikes honour them (word cache killed at 1.5x < 2x; Metal kept on a split gate with stated reasoning)
  • Fast plan-to-code cycle: most ranked items from 32/33/37 landed within days (task tags t834/t841/t886/t894), and 38 records before/after for each
  • Real-app validation (33, 37) corrected the synthetic-bench plan: the resize fast path was extended to virtual lists after 33 showed it never fired
  • Negative results and dropped attempts are recorded with numbers (path-string pool, !same_path node moves, MemoCache two-step lookup, MTLBinaryArchive, headless memory gap)
  • Landed perf work is guarded by tests (rewrap bit-equivalence, memo reuse byte-identical instances, struct-size ceilings El<=800 B and Node<=512 B, metallib staleness test, perf_warn)
  • Caches added respect AGENTS.md bounds (glyph cache 8 MiB/4,096 entries; layout stale budget 3 MB; Metal spares 2 per buffer)
  • Native Metal backend kept public API unchanged via wgpu::custom with an env/builder opt-out and describe_gpu diagnostics
Key concepts
  • Shape key vs layout key: Text cache split (28): shaping inputs vs width/alignment; a width miss re-breaks a shaped layout (~2 us) instead of reshaping (~30 us), in place when Rc::strong_count==1
  • Per-paragraph stacking rules: Spike Q1: force whole-text base direction, round line tops from running unrounded total, shift by (widest-own)*alignment share under unbounded width; gives 384/384 exact runs
  • Resize fast path: A viewport-only commit re-solves the last tree without running view or flatten; extended to virtual lists when their window holds (d7cdefde)
  • Partial virtual_rows remount: CommitWhy::VIRTUAL: when state is unchanged, staying rows and non-list subtrees move from the last build and only entering rows build (38)
  • Lazy motion tracks: No track for a property at its base value; set/animate that changes nothing doesn't mark dirty; is_resting_at skips apply on resting nodes
  • Memo flattened reuse: memo hits share subtrees, reuse flattened Node slices and Taffy subtrees, and move same-path nodes instead of cloning
  • wgpu::custom Metal backend: Rune's own Metal implementation behind wgpu's custom dispatch: one MTLCommandBuffer per frame, unretained refs kept by Keep lists retired on MTLSharedEvent, shared-storage buffers written in place with 2 spares
  • Command-buffer tax: wgpu commits 6 CBs and 2 handlers for an empty frame on Metal (Transit, Pre Pass, pass, PRESENT transitions, hal present); driver cost scales with CB count
Opportunities
Ship per-paragraph composite TextLayout and range-delta undoimpact higheffort highre-architecture
Implement plan 32 #1 using the spike's three stacking rules. Route the ~12 parley::Layout readers through a wrapper first. Gate at <=1.2 ms per keystroke at 50 KB (the spike measured 0.10 ms) and 100/100 undo steps at 200 KB.
Virtualize long Markdown blocksimpact higheffort medium
Plan 32 #10 / 28 #1. Use re-break-in-place for cheap height estimates. Projected 50 KB cold open 18 -> ~5 ms, and 200 KB from 70 ms to ~6 ms.
Single-build trak, style_run_builder, ResolvedStyle cacheimpact mediumeffort low
Plan 32 #9: remove the full reshape on a fallback-font trak mismatch and the default-style Fontique query. Projected md-open -1.5 to -2.5 ms.
Descriptor-aware Metal fallback or depth/MSAA supportimpact mediumeffort medium
Let Compositor declare attachments, or inspect pipeline descriptors, so default macOS apps fall back to wgpu instead of panicking. Alternatively implement depth and MSAA, revisiting the 3,500-line trigger.
Land the 26 pacing change behind a flagimpact mediumeffort low
Measure the half-period from frame start, and wait for the GPU before presenting under presentsWithTransaction. 26 measured 99% cadence for Glass; check with check-native-pacing.py and the existing pacer test.
Retained paint / subtree skip in the paint walkimpact mediumeffort highre-architecture
Start with subtree_end skips for off-viewport scroll children, then consider retained per-subtree spans translated on scroll (37 #4). This saves power on every scroll frame.
Pace headless runsimpact mediumeffort low
Poll or cap the frames in flight every N frames in tooling/headless.rs, so headless memory and cross-backend comparisons mean something.
Upstream present-skip and a fixed lazy-CB patch to wgpuimpact mediumeffort low
35: removes about a quarter of wgpu's per-frame instructions and a whole vkQueueSubmit on Vulkan. Windows, Linux and the wgpu opt-out on macOS all benefit.
Scope fit_anchored to the overlay and fold aspect_fit into measureimpact loweffort low
Plan 32 #11: removes up to two root compute_layout passes on media grids and overflowing menus.
Refresh and pin research citationsimpact loweffort low
Rewrite stale line refs in 23/27/32/33/34 as path:line @ sha (as note 18 does). Mark superseded policies (23, 27's budget) and fix the iOS custom-feature claim.
Re-run real-app scenarios after 38 on a quiet machineimpact mediumeffort low
Confirm whether the board long-card scroll (82 frames over in 37) now fits the budget, and record the Metal Phase 1/2 gate numbers.
Numbers, key files, roadmap and the verifier's additions
Numbers
Notes in scope / missing numbers
16 notes (18, 23-35, 37, 38); 19-22 and 36 absent
Note size
3,346 lines, ~36,300 words
Spike code + evidence
3,286 lines (excl. Cargo.lock)
Plan 32 items status
6 done (#2,#4,#5,#6,#7-mostly,#8), 1 partial (#3), 4 not started (#1,#9,#10,#11), 1 killed (#12)
Metal backend size
3,378 non-test lines (2,766 code), 1,277 test lines, 19 tests, 51 unsupported! sites; abandon trigger 3,500
HUD kinstr/frame
wgpu 1,395-1,555 -> native Metal 894 (Swift floor 808); heap allocs 65.1 -> 7.1
50 KB typing (one field)
~19 ms now; spike per-paragraph 0.10 ms
md-same commit
0.851 -> 0.167 ms (-80%), allocs 5,687 -> 10
stack commit (5,283 nodes)
10.2 ms (31) -> 3.25 ms (38, different machine)
50 KB live resize
16.1 ms -> 4.6 ms (28) -> 1.74 ms commit (38)
Cold first layer blur / first glow
727 -> 45 ms / 1,799 -> 70.9 ms
Vulkan native saving
~70 kinstr, 0.06-0.09 ms/frame (<1.1% of 8.33 ms)
Hot patch latency
989 ms median save->new output (target ~300 ms)
rune-taffy
4,446 lines; retained layout heap -80% on 500 rows
Key files
research/32-engine-plan.md Layout/text engine verdicts, 5 root causes, 12 ranked fixes, phase gates, spike results (Q1 go, Q2 kill)
research/34-own-gpu-plan.md Own-Metal verdict, option comparison, phases, Phase 0 spike results, precompiled metallib and rune-fx lazy pipelines, MTLBinaryArchive rejection, Metal-vs-wgpu memory
research/37-what-to-own-next.md Real-app re-measure; ranks remaining costs (Node copies, scans, paint walk); 'own nothing new' verdict table; scan spike
research/38-view-rerun-and-commit-cost.md What landed after 37 (virtual remount, Markdown auto-memo, node moves, elision cache) with paired before/after numbers
research/33-real-bottlenecks.md Four real apps checked against plan 32; finds rebuild-too-much as the cause; lists plan gaps
research/31-layout-text-cost.md CPU/alloc/heap attribution to Taffy, Parley, Rune per workload
research/30-overlay-gpu-cost.md wgpu vs hand-written Metal HUD per-frame instructions, CBs, handlers; wgpu patches; overlay loop fixes
research/35-wgpu-vulkan-dx12-cost.md wgpu overhead vs raw Vulkan/DX12 floors on software drivers; keep-wgpu verdict
research/engine-spike/paragraph_stack.rs Throwaway spike: paragraph stacking equivalence matrix, edit keystroke bench, word-cache bench (not compiled on dev)
research/overlay-cpu/wgpu-hal-metal-lazy-command-buffer.patch Prototype wgpu-hal patch; 34 found three bugs; unchanged since
Roadmap items
  • Implement the per-paragraph TextLayout behind a single-layout wrapper first (32 Phase 2a/2b), then range-delta undo (2c)
  • Virtualize long Markdown and fix single-build trak/ResolvedStyle for cold open (32 #9, #10)
  • Make the Metal fallback descriptor-aware or add depth/MSAA; revisit the 3,500-LOC trigger explicitly
  • Land the Glass pacing change behind a flag with motion-audit and native-pacing checks
  • Pace headless frames so memory benchmarks are valid
  • Upstream present-skip and a fixed lazy-CB patch to gfx-rs/wgpu
  • Re-run real-app scenarios (board long card) and record the Metal Phase 1/2 gate numbers
  • Refresh stale citations and superseded policies in 23, 27, 32, 33, 34 and PLAN §4.2/4.5/4.6
  • Add CI (at least cargo test plus rune-ref CPU hashes) and a Linux runner for the instruction gate
Found by the verifier
Medium
Undo is silently disabled for texts over ~512 KB, and each keystroke does O(n) history work
Change::bytes counts both full snapshot texts. After a push, record_change pops from the front while bytes > HISTORY_BYTES (1 MiB). A single change on a text over ~512 KB is therefore dropped at once, so typing or pasting in such a document records no undo at all, with no warning. This goes beyond note 27's '2 of 100 steps at 200 KB'. Each keystroke also clones the whole text twice (snapshot before, snapshot_now after) and compares whole texts up to three times (same_doc, the expected-text check, c.after == before). That O(n) cost stays after per-paragraph layout lands, so range-delta undo is required, not optional.
crates/rune/src/edit/history.rs:8-9 (HISTORY_BYTES), :62-71 (bytes counts before+after texts), :98-107 (snapshot_now clones text), :126-145 (three full comparisons), :156-158 (pop while bytes > cap)
Low
The public Gpu::instance doc promises indirect draws work, but the macOS default backend panics on them
The doc on the public Gpu::instance() says 'Indirect draws a compositor records on Rune's device still work'. On macOS, instance() returns the native Metal backend by default, which panics on draw_indirect, draw_indexed_indirect, multi_draw_indirect and dispatch_workgroups_indirect. The Features-only fallback cannot route these apps to wgpu.
crates/rune/src/render.rs:505-512; crates/rune/src/gpu/metal/pass.rs:290-307; crates/rune/src/gpu/metal/compute.rs:210-211; crates/rune/src/gpu/backend.rs:30,112-124
Low
Precompiled metallib staleness falls back silently, and only a hand-run Mac test catches it
A built-in pipeline whose WGSL hash is not in builtin_table.rs compiles at runtime with no error. That loses the cold-start wins note 34 measured (first layer blur 727 -> 45 ms; iOS sim 6,631 -> 440 ms). The guard test asserts zero misses but returns early off the native backend, and no CI job runs it. Each shader edit also requires regenerating three committed .metallib binaries.
crates/rune/src/gpu/metal/builtin.rs:6-16,57-59; crates/rune-light/tests/builtin_shaders.rs:14-15; scripts/precompile-metal-shaders.sh:111; .github/workflows/ (no macOS job)
Low
The macOS dilation bucket follows the animated text colour, the risk note 23 cited for rejecting this design
set_glyph_inks receives the presented (animated) P_TEXT colour, and the dilation radius derived from its luminance bucket keys the glyph atlas. During a text-colour or theme animation, glyph weight therefore steps at quarter-luminance boundaries, and new masks are rasterized per bucket. Note 23 gave exactly this, '5x cache cardinality and bucket jumps during theme animation', as its reason for rejecting luminance-keyed rasters. No measurement of it on the shipped path is recorded. It matches CoreText, but its atlas, glyph-cache and visual cost is unmeasured.
crates/rune/src/runtime/paint/content.rs:55-57,366; crates/rune/src/text/macos/smoothing.rs:132-148,238-253; crates/rune/src/text/glyph_cache_tests.rs:82-95 (an entry per ink); research/23-text-quality.md:94

Runtime, layout and motion

Runtime core · Layout · Motion and scroll

04

Runtime core: view functions, El tree, Cx/Tx, commit/diff, memo, state model, frame loop

solid

A single-threaded, whole-state retained-tree runtime: a plain fn(&S,&mut Cx)->El view re-runs on any handler/poll/update, gets flattened into path-keyed Nodes, laid out with Taffy at target state, diffed into rune_motion::Scene tracks, and painted every frame on the winit event-loop thread. Elision comes from memo, flattened-slice reuse, a resize relayout and a virtual-row remount. There is no render thread.

Summary (570 words)

Apps define AppSpec<S> (tooling.rs:17): init, view (a fn pointer taking &S and Cx<S>, returning El), optional setup(&mut S, Waker), poll(&mut S, clock, &mut Tx)->bool, on_key. App<S> (app.rs:42) adds lifetime hooks (on_ready, on_close, keep_running, overlays, compositor). Handlers are closures attached by El builders. They are erased to Rc<dyn Fn(States,&mut Tx)>, and a runtime downcast (states.rs:56) recovers &mut S. They are queued as Actions and run between frames. Cross-thread input enters through AppHandle::update (Mutex<Requests>, drained on the UI thread into Runtime::update_if), the setup Waker, lock-free Live<T>/LiveText, and Latest<T> (a pool of at most 4 workers).

Each frame, Runtime::frame_split (runtime/frame.rs:335) first advances already-running motion by catch_up. Then it runs poll and the queued handlers; key/IME routing can force a mid-frame ROUTE commit. If anything changed it commits (frame.rs:544). It then applies scroll requests, latches Live values, and runs step_motion: scene.frame(), growth, scroll, reveals, and the paint walk build() that emits instances. Report actions are queued for the next frame. Within the same call stack the host uploads, encodes, submits and presents (window/draw.rs:214-286).

A commit (runtime/commit.rs:79) picks one of three paths: a resize-only relayout that skips the view, a virtual_rows remount that builds only entering rows, or a full measure. A full measure runs the view inside a memo scope, repairs keys, builds virtual windows, and flattens into Vec<Node> plus Taffy, reusing memo slices along the way. It then solves layout and text, re-measures when a layout read, the focus or the caret moved, and finally applies to Scene. A type split (Measurement has no Scene, and Measured is the only thing apply accepts) keeps retries from mutating presentation. A commit can run the view many times (up to 9 measures × up to 9 virtual passes), so components keep history through memo::snapshot.

Invalidation is coarse: any handler that runs, a poll returning true, an update, or an env change re-runs the whole view. The escape hatches are Tx::live_only (a debug build still verifies it by committing ≥0.25 s after the last commit), update_if returning false, memo, and virtual_rows. Elision works at four levels. memo keys on hash(version, env) plus replayed Cx reads. Flatten-level reuse moves, clones or rebases old Node slices and Taffy subtrees, guarded by an exhaustive same_root_el. clean_apply_spans and unchanged_node_resting skip the diff for at-rest nodes. Relayout and remount skip the view entirely. Research 38 measured md-same commit p50 dropping from 0.851 to 0.167 ms, but memo-less workloads still take 2.7–3.3 ms per commit.

On threading, the code shows no render thread. Host<S> owns rt next to gpu and renderer on the single winit event loop (window.rs:324-360). Scene is a Runtime field. Runtime is !Send, with Rc in Node, El, handlers and memo. The only frame-path worker is the macOS-only PresentWorker, which overlays use for finish/submit/present. The README admits this (README.md:2817), but PLAN.md §3, the layer table and tenet 2 still describe a render thread with a command channel.

Runtime is a god object: 251 fields (28 pub), implemented across 94 files (~29.7k lines), all monomorphised per S. Partial subsystem structs exist, but hover, press, capture, clipboard, drag-out and focus are still flat field families. Identity is a path String (Node.path, path_ids), so focus, hover and every Action carry strings, and the runtime has 32 linear path scans. Tests are strong: 630 under runtime/ and 433 integration tests, all headless through the public frame API. Maturity is solid-but-complex. The main risks are the move-with-rollback node machinery, main-thread-bound animation, and coarse invalidation.

Why this maturity: The core loop, commit, memo reuse, relayout and remount fast paths have targeted tests (630 under runtime/, 433 integration tests) and measured benchmarks (research 33, 37 and 38), and real apps (team chat, notes, agent client, board) run within budget except one board interaction. It is not production-grade. The Runtime god object, the ordering-sensitive frame_step, the move-with-rollback node machinery and the coarse invalidation are structural risks, and PLAN still describes an architecture (render thread, Model store) the code does not have.

Issues, most severe first
Medium
Runtime is a 251-field god object
There is one generic struct with 28 pub fields, implemented across 94 files (~29.7k lines). Hover, press, capture, clipboard, drag-out and focus are still flat field families. Every method is monomorphised per S even though S is barely used, and subsystems can mutate each other's state freely.
crates/rune/src/runtime.rs:366-801 (251 fields, constructor 813-1071); 94 files impl Runtime<S>; AGENTS.md 'New runtime state goes in the owning subsystem's struct'
✓ Confirmed
Medium
Stringly-typed identity and linear path scans
Node.path is a String, and path_ids is a HashMap<String,NodeId>. Focus, hover, capture and every Action variant carry path Strings, and the runtime has 32 linear n.path == scans, including per-virtual-list find and filter passes in measure_virtuals and a virtuals.retain over all nodes after every commit.
runtime/types.rs:94; runtime/input/action.rs:6-56; runtime/commit/measure.rs:119-124; runtime/commit/apply.rs:835; research/37-what-to-own-next.md:122-136 (scans cost 3-11% of busy time)
≈ Partly Node.path is at types.rs:91, not :94. 28 of the 37 Action variants carry a String, not every variant: WindowFocus, Physical, Files, Key, KeyUp, Ime, ClipboardRead, FileDialog and Blur carry none. The scan count is in the right range (~35 single-line nodes.iter()…path ==). The apply-time virtuals.retain runs only when virtual lists exist. The research-37 shares (6-11%, 3-4.5%) are for highlight_target_in and Keyed::new. Those are key scans, not n.path == scans, and commit 8d3d3f72 addressed both after research 37 with key_index.rs and exit_mask.rs. An O(1) path-to-index lookup already exists (path_ids + node_index).
Medium
Coarse invalidation: any handler that runs re-runs the whole view
There is no read tracking. Apps that don't memo or use virtual_rows pay full rebuilds: stack and tree workloads take 2.7-3.3 ms per commit, and a chat keystroke took 14.8 ms (83% in the view) before virtual_rows. Adoption in rune-kit is low: 4 memo( and 8 live_only() call sites.
runtime/frame.rs:500-505; research/38 tables; research/33 cost 1
✓ Confirmed
Medium
No render thread; animation smoothness depends on the main thread
View, commit, layout, motion sampling, the paint walk, encode and present all run on the event-loop thread, so a slow handler or commit delays animation frames. PLAN still describes a render-thread architecture as the design.
window.rs:324-360; window/draw.rs:214-286; frame/present_worker.rs (macOS overlays only); PLAN.md:30,73,100-134; README.md:2817
✓ Confirmed
Medium
Fragile move-with-rollback node machinery
Nodes reach the new buffer in four ways (fresh flatten, moved via moved_stub, cloned, rebased), plus the relayout and remount moves, each paired with restore_moved_nodes on retry. Research 38 records a near-miss in which a move would have dropped exit transitions.
runtime/commit/memo_reuse.rs:524-640; runtime/types.rs:163-200; runtime/commit.rs:120-133; research/38 'Tried and dropped'
✓ Confirmed
8 more verified issues
Medium
frame_step is a 265-line ordering-sensitive function
Correctness depends on statement order: ROUTE commits, live-check bookkeeping, selection, popup hover release, and scroll requests after the commit. The runtime also has 73 debug-only cfg sites.
runtime/frame.rs:374-638
✓ Confirmed
Low
Unbounded-in-practice view runs per commit
A commit may measure up to 9 times (initial, 2 settle passes, focus plus 2, caret plus 2), and each measure may make up to 9 virtual-estimate passes. Nothing counts view runs per commit. Views must be idempotent, and components need memo::snapshot for their history.
runtime/commit.rs:96-110; runtime/commit/measure.rs:190-209; runtime/layout_read.rs:38,409-427; memo/snapshot.rs:14-31
✓ Confirmed
Low
Debug and release commit differently for live_only events
Debug builds force a commit for a live-only event at least 0.25 s after the last commit, and tests run in debug, so commit counts differ unless check_live_only(false) is set.
runtime/motion/live_check.rs:4-6,38-50
✓ Confirmed
Low
Handler state type checked at runtime
A handler built for another state type panics when its event fires instead of failing to compile.
states.rs:56-58; el/handlers.rs:10
✓ Confirmed
Low
Public mutable Runtime fields bypass invariants
28 pub fields are exposed, including scene, poll, on_key, reduced_motion, time_scale, t and clock. For example, reduced_motion is silently overwritten from the view's Cx at the next apply.
runtime.rs:367-799; runtime/commit/apply.rs:14-17
✓ Confirmed
Low
Commit frames allocate megabytes
Committing frames allocate megabytes, which contradicts PLAN tenet 7's zero allocation per frame; only non-committing paths are alloc-tested.
research/37-what-to-own-next.md:76-80 (2,446 KB per typing frame); crates/rune/tests/alloc.rs (6 tests)
≈ Partly The 2,446 KB figure is one app's typing at 29df6816, measured before the moved-node work (165e876f, 9beba394). research 38 shows a memo-hit commit at 10 allocations (md-same). alloc.rs does have 6 tests, but other allocation asserts exist in src and tests, such as rewind, a clean 3,700-row key repair, upload, mip and pixels_streaming. None of them covers a whole commit. Tenet 7 is at PLAN.md:87-88.
Low
Stale docs
The README's 'Differences from PLAN.md' says there is no AccessKit and scrolling is vertical only, but the code wires AccessKit and has ScrollAxes::X/Both. The lib.rs doc still says 'first slice'.
crates/rune/README.md:2820-2821; lib.rs:1-4,64-65; runtime.rs:310-321; el.rs:453-459
✓ Confirmed
Low
Dev tooling coupled into the core path
The playground host is threaded through handler state routing (states! macro), measure, relayout, remount, frame and action.
runtime.rs:41-45,373; rg playground in runtime/frame.rs, commit/measure.rs, commit/remount.rs
✓ Confirmed
Strengths
  • Clear phase separation enforced by types: Measurement can't reach Scene, and apply only takes Measured
  • Animation never re-runs app code; idle windows draw nothing (ControlFlow::Wait, the quiet-frame unchanged check)
  • Several layered elision paths (memo, flattened-slice reuse, clean apply spans, resting-node skip, resize relayout, virtual remount), each with measured gains (research 38: md-same commit -80%, list view -92%)
  • Exhaustive-destructuring equality checks make memo reuse compile-time safe against new fields
  • Deterministic headless runtime: the same Runtime and API drive apps, tests and tools, timers split headless steps, and there is a virtual clock
  • Strong test suite: 630 tests under runtime/, 433 integration tests, 6 zero-allocation tests on non-committing paths
  • Rich instrumentation: CommitWhy bits, frame-profile phases, perf_warn stall/commit/idle meters, debug live_only verification
  • Careful frame timing: catch-up vs dt split, MAX_GAP and RESUME_STEP, timer collapsing
  • Cross-thread entry points are latest-wins and lock-free where it matters (Live via AtomicU128)
Key concepts
  • View function: fn(&S, &mut Cx<S>) -> El function pointer; whole state in, El tree out; re-runs on any committing change; hot-patchable via jump table
  • El: Type-erased element value (52 fields, ~304 builders); cold groups behind Cold<T>/SharedBox<T>; size-asserted <= 800 bytes
  • Node: Flattened retained element with NodeId, path String, parent index, Taffy slot, text layout, Visual and target/local rects; <= 512 bytes
  • Path identity: parent/key or parent/#index strings mapped to NodeId via path_ids; duplicates renamed; drives focus/hover/actions
  • Cx: View context: env, accent, chrome insets, view-declared settings, and tracked reads (layout, layout_with, caret); holds no state
  • Tx: Per-handler transaction: instant/settle/motion/live_only, scroll requests, wake_after, clipboard/popup/window requests, merged into the frame's commit
  • Commit: measure (view run + flatten + Taffy + text, with retries) then apply (diff into Scene); three paths: full, resize relayout, virtual remount
  • Measurement/Measured split: Capability borrow struct without Scene access; Measured is the only input apply accepts, so retries can't mutate presentation
Opportunities
Split Runtime<S> into a non-generic RuntimeCore plus a thin typed shell with subsystem structsimpact higheffort highre-architecture
Keep state, view, poll and on_key in Runtime<S>. Move the other ~245 fields into owned subsystem structs (Focus, Hover, Press, Clipboard, DragOut, Scroll, Reports, PaintScratch) on a non-generic core. This cuts monomorphisation of ~30k lines per state type, makes borrows explicit (as Measurement already does), and lets types enforce the AGENTS.md ownership rule.
Intern node paths into integer idsimpact higheffort medium
Assign a u32 per path during flatten, carry ids in Action, focus, hover and capture, and keep strings only for tools. This removes 32 linear scans and the per-action String clones, and makes most key_index uses unnecessary.
Persistent node arena instead of per-commit Vec<Node> rebuildsimpact higheffort highre-architecture
Store nodes by NodeId and generation, and have each commit produce an order vector plus a dirty set. Reused, relaid and remounted subtrees then stay put, removing moved_stub, restore_moved_nodes and the four reuse modes. This targets research 37's top commit cost, Node copies.
Present windows from a worker threadimpact mediumeffort medium
Generalise the macOS overlay PresentWorker to windows: hand a Send frame packet (instances, uploads, surfaces) to a thread for encode, submit and present. This frees the event-loop thread without the full PLAN render thread.
Presentation snapshot as a step toward a render threadimpact higheffort highre-architecture
Have the paint walk read a per-commit Send 'paint list' (resolved visuals, glyph runs, clip tree) instead of Node with its Rc text layouts. That makes a later render thread owning Scene sampling possible.
Versioned sub-state for automatic memo versionsimpact mediumeffort medium
A Versioned<T> whose generation bumps on &mut access would give memo a version for free and approximate PLAN's model-granularity invalidation without a macro.
Count and bound view runs per commitimpact loweffort low
Track measure_view calls per commit, expose the count in FrameStats and the frame log, and warn in debug past a threshold, so that layout-read feedback and virtual estimate retries become visible.
Fold post-apply scans into flattenimpact loweffort low
Compute the seven has_* flags and the virtual list liveness while nodes are pushed, instead of making several full passes after apply.
Automatic retained instance spans for resting subtreesimpact mediumeffort high
The paint walk is 25-62% of a scroll frame. Cache emitted instances per subtree, keyed by commit generation and scene rest state, and replay them with a scroll offset.
Hide pub Runtime fields behind accessorsimpact loweffort low
Protect invariants on scene, poll, on_key, reduced_motion, time_scale, t and clock. This is an API break for tools and tests.
Numbers, key files, roadmap and the verifier's additions
Numbers
Runtime<S> fields
251 (28 pub, 40 pub(crate), 5 debug-only, 1 hot-only)
Files implementing Runtime<S>
94 files, ~29,700 lines, ~1,250 fns
runtime/ directory
175 files, 45,715 lines (16,646 test lines)
Scope files total
23,075 lines
El fields / builder methods
52 / ~304
Tx fields
54
Cx fields
16
Measurement borrow-struct fields
40
Size budgets
El <= 800 B, Node <= 512 B (size_tests.rs)
Tests
630 in runtime/, 16 memo, 36 el, 82 live/latest/app/frame; 1,714 in src/, 433 in crates/rune/tests
Linear path scans in runtime
32
String-typed Runtime fields
22
HashMap<NodeId,_> side tables
13
thread_local! blocks (crate)
71
Key files
crates/rune/src/runtime.rs Runtime<S> struct (251 fields, :366-801), constructor, ~110 #[path] submodule declarations, states!/app_call! macros
crates/rune/src/runtime/frame.rs Frame loop: frame/frame_split/frame_step (handlers, poll, ROUTE commits, main commit), step_motion (scene sample, growth, scroll, paint build, reports), update/update_if, wake deadlines
crates/rune/src/runtime/commit.rs commit orchestration; Measurement (40-field capability borrow) and Measured types
crates/rune/src/runtime/commit/measure.rs measure passes, measure_view (view run inside memo scope, flatten, solve), virtual windows, virtual row population
crates/rune/src/runtime/commit/relayout.rs measure_commit path selection, resize-only relayout fast path, Taffy solve
crates/rune/src/runtime/commit/remount.rs virtual_rows-only remount fast path
crates/rune/src/runtime/commit/flatten.rs El -> Vec<Node> + Taffy flatten, path construction
crates/rune/src/runtime/commit/memo_reuse.rs flatten-level memo slice reuse (moved/cloned/rebased), same_root_el exhaustive check, clean_apply_spans
crates/rune/src/runtime/commit/apply.rs Per-node diff into rune_motion::Scene, growth stacks, scrolls, exits, post-commit bookkeeping
crates/rune/src/memo.rs memo/memo_with_hash/cached, MemoCache, env hashing, Cx read replay, liveness eviction
Roadmap items
  • Update PLAN.md §3, the layer table and tenet 2 to describe the main-thread runtime as it is, or name the first concrete step toward a render thread
  • Fix the README 'Differences from PLAN.md' (AccessKit, horizontal scroll) and the lib.rs 'first slice' doc
  • Add a per-commit view-run counter to FrameStats and the frame log, with a debug warning threshold
  • Group the flat Runtime field families (hover, press, capture, clipboard, drag-out, focus) into subsystem structs, one PR each
  • Intern node paths into u32 ids for Action, focus, hover and capture, and remove the linear path scans
  • Prototype a non-generic RuntimeCore and measure compile time and binary size against the current Runtime<S>
  • Move window encode/submit/present to a worker as macOS overlays already do, and measure main-thread headroom
  • Evaluate a persistent node arena that replaces the moved_stub/restore machinery, using research 37's Node-copy cost as the target
  • Consider a Versioned<T> helper so memo versions come automatically from state generations
Found by the verifier
Medium
Default macOS GPU path is Rune's native Metal backend, which bypasses the present worker
The note's frame path and threading section describe wgpu throughout and say overlays present from PresentWorker. metal-backend is a default feature, and GpuBackend::Metal is the macOS default. On that backend, overlay/frame.rs skips the worker because submit+present is 'too cheap to hand to a present thread'. This changes three things: the default-macOS threading picture (nothing leaves the main thread), the case for opportunity 4 on Mac, and the meaning of headless versus windowed numbers.
crates/rune/Cargo.toml:8; src/gpu/backend.rs:1-2, :30; src/gpu.rs:33-43; src/overlay/frame.rs:113
Medium
An O(1) path-to-node index already exists, but common helpers still scan linearly
path_ids (HashMap<String, NodeId>) plus node_index (NodeId to position) already give an indexed lookup. interaction.rs's index_of and virtual/window.rs use it. Hot helpers still do O(N) scans: Runtime::node(path) in input/keys.rs, hit.rs, gesture.rs, secondary.rs, keys.rs:259 and others. Many of the ~35 scans could switch to the existing index with a small patch, with no interning re-architecture (opportunity 2).
runtime/interaction.rs:54-56; runtime/virtual/window.rs:44; runtime/input/keys.rs:226-227, :259; runtime/input/hit.rs:183; runtime/input/gesture.rs:164; runtime/input/secondary.rs:43
Medium
Research 37 cost shares are cited as current, but the fixes they called for have landed
Issue 2, section 12 and opportunity 3 present research 37's shares as current costs: the scans (highlight_target_in 6-11%, Keyed::new 3-4.5%, subtree_exiting) and Node copies (15-20% of commit). Commits after research 37 added key_index.rs and a one-pass exit_mask (8d3d3f72), and they move same-path reused nodes instead of cloning (165e876f, 9beba394). Research 37's own later section also records path-string pooling as tried and not worth it. The cost picture should be re-measured before the interning or arena rewrites are ranked.
git: e4e9bef7 (research 37) is an ancestor of 8d3d3f72 and 165e876f; research/37-what-to-own-next.md:12-21, :127-133, 'Tried, not landed: pooling node path strings'; runtime/key_index.rs:1-3; runtime/paint/exit_mask.rs:45
Low
Per-frame commit count scales with queued routed input, and the frame diagram omits the post-scroll caret commit
The view-runs issue is framed per commit, as 'typical commits run it once'. frame_step commits before each routed action (Key, KeyUp, IME, Paste, Physical, Files) that follows a state change. A burst of N keystrokes or key repeats drained in one frame therefore runs N full commits, each with up to 9 measures. There is also an extra instant commit after scroll requests when the caret moved (frame.rs:609), which the step list in section 5 doesn't show. Rune counts commits, but there is no per-frame bound or warning for this.
runtime/frame.rs:466-482, :609; runtime/input/action.rs:443-447 (route_key result feeds ran); runtime/types.rs:440-445
05

Layout: rune-taffy, layout store, virtual rows, growth, anchors, measurement

solid

Rune keeps Taffy 0.15's solver bit for bit but stores layout in its own dense arena (216 B slots, 64 B CompactStyle, 96 B CompactCache), synced post-order from flatten. Text measures through cached Parley shapings. Virtual lists mount only a window, folding the rest into padding, with O(n) bookkeeping.

Summary (595 words)

rune-taffy (4,446 lines, landed 8a14dda8 on 2026-11-01) replaces TaffyTree with LayoutStore. Its parts are dense 216-byte RetainedSlots indexed by SlotId(u32), an FxU64 map from NodeId to slot, double-buffered flat child arenas, and per-slot MUTATED/HAS_CTX bits. It implements Taffy's low-level traits (LayoutPartialTree, CacheTree, the flex/grid/block containers) directly, so the solver is unchanged; differential tests against upstream TaffyTree assert identical BoxLayouts and identical measure-call logs. CompactStyle (64 B) lives on El itself and implements Taffy's style traits. It packs size, padding, gap and flex fields inline (bf16-exact floats, 2-bit length tags) and falls back to a boxed full taffy::Style for anything cold (grid, margins, insets, aspect ratio). CompactCache (96 B) replicates taffy::Cache's 9-entry second-chance cache exactly, with overflow entries in a lazy box.

Commit protocol: flatten (post-order) calls sync_node(key=NodeId, node_idx, style, measure hash, children). It compares the child slice, the 64 B style and the measure hash. Dirtiness returns up to the parent, so any leaf change clears caches to the root, as Taffy's mark_dirty does. Memo hits call reuse_slot (copy the old child slice) or rekey_and_reuse_batch. finish_flatten frees unvisited slots without renumbering, so retry passes keep valid SlotIds. Compaction (live < 25% of capacity) happens only at the end of apply; it remaps Node.taffy and clears every cache. Incremental relayout is purely Taffy's input-keyed cache. Resize changes only the root style; subtrees whose inputs don't change hit their cache.

solve() runs compute_layout, then a second solve when any aspect_fit element exists (unconditionally, every commit), then place (rebuilds node_index and computes targets, anchored overlays positioned Floating-UI style), then a third solve if fit_anchored changed a max size, then lay_out_text for every text node. The measure callback calls TextSystem::layout_for_spec with the commit's shape key, so a width change re-breaks instead of re-shaping (research/28: 50 KB resize 16.1 to 4.6 ms). Three commit shapes share solve: full measure; resize-only relayout (no view, nodes moved); remount_virtuals (no view, only entering rows built).

Virtual lists: VirtualList keeps keys, a key-to-{index, measured height} map, row heights and prefix sums. Mounted rows are real children; unmounted space is folded into the column's padding. Windows use 2 viewports of overscan and, for index-built rows, half a viewport of new rows per side per commit. Anchoring keeps the first measured visible row in place. A pass whose rows don't cover the viewport retries the whole measure_view, and pass 9 mounts every row. Lookups are binary searches, but prefix sums rebuild in full on any height change and set_keys rebuilds the map and clones every key on any key change, so PLAN's sum tree is not built. Growth stacks animate presented row heights with fixed 1/240 s substeps and derive positions from them at paint time; Taffy sees targets only. Layout reads see unscrolled rects and settle in at most 2 extra passes, with an echo cap of 4.

Issues: the measure hash omits spec.blocks and exact_lines, so a rich text_input bullet or quote toggle can keep a stale height (predates LayoutStore). Hash flag bits collide (max_lines<<2 overlaps the revealed bit). Setters on cold styles free and re-box a 552 B Style per call, which hurts absolute/pin/margin elements. Exiting nodes keep stale SlotIds while LayoutStore accessors use get_unchecked. Compaction runs in hash order and wipes all caches. Many lookups are linear path or key scans (measure_virtuals, anchor_index, apply's virtuals retain). force_all has no cap. The README is stale on gaps and on the lazy API, and PLAN's 'sum tree' and 'layout runs once' don't match the code. Maturity: solid. Strong differential and behaviour tests, but no perf gates and no CI comparison against the baseline build.

Why this maturity: LayoutStore is 6 days old but has differential parity tests against upstream Taffy across commits, memo reuse and retries. Virtual rows, relayout, remount, anchors and growth have about 150 behaviour tests between them. Perf has paired A/B benches and research notes, but no perf gates and no CI comparison against the baseline build. A few correctness gaps remain (measure hash) and some O(n) bookkeeping.

Issues, most severe first
Medium
Measure hash omits text blocks and exact_lines
A rich text_input whose line toggles to Bullet/Quote with no text change changes only spec.blocks, which line breaking uses but the measure hash does not include. The LayoutStore keeps the cached size, so the field can keep its old height while lay_out_text draws indented, possibly longer, lines. exact_lines changes measured height and is also missing. Predates LayoutStore. Untested.
crates/rune/src/runtime/commit/flatten.rs:226-230; crates/rune/src/text/hash.rs:53-75; crates/rune/src/text/rich_layout.rs:122; crates/rune/src/el/text.rs:174-208; crates/rune/src/runtime/commit/text_layout.rs:366-372
✓ Confirmed
Medium
Cold CompactStyle setters free and re-box a full Style per call
Once extra is Some (absolute/pin with insets, margins, aspect ratio, grid), every setter goes through modify_cold: it moves the 552 B Style out of its box, applies the change and re-boxes it. Setter order changes the cost: .absolute().w().h() makes three alloc/free pairs per build. There are 196 .absolute( and 48 .pin( call sites across kit, rune and examples
crates/rune-taffy/src/style/mod.rs:531-538; crates/rune-taffy/src/style/setters.rs:7-18, 271-318; crates/rune/src/el/layout.rs:257-267
≈ Partly The mechanism is right: modify_cold moves the Style out of its box and from_style boxes it again. But 'every setter' is too broad. Direction, wrap, overflow, align, justify and set_position_absolute change the boxed style in place. Only size, padding, gap, grow, shrink, basis, aspect, margin, inset and grid setters go through modify_cold. .absolute(0.0, 0.0) also goes cold, because a zero length is not auto. Call-site counts depend on the filter: about 205 .absolute( and 54 .pin( outside tests, 421 and 82 with tests. The cost was never measured, so 'medium' is generous.
Medium
Retry passes re-run the whole view; force_all mounts every row uncapped
A virtual window short of the viewport re-runs measure_view including the app's view. After 8 passes force_all sets range to 0..len for every list, so a degenerate list builds all rows in one commit
crates/rune/src/runtime/commit/measure.rs:190-209, 198, 337; crates/rune/src/runtime/commit/relayout.rs:78-81
✓ Confirmed
Low
aspect_fit/anchored_fit force extra full solves every commit
Flatten restores the room style, so an aspect_fit node always looks changed. solve then refits unconditionally and dirties the ancestor spine twice per commit, even when nothing changed
crates/rune/src/runtime/commit/relayout.rs:223-235; crates/rune/src/runtime/commit/flatten.rs:445-448; crates/rune/src/runtime/anchor.rs:122-134; research/32-engine-plan.md:66-67
≈ Partly The mechanism is confirmed. Flatten puts the room style back, and memo excludes aspect_fit and above nodes, so sync_node dirties the spine. The refit then sets the fitted style, dirties the spine again and runs a second compute_layout. 'Full solves' overstates it: the second pass is a root solve in which clean subtrees hit their cache. For anchored_fit this happens only while the overlay fits on neither side.
Low
Stale SlotId on exiting nodes with unchecked accessors
Exiting nodes are appended after present nodes and still hold freed or compacted SlotIds. LayoutStore::style/box_layout use get_unchecked with only a debug_assert. Current callers avoid exiting nodes, but only by convention
crates/rune/src/runtime/commit/apply.rs:775-776; crates/rune-taffy/src/store.rs:517-529; crates/rune/src/runtime/commit/relayout.rs:99; crates/rune/src/runtime/web/export.rs:61,116
✓ Confirmed
7 more verified issues
Low
O(n) virtual-list bookkeeping
set_keys rebuilds the key map and clones every key on any change (one appended row). Prefix sums rebuild whole on any height change (every commit of a streaming row). Keys are stored twice. PLAN's sum tree is not implemented
crates/rune/src/el/virtual_list.rs:215-240, 257-279; PLAN.md:28, 222-224
✓ Confirmed
Low
Linear path/key scans per pass
measure_virtuals scans all nodes by path string per list per pass; apply retains virtuals with an any() scan; anchor_index and inherit_hover_within scan by key. research/37 puts window_tree's linear finds at 7-17% of commit
crates/rune/src/runtime/commit/measure.rs:120-124; crates/rune/src/runtime/commit/apply.rs:835; crates/rune/src/runtime/anchor.rs:7-9; crates/rune/src/runtime/commit/flatten.rs:268-279
≈ Partly The scans exist. But research/37's 7-17% covers all of window_tree (app row builders, El moves, a SipHash set and linear finds), not the linear finds alone. measure_virtuals is counted in a separate 9.7-10.7% bucket, together with layout reads, release_kept_layouts and place.
Low
Compaction runs in hash order and wipes all caches
Slots are re-laid out in by_key iteration order, losing tree locality, and every cache is cleared, so the next commit re-solves the whole tree
crates/rune-taffy/src/store.rs:462, 479-490, 484
✓ Confirmed
Low
Measure-hash flag bits overlap
max_lines<<2 overlaps the revealed bit 3 and the wrap_anywhere bit 4, so some simultaneous changes hash identically
crates/rune/src/runtime/commit/flatten.rs:227-229
≈ Partly The bits overlap, but no stale layout can follow. revealed changes the display only for secure text, and secure text always remeasures (measure Some(0) plus force_measure_dirty). wrap_anywhere is also in the shape key. A collision would need an equal coincidence in the shape key, so the fix is cosmetic.
Low
Dependence on Taffy internals
CompactLength is transmuted to/from usize relying on a private 64-bit representation. view.rs implements low-level traits that change between minors. The taffy = "0.15" range allows 0.15.x; only Cargo.lock pins it
crates/rune-taffy/src/style/mod.rs:40-61, 85-104; crates/rune-taffy/Cargo.toml:12
✓ Confirmed
Low
Docs stale or diverged
README says virtual rows can't use stack gaps and that a lazy view API is still missing; code supports gaps and virtual_rows is that API. PLAN claims a sum-tree height index and that layout runs once
crates/rune/README.md:321-326; crates/rune/src/el/virtual_list.rs:250-255,438-461; PLAN.md:28,222-224
✓ Confirmed
Low
Layout state spread over flat Runtime fields
About 25 layout/virtual/growth fields sit directly on Runtime, against AGENTS.md's 'state in the owning subsystem's struct'. virtual_rows.rs carries an ~805-line inline test module
crates/rune/src/runtime.rs:420-425 and fields virtuals, stacks, grows, row_*, layout_*; crates/rune/src/el/virtual_rows.rs:147-952
≈ Partly There are about 22 such fields, and some are already grouped (reuse: relayout::Reuse, layout_seen: LayoutSeen). AGENTS.md's rule covers new state. The inline test module in virtual_rows.rs (lines 148-952, 25 tests) does break the sibling-test-file rule, though it is under the 1,000-line cap.
Strengths
  • Solver parity is tested, not assumed: differential tests against upstream TaffyTree compare BoxLayouts and measure-call logs across commits, memo reuse and retries (crates/rune-taffy/src/tests.rs:345-915)
  • Large memory win: ~250 B/node retained versus 2.1 KB/node for TaffyTree; changelog reports -80% layout heap on 500 rows
  • Clean subtrees cost one hash lookup plus word compares; memo subtrees cost one reuse_slot per node
  • CompactCache reproduces taffy::Cache semantics exactly in 96 B, inline for the common two-measure case
  • Text measurement reuses commit-scoped shape keys and re-breaks cached shapings at new widths
  • Three commit shapes (full, resize-only, virtual remount) share one solve, and the fast paths fall back cleanly
  • Virtual rows: anchoring, estimates by key, per-commit build budget, focused/selection-pinned rows built offscreen, 25+ behaviour tests
  • Layout reads are scroll-invariant by default, deduplicated, and feedback-bounded
Key concepts
  • LayoutStore / LayoutEngine: Rune-owned retained layout arena driving Taffy 0.15 solvers; LayoutEngine is a type alias switched by the baseline-taffy feature (lib.rs:27-31)
  • RetainedSlot: 216 B per node: CompactStyle + CompactCache + BoxLayout + measure hash + grid_info + child range with HAS_CTX/MUTATED flag bits (store.rs:135-147)
  • sync_node post-order sync: Per node after children: compare child slice, style and measure; clear cache if dirty; return dirty so parents clear too (store.rs:329-420)
  • node_idx context: slot to index in this pass's Vec<Node>; replaces Taffy NodeContext; the measure callback receives it when HAS_CTX is set (view.rs:74-84)
  • MUTATED guard: Slots changed since the last applied commit cannot be memo-reused in retry passes; cleared in compact_with_root (store.rs:268-274, 456-460)
  • CompactStyle hot/cold: 64 B inline flex/block fields with bf16-exact floats; anything else boxes a full taffy::Style (style/mod.rs:207-233, 415-436)
  • Measure hash: Shape key XOR flag bits (wrap, truncate, max_lines, revealed, wrap_anywhere, advance_in); decides whether a text leaf's cached size survives (flatten.rs:226-230)
  • Three commit shapes: Full measure, resize-only relayout (no view), remount_virtuals (no view, only entering rows), all ending in solve()
Opportunities
Add blocks/exact_lines to the measure hash and use disjoint flag bitsimpact mediumeffort low
Hash spec.blocks when any block is non-paragraph, plus exact_lines, into the measure hash; pack flags in non-overlapping bits or hash them. Add a runtime test that toggles a bullet
In-place modify_cold, and hot insets/marginsimpact mediumeffort low
Mutate the boxed Style in place and update the hot words; better, move inset and margin (4x u32 + tags each) into hot storage so absolute/pin elements stay inline
Skip refit solves when the fitted style is unchangedimpact mediumeffort low
Compare fitted(..) with the slot's retained style before set_style_and_mark_ancestors; same for fit_anchored. This removes the second solve on most commits with aspect_fit
Index-based lookups instead of path scansimpact mediumeffort low
Use path_ids -> node_index in measure_virtuals, apply's virtuals retain and anchor_index (or a per-pass key -> first index map)
Cap force_all and retry only the listimpact mediumeffort medium
Bound the fallback mount by index plus a budget and warn. On a short window, build only the missing rows under the list (as remount does) and re-solve, without re-running the view
Tree-order compaction and targeted cache clearingimpact loweffort low
Compact slots in node_idx order to restore locality. Remap OofCandidates or clear only slots with cold_final, instead of wiping every cache
Incremental virtual-list bookkeepingimpact loweffort medium
Fenwick tree or recompute prefix sums from the lowest changed index; diff keys for append/prepend; store keys once
Relayout boundaries at fixed-size boxes and scroll viewportsimpact mediumeffort mediumre-architecture
Stop dirty propagation in sync_node at boundaries so leaf edits inside scrollers don't clear caches to the root (research/32 trigger 2). Possible now because LayoutStore owns dirtiness
SoA slots / pre-order slot arenaimpact loweffort highre-architecture
Split style/cache/layout into separate arrays, or keep slots in pre-order so SlotId equals the node index and node_idx and the hash map leave the hot path
O(changed) place()impact loweffort medium
Translate reused spans instead of recomputing every target and rebuilding node_index each pass
Numbers, key files, roadmap and the verifier's additions
Numbers
rune-taffy lines (total / tests)
4,446 / 915 (10 tests)
Area-adjacent rune lines
virtual (runtime/virtual 1,427 + el/virtual_list 483 + el/virtual_rows 952), growth 649+49+67, anchor 263+85+52, layout_read 660
Commit pipeline files used
flatten 765, measure 589, relayout 351, text_layout 451, remount 556, memo_reuse 792
Struct sizes
RetainedSlot 216 B, CompactStyle 64 B, CompactCache 96 B, BoxLayout 32 B (vs taffy Style 552 B, Cache 408 B, Layout 92 B)
Retained layout heap per node
~250 B (estimate) vs 2.1-2.2 KB TaffyTree (research/31)
Changelog A/B
500 rows: 5.52 MB -> 1.10 MB layout heap (-80%); 1,000-row rebuild commit p50 -15%
Taffy share
1-4% busy time outside resize; 0.06-0.09 ms per committing frame (research/37); md-resize 0.71 ms pre-store (research/31)
Resize rewrap
50 KB note 16.1 -> 4.6 ms/frame; texts shaped/frame 401 -> 0 (research/28)
Commit after remount+store
md-same 0.851->0.167 ms; list:commit 0.540->0.375 ms; md-resize 1.822->1.742 ms (research/38)
Virtual constants
OVERSCAN 2.0 viewports, INDEXED_EDGE 1.75, INDEXED_BUDGET 0.5, VIRTUAL_FILL_FRAMES 12, force_all after 8 passes
Layout read limits
PASSES 2, ECHOES 4, MOVED 0.5 pt, SCAN_READS 8
Tests in area
rune-taffy 10; virtual_rows 25 + virtual_list 3; relayout 21; remount 4; anchors 19; aspect_fit 5; growth 11 + scroll_growth 19 + layout_rows 9 + row_reorder 10; layout_read 6; rewrap/rebreak 12
unsafe sites in rune-taffy
21 (store 4, view 6, style/mod 11)
Key files
crates/rune-taffy/src/store.rs LayoutStore: dense RetainedSlots, key map, child arenas, sync_node/reuse/rekey/finish_flatten/compaction, dirty marking, compute_layout entry
crates/rune-taffy/src/view.rs LayoutStoreView: Taffy trait impls (traversal, cache, flex/grid/block containers), leaf dispatch to measure callback, no-op hoisting
crates/rune-taffy/src/cache.rs CompactCache: 96 B exact replica of taffy::Cache 9-slot second-chance semantics
crates/rune-taffy/src/style/mod.rs CompactStyle 64 B: hot packed fields, cold Box<Style>, CompactLength transmute packing, rune_base
crates/rune-taffy/src/style/setters.rs Builder setters (hot fast paths, modify_cold), take_box_placement for scroll wrappers
crates/rune-taffy/src/baseline_store.rs BaselineLayoutStore over upstream TaffyTree for parity tests and the baseline-taffy feature
crates/rune-taffy/src/tests.rs 10 tests incl. differential parity vs upstream across commits, memo reuse and retry guard
crates/rune/src/runtime/commit/flatten.rs El to Node flatten, path/NodeId resolution, prepare_text measure hash, sync_node calls
crates/rune/src/runtime/commit/measure.rs measure passes/retry loop, window_tree virtual window selection, measure_virtuals, populate_virtual_children
crates/rune/src/runtime/commit/relayout.rs measure_commit dispatch, resize-only relayout, solve() multi-pass (aspect_fit, anchored_fit), lay_out_text
Roadmap items
  • Fix the measure hash (blocks, exact_lines, disjoint flags) and add a runtime test for a bullet toggle in text_input
  • Make modify_cold in-place and move inset/margin into hot CompactStyle fields
  • Skip aspect_fit/anchored_fit refit solves when the fitted style is unchanged
  • Replace path-string scans in measure_virtuals/apply/anchor_index with node_index lookups
  • Cap force_all; make virtual retries rebuild only the list subtree
  • Compact in tree order; avoid full cache wipes on compaction
  • Incremental prefix sums and key diffs for virtual lists if 100k+ row lists matter
  • Consider relayout boundaries in sync_node before any own-solver work (research/32 triggers)
  • Update the README virtual-rows paragraph and PLAN 4.7 to match the code; pin taffy =0.15.0 or add a repr guard
Found by the verifier
Medium
One element turns off both no-view fast paths for the whole window
resize_only and virtual_only both require relayout::reusable for every node. That check rejects any node with pixel_aspect, aspect_fit or an anchored_fit anchor, and virtual_only also rejects any secure or live_text node. pixel_aspect is set for any picture with exactly one auto side, which includes every Markdown image (w_full().max_w(w).pixels(..), height auto). So with one image in a note, a live resize re-runs the view and flatten on every frame, and the '0 view runs over 600 resize frames' result no longer holds. With one image row mounted in a virtual_rows transcript, each window move falls back to a full view run. A ratio change is already detected separately (pixel_aspect_changed), so excluding every pixel_aspect node is broader than it needs to be.
crates/rune/src/runtime/commit/relayout.rs:40-44, 93-101; crates/rune/src/runtime/commit/remount.rs:56-62; crates/rune/src/runtime/commit/flatten.rs:436-444; crates/rune-kit/src/markdown/image.rs:64; crates/rune/src/runtime/frame.rs:539, 753-764
Low
.virtualize keeps every off-window row El alive between commits
populate_virtual_children's non-source branch moves every unmounted child into v.selection.unmounted: HashMap<usize, El> on every pass, retries included, instead of dropping it. The only use is to collect offscreen selection text. The cost is n hash inserts per pass, and the whole off-window row forest stays resident between commits. It applies to every .virtualize list, including rune-kit's popup_list, whether or not anything is selected.
crates/rune/src/runtime/commit/measure.rs:478, 540-553; crates/rune/src/runtime/virtual/selection.rs:71; crates/rune/src/runtime/virtual/selection_collect.rs:57; crates/rune-kit/src/popup_list.rs:235
Low
Taffy content_size and block_layout features cost work for nothing
rune-taffy turns on content_size, so Taffy's flex, grid and block code compute content-size contributions on every layout pass (about 20 cfg(feature = "content_size") sites in flexbox.rs alone). BoxLayout::from_taffy keeps only location, size and padding plus border, so the result is thrown away. block_layout is compiled and dispatched in view.rs, but no Rune builder sets Display::Block. research/32 PR 3b planned to drop both features.
crates/rune-taffy/Cargo.toml:12; crates/rune-taffy/src/store.rs:106-118; crates/rune-taffy/src/view.rs:70; taffy-0.15.0/src/compute/flexbox.rs (20 content_size cfg sites); research/32-engine-plan.md:335-337
06

Motion: springs, transitions, motion gate, flights, scroll physics, motion audit

solid

A solid, closed-form CPU spring/presence engine (rune-motion) driven once per frame on the main thread by Runtime, surrounded by separate hand-written steppers for scroll, growth and flights, with an offline frame-by-frame motion gate plus a second Python audit as the main guard.

Summary (617 words)

rune-motion (7,077 src lines, 93 tests) is pure data and math. Spring::new(duration, bounce) maps exactly like SwiftUI (ω=2π/d, ζ=1−b). Every animated f32 lane is target + Σ analytic Layer offsets (under-, critically or over-damped spring, decay, eased tween with carried velocity, Hermite cubic). Each Layer is sampled in closed form at the frame's time with deterministic polynomial exp/sin_cos, and carries a precomputed settle bound below the 1/64 px snap quantum. AnimationStore is struct-of-arrays with generational TrackIds, a dense active list and free-list pools. A retarget samples (x, v) exactly: springs merge (one segment), tweens add (up to 8 layers). It also has delays, completion tokens, reduced motion per PropClass, per-node time scales with rebase, and gesture release, including DecayClamped with an exact bound-hit time. Its tick allocates nothing (counting-allocator test). Scene builds a presented tree on top. Layout animates the four edges in parent space, so a stationary edge gets no track, width can lead (0.78×), and both edges snap to 1/64 device px. Presence is one 0→1 progress that blends a 9-lane effect vector, re-solved when a node reverses mid-flight so revives don't jump. Exits stay drawn until they are invisible (popLayout by default). Matched geometry and launches use straight root-space paths driven by a 2-lane TRAVEL progress.

The CPU evaluates everything, on the thread that calls Runtime::frame_split: the platform main thread in a window. There is no render thread, though PLAN.md and research 06 assume one; the crate README admits the divergence. A GPU-springs vertex shader spike exists but Runtime never uses it. FrameClock splits each frame's gap into catch_up, which moves only motion already running before handlers and the commit, and dt (at most 1/120 s), which moves everything. Gaps cap at 250 ms. So retargets sample the true pose, and new motion never jumps by a gap. Commits turn into motion in apply.rs through a long cascade of rules: tx.instant/settle/motion, El::motion, out-of-sight → INSTANT, growth/virtual rows with Y instant, window resize, flights re-aimed from where they are drawn, and keep_flights.

Scroll does not use rune-motion. ScrollState keeps f64 offsets and has its own steppers: exact exponential momentum (k=2.002/s), glides that step Spring::sample on the displacement, critically damped touch rebound (ω=14), and a rubber band with d fixed at 300. Desktop wheels apply 1:1 and clamp at the edges. Touch fling velocity comes from only two samples, although the crate's LSQ VelocityTracker is unused. Growth is a third system, a 240 Hz substep integrator with per-second caps (research 18). Flights must make up for scroll offsets that live outside the scene: Launches blends offsets and estimates drift by finite differences.

The motion gate records ElementInfo, painted properties and a pixel grid of the real Runtime on a virtual clock. It reports 27 rule kinds, with allowlist rows scoped and capped by max. The motion audit records 36 example scenarios and runs a separate 1,038-line Python checker whose rules overlap the gate's only in part. CI runs neither.

Bugs found: (1) a screen-travel path's X progress is restarted on anim.y, because start_path passes lane velocities for both lanes. So width_leads/axes do nothing on match_geometry, launch and retarget_drawn, and the README's caveat cannot happen. (2) The presence reversal loops cover 0..8 of the 9 Fx lanes, so the draw lane jumps on an asymmetric remove mid-entrance. Also: stale docs (test count 53 vs 93, "vertical scrolling only", a wrong default-fade duration), O(N) scans every frame (Scene::present_dirty, step_scroll), unused crate APIs, and std libm in the runtime's motion math. The biggest opportunity is to make scroll offsets scene tracks: flights would become exact, most of Launches could go, and the store's guarantees would cover scroll. Moving growth into the store and the render-thread split are further steps.

Why this maturity: rune-motion core is well-specified and heavily tested (93 tests: RK4 parity, C1 retarget property tests, zero-alloc, generational reuse, jittered sampling bound) and the motion gate is a sophisticated real-runtime checker (54 tests). Integration is working-but-heuristic: long special-case cascades in apply.rs, scroll and flights; two real bugs found (travel X lane, draw lane); high churn (71 commits in ~2 weeks); no CI; PLAN's render-thread architecture not built.

Issues, most severe first
Medium
Screen-travel X progress ignores anim.x
start_path animates TRAVEL lane 0 on anim.x then calls animate_raw again on anim.y with lane_vel Some for both lanes; animate_raw never skips a lane with explicit velocity, so lane 0 restarts on anim.y. width_leads/axes/lead have no effect on match_geometry, launch and retarget_drawn paths; README's caveat about non-straight width-leading screen paths cannot occur. Present since the initial commit; tests only check endpoints.
crates/rune-motion/src/scene/travel.rs:123-124; crates/rune-motion/src/store.rs:700-709; crates/rune/src/runtime/commit/apply.rs:479; crates/rune-motion/tests/scene.rs:288-309
✓ Confirmed
Medium
Touch fling velocity is a two-sample difference
Release velocity is the last delta over its dt, not LSQ/impulse as research recommends; rune-motion's VelocityTracker (LSQ) is unused. Noisy flings on iOS/web touch. Rubber band uses fixed d=300 not viewport dimension.
crates/rune/src/runtime/input/touch.rs:87; crates/rune/src/runtime/scroll/touch.rs:78; research/06-reactivity-animation.md §2.10; research/15-research-motion-perception.md §4
✓ Confirmed
Medium
Multiple motion systems outside the analytic store
Growth (240 Hz substep integrator), content slides, scroll momentum/glide/rebound, slack, text flights, launch offset blending, loops and reveals each have their own steppers, thresholds and determinism; PLAN's 'animated properties can only change through tracks' holds only for scene props. The retarget audit and Scene::rest don't see them.
crates/rune/src/growth.rs:137,288; crates/rune/src/runtime/motion/tracks.rs:155-211; crates/rune/src/runtime/motion/content_slide.rs:47-68; PLAN.md §6b
✓ Confirmed
Medium
Scroll outside the scene forces fragile flight compensation
Matched/launch flights compute scroll offset deltas from paint scratch and blend launch-time offsets toward current ones by travel, estimating drift by finite differences between commit-free frames.
crates/rune/src/runtime/motion/flights.rs:12-108, :168-178
✓ Confirmed
Medium
No render thread despite PLAN architecture
Animation, scroll and build run on the main thread inside Runtime::frame; a long commit delays animation frames (catch-up keeps timing, drops frames). PLAN §3/§4.9/§8 still describe a render thread and zero app-side work while animating.
crates/rune/README.md:2817; PLAN.md:30,106,512; crates/rune/src/runtime/frame.rs:658-682
≈ Partly Main-thread evaluation is confirmed and disclosed. But PLAN §8's 'App-side work while one value animates: zero (no view, layout or diff)' is still met, because views, layout and diff don't run for animation. What shares the thread is scene evaluation and build(). PLAN §3 and §4.9 do describe a render thread.
10 more verified issues
Medium
Motion gate and audit not enforced in CI
Workflows only deploy site/www (cargo test -p rune-www); rune/rune-kit gate tests and scripts/motion-audit run only locally; analyze.py has --fail but no committed allowlist.
.github/workflows/www.yml:84; .github/workflows/site.yml; scripts/motion-audit/run.sh
✓ Confirmed
Low
Presence reversal re-solve covers 8 of 9 effect lanes
Fx grew to 9 lanes (draw) in commit 111affb0 but remove() and revive() still loop 0..8, so the draw fraction jumps by (target-fx_a)*(1-p) when a node with an asymmetric draw transition is removed mid-entrance. Reduced-motion Fx literal duplicated in two places.
crates/rune-motion/src/scene/presence.rs:157, :229; crates/rune-motion/src/scene.rs:229-237, :863, :892
✓ Confirmed
Low
Two diverging motion checkers
Rust RULES (27 kinds) and Python analyze.py (~20 kinds) overlap partly; stall/dog-leg/invisible-work/latency/hitch are Python-only, snap/flash/changes-twice/text-swap/remount/unpinned Rust-only.
crates/rune/src/motion_gate/check.rs:38-66; scripts/motion-audit/analyze.py:344-720
≈ Partly analyze.py also emits a 'snap' kind, so snap is not Rust-only. Python's snap means something else: a 'smooth' expectation whose move happens in one frame. A shared name with a different meaning is itself drift. Python has about 22 kinds, including the expectation kinds expect-missing, not-instant, lags-hand and wrong-exit, plus step and sibling-jump. Rust RULES has exactly 27.
Low
Docs drift
rune-motion README says 53 tests (93 exist); rune README says scrolling is vertical only (scroll/x.rs exists); El::transition doc says default fade is 0.2/0.15 s but it is SETTLE pair 0.3/0.24 s springs; research opacity eps 1/512 vs code 1/1024.
crates/rune-motion/README.md (Examples and tests); crates/rune/README.md:2820; crates/rune/src/el/motion.rs:171; crates/rune-motion/src/props.rs:49-59
✓ Confirmed
Low
O(N) full scans every animating frame
Scene::present_dirty walks all scene nodes twice per frame/present; step_scroll scans all runtime nodes and is called up to ~8 times per frame with dt=0 from request paths; record_rewind scans all nodes.
crates/rune-motion/src/scene.rs:793-816; crates/rune/src/runtime/motion/tracks.rs:157-158; crates/rune/src/runtime/scroll/bottom.rs:76-129; crates/rune/src/runtime/scroll/offset.rs:25,87
≈ Partly Per-frame costs confirmed: present_dirty walks order twice, and step_scroll scans all nodes once (twice on catch-up frames). The dt=0 step_scroll calls run only on frames that carry scroll requests or caret follow, not on every animating frame. The largest O(N) cost per animating frame is the full build() rebuild, which the notes did not name.
Low
Unused rune-motion API surface and duplicated constants
Choreography, PhaseAnimator, Keyframes, retune, Release/DecayClamped, VelocityTracker, rubber_band, prop::SCROLL have no runtime or kit users; iOS decay defined twice.
crates/rune-motion/src/curve.rs:67; crates/rune/src/runtime/motion/tracks.rs:5; rg over crates/rune/src and crates/rune-kit/src
✓ Confirmed
Low
Determinism leak in runtime motion math
Crate uses custom exp/sin_cos for stable goldens but runtime scroll momentum, rebound and growth use platform libm exp.
crates/rune/src/runtime/motion/tracks.rs:191; crates/rune/src/runtime/scroll/touch.rs:16-22
✓ Confirmed
Low
Hard-coded springs/eps inside scene logic
Leaving a screen path seeds velocity on Spring::SMOOTH (persists on lanes whose target doesn't change); re-insert of a present key retargets on REFLOW; additive collapse uses fixed Eps.
crates/rune-motion/src/scene.rs:550; crates/rune-motion/src/scene/presence.rs:33-35; crates/rune-motion/src/store.rs:804
✓ Confirmed
Low
God functions and files over soft cap
check() ~455 lines; apply.rs per-node layout cascade; scene.rs 1,053 and store.rs 1,079 non-test lines (>800 soft cap).
crates/rune/src/motion_gate/check.rs:323-778; crates/rune/src/runtime/commit/apply.rs:409-440
✓ Confirmed
Low
GPU springs spike can bit-rot
Separate 48-byte ABI and Metal builtin table entry, not integrated with Runtime or kept in sync with Layer kinds.
crates/rune/src/gpu/springs.rs:14-25; crates/rune/src/render.rs:739; crates/rune/src/gpu/metal/builtin_table.rs:69
✓ Confirmed
Strengths
  • Closed-form springs validated against RK4 in all damping regimes including near-critical (crates/rune-motion/tests/spring.rs:23-45)
  • Retargets keep position and velocity, and randomized C1 continuity is tested (tests/store.rs:23); a retarget audit measures velocity error at real retarget boundaries
  • Zero-allocation steady-state tick proven with a counting allocator (tests/alloc.rs)
  • Edge-based layout animation plus two-edge snap: stationary edges provably still (snap.rs test, tests/scene.rs:222)
  • Deterministic polynomial exp/sin_cos in the crate; README microbench 16.8 ns per critical scalar track and 132 ns per scene node
  • Careful frame-time model: catch_up/dt split, MAX_GAP, waiting_until sleeps through delayed starts (zero frames at rest)
  • Per-node time scaling with exact rebase (El::time_scale freeze/slow-mo)
  • Motion gate drives the real Runtime and checks geometry, painted properties and pixels; allowlist rows need a reason, have scopes and caps, and unused rows are reported
  • Glides and touch rebound use exact per-step closed forms (frame-rate independent tests exist)
  • Rewind recorder is cheap (<0.01 ms/frame median, 0.8 MB/min measured)
Key concepts
  • Layer: One closed-form segment per f32 lane: offset(t-t0) decaying to 0, with precomputed velocity coefficients and an end settle bound
  • Merge vs Additive: Springs/decay restart one segment from sampled (x,v); tweens stack delta layers (max 8, then collapse)
  • PropClass: Per-property settle eps (below 1/64 px) and Reduce Motion mapping (spatial instant, opacity 0.18 s fade, gesture untouched)
  • Edge layout animation: FRAME is a 4-lane rect of edges in parent space; unchanged edges get no motion; width_leads shortens X to 0.78x
  • Presence progress + Fx: PRESENCE 0..1 blends 9 effect lanes between fx_a and fx_b; re-solved on reversal; generation guards stale exits
  • Screen travel: TRAVEL 2-lane progress interpolates root-space start edges to layout under parent's target origin (matched geometry, launch)
  • catch_up/dt split: FrameClock charges a frame's gap to running motion before the commit, and at most 1/120 s to new motion; 250 ms cap
  • keep_flights: Under Tx::instant, landing a value already in flight to the same target leaves that motion running
Opportunities
Fix TRAVEL lane 0 curveimpact mediumeffort low
Animate each TRAVEL lane separately (or add a per-lane velocity mask to animate_raw) and add a test that a width_leads().screen() path's X progress leads Y; or drop LayoutAnim.x for screen travel and document it.
Fx lane-count safetyimpact loweffort low
Replace 0..8 loops with a FX_LANES const and derive the reduced-motion Fx from one const.
Real velocity estimation for touchimpact mediumeffort low
Use rune_motion::VelocityTracker (LSQ 100 ms/20 samples, 40 ms stop) or an impulse estimator with LSQ as reference; use viewport dimension in the rubber band; project() for paging.
Dirty-list presentation and scroll-viewport indeximpact mediumeffort medium
Keep a dirty node list in Scene instead of scanning order twice; keep a Vec of scroll viewport indices so step_scroll doesn't scan all nodes repeatedly per frame.
CI gate for motionimpact higheffort medium
Run cargo test -p rune-motion -p rune -p rune-kit (gate tests) and motion-audit run.sh + analyze.py --fail with a committed allowlist on a runner.
Single motion checkerimpact mediumeffort medium
Port stall, dog-leg, invisible-work, latency, hitch into motion_gate and reduce analyze.py to a trace adapter, or rely on .gate.txt only; split check() into per-rule passes.
Scroll offsets as scene tracksimpact higheffort highre-architecture
Make viewport offsets prop::SCROLL tracks in a scroll-container scene node that composes into children's world origin; momentum = Layer::Decay, glides = springs, edge hand-off = DecayClamped. Flights/launches become exact root-space paths (delete most of Launches), retarget audit/trace/Scene::rest cover scroll, determinism by construction.
Growth in the storeimpact mediumeffort highre-architecture
Model capped growth as piecewise analytic segments (constant-velocity while capped, spring otherwise, switching at solvable times), or at least register growth rows as store-visible tracks for traces and audits.
Render/compositor thread or GPU springsimpact higheffort highre-architecture
Scene is pure data: run scene.frame + scroll + build against a committed snapshot on a second thread fed by research 06's Commit{apply_at, ops}; cheaper intermediate: wire GPU springs for instance translation/opacity so frames present while the main thread is busy.
Deterministic math in runtime steppersimpact loweffort low
Use rune_motion::math::exp in scroll momentum/rebound/growth and one shared decay constant.
Numbers, key files, roadmap and the verifier's additions
Numbers
rune-motion src lines
7,077 (tests 1,638)
rune-motion #[test]
93 (1 ignored bench); README claims 53
runtime/motion lines
1,962
runtime/scroll lines
3,001 (47 tests in-dir)
runtime/tests scroll_* tests
50 (growth 19, hover 11, children 10, retarget 5, spring 4, carried 1)
runtime/tests springs.rs tests
19
motion_gate lines / tests
3,592 / 54
motion gate rule kinds
27
rewind lines / tests
1,293 / 12
growth.rs lines
649
motion-audit scenarios
36 run lines, 24 scenario JSONs; analyze.py 1,038 lines; test_retargets.py 9 tests
Critical scalar spring tick
16.8 ns/track at 10k (README, M4, upper bound)
Rect frame track tick
75.5 ns/track at 10k
Scene node reflow to Presented
132 ns/node (1k), 144 ns (10k)
Key files
crates/rune-motion/src/layer.rs Analytic segment kinds, closed-form sample (x,v), settle bounds
crates/rune-motion/src/spring.rs Spring(duration,bounce) SwiftUI mapping, converters, NONE
crates/rune-motion/src/store.rs AnimationStore SoA tracks, tick, animate_raw/start_lane retarget, additive stack, delays, sub-clocks
crates/rune-motion/src/store/typed.rs Typed set/animate/release incl. DecayClamped bound hand-off
crates/rune-motion/src/props.rs PropClass eps and reduced-motion policy; built-in prop ids
crates/rune-motion/src/scene.rs Scene presented tree, set_frame edge layout anim, frame(), compute() Presented
crates/rune-motion/src/scene/presence.rs insert/remove/revive presence with effect re-solve (0..8 lane bug)
crates/rune-motion/src/scene/travel.rs Screen paths, match_geometry, launch, start_path (anim.x bug)
crates/rune-motion/src/transition.rs Effect/Transition, kit_rules clamps
crates/rune/src/frame/clock.rs FrameClock catch_up/dt split, RESUME_STEP, MAX_GAP
Roadmap items
  • Fix the TRAVEL lane-0 curve bug and the 0..8 Fx loops, with regression tests
  • Replace two-sample touch velocity with VelocityTracker/impulse; viewport-sized rubber band
  • Add a CI job running rune-motion, rune and rune-kit gate tests plus motion-audit with a committed allowlist
  • Refresh docs: rune-motion README test count and Not-yet list, rune README vertical-scroll claim, El::transition default fade, PLAN render-thread status
  • Unify checkers: port Python-only rules into motion_gate; split check() into per-rule passes
  • Dirty-list Scene presentation and a scroll-viewport index to remove O(N) scans
  • Move scroll offsets into the scene as tracks and delete Launches offset compensation
  • Decide render-thread vs main-thread long term; if render thread, start with the commit-op protocol and GPU springs for instance transforms
  • Consider bringing growth into the store as piecewise segments or store-visible tracks
Found by the verifier
Medium
A full paint rebuild on every animating frame, up to 4 per frame with keeps
build() clears and walks every runtime node each animating frame (instances, glyphs, hits, and scratch arrays resized to n_nodes), however few presented values changed. El::cache rasters skip GPU work but still walk their nodes. When keeps are active, follow_keeps can run build() three more times in the same frame. This outweighs the present_dirty scan the notes flag, and it matters for PLAN §8's 1,000-quad CPU budget and for the render-thread idea.
crates/rune/src/runtime/paint/build.rs:5-50,104-115; crates/rune/src/runtime/frame.rs:720-726; crates/rune/src/runtime/scroll/sticky.rs:576-597
Low
Touch fling edge hand-off depends on the frame rate and has no velocity cap
step_touch_scroll decays momentum through a whole frame past the edge. Only on the next frame does it switch to the omega=14 critically damped rebound, starting from that overshoot and velocity. The hand-off is not split at the crossing time, which Release::DecayClamped already computes exactly, so the overshoot changes with frame rate and phase. There is no 5000 pt/s transfer cap (research 06 §2.11), so an 8000 pt/s fling overshoots about v/(omega*e), roughly 210 pt. The frame-rate test covers only a return that starts out of range.
crates/rune/src/runtime/scroll/touch.rs:91,106-118,176-183; crates/rune-motion/src/store/typed.rs:94; research/06-reactivity-animation.md:706
Low
Touch velocity uses receipt-time timestamps
The winit host stamps each touch with Instant::now() when it handles the event, not with the event's own timestamp. Combined with the two-sample estimator, events delivered together in one run-loop turn get dt close to 0, and the velocity spikes up to the ±8000 clamp. The stop rule is FLING_HOLD = 100 ms, where research uses 40 ms. Research 06 §2.10 and research 15 §4 ask for hardware timestamps.
crates/rune/src/window.rs:718-729; crates/rune/src/runtime/input/touch.rs:11,86-87,99
Low
Two spring palettes share names with different values
Spring::SMOOTH and Spring::DEFAULT (both 0.5 s, SwiftUI) differ from tokens::SMOOTH (GLIDE, 0.32 s) and tokens::DEFAULT (SETTLE, 0.3 s), which is the runtime's default motion. Code inside rune-motion itself (the scene.rs:550 path exit, keyframes.rs:122-124) uses the 0.5 s Spring::SMOOTH. A caller who picks Spring::DEFAULT expecting Rune's default gets a spring two thirds longer.
crates/rune-motion/src/spring.rs:146-153; crates/rune-motion/src/tokens.rs:18,24,41-43,79-81; crates/rune/src/runtime/commit/measure.rs:451

Rendering and text

Renderer and GPU · Text and editing

07

Renderer and GPU: paint, uber-quad SDF pass, layers, blur, wgpu vs own Metal backend, uploads, shaders

solid

A single 128-byte instanced uber-quad SDF pass with inline per-instance clips, lazily materialized Rgba16Float layers, a pyramid backdrop blur, span-diffed staging uploads, and a ~3.4 kLOC native Metal backend plugged under wgpu::custom (default on macOS) with precompiled shaders on Metal and DX12. It is well tested, but surface colorspace, OS gating, memory budgets and DXBC gating have rough edges.

Summary (626 words)

The paint walk (runtime/paint/build.rs, 1,216 lines) turns presented poses into a flat, painter-ordered Vec<Instance>. Each Instance is eight vec4s (128 B, render.rs:184-204) with the kind as an f32 in params[1]. There are 14 kinds: rect/border, analytic shadow, glyph, inset shadow, gradients, segments, triangles, images, layer begin/end, dashed rings, radial stops, effect slots and backdrop blurs. Clips travel inline: a rect, four f16 soft-edge widths, unorm8 origins and a packed per-corner rounded radius (pack_fade, pack_clip_radii), evaluated in clip.wgsl. There is no clip table. Compound clips, group opacity, blur, plus-lighter, turns and caches open scopes, and render::end_layer folds trivial ones back into the direct path.

Renderer::prepare (render/upload.rs) does the per-frame work. It stages changed atlas rows and changed 64-instance spans through rune-staging chunks, rebatches only when params or the list length change, plans layers (render/layers.rs: Rgba16Float targets in 64-px buckets, El::cache under a 64 MiB LRU, a separable Gaussian with a reduced-resolution path), and prepares backdrop copies and a 7-level Jimenez dual-filter pyramid for up to 4 backdrop blurs. Drawing encodes the layer passes first (deepest first), then the frame pass. The frame pass composites layers, interleaves native surfaces, calls compositor effect hooks, and splits the pass (end, copy, reopen with Load) at backdrop slots and blurs. A steady frame is one draw per bind-group run; the README's "one draw call per frame" holds only in the simplest case.

Devices: GPU_INIT serializes creation. Windows is DX12 through DirectComposition with FXC; Linux is Vulkan only; adapter choice uses the Wayland compositor's DRM device or Windows' primary-display GPU; MemoryUsage hints; translucency-aware adapter fallback. On macOS the default is Rune's own Metal backend (gpu/metal, about 3,380 non-test lines, just under research/34's 3,500-line abandon trigger). Each frame is one MTLCommandBuffer with unretained references and MTLSharedEvent retirement, held from submit to present. Buffers are shared and written in place by memcpy, with a 2-spare swap ring when the GPU still reads them; textures are private and zero-filled. Naga MSL is generated per pipeline layout. A 61-row precompiled table (builtin_native*.metallib) covers every Rune, rune-fx and rune-light pipeline on macOS and iOS. Unsupported features panic, and the backend does no validation. Shader blobs: uber.metallib (wgpu passthrough), uber_native.metallib, builtin libraries (about 540 KB each), and FXC DXBC for DX12. Each is hash-gated with a runtime fallback and has a freshness test; scripts/precompile-metal-shaders.sh regenerates the Metal ones. Warmup: prewarm_gpu on macOS, warm_gpu/park on Windows and Linux, a DX12 probe thread.

Measured: the native HUD runs at 894 vs 1,395 kinstr/frame for wgpu (897 vs 1,668 with one buffer write), one command buffer per frame. Cold first use with the precompiled library: layer blur 727 to 45 ms, backdrop blur 394 to 29 ms. Cold Renderer::new is 222 to 90 ms on the native backend; DX12 uber pipeline creation is 250 to 2 ms. Shadow bands cut a 5K frame pass from 13 to 4.5 ms. research/35: a native Vulkan/DX12 backend would save under 0.1 ms per frame.

Key risks found: - The CAMetalLayer sRGB tag is reset to nil by every surface configure (resize) on both Apple backends. The comment at platform/macos.rs:184 claims wgpu keeps it, but wgpu-hal 30.0.1 and gpu/metal/surface.rs:111 both reset it. - The native default has no macOS 13 floor, although its MSL 3.0 and metallib targets need one. - The DXBC hash differs from the macOS hash of the same WGSL, likely from a CRLF checkout, with no .gitattributes; an LF checkout on Windows skips the bytecode silently. - No device-loss handling exists anywhere in the crate. - Transient layers, backdrop copies, the pyramid and the instance buffer have no budget and never shrink. - The first isolated layer compiles pipelines on the UI thread. - render.rs counts 1,400 lines against the 1,500 hard cap. - PLAN §4.2/§4.3 and README sections are stale.

Why this maturity: It is the production path on all platforms, and the native Metal backend has been the macOS default since 2026-10-31. Pixel-equivalence tests compare native vs wgpu and precompiled vs WGSL, every shader blob has a freshness test, and upload, store and layer invariants are tested (180 unit tests plus GPU integration tests and benches). Decisions are measured and documented. It falls short of production because there is no device-loss handling, no validation on the default macOS backend, unbudgeted transient memory, a colorspace regression after resize, a missing OS gate for Metal 3, fragile DXBC gating, and GPU springs still a spike.

Issues, most severe first
Medium
sRGB colorspace tag lost on every surface reconfigure
pin_contents_top_left tags the CAMetalLayer sRGB once, after the first configure. Every later configure (resize, blend switch, Outdated recovery, overlay reconfigure) resets the colorspace to nil on both Apple backends and nothing re-tags it. By Rune's own CHANGELOG reasoning, wide-gamut displays then show untagged, oversaturated output after the first resize. The comment claiming wgpu keeps the tag is wrong for wgpu-hal 30.0.1.
crates/rune/src/platform/macos.rs:180-195 (comment at :184); crates/rune/src/gpu/metal/surface.rs:111 setColorspace(None); wgpu-hal 30.0.1 src/metal/surface.rs:286-327 maps Srgb to None; window/win.rs:53, window.rs:628, window/pacing.rs:146-153, overlay/surface.rs:163 reconfigure without re-tagging; the test at platform/macos.rs:840-857 checks only before any configure
✓ Confirmed
Medium
Native Metal default has no macOS 13 floor
The backend picks MSL 3.0 for any macOS below 14, and the uber_native and builtin metallibs target macOS 13. A failed runtime compile panics in pipeline creation, and the backend is the default with no OS check. A default-feature app on macOS 11-12, which other Rune code still supports, would likely panic at Renderer::new instead of falling back to wgpu.
crates/rune/src/gpu/metal/device.rs:83; crates/rune/src/render/metallib.rs:43-46; crates/rune/src/gpu/metal/pipeline.rs:177; crates/rune/src/gpu/backend.rs:30; crates/rune/src/platform/display_link.rs:64
✓ Confirmed
Medium
DX12 bytecode gate depends on line endings
The DXBC hash and the macOS hash of the same uber_wgsl() string differ, although the DXBC commit postdates the last WGSL change. No .gitattributes pins *.wgsl to LF, so an LF checkout on Windows likely misses the gate silently and pays the FXC compile (about 250 ms) per device. dxbc::uber returns None before its only log line.
crates/rune/src/render/uber_dxbc_hash.rs:2 (9646eb...) vs crates/rune/src/render/uber_metallib_hash.rs:3 (e32ae5...); commit c448a35a after 801e61aa; no .gitattributes in the repo; render/dxbc.rs:46-49
✓ Confirmed
Medium
No GPU device-loss handling
No device-lost callback or uncaptured-error handler is installed anywhere, and the native backend's callback is a no-op. A TDR, driver update or eGPU removal under wgpu reaches wgpu's default panic.
rg device_lost|on_uncaptured_error finds nothing outside gpu/metal; crates/rune/src/gpu/metal/device.rs:143
✓ Confirmed
Medium
Native backend validates nothing
Error scopes always return None, so window::configure's error capture and compositor mistakes that wgpu reports become Metal-level failures or unsupported! panics on the default macOS backend.
crates/rune/src/gpu/metal/device.rs:146-147; crates/rune/src/window.rs:595-608; crates/rune/src/gpu/metal/mod.rs:157-163
✓ Confirmed
9 more verified issues
Medium
Unbounded or never-shrinking GPU memory pools
Transient isolated layers have no byte budget (8 B/px, about 3x with reduced blur; 354 MB for one blurred full-window layer at 5K). Backdrop copies are never freed and are reallocated unbucketed at every viewport change. The blur pyramid only grows, and the instance buffer only grows (plus up to two Metal spares). Image pages go up to 256 MiB per image with no total cap. LayerStats omits backdrops and the pyramid.
crates/rune/src/render/layers.rs:372-434; render/layer_blur.rs:72-77,147; render/pass.rs:200-224; render/backdrop_blur.rs:253-289; render/upload.rs:216-220; gpu/metal/store.rs:17; pixels.rs:251
≈ Partly The blur pyramid does shrink when the window shrinks: size = have.min(cap).max(need). It is never freed after blurs stop. A full 5K pyramid is about 86 MB (2 chains x 7 mips of 2624x1536 Rgba16Float), not about 79 MB. Everything else holds: no transient layer budget, 3x with a reduced blur (354 MB at 5K), backdrops never freed and reallocated per viewport size with no bucketing, an instance buffer that only grows plus 2 spares, 256 MiB image pages with no total cap, and LayerStats omitting backdrops and the pyramid.
Low
First isolated layer compiles pipelines on the UI thread
Prewarm builds only the frame-format uber pipeline. The first layer builds the Rgba16Float content pipeline and composite pipelines lazily. Research/34 measured about 89 ms of cold GPU codegen per uber pipeline state, so the first fade after an install or OS update can stutter. Two of those pipelines duplicate existing descriptors when there are no springs.
crates/rune/src/render/layers.rs:481-502; crates/rune/src/render/prewarm.rs:36-40; render/first_use.rs:20-27 does not time layer pipelines
✓ Confirmed
Low
Layer targets pooled by plan index and freed immediately
Targets are matched by position and dropped when the plan shrinks, so fades that start and stop allocate and free textures. Every native-backend allocation is also a full blit zero-fill.
crates/rune/src/render/layers.rs:324,408-434; crates/rune/src/gpu/metal/device.rs:117-123; gpu/metal/encode.rs:162-187
✓ Confirmed
Low
Metal store write log too short
If a buffer received more than 8 writes in the previous frame, the swap copies the whole buffer on the CPU. That is fine at 2,000 instances but grows with large instance buffers and scattered span writes.
crates/rune/src/gpu/metal/store.rs:19,61-67,108-136
✓ Confirmed
Low
render.rs near the hard file-size cap
scripts/file-size.sh counts 1,400 lines, the largest file in the crate, against a 1,500 cap. Gpu creation and the macOS prewarm tests live there, and the script counts cfg(all(test, ...)) modules as production code.
scripts/file-size.sh --warn-only output; crates/rune/src/render.rs:368-610,1283-1415
✓ Confirmed
Low
Stale docs and plan
README claims one draw call per frame and says effect, blur and iOS shaders aren't precompiled. PLAN §4.2/§4.3 describe wgpu-first, a clip table, six primitives, Slug, sparse strips, dithering, linear blending and dirty rects, none of which match the code. The shader header lists kinds only to 11.
crates/rune/README.md:56-57,672-673; PLAN.md:148-175; crates/rune/src/render/metallib.rs:15-16; crates/rune/src/shader.wgsl:1-8
≈ Partly render/metallib.rs:15-16 is not stale. It sits under the heading 'On wgpu's backend, other shaders stay on WGSL (Rune's own backend precompiles them too...)' (metallib.rs:8), which is correct for wgpu. The README lines, PLAN §4.2/§4.3 (including PLAN.md:23 'via wgpu-hal escape hatches') and the shader header (kinds only to 11) are stale.
Low
COPY_SRC always on window surfaces
Requested so backdrop copies work, which disables framebufferOnly on Metal for every window, including windows that never blur.
crates/rune/src/window.rs:581-585; crates/rune/src/gpu/metal/surface.rs:105
✓ Confirmed
Low
Silent degradation paths
More than 4 backdrop blurs, a target without COPY_SRC, a caller-owned pass, or a format added after prepare all draw fill-only without notice.
crates/rune/src/render/backdrop_blur.rs:10,361,415; render/pass.rs:96-98
✓ Confirmed
Low
Layer draw recursion is O(L^2)
draw_layer_range rescans the whole plan on every recursive call, and draw_plain scans every native surface; this scales poorly with many flattened scopes.
crates/rune/src/render/layers.rs:609-665
✓ Confirmed
Strengths
  • A clean, compact instance ABI with exact clip semantics: continuous corners, mixed radii, linear and smoothstep feathers, origin offsets.
  • Careful correctness work in the shader: seam-free triangle ownership, band edges computed identically by neighbouring bands, texel-clamped image filtering, pixel-centre sampling where interpolation would disagree.
  • Uploads are close to minimal: block-diffed spans, globals only on change, no allocations in a steady frame, lost-encoder recovery.
  • The native Metal backend keeps 100% wgpu API compatibility while reaching one command buffer per frame with in-place shared-memory writes. It is pixel-equivalent to wgpu in tests and keeps wgpu's write-ordering semantics (swap vs stage).
  • Precompiled shaders cover the uber shader on every native path, every builtin pipeline on Apple, and the uber shader on DX12, each with a freshness test, a pixel-equivalence test and a safe runtime fallback.
  • Strong measurement culture: kinstr-based benches, paired alternating runs, documented decisions with rejected options (research/34, 35).
  • Many hard-won platform fixes are encoded in code and comments: Vulkan loader serialization, FXC choice, DirectComposition alpha, display-GPU choice, Wayland compositor GPU matching, lavapipe exclusion, occlusion-aware nextDrawable.
  • Layer system features: plus-lighter, bounded blur support through nested filters, turned layers, El::cache with LRU budget and resident-hit priority.
Key concepts
  • Instance (uber-quad ABI): 128-byte per-instance record of 8 vec4s (rect, radii, fill, border, params, uv, clip, fade); kind in params[1]; public API that compositors also build
  • Inline clip / packed fade: Every primitive carries a clip rect plus four f16 feather widths, unorm8 origin offsets and a packed per-corner rounded radius (exact f32 or tagged 4x7-bit), evaluated by clip_alpha
  • Scope records and end_layer fold: KIND_LAYER/KIND_LAYER_END bracket isolated subtrees; empty/single-primitive scopes fold back into the direct stream
  • Materialized layer: Scope that needs offscreen isolation gets an Rgba16Float target (64-px bucket), its own pass, optional Gaussian, then one composite quad; opaque unclipped scopes draw inline
  • Bands: Big shadows under opaque boxes and fill-less rings split into four band instances around the hidden middle to avoid shading it
  • Effect slots and backdrop splits: Painter positions where compositor hooks draw; backdrop slots/blurs end the pass, copy the target, and reopen with Load
  • Dual-filter backdrop pyramid: 7-level half-res Jimenez downsample/tent upsample, scissored to the blur region, crossfading levels for continuous sigma, origin snapped to texel grid
  • Staging + span diff: rune-staging reuses mapped chunks; prepare diffs instances in 64-instance blocks and writes only changed spans; batches only rebuilt when params change
Opportunities
Re-tag the sRGB colorspace after every configureimpact mediumeffort low
Apply the tag inside window::configure and Win::resize_surface, or map SurfaceColorSpace::Srgb to kCGColorSpaceSRGB in the native backend. Add a test that resizes and then reads the colorspace back.
Gate the native backend on macOS >= 13impact mediumeffort low
Fall back to wgpu below Metal 3 to match the metallib targets and MSL 3.0, so defaulted apps can't panic on older systems.
Line-ending-proof shader hashesimpact mediumeffort low
Add .gitattributes (*.wgsl text eol=lf), or normalize CRLF before hashing in dxbc.rs and metallib.rs. Log once when the DXBC gate misses.
Prewarm layer, blur and backdrop pipelines off the UI threadimpact mediumeffort low
Build the Rgba16Float content pipeline, the composite pipelines and the blur pipelines on the prewarm or warm thread, or in a background thread after the first frame. Reuse self.pipeline instead of building identical vs pipelines.
Budget and age transient GPU memoryimpact mediumeffort medium
Pool layer targets by node identity with frame-age eviction and a byte budget. Free backdrop copies and the pyramid after N frames without blur, and bucket backdrop sizes. Allow the instance buffer to shrink. Report backdrop and pyramid bytes in LayerStats.
Skip eager zero-fill for render targets on Metalimpact mediumeffort low
Textures that are render attachments and always cleared on first use (layers, backdrops, pyramid) don't need a blit zero-fill. Alternatively zero with a clear pass, or track first write the way wgpu-core does.
Dirty-hull store logimpact loweffort low
Replace the 8-entry write log with a per-storage dirty range so swap catch-up copies stay proportional to the change.
COPY_SRC on demandimpact loweffort medium
Configure surfaces framebufferOnly until a backdrop slot or blur first appears, then reconfigure. Alternatively blur from an intermediate copy made by a render pass.
Cache the backdrop pyramid and add ditheringimpact loweffort medium
Skip pyramid passes when nothing under the blur region changed (research/12 #3e). Add deterministic IGN or blue-noise dithering at the final write for gradients, shadows and blurred backdrops (research/12 #9).
Precompile all builtin pipelines for DX12 and use a Vulkan pipeline cacheimpact loweffort medium
Extend FXC bytecode beyond the uber shader to blur, video and alpha pipelines on Windows, as builtin_native.metallib does on Apple. Evaluate wgpu PipelineCache on Linux Vulkan.
Device-loss recoveryimpact mediumeffort medium
Install device-lost callbacks and error handlers. Rebuild the device and renderer the way overlays already handle a new device via DeviceKey.
Framebuffer-fetch group opacity on Appleimpact higheffort highre-architecture
With MSL generation now owned, an uber fragment variant that reads [[color(0)]] could composite simple opacity and blend-mode groups in tile memory without offscreen layers (research/12 #7). Needs MSL post-processing beyond naga.
Split the uber shader by cost classimpact mediumeffort highre-architecture
Measure register pressure and occupancy. A simple rect/glyph/image pipeline and a rich shadow/dash/radial/triangle pipeline, switched per painter run, may pay off on low-end GPUs (research/04 §5.1).
Automatic retained layers for opacity-only animationimpact mediumeffort mediumre-architecture
Skip a materialized layer's content pass when its content signature is unchanged, as El::cache does but without opt-in. Saves a whole subtree draw per frame during fades.
Move Gpu creation and the prewarm tests out of render.rsimpact loweffort low
Gets render.rs well under the cap and separates device setup from drawing.
Numbers, key files, roadmap and the verifier's additions
Numbers
render.rs + render/ lines
6,077 (render.rs 1,415; file-size.sh counts 1,400 of the 1,500 hard cap)
gpu/metal lines
4,655 total, ~3,380 non-test (research/34 abandon trigger 3,500)
gpu.rs + gpu/ non-Metal lines
834
runtime/paint lines
3,480 (build.rs 1,216)
WGSL lines
989 across 7 files (shader.wgsl 500)
Instance size
128 bytes, 14 kinds
Unit tests in area files
180 #[test] (plus integration: backdrop_blur 11, effect_slot 10, clip 7, border_gradient 5, ...)
Precompiled builtin table
28 source hashes, 61 pipeline rows
Shader blobs
builtin_native metallibs 540-549 KB x3, uber.metallib 34 KB, uber_native 28 KB, DXBC 4 KB + 48 KB
Native HUD kinstr/frame (0 / 1 write)
894 / 897 vs wgpu 1,395 / 1,668 (research/34)
Cold Renderer::new
native 222 -> 90 ms; wgpu Metal 232 -> 85 ms; DX12 uber pipeline 250-330 -> 2 ms
Cold first layer blur
727 -> 45 ms with builtin metallib
Shadow bands effect
5K frame pass 13 ms -> 4.5 ms
Budgets
El::cache 64 MiB LRU, 4096^2 max; MAX_BACKDROP_BLURS 4; layer blur sigma <= 64; glyph page 4 MiB; image shelf page 4 MiB; staging keep 4 MiB, pending 16 MiB; Metal IN_FLIGHT 2, spares 2, write log 8
Key files
crates/rune/src/render.rs Instance ABI and kinds, pack_fade/pack_clip_radii, end_layer fold, Gpu device/adapter creation, Renderer struct, pipelines, draw entry points, Offscreen readback, prewarm API (1,415 lines)
crates/rune/src/shader.wgsl Uber-quad vertex/fragment shader: SDF rects, erf shadows, gradients, dashes, segments, triangles, images, glyphs, layer composites
crates/rune/src/clip.wgsl Shared clip math: continuous-corner SDF, rounded clips, soft edges (also public CLIP_WGSL for compositors)
crates/rune/src/render/layers.rs Isolated-layer planning, Rgba16Float target pooling, El::cache LRU, layer pass encoding, layer composites
crates/rune/src/render/upload.rs prepare(): staging uploads, span-diffed instance writes, batching by bind group, globals, image/glyph atlas pages
crates/rune/src/render/backdrop_blur.rs Backdrop blur: dual-filter pyramid, continuous sigma, per-record uniforms, composite
crates/rune/src/render/pass.rs ActivePass and pass splitting for backdrop copies; backdrop pool
crates/rune/src/render/layer_blur.rs Separable Gaussian for layer blur with reduced-resolution path
crates/rune/src/render/metallib.rs Uber shader source assembly, ABI hashing, precompiled metallib loading with fallback, freshness/pixel tests
crates/rune/src/render/dxbc.rs DX12 FXC bytecode loading for the uber shader, hash-gated
Roadmap items
  • Fix the sRGB colorspace reset after configure on both Apple backends, and add a resize-then-check test.
  • Add a macOS >= 13 gate for the native Metal default, with fallback to wgpu.
  • Pin *.wgsl to LF (or normalize before hashing) and regenerate the DXBC hash; log DXBC gate misses.
  • Prewarm layer and blur pipelines off the UI thread; remove the duplicate vs pipelines.
  • Add device-loss callbacks and a rebuild path; consider debug-build validation in the native backend.
  • Introduce a transient GPU memory budget, age-based target pools, and release of backdrop and pyramid resources; report them in LayerStats.
  • Skip zero-fill for always-cleared render targets on Metal; replace the 8-entry store log with dirty hulls.
  • Split render.rs (Gpu setup and prewarm tests into their own modules) before it hits the 1,500-line cap.
  • Update PLAN §4.2/§4.3 and the README to match the shipped renderer and backend.
  • Spike framebuffer-fetch group opacity and measure uber-shader register pressure on low-end GPUs before considering a pipeline split.
Found by the verifier
Medium
LaunchDrawables reconfigure drops the sRGB tag on every macOS window about 1 s after launch
The note says the tag is lost after the first resize. But every macOS window starts capped at 2 drawables. Once it settles, or after 1 s, draw.rs reconfigures it to the steady latency with a bare Surface::configure and does not call pin_contents_top_left again. Both Apple backends reset the colorspace to nil on configure, so every window shows untagged output shortly after launch, resized or not. Any re-tag fix must cover this site.
crates/rune/src/window/draw.rs:341-344; crates/rune/src/window/launch_drawables.rs:4-34; crates/rune/src/window/create.rs:123 (cap), 139-141 (the only pin)
Low
Window resize and creation reconfigure without error capture, so a refused configure panics
window::configure exists so that a surface the driver refuses costs only its owner (hex#979). Overlays, blend switches and Outdated recovery use it. Window resize, first window configure and the launch-drawables reconfigure call Surface::configure directly. wgpu sends configure errors to the device's error sink, whose default handler panics. So a refused resize, for example on a driver that rejects a size, takes the whole app down.
crates/rune/src/window/win.rs:53; crates/rune/src/window/create.rs:139; crates/rune/src/window/draw.rs:343; wgpu-30.0.1 src/backend/wgpu_core.rs:3975-3981 and 692-694; crates/rune/src/window.rs:591-608
Low
Native backend never checks command-buffer status, and its pacing waits up to 1 s per frame
Command buffers are made with unretained references. Resources stay alive only through keep lists, which retire when the MTLSharedEvent reaches each buffer's stamp. Nothing reads MTLCommandBuffer status or error. If a GPU fault or reset leaves the event unsignalled (not verified on hardware), get_current_texture's pace() blocks the main thread for up to 1000 ms each frame, and the keep lists and callbacks pile up with no report. This adds to the note's device-loss issue: on the default macOS backend, a GPU failure would show up as a hang rather than an error.
crates/rune/src/gpu/metal/submit.rs:66, 82-87, 126-147, 175-185; crates/rune/src/gpu/metal/surface.rs:127
Low
The DXBC freshness tests fail on an LF Windows checkout, not just the runtime gate
The BLAKE3 recomputation shows the committed DXBC WGSL hash is the CRLF hash. uber_dxbc_is_fresh asserts that hash, and renderers_load_the_precompiled_uber_shader expects the bytecode to load. Windows CI with autocrlf=false, or a contributor with LF line endings, would see these tests fail. A regeneration from such a checkout would flip the hash to LF and break the CRLF users. Neither side can win without .gitattributes or a normalized hash.
crates/rune/src/render/dxbc_tests.rs:90-113; crates/rune/src/render/uber_dxbc_hash.rs:2 (= BLAKE3 of the CRLF clip.wgsl + '\n' + CRLF shader.wgsl; the LF form gives e32ae5..., as in uber_metallib_hash.rs:3)
08

Text: shaping, fonts, line cache, glyph atlas, rich text, editing, IME, selection

solid

Parley 0.12 handles shaping and layout, a pure-Rust port of CoreGraphics' glyph pipeline rasterizes into a 2048² R8 shelf atlas, and the caches are carefully bounded. The editor is a flat String with full-snapshot undo and IME goes through winit, both short of PLAN's rope plus native-protocol design.

Summary (654 words)

Rune's text stack layers its own code over Parley 0.12. Inside Parley, fontique handles fallback, HarfRust 0.12 shapes, ICU does bidi and segmentation, and Parley itself breaks lines and places inline boxes. Rune adds trak tracking re-derived at point size, a second build when a fallback font's tracking differs, hidden variable-font axes taken from named instances, emoji and math fallback routing, 4-column mono tab stops, pill and inline-icon boxes, and block indents (text.rs:452-789). System fonts are never enumerated wholesale. Rune walks the font directories and loads only symbol, CJK, script, math and mono files whose names match fixed fragments, so an installed but unregistered family silently falls back to sans.

Layouts are cached per (shape key, break key). A width change re-breaks a cached shaping instead of shaping again: about 2 µs against 30 µs per paragraph, and a 50 KB resize frame went from 16.1 to 4.6 ms (research/28). Stale layouts stay within 3 MiB, the glyph replay cache within 8 MiB and 4,096 entries, colour glyphs within 16 MiB and colour icons within 4 MiB. The atlas is 2048² R8 with 2 steady pages and up to 8 overflow pages, evicted a whole page at a time.

Rasterization is a pure-Rust re-implementation of CoreGraphics that runs on every OS: - ppem-dependent subpixel x steps from fifths to whole pixels, stored in 60ths; - 4 y glide phases; - a direction-sign outline dilation keyed on one of 5 luminance buckets (FontSmoothing::On, the macOS default); - CG's y autohinter at 7–18 ppem; - CG's curve flattening, then zeno coverage.

Tests hold masks within 3/255 of CoreGraphics. Off macOS, smoothing is Off and coverage takes a Chromium-Windows-fitted gamma (TEXT_GAMMA, added in the latest commit). Paint binary-searches the visible lines and replays per-line flattened glyphs (glyph_cache.rs). Each glyph is drawn as one 128-byte instance with exact texel loads.

Editing uses TextEdit: a public flat String with byte anchor and focus, inline marks as sorted byte ranges, one Block per \n line, pills, and a safe HTML import/export subset. Undo stores full text snapshots, capped at 128 steps and 1 MiB. The cost grows with the text: every keystroke or IME preedit change reshapes the whole field (12 ms at 50 KB, 46 ms at 200 KB), clones the text several times, and keeps only 2 undo steps at 200 KB. PLAN's Zed sum_tree/rope and research/32's per-paragraph composite layout are not started.

IME on desktop goes through winit (WindowEvent::Ime, set_ime_allowed, set_ime_cursor_area), which PLAN.md explicitly rejects. That rules out replacement ranges, clause attributes and reconversion. The web has its own 512-UTF-16-unit sliding hidden-textarea bridge, which matches research/05. iOS and Android have nothing.

Selection works two ways. Fields keep it in TextEdit. Read-only selectable text keeps a runtime-owned Held state that spans selection groups and virtual rows. Both draw through text::range_boxes, which carries Parley 0.12 workarounds (indents, pill boxes).

Bugs and drift found: - is_pristine() stays true after typing in plain fields: the fast path returns before mark_edited (edit.rs:812 vs 935). - Text flights and pixel_compare skip the new coverage exponent (flights.rs:214, pixel_compare.rs:414), so flight weight jumps and the Off-mode CoreText tests don't measure what apps draw. - Left and Right arrows move in logical order, so they go the wrong way inside RTL runs. - Option-arrow treats only ASCII whitespace as a word boundary, unlike double-click's UAX#29. - Synthetic bold is ignored. - Font collections and atlases are duplicated per window and per measuring thread. - Empty atlas entries are never pruned. - Docs lag: research/23 describes the removed Calibrated rasterizer, research/27's 64 KB budget is now 3 MiB, and the FontSmoothing doc still says coverage is drawn as is.

About 340 tests touch the area: 103 in text/, 57 for the edit model, about 75 selection and text integration tests and about 110 runtime tests. They include strong bit-identity tests for re-break and replay and CG-parity suites. There is no real-IME harness and no field RTL-caret test.

Why this maturity: Rendering quality and caching are exceptionally well engineered and tested: CG parity at 1e-11 to 1e-12 in paths and 3/255 in masks, bit-identity re-break and replay tests, bounded caches, and about 340 tests. Editing and IME are working but not production-grade for long documents or CJK/mobile: O(n) per keystroke, snapshot undo, winit-limited IME, nothing on iOS, logical bidi carets.

Issues, most severe first
High
Whole-field reshape on every keystroke and preedit update
One Parley Layout per field keyed by the whole text; any edit or IME composition change (preedit spliced into display text) misses and reshapes everything. Each keystroke also does two full snapshot clones, a full-text compare, sync_invariants newline scans, a text_input clone and a display() copy, and hashes the full text.
text.rs:452-789; edit/display.rs:224-248; edit/history.rs:98-158; el.rs:712-717; research/27: 12.0 ms at 50 KB, 45.7 ms at 200 KB
✓ Confirmed
High
Undo depth collapses on large text
Each step stores full before/after text within a 1 MiB budget, so about 1 MiB/(2×size) steps survive.
edit/history.rs:8-9, 63-70; research/27: 2 of 100 steps kept at 200 KB
✓ Confirmed
High
IME limited to winit's implementation; nothing on iOS/Android
Desktop IME is winit's WindowEvent::Ime with one cursor area: no replacement ranges, clause attributes, reconversion, per-range rects or ImePurpose. iOS LayerHost has no UITextInput. PLAN rejects winit IME and names iOS UITextInput its top risk.
window/events.rs:420-427; window/platform_sync.rs:12-30; platform/embed.rs; PLAN.md:27,32,36,211-217
✓ Confirmed
Medium
is_pristine() stays true after typing in plain fields
The plain-text fast path in apply_text_and_attr_replace returns before mark_edited(); replace() and record_change never call it. Pristine tests only cover secure fields.
edit.rs:796-812 (return) vs edit.rs:935 (mark_edited); edit.rs:938-994; edit/tests.rs:133-205
≈ Partly The fast path does return before mark_edited. But replace() calls mark_edited on its secure branch (edit.rs:950) and its no-op branch (edit.rs:964). The runtime also marks a field edited after any text change when it has on_input_change (runtime/input/keys.rs:191-197). So in an app, only fields without that handler stay pristine. Newline and paste use the same fast path. Nothing inside Rune reads is_pristine on non-secure fields; the impact falls on app code. All pristine tests use secure fields, including runtime/input_click_tests.rs, runtime/tests/secure_text.rs and rune-kit/tests/text_input_press.rs.
Medium
Flights and CoreText Off tests bypass the new coverage gamma
motion/flights.rs builds glyph instances with glyph() (exponent 1.0) while resting text uses glyph_or_image with TEXT_GAMMA when smoothing is Off. A source flight therefore draws at a different weight on Linux, Windows, web and macOS Off. pixel_compare also uses glyph(), so the Off parity tests don't measure the runtime path.
runtime/motion/flights.rs:214; runtime/paint/blend.rs:57-64; runtime/paint/helpers.rs:247-251; text/pixel_compare.rs:414; text.rs:398-405
✓ Confirmed
8 more verified issues
Medium
Logical arrow movement and ASCII-only word motion
Left/Right move by logical grapheme, which is the wrong visual direction in RTL runs. Option-arrow stops only at ASCII whitespace (CJK sentences and punctuation-joined tokens become one word), while double-click uses UAX#29. Editor segmentation uses unicode-segmentation while Parley uses ICU.
edit/input.rs:214-221; edit.rs:132-140, 591-638; runtime/selection/selectable.rs:97-125
✓ Confirmed
Medium
Per-window and per-thread duplication of fonts, caches and atlas
Every TextSystem::new builds an unshared Collection, registers the bundled fonts, and loads symbol and up to 16 CJK files. Every Runtime has its own atlas (4 MiB CPU + 4 MiB GPU per page, 2–8 pages). measure() reshapes texts in a separate per-thread system.
text.rs:258-320; system_fonts.rs:124-142; tooling.rs:136; overlay.rs:397; measure.rs:41-45, 209-238; atlas.rs:106-113
≈ Partly The duplication is real. But the atlas starts at 1 page, not 2: page 0 is always allocated (CPU 4 MiB vec, GPU texture created in Renderer::new). It grows to 2 steady pages and at most 8, so the range is 1–8. The measure() TextSystem also allocates its own never-used Atlas. On the verifying Mac the matched CJK and symbol files come to about 315 MB of mappings per TextSystem (Apple Color Emoji 188 MB).
Medium
Synchronous first-use shaping and rasterization stalls
No warm-up or worker threads. The CG path allocates several Vec<Cmd> per glyph and builds two swash scalers per new glyph. First frames of real apps spend 9–38 ms in shaping and rasterization.
glyph_emit.rs:148-170; smoothing.rs:163-205; research/33 items 4 and 10
✓ Confirmed
Low
Atlas granularity and unbounded empty entries
Single shelf cursor per page, whole-page eviction, full-width dirty-row uploads. Up to 5 x phases × 4 y phases × 5 dilation radii × pipelines per glyph. None (empty-glyph) entries survive page eviction and are never pruned, which is unbounded under size or variation animation.
atlas.rs:11-28, 48-97, 252-266, 381-383; render/upload.rs:121-125, 201-213
✓ Confirmed
Low
Silent typographic fallbacks
Parley's synthetic embolden is ignored (Inter 700 draws as SemiBold). Installed but unregistered families fall back to sans. Ink u16 wraps past 65,535 spans. Cache hits are not verified against the text (64-bit key).
glyph_emit.rs:259 (only skew used); text/default_fonts.rs:5-9; text.rs:698; hash.rs:12-33
≈ Partly The embolden framing is wrong. fontique 0.12 sets embolden only when the requested weight is more than 200 above the face's, so Inter 700 resolves to SemiBold 600 without any embolden flag. Ignoring synthesis().embolden() matters only above weight 800 (e.g. 900). The Ink cast 'Ink(i as u16 + 1)' panics on overflow in debug at index 65,535 and wraps in release; from 65,536 on it silently aliases earlier spans. Unregistered installed families falling back, and unverified 64-bit cache keys, are confirmed.
Low
Double shaping when a fallback font has trak
After shaping, a mismatch between predicted and actual run fonts' tracking triggers a full second build (e.g. Inter text with ⌘ falling back to SF).
text.rs:755-778; system_fonts.rs:13
✓ Confirmed
Low
Docs drift from code
research/23 describes the removed Calibrated rasterizer (quarter-pixel pens, 0.1 pt emboldening, gamma). research/27 cites a 64 KB stale budget (now 3 MiB). PLAN §4.5–4.6 still say 4× subpixel, kitlangton dilation, Slug, sum_tree, native IME. The FontSmoothing doc says coverage is drawn as is, but the gamma now applies when Off. text/macos/ holds cross-platform code.
research/23-text-quality.md; CHANGELOG.md:184-205; layout_cache.rs:45; coretext_match.rs:12-13 vs text.rs:398-405; PLAN.md:205-217
✓ Confirmed
Low
File-size debt
edit.rs (1,005), edit/html.rs (992) and text.rs (887) exceed the 800-line soft cap; edit/tests.rs (1,021) and edit/rich_tests.rs (1,056) exceed the 1,000-line test cap.
wc -l; AGENTS.md file-size rules; scripts/file-size-exceptions.txt is empty
≈ Partly The non-test counts from scripts/file-size.sh are edit.rs 1,000, edit/html.rs 992 and text.rs 870; 1,005 and 887 are totals. Test files have 1,021 and 1,056 lines. The exceptions file lists only files over the 1,500 hard cap, so its being empty is expected. These are warnings, not violations.
Strengths
  • Exact, test-pinned CoreGraphics parity: dilation paths within 1e-11, autohint within 1e-12, masks within 3/255; Core Text advance tests via FFI; CoreText pixel sheets committed for Inter
  • Every cache has an explicit byte/entry budget with documented reasoning (layout_cache.rs:36-45, glyph_cache.rs:16-21, atlas.rs:41-46)
  • Bit-identity regression tests for re-break (8 widths × span kinds, RTL, CJK, emoji, pills) and glyph replay
  • Resize, scroll and caret navigation are cheap even at 200 KB (0.09 ms scroll, 0.41 ms Down arrow)
  • Careful handling of real-world text: tabs in mono, keyboard symbols, emoji presentation selectors, math alphanumerics, per-locale Han fallback, hidden variable axes, trak
  • Robust secret handling (Zeroizing, cache bypass, no IME/history/copy on secure fields)
  • Rich model with pills, blocks, allowed-mark sets, safe HTML import/export and sanitized clipboard HTML/RTF
  • Web IME bridge with UTF-16 windowing and stale-edit rejection, tested
  • Read-only selection across groups, virtual rows and streaming appends without re-running views
Key concepts
  • shape key / break key: Shaping cache key (text, spans, style, scale, wrap_anywhere, pills) vs line-breaking key (+width, align, block indents); a new width re-breaks the newest shaping of the same shape key
  • Ink brush: u16 Parley brush: 0 = element colour, n = spans[n-1]; colour changes never reshape
  • FontSmoothing On/Off + ApplePipeline: On = CG pipeline with luminance-keyed outline dilation (macOS default); Off = without dilation plus Chromium gamma (default elsewhere); stages dilate/flatten/hint
  • quantisation_steps / PHASES: CG pen floor: 1–5 steps per device px by ppem; phases stored in 60ths so all steps share one key space
  • glide phases: 4 vertical sub-pixel phases for text in a pixel-snapped moving box
  • luminance bucket / dilation radius: 5 Rec.709 luminance buckets of ink; radius=min(ppem·(0.0058+0.01q),0.3); radius keys the atlas
  • GlyphKey: font id, face index, glyph, size bits, coords hash, subpx, subpy, dilation, pipeline bits, skew
  • glyph replay cache: Per Rc<Layout> (weak), ink hash and pipeline: lines flattened once, positions recomputed bit-identically each frame, masks reused when phase unchanged
Opportunities
Per-paragraph composite TextLayoutimpact higheffort mediumre-architecture
Split at \n, cache each paragraph's Layout, and keep a (byte_start, y_top, line_start) prefix index used by caret, hit-test, selection, decorations, elision and the glyph walk. Projected −14 ms per keystroke at 50 KB (research/32 #1, about 900 LOC). Also fixes preedit reshapes.
Delta undoimpact higheffort medium
Store the removed and inserted range text plus the small mark and block vectors; validate by length and hash. Keeps 100/100 steps at 200 KB and removes two full clones per keystroke.
Rope/sum-tree text buffer with UTF-16 and line summariesimpact higheffort highre-architecture
O(log n) offsets and lines for editing, IME and accessibility, as PLAN and research/05 specify. TextEdit.text is a public String, so it needs a compatibility view or an API migration.
Own IME shells (NSTextInputClient, UITextInput+UITextInteraction, TSF)impact higheffort highre-architecture
Adds replacement ranges, marked-text attributes, per-range rects and iOS support. The web bridge's base+expected protocol is a template.
Share font Collection and atlas across runtimesimpact mediumeffort medium
One fontique Collection and SourceCache per process; one glyph atlas per GPU device; let main-thread measure() reuse the runtime's layout cache.
Parallel or ahead-of-time glyph rasterization and an ASCII prewarmimpact mediumeffort medium
Masks are pure functions of outline and key. Rasterize misses on a worker pool after apply, and prewarm the slot fonts' ASCII at common sizes in on_ready.
Fix pristine fast path and gamma consistencyimpact mediumeffort low
Call mark_edited in the plain fast path. Use glyph_or_image or coverage_exponent in flights and pixel_compare. Update the FontSmoothing doc and research/23 and research/27.
Visual and UAX#29 caret motionimpact mediumeffort low
Use parley::editing::Selection visual movement for Left/Right, and unicode word boundaries (matching unit_at) for Option-arrow and word deletion.
Better atlas packing and evictionimpact loweffort medium
Skyline packer, per-shelf eviction, dirty rectangles, and pruning of None entries.
Cheaper history bookkeepingimpact mediumeffort low
Replace full-text same_doc and after==before compares with a version counter plus length; skip the before-snapshot on coalesced typing.
Numbers, key files, roadmap and the verifier's additions
Numbers
text.rs + text/ lines
887 + 9,011 (6,266 non-test)
edit.rs + edit/ lines
1,005 + 2,886 non-test + 2,077 test
runtime/selection lines
2,308 (8 files)
clipboard lines
2,135
Unit tests text/
103
Unit tests edit/
57
Tests touching area (approx.)
~340
Commits touching text since 2026-10-22
108 (edit: 44, selection: 8)
Atlas page
2048×2048 R8, 4 MiB CPU + 4 MiB GPU; 2 steady, max 8 pages
Stale layout budget
3 MiB (STALE_BYTES)
Glyph replay cache budget
8 MiB / 4,096 entries / 2 MiB per entry
Colour glyph / colour icon budgets
16 MiB / 4 MiB
Undo budget
128 steps / 1 MiB of snapshot text
Typing a char, one field (5/50/200 KB)
2.2 / 12.0 / 45.7 ms (research/27)
Key files
crates/rune/src/text.rs TextSystem struct (138-195), constructor/font registration (258-320), layout_keyed shaping/re-break/trak pipeline (452-789), coverage_exponent gamma (398-405), icon quads
crates/rune/src/text/layout_cache.rs Layout/elision/run cache entries, STALE_BYTES=3MiB eviction, supersede on edit, end_commit
crates/rune/src/text/hash.rs KeyHasher, text_hash/shape_key/break_key/elide_key
crates/rune/src/text/atlas.rs 2048² R8 shelf atlas, GlyphKey, page LRU eviction, overflow pages, put with zeroed gutter, budgets
crates/rune/src/text/glyph_emit.rs glyphs_in_band (band culling), push_glyph (atlas lookup, colour glyphs, CG raster), place() phases/glide
crates/rune/src/text/glyph_cache.rs Per-layout flattened glyph replay cache (8 MiB/4096 entries)
crates/rune/src/text/macos/smoothing.rs CoreGraphics pipeline port: design_outline, dilate, luminance buckets/radius, prepare_outline, zeno mask
crates/rune/src/text/macos/hint.rs CG small-size y autohinter (7–18 ppem)
crates/rune/src/text/coretext_match.rs FontSmoothing modes, PHASES=60, quantisation_steps, glyph_x
crates/rune/src/text/system_fonts.rs Font directory walk, symbol/CJK/script/mono file loading, family_list/ui-monospace
Roadmap items
  • Fix is_pristine fast path (edit.rs:812) and add a plain-field test
  • Apply coverage_exponent in text flights (flights.rs:214) and pixel_compare; reconcile FontSmoothing docs with TEXT_GAMMA
  • Refresh research/23, research/27 and PLAN §4.5–4.6 to describe the CG port, the 3 MiB budget and the actual IME path
  • Visual Left/Right via Parley Selection; UAX#29 word motion matching unit_at
  • Delta undo history (range diffs + hash validation)
  • Per-paragraph composite TextLayout behind a TextLayout facade (research/32 #1)
  • Share fontique Collection/SourceCache and the glyph atlas across runtimes on a device
  • Prewarm ASCII glyphs after the first frame; then parallel rasterization of a frame's misses
  • Decide the IME strategy: own NSTextInputClient/UITextInput/TSF shells versus upstreaming fixes to winit; start iOS UITextInput
  • Rope/sum-tree TextBuffer once composite layouts land (API migration for TextEdit.text)
Found by the verifier
Medium
Font discovery and loading run synchronously before the first frame, once per text system
runtime_for builds TextSystem::for_window, and TextSystem::new runs before the first frame. That walks the platform font directories once per process; on Linux it also spawns fc-list. It then maps and has fontique scan up to 16 CJK files plus the symbol files into a fresh unshared Collection. The scan repeats for every overlay and for every thread's measure() system. research/13 planned font loading on a background thread, and AGENTS.md says to start slow work after the first frame. On the verifying Mac the matched files total about 315 MB of mappings (Apple Color Emoji 188 MB, AppleSDGothicNeo 54 MB, Hiragino Sans GB 23 MB). The cost has never been measured.
tooling.rs:136; overlay.rs:397; text.rs:258-277; text/system_fonts.rs:124-142, 182-253 (walk + fc-list), 45-53 (fc-match); text/measure.rs:160-161 ('first call on a thread loads the fonts'); research/13-research-latency-startup.md:60
Low
IME commits never join a typing undo group
Every IME event (preedit or commit) calls break_history_group and an O(n) sync_invariants. Commit then inserts through insert(), which calls replace(.., typing=false) and breaks the group again. So each CJK conversion, macOS dead-key accent, dictation chunk or emoji-picker insert is its own undo step and splits the surrounding typing run. This fills the 128-step / 1 MiB history quickly and gives undo a granularity unlike AppKit's.
edit/input.rs:322-334; edit.rs:714-715 (insert → replace typing=false), edit.rs:958 (!typing → break_history_group); edit/input.rs:86 (keys coalesce only for Key::Text)
Low
The history is copied on every recorded edit
text_input clones the TextEdit into the node tree (sharing Arc<History>). So when the app's TextEdit records an edit, Arc::make_mut in record_change and in break_history_group sees a strong count of 2 or more. It deep-copies the VecDeque<Change>, including every snapshot's mark, block (one per line) and soft-break Vec. Texts are Arc-shared, but that is up to 128×2×3 Vec allocations per keystroke. A comment claims the view never copies the undo stack.
edit/history.rs:73 (comment), 95, 134 (Arc::make_mut); el.rs:714 (edit.clone() into InputSpec); runtime/input/keys.rs:161 (node keeps input.edit)
Low
Shaping scratch never shrinks, and large layouts are undercounted in the stale budget
Each TextSystem keeps one LayoutContext for its whole life; only secure text swaps in a fresh one. HarfRust's buffer stays at the size of the largest text ever shaped: 4.3 MB after a 50 KB field per research/31, and more per window after a 200 KB note. The cache's cost estimate is 64 B per text byte, but research/31 measured about 156 B per byte of ShapedText for a 50 KB field. So STALE_BYTES (3 MiB) can hold over twice the real heap it implies for large layouts.
text.rs:467, 785-787 (only cache==false replaces layout_cx); text/layout_cache.rs:35-45 (LAYOUT_PER_BYTE 64, STALE_BYTES 3 MiB); research/31-layout-text-cost.md:176-178

Input, platforms, media and web

Input and accessibility · Platform shells · Media · Web target

09

Input, hit testing, focus, gestures, shortcuts, drag and drop, accessibility

working

A main-thread input layer: hosts call Runtime entry points that hit-test the last built frame and queue path-addressed Actions; the next frame runs them in order with one commit. It adds AppKit-faithful focus and key routing, canvas gestures with live-only skips, four global-shortcut backends, file drop in (all desktops) and drag out (macOS only), and a lazy, fingerprinted AccessKit tree on Windows, macOS and Linux.

Summary (572 words)

Scope is about 13,960 lines: runtime/input 6,373, input 1,795, shortcuts 1,702, a11y 2,246, cursor 556, drag_out 796. There are 200 unit tests and about 61 integration tests, plus GUI-only harnesses and 23 rune-kit a11y tests with 26 goldens. None of it is a separate subsystem. Every file is an impl Runtime<S> block pulled in through #[path] with use super::*. About 78 of Runtime's ~239 fields are input state, mostly flat (capture, press, hover, focus, key, drag-out, modal), with some newer structs (HoverHold, FileDrag, HelpState, Titlebar, Touch, WheelLock, ModifierKeys).

Pipeline: winit hosts (window/events.rs, overlay/any_host.rs, web, layer_shell) open an arrival-time scope (input/time.rs, which reads the NSEvent timestamp on macOS) and call pointer_move/down/up, secondary_*, button_*, wheel_event, magnify_event, touch, physical_then, key, ime and drag_files*. These hit-test synchronously against hits, a paint-order Vec<(NodeId, rect)> filled by register_node_hits during the last build, using reverse linear scans, half-open rects and unturning for rotated layers. Capture and hover update at once, and a path-addressed Action (36 variants) is pushed with its timestamp. frame_step then drains the queue in order. Drag ends go after their own starts. File steps wait for a fresh build. A key, IME, paste or file step forces a commit first, so it reaches a field the same frame just focused. Handlers run through dispatch_action, their Tx's merge, and the frame commits once. A Tx::live_only handler skips the view, cutting a 6,000-element pinch from 13.7 to 2.0 ms per frame and from 42,124 to 78 allocations (README).

Focus is one path plus focus-visible and hover-focus flags. It covers roving groups with role-based arrow, clamp, wrap and type-select rules (AppKit), tab_index ordering, Full Keyboard Access, a modal stack with restore, focus_return, default buttons, slider steps, and held activation keys that can't act again after focus moves. Key routing goes: physical handler first (shortcut recorders), then modifier keys, paste capture, element on_key, app on_key (first when nothing is focused, last otherwise), the field editor, page scroll, and finally Unhandled ⌘W/⌘M/menu fallbacks. Chord/Keybind (logical, per platform) and the global Shortcut type (physical US key) are separate grammars. The global backends are Carbon, RegisterHotKey, X11 grabs and the Wayland portal, with conflict owners named.

AccessKit adapters cover Windows (SetWindowSubclass plus extra WinEvents), macOS and Linux (works windowless). Nothing is built until a client asks. After that, each turn compares a stamp; a scroll-only change rebuilds just the viewports (offset as a transform). Any other change runs one walk that fingerprints each node and sends only the nodes that changed. Test builds check after every update that the sent tree equals a whole build. Roles map from ARIA names, and actions run the same handlers a pointer or keyboard reaches. iOS, Android and web have no adapter; web uses a separate, thin DOM mirror.

Main risks: - A modal opening mid-drag drops the capture without the drag's Up. - Plain boxes with only on_hover or on_drag are announced as Buttons with no action. - A11y bounds go stale after live-only events. - --tree omits scroll-right. - Docs are stale: README says "No AccessKit, vertical scrolling only", and the on_key_up docs are out of date. - Hot paths use linear path lookups even though a path_ids index exists. - Hover does O(n) passes on every move and every frame, and tab_order is O(F²·depth). - Overlays get only a subset of input (no wheel, secondary click or gestures). - chord.rs has no tests. - The drag-out snapshot blocks on a GPU readback inside CursorMoved.

Why this maturity: Runtime-side semantics are deep, platform-faithful and covered by about 260 tests including real-desktop GUI harnesses. But the AccessKit layer is 3 days old with no recorded costs, drag-out is macOS-only, touch is single-finger, overlays lack wheel and gesture input, the chord matcher is untested, and hot paths still use linear scans and flat state.

Issues, most severe first
Medium
Modal opening mid-drag drops capture without Drag Up
sync_modals clears capture, secondary_capture and hovered but does not call cancel_drag, so an on_drag handler in progress never hears Phase::Up/cancelled. press_repeat, drag_out_armed, text_sel.dragging and input_click also stay set.
crates/rune/src/runtime/input/focus.rs:452-457 vs cancel_drag at crates/rune/src/runtime/input/pointer.rs:109
✓ Confirmed
Medium
Hover-only or drag-only plain boxes announced as Button with no action
RoleCtx.pressable uses Handlers::has_primary, which includes on_hover and on_drag; roles::group returns Button for any pressable plain box, but Click is only added for on_press.
crates/rune/src/a11y/node.rs:24, crates/rune/src/el/handler_set.rs:69-75, crates/rune/src/a11y/roles.rs:113, crates/rune/src/a11y/node.rs:207
✓ Confirmed
Medium
A11y bounds stale after live-only events and during animation
The stamp covers commits, scroll hash, focus, animating, viewport, title and tooltip. Live-only pans and zooms change drawn rects without touching any of these, so canvas element bounds stay stale until the next commit.
crates/rune/src/a11y/tree.rs:281-295
✓ Confirmed
Medium
Linear path lookups in per-action hot paths
node(), live_index, hover_live, focused_index, gesture_handler and a11y_action scan all nodes with string compares, while path_ids+node_index give O(1) and interaction.rs already uses them.
crates/rune/src/runtime/input/keys.rs:226,257; hit.rs:182; hover.rs:276; gesture.rs:163; runtime/interaction.rs:54
≈ Partly node, focused_index, live_index, hover_live and gesture_handler do scan by path string, and interaction.rs index_of already does the O(1) lookup. a11y_action scans by NodeId, not by string, and runs only once per assistive action, so it is not a hot path. Each scan short-circuits on path equality, so the cost is modest (O(n) memcmp).
Medium
O(n) hover passes per pointer move and per frame; O(F²·depth) tab_order
decide_hold with flips None runs hover_flip over every node; update_interaction, hovered_alone and shared_hovered each scan all nodes; tab_order filters all items by group() for each item.
crates/rune/src/runtime/input/hover.rs:146-151,288-305,334; crates/rune/src/runtime/input/focus.rs:300-313
✓ Confirmed
10 more verified issues
Medium
Overlays take only a subset of input
winit overlays handle cursor move/leave, modifiers, keys and the left button only: no wheel, secondary, extra buttons, touch or gestures. Layer-shell surfaces have no wheel and hard-code repeat:false.
crates/rune/src/overlay/any_host.rs:109-160; crates/rune/src/platform/layer_shell.rs:182
✓ Confirmed
Medium
Chord matching has no tests
424 lines of platform-folding, AltGr, non-Latin fallback and shifted-symbol logic, recently changed in 332 lines, with zero unit tests.
crates/rune/src/input/chord.rs (0 #[test]); git 1d57a1a7, d03349e2
✓ Confirmed
Medium
Web accessibility is a separate thin model
The web DOM mirror exposes only button, link, heading, image, group and landmark tags with its own role mapping; no checkbox, slider, textbox, listbox, menu or dialog semantics.
crates/rune/src/runtime/web/a11y.rs:104-120, 292-430
✓ Confirmed
Low
--tree accessibility JSON omits scroll-right
dump ACTIONS lists 15 actions without Action::ScrollRight, which node.rs adds and actions.rs handles.
crates/rune/src/a11y/dump.rs:10; crates/rune/src/a11y/node.rs:229; crates/rune/src/a11y/actions.rs:98
✓ Confirmed
Low
Stale docs about AccessKit, scrolling and key-up routing
The README 'Differences from PLAN.md' section says no AccessKit and vertical-only scrolling. The on_key_up docs say an unfocused release goes to the root, but since the unfocused-key-up change it goes to every handler, deepest first. The a11y/mod.rs path reference and the drag_out 'take no drops' note are outdated.
crates/rune/README.md:2820, 390-393; crates/rune/src/input/canvas_input.rs:195-199; changelog/unreleased/2026-10-30-unfocused-key-up.md; crates/rune/src/a11y/mod.rs:4
✓ Confirmed
Low
Two chord grammars disagree
Chord reads 'plus' as '+' and '{' as Shift+[; Shortcut reads 'plus' as the = key and rejects '{'. Stored strings can mean different keys depending on the type.
crates/rune/src/input/chord_label.rs:44; crates/rune/src/shortcuts/parse.rs:56
≈ Partly The divergence is real: Chord 'plus' is the '+' character (matched with or without Shift), while Shortcut 'plus' is the = key. Chord turns '{' into Shift+[, while Shortcut rejects '{' and also a trailing 'mod++'. But no code in the repo moves strings between the two types. ShortcutRecorder builds a Shortcut from the physical key, and the kit's Keybind is a display component. So the risk falls on apps only.
Low
Drag-out snapshot blocks inside CursorMoved
Renders the full frame into a full-size offscreen texture and waits on device.poll(wait_indefinitely) to read back a crop on the main thread.
crates/rune/src/drag_out/mod.rs:300-347
✓ Confirmed
Low
Flat Runtime input state and total coupling
~78 input-related flat Runtime fields, against AGENTS.md's rule; every input file uses super::* and reads paint scratch directly.
crates/rune/src/runtime.rs:383-812; AGENTS.md 'New runtime state goes in the owning subsystem's struct'
≈ Partly The facts hold: about 240 fields, about 75 of them input-related, and use super::* in all 19 runtime/input files, with hit.rs reading turn_scratch and inh_scratch. But the AGENTS.md rule governs new state, and it landed on 2026-10-26. Most of these fields predate it; only a few came later (e.g. hover_gone on 10-27, key_index on 10-30). This is debt more than a breach.
Low
Inline test modules and misplaced files
Large inline test modules (focus.rs ~880 lines, physical.rs ~450) break the sibling-tests rule. key_diagnostics.rs (sibling identity keys) sits in input/, and popup.rs and file_dialog.rs sit in runtime/input/.
crates/rune/src/runtime/input/focus.rs:497; physical.rs:203; input/key_diagnostics.rs:1-2
✓ Confirmed
Low
Single-finger touch with two-sample velocity
Extra fingers are ignored, and fling velocity is the last segment timed at dispatch Instant::now, not the event timestamp.
crates/rune/src/runtime/input/touch.rs:85-99; crates/rune/src/window.rs:720-729
✓ Confirmed
Strengths
  • Hit testing uses the frame the user saw, and queued handlers get per-event arrival times (input/time.rs), so ordering and latency attribution are exact
  • Behaviour is deliberate and platform-faithful: AppKit clickCount, tracking-area hover hold, NSTableView clamping, NSPopUpButton arrows, UIScrollView press cancellation, held-key repeat suppression and IME Return/Escape ownership are all implemented and tested
  • Keyboard routing is ordered and well tested (physical before logical, recorder capture, paste target captured in event order, Unhandled menu/close fallbacks)
  • Live-only events are measured (13.7→2.0 ms, 42k→78 allocations per frame) and have a debug-time correctness check
  • The a11y tree is lazy, incremental and self-verifying: test builds assert after every update that the sent tree equals a whole build
  • Global shortcuts cover four backends with conflict owner naming, unmodified-chord refusal, and headless virtual registration
  • Modal focus semantics are thorough: a stack with restore, focus_before_commit, portals anchored into modals, scrim blur-then-close
  • Coverage is good: ~200 unit tests plus ~61 integration tests and real-desktop GUI harnesses for a11y, drag-out, cursors and menus
Key concepts
  • hits list: Per-build paint-order Vec<(NodeId, clipped rect)> of input-taking nodes; all pointer targeting is a reverse linear scan of it, so input hits what was last drawn
  • Action queue: Path-addressed, arrival-stamped actions queued by entry points and run in order at the next frame_step; routed actions force a commit first so keys reach newly focused fields
  • capture: (path, Drag) held from press to release; capture_inside is updated only when the pointer moves (AppKit semantics)
  • hover hold: Under layout motion with a still pointer, hover states freeze until motion settles or the pointer moves
  • live_only: Tx flag by which a handler that only moves Live values skips view re-run, diff and layout; debug builds verify the view did not change
  • focus groups: Roving-tabindex containers with role-driven arrow, clamp/wrap, paging and type-select behaviour
  • held_gate: Activation keys (Enter, Escape, Space) remember their press's focus; repeats are dropped once focus moved
  • physical + fallback: Physical key code and logical KeyEvent queued together so focused on_physical_input sees keys before editing and shortcuts
Opportunities
Use path_ids+node_index for path lookupsimpact mediumeffort low
Route node/live_index/hover_live/focused_index/gesture_handler/a11y_action through the existing O(1) index, and fall back to a scan only when an exiting twin shares the path.
Per-commit index lists for hover, scroll and canvas handlersimpact mediumeffort low
Keep lists of nodes with hover tracks, hover_alone/hover_share, scroll viewports and gesture handlers, so per-move and per-frame passes iterate tens of nodes instead of thousands.
Linear tab_order and cached a11y ancestryimpact loweffort low
Compute a group-of map once per key; fill can_focus/in_focus_group top-down during the a11y walk (like ExitMask) to make it O(n).
Drawn-generation in a11y stampimpact mediumeffort low
Bump on live-value changes and rebuild only nodes under the moved live transform, so canvas bounds stay current.
Crop-only async drag snapshotimpact loweffort medium
Render into a crop-sized target with scissor/viewport, and avoid wait_indefinitely in the event when possible.
Input subsystem structsimpact mediumeffort highre-architecture
Move pointer/capture/press, focus/modal, keys/IME and hover state into owned structs with read-only geometry views, per AGENTS.md. This makes runtime/input testable without a full Runtime and stops new flat fields.
Spatial hit indeximpact mediumeffort mediumre-architecture
A per-build grid or BVH over hits and scroll viewports with cached ancestor chains, replacing reverse linear scans for pointer move at 120 Hz and high-rate trackpad wheels at 6,000+ elements.
One semantics layer on every targetimpact higheffort highre-architecture
Derive the web DOM mirror from the AccessKit tree (or a shared intermediate), and wire accesskit_ios/android behind AccessibilityLink, giving one tree for screen readers, goldens and agents everywhere.
Late-latched resampled inputimpact mediumeffort highre-architecture
Keep raw timestamped samples, resample drags and touches at frame target time, and use an impulse velocity estimator as PLAN specifies.
Full input parity for overlaysimpact mediumeffort medium
Route wheel, secondary, extra buttons, touch and gestures through overlay hosts the same way as windows (shared dispatch helper).
Chord tests and grammar convergenceimpact mediumeffort low
Add table-driven tests for Chord matching across KeyPlatform × layouts, and unify plus/{ handling with Shortcut.
Numbers, key files, roadmap and the verifier's additions
Numbers
Lines in scope
~13,960 (runtime/input 6,373; input 1,795; shortcuts 1,702; a11y 2,246; cursor 556; drag_out 796)
Unit tests in scope
200 (focus 31, physical 15, a11y 18, drag_out 17, shortcuts 17, modifier_keys 12, drop 12, input_click 12, live_only 13, on_key 11, …)
Integration tests touching input
~61 plus 8 GUI-only harnesses; rune-kit a11y 23 tests, 26 goldens
Action variants
36
Runtime fields input-related
~78 of ~239
Live-only pinch (6,000 elements, 2x)
13.7 ms → 2.0 ms CPU/frame; 42,124 → 78 allocations/frame
Cursor image cache
32 entries, 8 MiB, 256 px max side
Thresholds
click slop 4 pt; drag-out 4 pt (8 pt Linux); touch slop 8 pt; fling hold 0.1 s; type-select reset 1 s; pinch wheel 200 pt per unit
a11y limits
content name 400 bytes; text runs off above 64 KiB; word starts ≤255 per line
chord.rs tests
0
a11y commits / age
4 commits, landed 2026-11-04
Key files
crates/rune/src/runtime/input/action.rs Action enum (36 variants), ActionQueue with arrival stamps, live_only_handler, dispatch_action, Tx merge, order_drag_ends
crates/rune/src/runtime/input/pointer.rs press/capture/release, double press, drag phases, drag-out start, cancel_drag, cursor resolution, wheel/fling entry, scroll_cancels_press
crates/rune/src/runtime/input/hit.rs hit registration during build, top_target/primary_target, to_local, turned-layer hit math, live_index, textbox_input
crates/rune/src/runtime/input/hover.rs hovered/hover_within/delays, hover hold under moving layout, hover_alone/shared groups, update_interaction (hover/press/press-scale tracks)
crates/rune/src/runtime/input/focus.rs focus model: can_focus, modal index/stack, tab_order, groups, type-select, default button, slider steps, sync_requested_focus; 31 inline tests
crates/rune/src/runtime/input/keys.rs route_key order, page_scroll, focused-field editing, paste routing, linear node(path) lookup
crates/rune/src/runtime/input/physical.rs physical+logical key queueing, held_gate, on_physical_input, Unhandled fallbacks, modifier observation at rest
crates/rune/src/runtime/input/gesture.rs on_wheel chain and gesture lock, magnify/rotate/smart magnify, Ctrl+wheel pinch, extra buttons, key-up routing, IME key-up eating
crates/rune/src/runtime/input/touch.rs single-finger touch: tap presses, slop 8pt, drag vs pan, fling within 0.1s
crates/rune/src/runtime/input/drop.rs file drag-in targeting, hover/move/reject callbacks, hold_files for stale trees
Roadmap items
  • Fix sync_modals to cancel a held drag (send Phase::Up cancelled) and add a test
  • Restrict a11y 'pressable' to press handlers; add ScrollRight to dump ACTIONS; add a drawn-generation to the a11y stamp
  • Refresh README 'Differences from PLAN.md', the on_key_up docs and the a11y/drag_out module docs
  • Add table-driven Chord/Keybind tests per KeyPlatform and layout; converge plus/{ grammar with Shortcut
  • Switch per-action path lookups to path_ids+node_index; add per-commit index lists for hover/scroll/gesture nodes; linearize tab_order
  • Record a11y_cost on --profile perf in the README
  • Give overlays wheel, secondary, buttons, touch and gesture parity
  • Move input state into owned subsystem structs; move inline tests to sibling files
  • Drag-out on Windows (DoDragDrop) and Linux; multi-touch gestures
  • Unify the web semantic mirror with the AccessKit tree; wire iOS/Android adapters
Found by the verifier
Medium
Overlays never claim macOS secure input
SecureInput (EnableSecureEventInput) is driven only by the window host's sync_platform. Overlay hosts never touch it. A secure field focused in a key overlay panel (a login popover, a palette) types without secure event input, so other processes can observe the keystrokes.
crates/rune/src/window/platform_sync.rs:8-12; crates/rune/src/input/secure_input.rs:1-20; no reference to secure_input or has_secure_focus in crates/rune/src/overlay/
Medium
Overlays have no IME
overlay/any_host.rs has no WindowEvent::Ime arm and never calls set_ime_allowed; only the window host does. The layer-shell Input enum has no IME either. Text fields in overlays (command palettes, popovers) can't compose CJK, and rt.ime_area is ignored there.
crates/rune/src/overlay/any_host.rs:97-156; crates/rune/src/window/events.rs:373-383; crates/rune/src/window/platform_sync.rs:12; crates/rune/src/platform/layer_shell.rs:31-34
Medium
Wayland startup shortcuts block the first frame
Host::new attaches the shortcut Guard, which registers every pending startup shortcut one by one on the main thread before the first frame. On Wayland each registration creates its own portal session and blocks on a sync channel until the portal answers, up to the 120 s consent timeout. N startup shortcuts can mean N serial consent waits before anything draws. shortcuts/README.md documents this, but it conflicts with the repo's 'start slow work from on_ready' rule.
crates/rune/src/window.rs:479; crates/rune/src/shortcuts/service.rs:248-252,125-139; crates/rune/src/shortcuts/wayland.rs:13,47,160-163; crates/rune/src/shortcuts/README.md:75-77
Low
Mouse and trackpad drags carry no release velocity
Drag has no velocity field and no Tx API gives one, so an on_drag release cannot hand measured velocity to a spring as PLAN.md:270 says. Only touch pans fling. Apps that throw cards or sheets must compute velocity themselves from dx and dy over time.
crates/rune/src/el.rs:62-83; crates/rune/src/runtime/input/pointer.rs:430 (fling is scroll-only); PLAN.md:269-270
10

Platform shells and windows: macOS, Windows, Linux (X11/Wayland/layer-shell), iOS embed, overlays, menus, tray, dialogs

working

Rune runs on winit 0.30.13 everywhere except iOS and adds about 11k lines of per-OS code on top (5.6k for macOS alone). Much of it reaches under winit: class patching, view transplants and HWND/wl_display hijacks. It works and shows real-use hardening, but it is fragile, uneven across platforms, and no CI runs it.

Summary (603 words)

This area is everything between the OS and Runtime<S>. It covers the shared winit event loop (Windows, an ApplicationHandler over Vec<Option<Box<dyn AnyHost>>>), app-window hosts (window::Host) and overlay hosts (overlay::Overlay), GPU surface setup, frame pacing, chrome, and OS services: menus, pop-ups, tray, file dialogs, clipboard, URLs, prefs and folders. Web (platform/web.rs) and iOS (embed::LayerHost) have their own hosts, and desktop.rs is a headless stand-in for a desktop of windows. Scope is about 28.7k lines with about 278 unit tests.

How much rides on winit: the event loop, window creation, all ordinary input (keys, mouse, wheel phases, touch and gestures), IME preedit and commit, scale factors, monitors, theme, cursor, and on the web rAF and resize. Rune's own code adds the rest. On macOS: non-activating NSPanels, one CVDisplayLink per surface with an admission policy and a Low Power cap, presentsWithTransaction, native Glass/Popover materials synced in the drawable's CA transaction, a drag destination with positions and file promises, app and Dock menus, NSMenu pop-ups, traffic lights, drag regions, Apple-event URLs and reopen. On Windows: a custom frame (WM_NCCALCSIZE plus Rune-drawn caption buttons), a first-frame cloak, layered no-activate overlays with a low-level mouse hook, TrackPopupMenuEx, the tray, and a VRR steady-present window. On Linux: layer-shell overlays and xdg-activation on winit's wl_display in private queues, an XWayland overlay fallback for GNOME, X11 SHAPE and XI2, and zbus portals plus a StatusNotifierItem tray.

The main design issue is how this attaches. Rune doesn't wrap winit; it patches it. panel_bridge.rs adds 15 methods to winit's KVO'd NSWindow class, with naked-asm trampolines that check the caller's return address against Rune's own __TEXT segment. appearance.rs swaps the implementation of WinitWindowDelegate's KVO observer. reopen.rs and standard_macos.rs add methods to winit's delegate and WinitView classes by name. winit's content view is isa-swizzled up to four times. On Windows, winit's HWNDs are subclassed. Each hook depends on winit 0.30 internals, and the recovery code (view reattach in sendEvent:, lost-click grace timers) shows they fail in practice. This diverges from research/11 ("do not build on winit") and from PLAN.md:32 ("own shells once text input lands"). Text editing has landed, but the shells were not written.

Parity is uneven. macOS has everything except a tray (tray.rs:9, no NSStatusItem anywhere). Windows lacks a native menu bar and drag-out. Linux lacks pop-up menus and menus. Wayland also lacks file drops, positioning and dialog parenting. Web is a single canvas with its own textarea IME mirror and a DOM a11y mirror. iOS is embed-only, with no text input, a11y or clipboard. IME is winit's on every native platform: macOS without document context, Windows IMM32 rather than TSF.

Measured numbers: research/30 puts an empty overlay at ~1,555 kinstructions per frame against 850 for hand-written Metal, because wgpu commits 6 command buffers per frame. Research/26 puts synced Glass at 1.8% of moving frames off by more than 4 px, with 3.2 ms of CPU per frame and about 80 fps under the stock pacer. The changelog records overlay quiet frames going from 4.6% to 0.7% CPU, and on Windows, choosing the GPU that drives the display saves ~180 MB and cuts surface creation from 50–160 ms to 6 ms.

Maturity: solid on macOS (22 opt-in GUI tests), working on Windows and Linux, experimental on web, a spike on iOS. No CI runs any tests. Docs have drifted from the code in many places: README "Differences from PLAN.md", the Wayland overlay notes, WEB.md on WebGL, and the PLAN.md section 13 follow-ups. The main opportunities are an own macOS shell, one shared host core, a shared per-display link, a macOS tray, CI, and an own KeyCode type to decouple the public API from winit.

Why this maturity: macOS is solid, with real-use hardening and 22 opt-in GUI tests. Windows works, with real-device fixes in the changelog. Linux works but has gaps, checked under headless sway. Web is experimental but Playwright-proven. iOS is an embed-only spike. Its central coupling to winit internals is fragile, and no CI runs any tests.

Issues, most severe first
High
macOS panel bridge patches winit's NSWindow class and gates calls by caller return address
15 forwards are added with class_addMethod to winit's KVO'd window class. Naked-asm trampolines read x30 or [rsp] and compare it with Rune's __TEXT segment to decide whether contentView and the frame setters see the moved view or move the panel. This depends on objc_msgSend tail-calling, link mode and winit 0.30 class layout. The recovery code (sendEvent: reattach, keep_view, 2 s lost-Up grace) shows it fails in practice.
crates/rune/src/platform/macos/panel_bridge.rs:93-163,240-258; platform/macos.rs:56-62,668-677,295-317
≈ Partly The mechanism is accurate. There are 15 forwards; six are gated by the caller's address through naked-asm trampolines (x30 on arm64, [rsp] on x86_64): contentView, setFrame:display:, setFrameOrigin:, setContentSize:, setLevel: and setIgnoresMouseEvents:. Each is checked against the __TEXT range of Rune's image. Two parts of the claim are wrong. (1) The methods go on the class that -class returns, which is winit's declared WinitWindow below the KVO subclass, not on the KVO class. A 16th method, hitTest:, goes on winit's view class. (2) The recovery code does not show that the gated design fails in practice. Commit dced44f6 added sendEvent: reattach, keep_view and the 2 s grace as a backstop, in the same change that fixed the earlier ungated bridge (ReplayKit's setStyleMask: pulled the view out). The GUI test macos_overlay_source asserts reattach_count() stays 0 under ReplayKit and setStyleMask: restyles.
High
No CI runs any tests on any OS
The only workflows deploy the site. Win32 subclass procedures, Wayland private queues, X11 SHAPE and all macOS GUI tests run only by hand; the GUI tests need RUNE_GUI_TESTS=1.
.github/workflows/{site.yml,www.yml}; crates/rune/tests/secondary_window.rs:37-41; README:1988-1989
≈ Partly www.yml is more than a deploy. It runs on every push and PR that touches crates/**. On ubuntu it compiles rune natively, including the X11, Wayland and layer-shell code, and for wasm32, then runs cargo test -p rune-www. The build uses default-features=false, so AccessKit, D-Bus, tray, portals and metal-backend are never compiled. No rune or rune-kit tests run, nothing is built for Windows or macOS, and GUI tests need RUNE_GUI_TESTS=1.
Medium
Hard-coded winit internals make any winit upgrade high risk
Class names and delegate behaviour are assumed: WinitWindowDelegate KVO implementation swap, WinitView menu actions, app-delegate reopen injection, foreign wl_display backends. Nothing tests these across winit versions.
platform/macos/appearance.rs:33-43; native_menu/standard_macos.rs:52,75; platform/reopen.rs:94-110; platform/layer_shell.rs:375-378
✓ Confirmed
Medium
CVDisplayLink created and destroyed per surface, against research's crash warning
Each window and overlay owns a link that is stopped and released on drop. Research/11 cites CoreVideo teardown segfaults and recommends immortal per-display links. macOS overlays with release_gpu_when_hidden recreate their window and link on every show. N surfaces means N high-priority CV threads.
platform/display_link.rs:104-128,196-198; overlay.rs:880-910; research/11-platform-shells.md:113-115
✓ Confirmed
Medium
Text input is winit's on every native platform; native protocols not started
macOS NSTextInputClient without document context (no reconversion, no context-aware input), Windows IMM32 rather than TSF, no iOS text input. PLAN names text input the top risk and promised native protocols at M2.
window/events.rs:418-425; PLAN.md:27,32,525,570; research/11-platform-shells.md:34-41
✓ Confirmed
10 more verified issues
Medium
No macOS tray on the lead platform
Tray::new returns Unsupported on macOS; no NSStatusItem exists in the repo, though research/11 asked for it first-class.
crates/rune/src/tray.rs:9,93-99; research/11-platform-shells.md:131
✓ Confirmed
Medium
Wayland layer surface creation blocks the UI thread
LayerSurface::new loops on blocking_dispatch until the compositor configures or closes the surface, so a stuck compositor hangs the app.
platform/layer_shell.rs:405-411
✓ Confirmed
Medium
Five host implementations duplicate the frame loop
window::Host, overlay::Overlay, web Browser, embed::LayerHost and desktop Member each own clock, retry and present logic; fixes land per host (quiet pacing reached overlays later). LayerHost reconfigures without window::configure's error scope.
window.rs:324; overlay.rs:315; platform/web.rs:274-590; platform/embed.rs:153-229; changelog/unreleased/2026-10-31-quiet-pacing.md
≈ Partly Four hosts own a loop, not five. Desktop Member renders offscreen with a passed-in dt and has no clock, retry or present. FrameClock, SurfaceMeter, HiddenPace, Missed::retry and acquire_checked are already shared by the window and overlay hosts. The 'fixes land per host' point holds: the quiet-frame skip (Presented) never reached web Browser or LayerHost. LayerHost calls surface.configure directly on Outdated or Lost, without window::configure's error scope.
Medium
rune_mac::remember_frame names every app window
It sets one autosave name on every window in NSApp.windows, including overlay panels and the hidden source windows panel adoption leaves. AppKit gives the name to only one window, so a launcher or panel app may save the wrong frame. It returns true as soon as any window exists.
crates/rune-mac/src/lib.rs:15-28; platform/macos.rs:634
✓ Confirmed
Low
Public API leaks winit types
PhysicalKeyCode is winit::keyboard::KeyCode, and raw_window_handle is re-exported, so replacing winit would break apps.
shortcuts/keys.rs:3; lib.rs:295,347
≈ Partly PhysicalKeyCode = winit::keyboard::KeyCode is a real leak. raw_window_handle is the independent raw-window-handle 0.6 crate, reached through winit. Rune could re-export it directly with identical types, so that part need not break apps.
Low
Wayland and Linux parity gaps
No file drops (winit 0.30), unparented portal dialogs, no positioning, no capture exclusion, no pop-up menus on Linux at all.
file_dialog/portal.rs:19-33; popup_menu/mod.rs:38,49; README:1612-1613
✓ Confirmed
Low
X11 connection churn
pointer_position and output_crtc open a new X connection per call; each overlay InputWindow and MouseWatch holds its own; the XI2 thread does a QueryPointer round trip per raw motion event.
platform/x11/overlay.rs:46,108-119; platform/x11/pointer.rs:14,24-28
✓ Confirmed
Low
Many docs no longer match the code
README 'Differences from PLAN.md' says no AccessKit, no glass underlays and wgpu on macOS. README says non-activating panels are unimplemented, interactive Wayland overlays are unavailable, non-key panel hover is unsupported, and Windows is clippy-only. WEB.md says there is no WebGL fallback. PLAN.md §13 lists the a11y mirror as follow-up. README describes the mac-app relaunch order wrongly. All are contradicted by the code.
crates/rune/README.md:806,1731-1733,1978,1989,1991,2812-2821; WEB.md:230; PLAN.md:616; scripts/mac-app.md:3-6; platform/layer_shell.rs:63-189; Cargo.toml feature webgl
✓ Confirmed
Low
Files over the 800-line soft cap
overlay.rs has 1,097 and platform/macos.rs 828 non-test lines (file-size.sh warns). overlay.rs also uses redundant #[path] attributes.
scripts/file-size.sh output; crates/rune/src/overlay.rs:44-60
✓ Confirmed
Low
Win32 low-level hook removal goes unnoticed
supported() reports only that the hook installed. Windows silently removes LL hooks that time out, and overlay pointer following would stop without notice.
platform/win32/pointer.rs:40-55
✓ Confirmed
Strengths
  • Hardened by real use: fixes for KVO NSNull aborts, ReplayKit restyling, Space rejoining, macOS 26 traffic-light relayout, Low Power Mode 60 Hz caps, NVIDIA XWayland surface refusal, Windows cross-adapter swapchains and VRR brightness swings
  • Careful frame pacing: coalesced display-link ticks, burst-free admission, draw-at-once after rest, no Poll spin on occlusion, quiet timer frames that present nothing (overlay CPU 4.6% to 0.7%)
  • Native materials synced with the Metal drawable in one CATransaction, with measured results (research/26)
  • Wide overlay support: NSPanel, Win32 tool window, X11 override-redirect, Wayland layer-shell, XWayland fallback for GNOME, with regions, capture exclusion and pointer following where the OS allows
  • Modal native UI (menus, dialogs) kept off winit's handler, so frames, springs and timers keep running while menus track
  • Every OS service has a headless or scripted form (menus, pop-ups, file dialogs, drops, URLs, --desktop composites), so agents can test platform behaviour without a window server
  • Drop order and native life cycles documented in code comments at each load-bearing point
  • Pure-logic parts (pacing admission, pointer capture recovery, trampoline registers, material assignment) have focused unit tests
Key concepts
  • AnyHost: Trait the shared winit loop drives (window.rs:102). Implemented by window::Host<S> and overlay::Overlay<T>; slots never reused; keeps_loop decides app exit.
  • WakeEvent: The user event every cross-thread request becomes (window.rs:83): App, Live, Window, Focus, Position, Level, Place, Frame, DisplayTick, A11y, Reopen, Turn.
  • Panel adoption: On macOS, winit's content view (with the wgpu CAMetalLayer) moves from winit's NSWindow into a RuneOverlayPanel NSPanel. panel_bridge forwards winit's readbacks to the panel.
  • Caller-image gating: Naked-asm trampolines pass objc_msgSend's return address to Rust. Only messages from Rune's own __TEXT image see the moved view or move the panel (panel_bridge.rs:93-163).
  • DisplayLink Opportunity: Tick(target) / Now (rested surface draws at once) / Wait; admission refuses a tick under half a period after the last present; Low Power 60 Hz cap.
  • PresentFlag: Single owner of CAMetalLayer.presentsWithTransaction: on only while the window frame animates, materials show, or a live resize runs.
  • Occlusion pre-check: macOS skips get_current_texture on occluded surfaces, because wgpu-core 30.0.1 leaks a texture id per failed acquire.
  • Backing: Overlay surface kind: winit Window, Wayland layer surface, or XWayland window; parked (no GPU) while hidden with release_gpu_when_hidden.
Opportunities
Own macOS shell behind AnyHostimpact higheffort highre-architecture
Rune-owned NSApplication delegate, RuneWindow and RunePanel classes, and a RuneView implementing NSTextInputClient and NSDraggingDestination. This removes panel_bridge, the KVO patch, reopen injection, the drop, drag-region and traffic-light swizzles and the click recovery, and gives document-aware IME. Keep winit for Windows, Linux and web. Order: RuneView and text input first, then panels, then the run loop.
Extract a shared SurfaceHost coreimpact higheffort mediumre-architecture
Clock, retry and backoff, HiddenPace, meter, acquire and miss handling, quiet frames, and present (main thread, worker or CA transaction) shared by window, overlay, web, LayerHost and desktop hosts, with a small Backing trait for each surface kind.
Shared per-display display link (or CADisplayLink on macOS 14+)impact mediumeffort medium
Immortal per-CGDirectDisplayID links fanning ticks out to surfaces, or CADisplayLink per screen (a probe exists in scripts/native-pacing). Avoids create and destroy on each overlay show, cuts CV threads, and is a chance to revisit the half-period admission that holds Glass near 80 fps.
Add CI on Linux and Windows, and a macOS self-hosted runnerimpact higheffort medium
cargo test plus a short RUNE_GUI_TESTS smoke under headless sway or Xvfb with lavapipe (already documented in the README), and a Windows runner; the macOS GUI suite on a self-hosted Mac.
macOS NSStatusItem trayimpact mediumeffort low
Implement the existing Tray API with NSStatusItem and NSMenu on macOS; closes the most visible gap on the lead platform.
Ship the wgpu present patches or bypass wgpu's surface on macOSimpact mediumeffort medium
Research/30: 6 to 2 command buffers per frame, about 28% fewer process instructions for overlays. Re-measure with metal-backend first.
Decouple the public API from winitimpact mediumeffort low
An own KeyCode enum and Rune's own raw-handle trait, before more apps depend on winit types.
Close cheap Linux and Wayland gapsimpact mediumeffort medium
xdg-foreign-v2 parenting for portal dialogs; wl_data_device file drops on the existing private-queue pattern; Rune-drawn or xdg_popup pop-up menus; an asynchronous layer-surface configure.
Share one X11 connection per processimpact loweffort low
One x11rb connection for overlays, pointer queries, RandR and shortcuts; take root coordinates from XI2 Motion events instead of a QueryPointer per raw event.
Fix the doc drift and split the oversized filesimpact loweffort low
Update the README differences, overlay and mac-app sections, WEB.md and PLAN §13. Split overlay.rs (placement, presence and fade, parking) and platform/macos.rs (panel, pointer state, geometry).
Numbers, key files, roadmap and the verifier's additions
Numbers
Lines in scope (incl. tests)
~28,700
Unit tests in scope (#[test])
~278
GUI integration tests (harness=false, opt-in)
22, mostly macOS
macOS-specific lines
~5,600
Windows-specific lines
~1,800
Linux-specific lines (X11, Wayland, portals, SNI)
~2,250
Web lines (Rust + JS)
~1,760 (637 JS)
iOS lines
285 (platform/embed.rs)
Files in src depending on winit
85 files, 183 'winit::' references
unsafe occurrences in platform/
283 (199 msg_send)
winit version
0.30.13
Overlay frame cost vs hand-written Metal (research/30)
~1,555 vs ~850 kinstructions/frame; 6 vs 1 command buffers
Synced Glass mis-registration (research/26)
1.8% of moving frames >4 px off (29% unsynced); 3.2 ms CPU/frame median
Quiet-frame overlay CPU (changelog)
4.6% to 0.7% for a 30 Hz no-op wake
Key files
crates/rune/src/window.rs Shared event loop: WakeEvent, AnyHost trait, Windows ApplicationHandler, Host<S> struct, surface_config (AutoVsync, frame latency 2, COPY_SRC)
crates/rune/src/window/event_loop.rs run/run_windows: window-server session check, GPU prewarm, accessory policy, Turn idle hook for modal menus
crates/rune/src/window/create.rs Window creation order: cloak and custom frame (Win), a11y adapter, panel adoption, drop install, GPU pool reuse, first frame drawn synchronously on macOS
crates/rune/src/window/events.rs Translates winit WindowEvents (keys, IME, wheel, gestures, file drops, resize/live-resize, occlusion, focus) into Runtime calls
crates/rune/src/window/pacing.rs Missed-frame backoff, HiddenPace, timer deadlines, acquire() with the macOS occlusion pre-check (wgpu-core texture id leak)
crates/rune/src/platform/macos.rs OverlayPanel NSPanel subclass, Panel view adoption, PointerState click and capture recovery, occlusion, PresumeShown layer delegate swap, frame geometry
crates/rune/src/platform/macos/panel_bridge.rs Most fragile code: class_addMethod forwards on winit's NSWindow class, naked-asm trampolines gated on the caller's image
crates/rune/src/platform/display_link.rs Per-surface CVDisplayLink pacing: coalesced ticks, Tick/Now/Wait admission, Low Power 60 Hz cap
crates/rune/src/platform/macos/appearance.rs Swaps the implementation of WinitWindowDelegate's KVO observer to survive NSNull appearances (ReplayKit)
crates/rune/src/system_material/macos.rs NSGlassEffectView/NSVisualEffectView under the Metal layer, moved in the drawable's CATransaction
Roadmap items
  • Add CI: Linux (headless sway or Xvfb with lavapipe) and Windows runners for cargo test plus a RUNE_GUI_TESTS smoke; macOS GUI suite on a self-hosted runner
  • Fix the doc drift (README differences, overlay, mac-app and panel sections; WEB.md WebGL; PLAN §13) so the docs match the code
  • Replace per-surface CVDisplayLinks with a shared per-display link or CADisplayLink, and revisit the half-period admission for Glass
  • Implement the macOS NSStatusItem tray behind the existing Tray API
  • Make Wayland layer-surface configure asynchronous; add xdg-foreign dialog parenting and wl_data_device drops
  • Extract a shared SurfaceHost core used by window, overlay, web, LayerHost and desktop hosts
  • Introduce an own KeyCode type and a raw-handle trait to decouple the public API from winit
  • Decide on the own macOS shell (RuneView with NSTextInputClient first) and either harden or retire panel_bridge
  • iOS: touch and UITextInput bridge helpers and a Swift RuneView wrapper for LayerHost
  • Upstream or bypass the wgpu present patches (research/30) after re-measuring with metal-backend
Found by the verifier
Medium
winit is a caret dependency, not pinned, while Rune patches its internals
crates/rune/Cargo.toml requires winit '0.30.13', which Cargo reads as ^0.30.13. The notes call this a pin. Apps that pin a Rune rev still resolve winit in their own Cargo.lock, so cargo update can bring in a 0.30.x that the class-name, KVO, delegate, WinitView and foreign wl_display hooks were never checked against. Most hooks then disable themselves silently: panel adoption returns None, or the reopen and menu hooks skip. wgpu, by contrast, is held at ~30.0.1. Pinning =0.30.13 would tie the hooks to the version they were written for.
crates/rune/Cargo.toml:65 (wgpu '~30.0.1') vs :67 (winit '0.30.13'); Cargo.lock:5084-5085; panel_bridge.rs:182-192; appearance.rs:35-40; reopen.rs:102-104
Medium
Wayland and XWayland overlays are torn down on every hide and rebuilt, blocking, on every show
Hiding a Layer or Xwayland overlay drops Live, and showing it calls LayerSurface::new again. That repeats a blocking registry roundtrip (registry_queue_init), new binds, a blocking_dispatch loop until configure, a new wgpu surface and a new rune-layer-watch thread; the old thread is not joined and lingers for up to about 350 ms. Issue 7's UI-thread hang risk and its latency therefore apply to every show of a frequently shown HUD, not only to creation.
overlay.rs:713 ('Backing::Layer(_) | Backing::Xwayland(_) => { self.live.take(); }'), :719-742; platform/layer_shell.rs:378,405-411,315-343; crates/rune/README.md:1976-1977
Medium
The macOS present path now forks between the native Metal backend (default) and wgpu, and the notes describe only the wgpu path
metal-backend is a default feature, and Mac apps draw with it unless they opt out. On that path the overlay 'rune present' worker is never used (it is gated on !gpu::native), wgpu-core is bypassed through the custom backend, and with_layer finds the CAMetalLayer by a different route. The notes' present and threading description, the wgpu-core 30.0.1 texture-id leak rationale, and opportunity 6 (research/30's wgpu patches) apply only to the GpuBackend::Wgpu opt-out, to iOS, and to default-features=false builds such as CI. Platform fixes (occlusion, PresumeShown, materials transactions) must be checked on both paths, and CI builds neither on macOS.
crates/rune/Cargo.toml default features and metal-backend comment; changelog/unreleased/2026-10-31-metal-default.md; overlay/frame.rs:113-114; gpu.rs:18-43; gpu/backend.rs:83-87
Low
Web and embedded (iOS) hosts never got the quiet-frame skip
Since the quiet-pacing change, the window and overlay hosts record a Presented snapshot and present nothing when a timer frame's pixels match the last frame. Web Browser presents on every redraw it is asked for. LayerHost::frame always acquires, renders and presents, and reports drew: true, so an embedded iOS view woken by wake_after_secs, or a web page with a timer, redraws identical frames. This is a concrete case of issue 8's 'fixes land per host', with battery cost on iOS.
overlay/frame.rs:10,37-51 and window/draw.rs:1 (Presented, quiet frame); platform/web.rs:532-548 (no Presented); platform/embed.rs:157-229 (always presents)
11

Media: images, video, audio playback, recording, native surfaces

working

A content-addressed image cache with linear-light mips feeding a per-runtime CPU/GPU atlas, plus a latest-wins NativeSurface video pipeline. Playback (AVPlayer, zero-copy IOSurface) and recording (AVAudioRecorder) run on macOS only; other platforms get images and byte surfaces, and on web a drawn surface ends the app.

Summary (558 words)

Media is about 6,400 production lines across image.rs/image/, pixels.rs, native_surface/, video/ and recorder/, plus ~3,100 test lines and 127 lines of WGSL.

Static images: ImageCache (image.rs:142) is a blake3 content-addressed map of Weak<State>. Requests go over an unbounded mpsc to min(4, cores) "rune-images" threads (image.rs:137,159). The image crate is built with png+jpeg only (Cargo.toml:76), resvg handles SVG/SVGZ (svg feature), and platform icons come from NSWorkspace, PrivateExtractIconsW or XDG. Decodes are capped at 8192² and a 256 MiB decoder alloc, then turned upright by EXIF and built into a linear-premultiplied mip chain with sRGB lookup tables (image/mips.rs). A decoded image lands in Pixels, which the paint walk copies into a per-runtime ImageAtlas (1024² shelf pages, or exact-size standalone pages up to 8192), picking the smallest mip that covers the drawn size (pixels.rs:249-293). Dirty row spans are then uploaded (render/upload.rs:129). On web, the browser fetches and decodes (createImageBitmap) and mips are built in slices between tasks.

Native surfaces: NativeSurface (native_surface/mod.rs:146) is a single-slot latest-wins mailbox. SurfaceRenderer (pipeline.rs) imports frames as follows: - CPU byte frames (BGRA/NV12): uploaded into a new texture per frame. - macOS IOSurface CVPixelBuffers: zero-copy through CVMetalTextureCache, on either wgpu-hal or the native Metal backend. - Windows D3D shared textures: one GPU copy into a new owned texture per frame, then a fence signal.

It draws in painter order inside the UI pass with YCbCr->linear conversion, exact 1:1 texel loads, orientation, mirroring, and clips and corners. A per-renderer completion thread provides submit, completion and GPU-pass timing.

Player: the handle records intent; each frame that draws the clip pulls on the UI thread. On macOS this means AVPlayer + AVPlayerItemVideoOutput (420v IOSurface) at the display-link target, a poster from AVAssetImageGenerator on a per-clip worker (max 1920 px), and 4 parked players. Audio uses a 20 Hz main-queue tick, and Ogg/WebM audio is decoded by symphonia/opuscule to a temp WAV. Headless runs are deterministic and silent. Every other platform reports Failed. Recorder: AVAudioRecorder on its own thread, meters at 30 Hz, an attempt counter for stale reports, and FakeMicrophone for headless runs.

Key risks: 1. On web, any drawn NativeSurface, including a failed Player's placeholder, ends the app (platform/web.rs:521). The docs promise a placeholder. 2. iPhone HDR/BT.2020 clips likely fail once playing. No colour conversion is requested, and info() rejects any matrix or transfer other than 601/709 and sRGB/709. 3. A playing video forces full frames at the display rate (frame.rs:740, presented.rs:64), so 24 fps content presents ~120 times a second on ProMotion. 4. The Windows shared-texture cache trusts a name after the first open, without re-checking size. 5. usvg's default resolver lets an untrusted SVG read local files, including /dev/zero, which can hang or OOM the decoder. 6. Native decode jobs hold strong Image refs, so dropped requests cannot be cancelled. 7. Memory has no overall byte bound: roughly 3 copies per drawn image (mips, CPU atlas, GPU), and decode peaks of ~0.6-0.8 GiB per 8192² image, four at a time.

Docs drift: README and module docs still say "one worker"; ImageCache::file claims WebP works natively; the video-tiles README says rotation is missing; the Windows path is absent from the README; PLAN.md's shared background pool and AVPlayerLayer underlay don't match the code.

Maturity: working. The macOS path is solid and well tested (~110 unit tests, GPU tests on both backends, a GUI integration test). Cross-platform media is thin.

Why this maturity: macOS images, zero-copy video, audio and recording are carefully engineered, with ~110 unit tests, GPU tests on both backends and a GUI integration test. But other platforms get only images and byte surfaces, web ends the app on any drawn surface, HDR likely fails, playing video presents at the display rate, the Windows shared-texture path has no tests, and memory bounds are implicit rather than enforced.

Issues, most severe first
High
Web: any drawn NativeSurface ends the app
The web shell errors and ends the event loop when rt.surfaces is non-empty, and SurfaceRenderer::new panics on wasm. A Player fails at creation on web and then pushes a grey placeholder, so a cross-platform app showing el().video() stops on web. Docs promise a placeholder.
crates/rune/src/platform/web.rs:521-522; crates/rune/src/native_surface/pipeline.rs:84-87; crates/rune/src/video/mod.rs:26,570-573; crates/rune/README.md:1903-1904
✓ Confirmed
High
HDR/BT.2020 sources likely fail once playing
The video output requests 420v without AVVideoColorPropertiesKey, so buffers probably keep BT.2020/HLG attachments. PixelBuffer::info rejects any matrix but 601/709 and any transfer but sRGB/709, and pull then fails the clip. The poster path converts via CGImage, so the poster shows and play then fails. Not verified on hardware; no HDR fixture.
crates/rune/src/video/macos.rs:504-511,778-784; crates/rune/src/native_surface/macos.rs:95-110
≈ Partly The failure path is real: info() rejects any matrix but 601/709 and any transfer but sRGB/709, then pull calls c.fail and drops the player. Posters go through an sRGB CGBitmapContext. Whether a 420v AVPlayerItemVideoOutput keeps BT.2020/HLG attachments is still unverified. The proposed fix also needs initWithOutputSettings:, because AVVideoColorPropertiesKey is an AVVideoSettings key, not a CVPixelBuffer attribute. Colour primaries are never checked at all.
High
A playing video presents at the display rate regardless of clip frame rate
videos_active marks the frame animating, every frame re-runs the paint build, and a frame with surfaces is never treated as 'same', so a 24 fps clip on 120 Hz presents ~120 frames/s. hasNewPixelBufferForItemTime is checked but doesn't throttle the frame loop.
crates/rune/src/runtime/frame.rs:740; crates/rune/src/window/presented.rs:64; crates/rune/src/video/macos.rs:772
✓ Confirmed
Medium
Windows shared-texture cache doesn't re-validate a reused name
Importer::texture returns a cached ID3D12Resource by name without checking its size; only the first open validates. A producer reusing a name at a new size breaks the SAFETY contract of texture_from_raw (wrong-size copy or validation error), and a recreated texture shows stale content.
crates/rune/src/native_surface/windows.rs:145-164,116-117
✓ Confirmed
Medium
Untrusted SVG can read local files or hang the decoder
svg_rgba uses usvg::Options::default(), whose href resolver fs::reads any existing path. Nested SVG files render; /dev/zero or a FIFO would hang or OOM a decoder thread (catch_unwind can't help). Relevant for markdown or web content passed through ImageCache::load/load_mime.
crates/rune/src/image.rs:432-446; usvg-0.45.1/src/parser/image.rs:85-113
✓ Confirmed
12 more verified issues
Medium
Native decode requests cannot be cancelled and run FIFO
Job holds a strong Image, so dropped requests still decode and hold memory; a fast scroll queues every passed thumbnail ahead of the visible ones. Web checks wanted().
crates/rune/src/image.rs:134,280,285-296
✓ Confirmed
Medium
Decode memory peaks are unbounded across workers
For an 8192² image, the decoded RGB plus into_rgba8 (256 MiB) plus the mip-0 copy (256 MiB) plus mips (~85 MiB) come to ≈0.6-0.8 GiB transient, with up to 4 decodes in parallel. image::Limits covers only the decoder's own buffers. The changelog's 341 MiB peak is for the mip chain alone.
crates/rune/src/image.rs:610-624; crates/rune/src/image/mips.rs:29; CHANGELOG.md:250-255
≈ Partly into_rgba8 moves an RGBA image without copying, and it frees the RGB buffer before mip_chain runs, so the RGB buffer and the mips never coexist. The peak is about 256 MiB (RGBA) + 256 MiB (mip-0 copy) + 85 MiB (smaller mips) ≈ 0.58 GiB per 8192² image, not 0.8. Four workers make about 2.3 GiB.
Medium
No byte budget across image memory; ~3 copies per drawn image
The cache holds nothing strongly. Each drawn image keeps its Decoded mips, a CPU atlas copy of the drawn level (standalone pages hold full copies) and a GPU texture. Nothing counts total decoded bytes, despite AGENTS.md asking caches to be bounded in bytes.
crates/rune/src/pixels.rs:249-293,346-352; crates/rune/src/render/upload.rs:129-151
✓ Confirmed
Medium
Per-clip poster threads with no concurrency cap, and full-size CPU posters retained
request_poster spawns a thread per clip (100 tiles open 100 AVAssets at once). Posters are up to 1920² BGRA regardless of drawn size and stay in CPU memory on the surface after upload. Playing players are not capped.
crates/rune/src/video/macos.rs:28,445-498,916-926; crates/rune/src/native_surface/pipeline.rs:23-26
✓ Confirmed
Medium
Per-frame GPU allocations on surface paths
Byte frames create a new texture per frame, the Windows path creates an owned texture per frame, each new imported frame gets a new uniform buffer and bind group, and timed submits allocate two buffers.
crates/rune/src/native_surface/pipeline.rs:299-336,487-498,565-592; crates/rune/src/native_surface/windows.rs:134
✓ Confirmed
Medium
Ogg/WebM audio read whole into memory with no cap, via a synchronous deprecated fetch
fetch reads the entire file or URL (NSURLConnection sendSynchronousRequest) before decoding to disk; there is no streaming and no input size limit.
crates/rune/src/video/macos.rs:284-303; crates/rune/src/video/foreign.rs:182-213
✓ Confirmed
Medium
UI-thread blocking in media APIs
load/rgba hash the whole buffer on the caller thread. Recorder::stop and the last-handle drop wait up to 5 s (the docs say 'a few milliseconds'). On web, load/rgba/svg decode in one main-thread task, and SVG in land_in_slices isn't sliced.
crates/rune/src/image.rs:178-181,226-234,298; crates/rune/src/recorder/macos.rs:20,200-214; crates/rune/src/recorder/mod.rs:403; crates/rune/src/image/from_url.rs:85
✓ Confirmed
Low
Docs drift on decoder count, formats, rotation and platforms
README and module docs say one worker (the code runs up to 4). ImageCache::file claims WebP works natively (only png/jpeg are compiled). The video-tiles README says rotation isn't implemented (Orient exists, but only Player can use it). The README omits the Windows push_shared path. PLAN.md describes a shared background pool and AVPlayerLayer underlays.
crates/rune/README.md:1760-1762; crates/rune/src/image.rs:1-2,140,209-210; crates/rune/Cargo.toml:76; examples/video-tiles/README.md:77; PLAN.md:119,121
✓ Confirmed
Low
Completion thread polls every 1 ms; recorder wakes at 30 Hz while paused
Background wakeups cost power while video plays or a recording is paused.
crates/rune/src/native_surface/pipeline.rs:109-116; crates/rune/src/recorder/macos.rs:275,303
≈ Partly The completion thread blocks on recv. It polls at 1 ms only until the queue drains after a submit that drew surfaces, so 1,000 wakeups/s is an upper bound. The recorder's 33 ms wake while paused is confirmed.
Low
Unclamped sizes and limits
url_set passes the listed width as the SVG raster size without clamping (a 20000w SVG asks for a ~1.6 GB pixmap). The atlas doesn't check max_texture_dimension_2d for standalone pages, whereas NativeSurface does.
crates/rune/src/image/from_url.rs:53; crates/rune/src/image.rs:437; crates/rune/src/render/upload.rs:139-144; crates/rune/src/native_surface/pipeline.rs:348
✓ Confirmed
Low
Coarse atlas uploads and contention
One dirty row span per page means two small icons far apart upload the whole 4 MiB page. The paint-time copy holds the Pixels mutex, so producers block during the UI thread's copy. Discrete mip levels pop during zooms.
crates/rune/src/pixels.rs:250-290,259-263
✓ Confirmed
Low
Structural debt
video/macos.rs (~911 production lines) and recorder/mod.rs (~812) exceed the 800-line soft cap. There are two fit implementations (place.rs and pixels::fit_in), and flat Runtime fields (videos_active, video_signature, pub images). Semi-private APIs are used: AVURLAssetHTTPHeaderFieldsKey and PrivateExtractIconsW.
crates/rune/src/native_surface/place.rs:34-51; crates/rune/src/pixels.rs:146-195; crates/rune/src/runtime.rs:378,757-759; crates/rune/src/video/macos.rs:217-218; crates/rune/src/image.rs:367
✓ Confirmed
Strengths
  • Correct linear-light premultiplied mip generation, verified against a float reference within 1/255, with slice equivalence and allocation-bound tests (image/mip_tests.rs)
  • Zero-copy IOSurface import on both wgpu-hal and the native Metal backend, with plane lifetimes tied to GPU use and tested via live_planes counts
  • Video draws in painter order with rounded corners, soft clips, opacity, mirroring, quarter-turn orientation and exact 1:1 texel loads; GPU colour is tested against a scalar YCbCr oracle on both backends
  • Decoder panics are isolated per image (catch_unwind), and EXIF orientation is applied
  • Careful resource policy for paused video: posters without players, 4 parked AVPlayers, players released on the main thread
  • Clear, lower-case error states for every unsupported path, and a microphone preflight that avoids a macOS crash
  • Deterministic headless video, audio and recording, which makes media testable in CI
  • Lock-free recorder levels plus a Live<f32> binding, so meters redraw without view re-runs
  • Videos out of sight still fold into the state signature, so scrolling doesn't commit (changelog 2026-10-30-video-scroll-commits)
  • On web, dropped requests fetch nothing and mips are built in slices (TBT ~500 ms -> ~100 ms)
Key concepts
  • Content-addressed weak cache: ImageCache maps blake3(tag+input) to Weak<State>. It holds nothing strongly, so decoded memory lives exactly as long as a handle or drawn Pixels holds it (Pixels.keep).
  • Linear-premultiplied mips: Mip 0 is premultiplied in linear light, mip 1 filters the straight source, later mips filter the 8-bit level above, all with sRGB tables. Paint picks the smallest level that covers the drawn device size.
  • ImageAtlas: Per-runtime CPU shelf pages (1024²) or exact-size standalone pages, mirrored to Rgba8UnormSrgb textures. Slots are keyed by (pixels id, mip level), copied on generation change and uploaded as dirty row spans.
  • NativeSurface mailbox: Single latest-wins frame slot shared by clones. Push never queues, the old frame drops outside the lock, and only the newest is imported at render prep.
  • Zero-copy CoreVideo import: CVMetalTextureCache wraps IOSurface planes as Metal textures. A drop guard owns the CVMetalTexture and the PixelBuffer for the GPU lifetime, on both wgpu-hal and the native Metal backend.
  • Player intent/pull split: Handles record intent in Control. Each frame that draws the clip reconciles with AVPlayer on the UI thread and pulls the buffer for the display-link target. The generation folds into a frame signature so views re-run only on state changes.
  • Posters and parking: Unplayed clips show a worker-decoded poster (<=1920 px) and hold no player. At most 4 paused players keep their AVPlayer; older ones are released.
  • Headless determinism: With no event loop, video decodes the frame at virtual time synchronously, audio time follows the thread's virtual clock, and recorders hear a FakeMicrophone and write real WAVs.
Opportunities
Frame-rate-aware video pacingimpact higheffort medium
Treat 'no new pixel buffer and nothing else changed' as an unchanged frame (include the surface's latest frame id in presented.rs::same), or schedule the next wake from Meta::frame instead of animating every vsync. This could cut a 24 fps clip from ~120 to ~24 presents/s on ProMotion.
Request SDR BT.709 output from AVPlayerItemVideoOutputimpact higheffort low
Add AVVideoColorPropertiesKey (709 primaries, transfer and matrix) to the output attributes so HDR/2020 sources convert instead of failing; add an HDR fixture test.
Web: degrade surfaces to a placeholder or an HTMLVideoElementimpact higheffort low
Drop SurfaceDraws (or draw the placeholder as an image) instead of ending the app; later, back Player on web with HTMLVideoElement + importExternalTexture.
Weak, cancellable, visible-first native decode jobsimpact mediumeffort low
Hold Weak<State> in Job, skip work nothing wants, and use LIFO or priority order so a scroll's visible rows decode first; move the blake3 hash onto the worker.
Reuse surface textures and uniform buffersimpact mediumeffort low
Keep one texture per surface per size/format for byte and Windows frames, and one uniform buffer per draw slot; pool the timestamp resolve buffers.
Harden SVG and Windows importsimpact mediumeffort low
Use a data:-only ImageHrefResolver for usvg; re-validate D3D shared textures by name and size and evict on mismatch; clamp url_set SVG widths.
Halve decode peak memoryimpact mediumeffort low
Take ownership of the decoded Vec, build mip 1 from the straight pixels, then premultiply mip 0 in place instead of copying it (mips.rs:29). Optionally gate concurrent large decodes by a byte semaphore.
Size posters to the drawn size and pool poster workimpact mediumeffort medium
Rasterize posters at the element's device size (like ImageCache::svg), drop CPU bytes after upload, and run poster/open work on a small bounded pool.
GPU-resident images with real mip levels and a byte budgetimpact mediumeffort highre-architecture
Upload Arc<Decoded> mips straight into pooled textures with trilinear sampling, dropping the CPU atlas copy (one fewer full copy per image, smooth zooms; device loss re-uploads from Decoded). Add an LRU byte budget that counts decoded + GPU bytes.
Shared media worker poolimpact mediumeffort mediumre-architecture
Replace per-cache decoders, per-clip poster threads and ad-hoc file IO with one prioritized, cancellable pool, as PLAN.md:121 describes.
Cross-platform playback backendsimpact higheffort highre-architecture
iOS: mostly widen cfg(target_os=macos) to target_vendor=apple for video::macos and native_surface::macos. Windows: IMFMediaEngine with DXGI into the D3D12 path. Linux: GStreamer/FFmpeg with VA-API and dmabuf import. Web: HTMLVideoElement. The Player intent/pull + NativeSurface seam already fits.
Optional native-layer video for full-screen/HDRimpact mediumeffort highre-architecture
An AVSampleBufferDisplayLayer underlay for unclipped or HDR playback, getting EDR and WindowServer hardware planes, while keeping the in-pass path for clipped, interleaved video.
Streaming Ogg/WebM audioimpact loweffort mediumre-architecture
Feed symphonia output to an AVAudioEngine source node instead of a whole-file WAV, removing the in-memory read, the disk cost and the 6 h cap.
Web image upload without main-thread readbackimpact loweffort medium
Use copyExternalImageToTexture from the ImageBitmap instead of drawImage+getImageData on the main thread; build mips on the GPU or in a worker.
Numbers, key files, roadmap and the verifier's additions
Numbers
Production lines (approx.)
~6,400 (7,275 in non-*_tests.rs files minus ~840 inline test lines) + 127 WGSL
Test lines
2,276 in *tests.rs files + ~840 inline
Unit tests
~110: image 22, pixels 14 (1 ignored), native_surface ~20 (5 bodies x wgpu+Metal), video 30, recorder 23
Integration tests
tests/video_gui.rs (RUNE_GUI_TESTS=1, macOS), tests/pixels_streaming.rs (1)
Largest files
image.rs 981; video/macos.rs 926 (~911 prod, over 800 soft cap); recorder/mod.rs 814 (~812 prod); pixels.rs 795
Decoder threads per ImageCache
min(4, available_parallelism)
Image limits
8192x8192, 256 MiB decoder alloc, SVG input 32 MiB, SVG auto raster <=4096, icons <=1024
Atlas page
1024x1024 RGBA (4 MiB); standalone exact-size pages up to 8192
8192² mip chain
0.15-0.25 s, 341 MiB (was 1.5 GiB / 1.25 s) per CHANGELOG.md:250
1080p NV12 import+draw+submit
~1.05 M instructions native Metal vs 2.15 M wgpu (changelog 2026-10-30-metal-video)
Web mip slicing
TBT ~500 ms -> ~100 ms for 7 screenshots on a throttled phone
Video policy constants
PARKED_PLAYERS 4, POSTER_MAX 1920, SEEK_PATIENCE 2 s, LOAD_PATIENCE 30 s, AUDIO_TICK 50 ms
Recorder
meters every 33 ms, device check every 15 ticks, 5 s stop/cancel patience
Surface limits
1..16384 per side, Windows importer caches 16 textures/fences, 8 timing slots
Key files
crates/rune/src/image.rs ImageCache, Image, decode entry points (load/svg/file/rgba/app_icon), worker pool, platform icon rasterizers, SVG via resvg, ICNS-PNG
crates/rune/src/image/mips.rs Linear-light premultiplied mip chain with sRGB tables; MipSteps for sliced (web) construction
crates/rune/src/image/from_url.rs ImageCache::url/url_set; web fetch+createImageBitmap landing in slices; native file: URL mapping
crates/rune/src/pixels.rs Pixels (replaceable RGBA, live::Source wake), fit_in placement, ImageAtlas shelf pages and slot lifecycle
crates/rune/src/render/upload.rs upload_images (dirty-row atlas upload, texture creation) and prepare_surfaces
crates/rune/src/native_surface/mod.rs NativeSurface mailbox, Frame/Source/Format/ColorInfo/Orient, push_bytes/push/push_shared, SurfaceDraw, YCbCr reference oracle
crates/rune/src/native_surface/pipeline.rs SurfaceRenderer: import, per-draw uniforms/bind groups, video pipeline, timing pool, completion thread
crates/rune/src/native_surface/macos.rs PixelBuffer (CVPixelBuffer/IOSurface) ownership, colour metadata validation, CVMetalTextureCache zero-copy import on wgpu-hal or native Metal
crates/rune/src/native_surface/windows.rs D3D12 shared-texture open-by-name, per-frame copy, release fence, adapter LUID
crates/rune/src/native_surface/video.wgsl YCbCr->linear conversion, orientation, mirroring, exact/area sampling, rounded and soft clips
Roadmap items
  • Fix the web fatal path: skip or placeholder SurfaceDraws on web instead of ending the event loop
  • Request SDR BT.709 color properties from AVPlayerItemVideoOutput and add an HDR/HLG fixture test
  • Throttle presents for playing video to new-frame cadence (frame id in presented.rs::same, or wake at the next frame time)
  • Harden inputs: a data:-only SVG href resolver, Windows shared-texture size re-validation, clamped url_set SVG widths, an atlas max-texture-dimension check
  • Make native decode jobs weak, cancellable and visible-first; move hashing off the caller thread
  • Reuse textures and uniform buffers on byte and Windows surface paths; drop poster CPU bytes after upload; size posters to the drawn size
  • Update README, module docs, the video-tiles README and PLAN.md for the decoder count, formats, the Windows path, rotation and the in-pass video design
  • Split video/macos.rs (player vs audio) and recorder/mod.rs under the 800-line soft cap
  • Longer term: a shared media worker pool, GPU-resident mipped images with a byte budget, iOS/Windows/Linux/web playback backends
Found by the verifier
Medium
Native image decode ignores colour profiles (Display P3 photos misrendered, and native differs from web)
decode() never reads the decoder's ICC profile, so a Display P3 PNG or JPEG (every recent iPhone photo or screenshot) shows its P3 values as sRGB, desaturated. The web path asks createImageBitmap for colorSpaceConversion 'default', so the browser converts, and the same image looks different in the two builds. Video likewise never reads kCVImageBufferColorPrimariesKey, so P3- or 2020-primaries SDR video draws as 709 with no error. That goes against the code's own 'reject unsupported colour metadata' rule and PLAN.md's Display P3 line.
crates/rune/src/image.rs:600-625 (no icc_profile); crates/rune/src/platform/web/platform.js:75; crates/rune/src/native_surface/macos.rs:84-110 (matrix and transfer only); PLAN.md:174
Medium
The first draw of a large image does a full-size copy and upload on the UI thread in one frame
Decode and mips run off-thread, but ImageAtlas::place allocates a page of exactly the image's size and copies the chosen level row by row while it holds the Pixels mutex. upload_images then creates a texture of that size and writes every row, all in the same paint/upload frame. A 5K screenshot drawn at full size moves about 59 MB (allocate, copy, upload) in one frame, and an 8192² image about 256 MB. Nothing slices this across frames. The notes' design decision 3 says 'the render thread only picks a level', which is too strong.
crates/rune/src/pixels.rs:249-290,339-352; crates/rune/src/render/upload.rs:139-148
Medium
Audio opens have no timeout or size cap; endless HTTP streams hang the clip and grow memory
For an .ogg/.opus/.webm URL, or for any audio URL AVFoundation fails to open (the sniff fallback), decode_foreign calls fetch, which uses NSURLConnection sendSynchronousRequest and buffers the whole body. On a live stream (internet radio) the request never finishes. The rune-media-poster thread blocks forever and memory grows without bound. The clip never opens, because LOAD_PATIENCE applies only to player items in check_item, not to the open/poster worker. ogg-audio is a default feature.
crates/rune/src/video/macos.rs:240-262,268-281,284-303,636-640,676-683; crates/rune/Cargo.toml default = [..., "ogg-audio", "svg"]
Low
Frames are pushed (and the surface waker run) while the player's ctl lock is held
macos::pull, take_poster, pull_virtual and the placeholder push all call surface.push_*() while they hold the clip's ctl guard (and often native). NativeSurface::replace calls the surface waker at once. Player::surface() is public, so an app can set_waker on it. If that waker reads the player's state on the same thread (player.time(), player.state(), which lock ctl), it deadlocks, because std Mutex is not re-entrant. Rune's usual event-posting wakers are safe, so this is an API footgun rather than a live bug.
crates/rune/src/video/macos.rs:619-622,775-779; crates/rune/src/video/mod.rs:569-573,586-596,374-376; crates/rune/src/native_surface/mod.rs:174-176,288-297
13

Web target, www app, docs site, CI deploys

prototype

Rune runs in the browser through winit 0.30 plus a WebGPU canvas and a JS bridge: a hidden sliding textarea for text, a transparent semantic DOM mirror, and a document mode where the canvas is a scrolled "band" with a static --html first frame. It powers the public www page (itself a Rune app, deployed by CI to Cloudflare). There is no CI for the core crates, no browser test of document mode, and no recorded bundle size.

Summary (629 words)

The web target (started 2026-10-24, about 30 commits, heavy churn 11-04..06) runs an unchanged Rune app on wasm32 on the browser main thread: no SharedArrayBuffer, no COOP/COEP. platform/web.rs (598 lines) is a winit 0.30 ApplicationHandler. It refuses overlays, extra windows, windowless apps, on_window and on_ready. It enforces one app per page (page.rs), creates or borrows a canvas, and starts the WebGPU device (LowPower, default limits; WebGL2 only behind an opt-in webgl feature) while fonts load by URL. Then it builds the same Runtime/Renderer as native. Frames are demand-driven: idle submits nothing and requests no rAF, as Playwright checks.

Input comes through two channels. winit handles pointer, keys, wheel and touch. Only activation-sensitive input commits synchronously inside the DOM handler; moves and wheels coalesce to rAF. bridge.js handles everything else as JSON callbacks: a hidden 512-UTF-16-unit sliding textarea, validated against stale or mid-surrogate edits in runtime/web/runtime.rs; a password sink that is emptied after every input; paste/copy; mirror actions; scroll; viewport, DPR and visibility. The accessibility story is a hand-built DOM mirror (runtime/web/a11y.rs + syncA11y), not AccessKit. It covers landmarks, headings, paragraphs with inline links, links, images, buttons and horizontal scrollers. It leaves out inputs and widget states. It rebuilds only after commits and diffs styles per node.

App::web_document makes the app the page. The root lays out at natural height. The canvas is a band (viewport plus a 256 pt skirt each end) inside a clipper, moved with translate3d in the same task as present, and redrawn only within 64 pt of its edge (about every 192 pt of steady scroll). It is sized from 100lvh and never shrinks the surface for toolbar changes. Mirror text carries real fonts, so selection, find, anchors and Tab are the browser's own. --html lays the app out natively at several widths and folds them into flex CSS with @media classes, images as img srcset and shapes as SVG. That is the first paint; after Rune's first frame it is hidden, deferred while the reader is touching or scrolling.

www/app (package rune-www, 2,084 lines) is the public page at anoma.ly/rune. build.ts builds the wasm (opt-level z, fat LTO, wasm-opt), bundles it with Vite, then runs the native app with --html at 6 widths for index.html and 404.html. A Worker serves it with cache headers. site/ is a separate internal React 19/Vite docs site behind Cloudflare Access (/team/rune). It is prerendered and cuts its code snippets from repo source.

CI is only www.yml and site.yml. www.yml runs cargo test -p rune-www, does the full build, and deploys on push. site.yml deploys on site/** pushes. Nothing runs cargo test -p rune, a workspace check, the wasm build with default features, or the Playwright smoke.

Measured numbers: - Idle draws 0 frames. - Image mips in slices cut Lighthouse total blocking time from about 500 to about 100 ms. - A --dev rebuild takes about 2 s, against about 12 s for release. - opt-level z plus fat LTO is about 10% smaller.

No wasm size is recorded anywhere; research/11's target is under 1.5 MB brotli, and the default embedded fonts alone are 1.40 MB raw.

The docs lag the code: - WEB.md still describes a fixed canvas, the wrong font set, a nonexistent dev feature and no WebGL. - PLAN section 13 says the accessibility mirror is still to do. - The README says the web host sets no cursors. - examples/web-showcase is orphaned.

Main risks: - No core CI. A wasm break has already landed once. - No unchanged-frame skip: every hover or timer wake redraws the whole band. - Mirror and export links are not scheme-checked. - Accessibility for inputs and widget states is weak. - The IME textarea is not placed at the caret. - Document mode is never tested in a browser.

Why this maturity: It is functional and carefully tuned for Chromium and iOS-style scrolling, with headless Rust tests for its arithmetic, and it ships the public www page. But it is about two weeks old, under heavy churn, has no browser test of document mode, no Safari or Firefox verification, no CI for the core or the smoke, no size tracking, and several stale docs. On the evidence it sits at the upper end of prototype, close to working.

Issues, most severe first
High
No CI for core crates or the web smoke
Only www.yml (cargo test -p rune-www plus the www wasm build) and site.yml exist. Nothing runs cargo test -p rune, cargo check --workspace, a wasm build with default features, web-hello, or Playwright. A wasm compile break has already landed on dev once.
.github/workflows/ contains only site.yml and www.yml; www.yml:82-86; commit de2b16de / changelog/unreleased/2026-11-07-web-build-menu-turn.md
≈ Partly The listed jobs are missing, but CI did catch the wasm break. The www run on PR #152 failed with E0599 (no method turn) at window.rs:284. The PR merged 9 s after that check started. The dev ruleset has only non_fast_forward and deletion rules, with no required status checks. Four dev pushes in a row then had red www runs, which also blocked dev deploys. The real gap is that CI is advisory, not only narrow.
Medium
No unchanged-frame skip on web
Every RedrawRequested acquires a texture and submits a full draw. Hover over the canvas or the mirror, timer wakes and Wake::App all redraw the whole band (about 1.6x the viewport) even when nothing changed. Native has a quiet-frame unchanged check.
crates/rune/src/platform/web.rs:509-562, 498; input.rs:181-187, 204-207; native crates/rune/src/window/draw.rs:141-163
≈ Partly Web does always acquire a texture and submit. But native's quiet check skips only timer-woken resting frames. Native clears quiet on every window event and every non-DisplayTick wake, so native also draws on hover and Wake::App. The real gap vs native is timer wakes, made costlier by the 1.6x band.
Medium
Mirror and export links are not scheme-checked
In page mode, link items set el.href to the app URL verbatim, and --html writes href verbatim, so javascript: URLs passed to El::href become live links. The canvas path validates with open_url::check, and inline runs fall back to '#'.
crates/rune/src/platform/web/bridge.js:352-355 vs 273-283; runtime/web/export.rs:102; export/css.rs:270; el/a11y.rs:86-94
✓ Confirmed
Medium
Web accessibility is a reading mirror, not a widget tree
Text inputs are excluded from the mirror. The hidden fields are labelled 'Text input'/'Password input' for every field. There is no checked/selected/value/disabled state and no slider/switch roles (only aria-expanded). It is a separate projection from the AccessKit tree and the --html exporter, so the three can drift.
runtime/web/a11y.rs:298-302, 357-372; bridge.js:51,55,346-349; Cargo.toml:49-57
✓ Confirmed
Medium
Docs and plan drift from the code
WEB.md describes a fixed canvas in document mode (code uses a band), lists only Inter Regular plus Plex Mono, mentions a nonexistent dev feature and says there is no WebGL. PLAN section 13 says the a11y mirror is to-do. README says the web sets no cursors. The docs site says accessibility is to come and promises live demos on the site. web-showcase claims to be the website's live panel but is orphaned.
WEB.md:89,124-128,182,230; PLAN.md:615-617; crates/rune/README.md:142 vs cursor/os.rs:78-90; site/src/pages.tsx:189-190; site/src/content.tsx:534; examples/web-showcase/src/lib.rs:1-3,150
✓ Confirmed
10 more verified issues
Medium
IME textarea never follows the caret
The textarea is fixed at the viewport's top-left, so desktop CJK candidate windows and emoji pickers anchor there. Research recommended positioning it at bounds_for_range.
bridge.js:61; research/05-text-ime-a11y-layout.md:242; research/11-platform-shells.md:302
✓ Confirmed
Medium
Bundle size unmeasured and ungated
No wasm size is recorded anywhere and nothing in CI checks it. The default embedded-fonts feature adds about 1.40 MB of raw TTF (Inter Regular/Medium/SemiBold plus Plex Mono). research/11 targets under 1.5 MB brotli.
text/default_fonts.rs:10-16; crates/rune/assets/*.ttf sizes; research/11-platform-shells.md:243; web-build.sh:176
≈ Partly It is measured: web-build.sh prints raw and gzip size on every CI build. The latest www run logged 4,218,150 bytes raw and 1,740,456 bytes gzip, with fonts and resvg off, opt-level z, fat LTO and wasm-opt -Oz. That is likely near or over the 1.5 MB brotli target even at its smallest. It is not recorded in the repo or gated. The font byte counts are right. research/11:243 also says to stream fonts rather than embed them.
Medium
Document mode, embedded mode and the static swap have no browser tests
The Playwright smoke covers only web-hello in full-viewport mode under Chromium. WebKit is skipped headless. There is no record of a real Safari or Firefox run, and no JS unit tests.
scripts/web-smoke.mjs:51-56,141; WEB.md:251-253
✓ Confirmed
Low
CI path filters miss inputs
www/app include_str!s examples/hello/src/main.rs, but www.yml does not watch examples/**. site.yml ignores the repo files its snippets and link checker read, and has no PR trigger.
www/app/src/code.rs:13-14; .github/workflows/www.yml:9-25; .github/workflows/site.yml:4-9
✓ Confirmed
Low
Static export silently truncates to 6 widths and keeps only the narrowest tree
RANGE_PREFIX has 6 entries and widths are sliced to that. Nodes present only at wider widths are dropped from the body.
runtime/web/export/page.rs:31,37; export/tests.rs ('Wide only' absent)
✓ Confirmed
Low
In document mode a page-owned canvas is removed on quit
mount moves the canvas into the band clipper and destroy removes the clipper, contradicting 'a passed-in canvas stays'.
bridge.js:77-78,479; WEB.md:113-114
✓ Confirmed
Low
Duplicated logic and assets
canvas_physical duplicates web_math::fix_canvas_size without tests. The snippet cutter exists in both TS and Rust. site/ and www/ duplicate worker.ts, base.ts, icons.ts, brand pixels and og.png. TITLE/REPO are defined in both Rust and TS.
platform/web.rs:209-215 vs web_math.rs:11-26; site/scripts/snippets.ts vs www/app/src/code.rs; diff of site/www files
✓ Confirmed
Low
Generated index.html disables pinch zoom
maximum-scale=1,user-scalable=no in the default page hurts low-vision users.
scripts/web-build.sh:103
≈ Partly The meta tag is there, but that page is for full-viewport apps. Those apps also set touch-action:none on html, body and canvas and cancel gesturestart, so changing the meta tag alone would not restore zoom. Document mode (www) uses its own template and fitHeight=true, so it does not block gestures.
Low
on_ready refuses to start the app on web
App::on_ready returns Err on web, though project guidance routes slow work through on_ready. WEB.md doesn't mention this.
platform/web.rs:54-56; app.rs:404-409
✓ Confirmed
Low
Large-image transient memory
8192x8192 images are allowed: 256 MB RGBA in a JS ArrayBuffer, copied again into wasm before mips.
image/from_url.rs:10,105; platform.js:79-83
✓ Confirmed
Strengths
  • Idle frames are verified as truly idle (0 submits and 0 rAFs) and pointer bursts are verified as coalesced, in Playwright
  • The text bridge validates every browser edit (stale snapshot, surrogate boundaries, pills), and secrets never enter the DOM
  • Document mode is carefully engineered for iOS: compositor-scrolled band, lvh sizing, no surface shrink, momentum-safe static swap, native horizontal scrollers
  • The static --html export gives real HTML for crawlers and for readers without WebGPU or JS, with @media folding and srcset
  • Arithmetic is factored for headless tests (web_math.rs, page.rs, a11y and export tests: about 36 Rust tests)
  • Clean teardown and remount for SPA routes (Borrowed give_back, queued start, device.destroy)
  • www is dogfood: the public page is a Rune app with breakpoint-invariance and snippet-drift tests
  • The build script handles dev/watch, atomic output, version checks and size reporting
  • Docs site snippets and repo links are verified at build time
Key concepts
  • Three hosting modes: Full-viewport canvas (default), embedded canvas (canvas_id with fit_content_height or full_viewport), and web document (App::web_document: the app is the page and the browser scrolls it).
  • Band canvas: In document mode the canvas is view+512 pt tall inside a page-height clipper, moved by translate3d in the same task as present. It is redrawn only when the viewport comes within 64 pt of an edge, so the compositor scrolls pixels Rune already drew.
  • Sliding textarea mirror: A hidden 1x1 textarea holding up to 512 UTF-16 units each side of the selection. Edits come back as replacements validated against the expected snapshot and UTF-8 boundaries.
  • Secure sink: A separate password input emptied after every input. Only the new characters are forwarded, and the secret never sits in the DOM.
  • Semantic DOM mirror: Transparent absolutely positioned DOM (landmarks, headings, paragraphs with links, buttons, images, scrollers) built from laid-out nodes. In page mode it carries fonts so selection and find work, and real anchors and Tab.
  • Static first frame (--html): A native headless layout at several widths exported as flex CSS plus @media classes. It paints before the wasm and is hidden (not removed, to keep LCP) after Rune's first present.
  • Activation commits: Mouse buttons, keys, touch end and bridge events run rt.frame(0.0) inside the DOM handler, so the clipboard, window.open and focus see user activation. Moves and wheels wait for rAF.
  • One app per page: A thread-local PAGE slot. An app started while another quits is queued and started on vacate.
Opportunities
Port the native unchanged/quiet-frame check to the web shellimpact mediumeffort low
Skip get_current_texture and submit when the frame output is unchanged (hover, timer, wake), reusing Presented::unchanged.
Add real CIimpact higheffort medium
Add jobs for cargo test -p rune -p rune-kit, cargo check --workspace --all-targets, a wasm build of web-hello with default features, the Playwright smoke in headless Chromium, and a wasm size report or gate. Add examples/** to the www filter and a PR build to site.yml.
Derive the web mirror and --html semantics from the AccessKit treeimpact higheffort mediumre-architecture
One semantic source gives roles and states (checked, value, slider, textbox) for free and stops drift between three projections. Page-only extras (fonts, rects, scrollers) stay as an overlay.
Incremental mirror diffsimpact mediumeffort medium
Hash items per subtree and send add/update/remove by path instead of building serde_json Values for the whole scene on every commit. Important for long documents.
GPU image upload without CPU readbackimpact mediumeffort highre-architecture
Use copyExternalImageToTexture from an ImageBitmap and build mips on the GPU, removing getImageData, the wasm copy and CPU mip work from the main thread.
Velocity-adaptive band and marginimpact loweffort low
Grow MARGIN/SKIRT with fling speed, or pre-draw in the scroll direction, so fast flings don't expose the band edge. Shrink the band on memory-tight devices (about 19 MB per texture at 3x).
Caret-anchored textarea and EditContext on Chromiumimpact mediumeffort medium
Place the textarea at the caret rect for IME candidate windows. Use EditContext where available.
Owned web shellimpact mediumeffort highre-architecture
Replace winit on web to allow multiple canvases per page sharing one device (docs with several demos) and direct control of pacing, as research/11 recommends.
Fix docs drift and remove or repurpose web-showcaseimpact loweffort low
Update WEB.md (band, fonts, features, webgl, on_ready), PLAN section 13, the README cursor line and the docs site copy.
Share site/www infrastructureimpact loweffort low
Factor out the common worker, base helpers, icon script and brand pixels; add one snippet-cutter spec.
Numbers, key files, roadmap and the verifier's additions
Numbers
Web runtime Rust lines (runtime/web incl. export and tests)
2,016
Platform web Rust lines (web.rs, web/*.rs, web_math*)
1,098
Bridge JS lines (bridge.js + platform.js)
637
www/app Rust lines
2,084
site/src TSX/TS/CSS lines
5,119
Rust tests in area (runtime 6, a11y 7, page 8, export 6, web_math 7, html 2, www 10)
46
wasm32 cfg occurrences in crates/rune/src
177 in 46 files
Commits touching web platform/runtime
30 (first 2026-10-24)
Embedded web fonts raw size
1,404,624 bytes
www Geist TTF fonts
59,040 + 47,604 bytes
www AVIF images total
~249 KB across 17 files
Band skirt / redraw margin
256 pt / 64 pt (redraw every ~192 pt)
Text context window
512 UTF-16 units each side
Image mips TBT (changelog)
~500 ms -> ~100 ms
Key files
crates/rune/src/platform/web.rs winit ApplicationHandler shell: canvas setup, async WebGPU init, frame loop, band placement, teardown
crates/rune/src/platform/web/input.rs Rust side of DOM bridge: sync_input, input_event (bridge JSON), window_input (winit events), activation commits
crates/rune/src/platform/web/bridge.js Hidden textarea/password IME bridge, semantic a11y mirror DOM, band clipper, static-export swap, scroll/hover hooks
crates/rune/src/platform/web/platform.js Clipboard, links, image fetch/decode via createImageBitmap+getImageData, font fetch, scheduler.yield, viewport/DPR/visibility listeners
crates/rune/src/platform/web/page.rs One-app-per-page slot, queued start after quit, same-tab router, restore borrowed canvas/body/title
crates/rune/src/platform/web_math.rs Headless-tested canvas sizing and surface reconfigure rules
crates/rune/src/runtime/web/runtime.rs Sliding 512-unit edit context Mirror, web_edit/web_key/web_secure validation
crates/rune/src/runtime/web/a11y.rs Builds semantic mirror items and JSON; a11y actions; page scroll_x
crates/rune/src/runtime/web/page.rs Document mode band math: page_mode, set_band, set_page_scroll, SKIRT/MARGIN logic
crates/rune/src/runtime/web/export.rs Static HTML export nodes (tags, attrs, CSS) for --html
Roadmap items
  • Add a core CI workflow (rune/rune-kit tests, workspace check, wasm build of web-hello with defaults, Playwright smoke, size report); widen the www.yml path filter to examples/**; add a PR build to site.yml
  • Port the unchanged-frame skip to the web RedrawRequested path
  • Scheme-check El::href in the mirror and in the --html export
  • Fix docs drift (WEB.md band, fonts, features, webgl, on_ready; PLAN 13; README cursor; docs site copy); delete or repurpose web-showcase
  • Add a document-mode browser test (mirror, static swap, scroll band, fonts by URL)
  • Expose inputs and widget states in the mirror, ideally by deriving it from the AccessKit tree
  • Caret-anchored textarea, then EditContext on Chromium
  • Real-device Safari/iOS and Firefox verification
  • Measure and budget wasm size; reconsider embedded-fonts as a default
  • Longer term: GPU image upload path, incremental mirror diffs, owned web shell for multiple canvases per page
Found by the verifier
High
CI is advisory: no required checks on dev, and red www runs were merged
The www job does build Rune for wasm32 on every crates/** PR, and it failed on the PR that broke wasm. That PR merged 9 seconds after its check started. The dev ruleset requires no status checks, and four dev pushes in a row had failing www runs, so dev deploys of the public page failed during that window. Adding more jobs will not help until checks are required.
gh api repos/anomalyco/rune/rules/branches/dev -> only non_fast_forward and deletion; gh pr view 152: mergedAt 21:51:39Z, build FAILURE; www run on 53b8dd10 at 21:51:30Z failed with E0599 at window.rs:284; failing dev pushes 90c1ff3a, a0ad6c9f, 1d57a1a7, 2391f391
Medium
The actual wasm size is in CI logs but never recorded or tracked
rune-www, with Rune's embedded fonts and resvg off, opt-level z, fat LTO and wasm-opt -Oz, is 4,218,150 bytes raw and 1,740,456 bytes gzip. Brotli is probably near or over research/11's 1.5 MB target even in this smallest configuration. A default-features app such as web-hello adds about 1.4 MB of raw TTF plus resvg on top. The number exists in every CI log, so a size report or gate would be cheap to add.
gh run view 42351260566 --log: 'www/src/wasm/app_bg.wasm: 4,218,150 bytes raw, 1,740,456 bytes gzip'; scripts/web-build.sh:137-141,176; www/scripts/build.ts:30-33; www/app/Cargo.toml:17
Low
Static export turns rich-text Link ids into relative hrefs
Link ids are arbitrary ids handled by El::on_link (mentions, file chips), not URLs. The live mirror only makes a real href for http, https and mailto and otherwise uses '#' plus an a11y_link event. The --html export writes <a href="{id}"> for every link range. So the static page, which readers without WebGPU keep and crawlers index, gets broken relative links such as href="user-42". The same path also lets a javascript: id through.
runtime/web/export/css.rs:270; text/span.rs:205-224 (Link::new(range, id)); bridge.js:267-283 (webLink check and '#' fallback)
Low
Outside page mode, mirror links swallow pointer input over El::href elements
Link mirror items are pointer-events:auto in every mode and sit over the canvas. The a11y-layer pointermove to Rune hover forwarding is set up only in page mode. In full-viewport and embedded apps, hovering an El::href element makes the canvas lose the pointer, so hover and pressed looks never show. A click is handled by the browser, so Rune's on_press (Tx::open_url) never runs. A relative or fragment href navigates the tab, while natively those do not open.
platform/web/bridge.js:296 (link pointer-events:auto), :194-205 (hover forwarding inside if (page)), :353-354 (target only set for web links outside page mode); el/a11y.rs:86-94

Components and effects

Kit components · Markdown, diff, Mermaid · Effects and theming

14

rune-kit core components and theming API

working

A theme-agnostic token schema (Kit) and about 40 builder components with @opencode/ui names. Accessibility is first-class and golden-tested, and the data views are measured at scale. It is held back by duplicated rows and surfaces, token bypasses, README drift, a picker that builds every row, and visual parity that is checked by hand and not in CI.

Summary (555 words)

rune-kit sits above crates/rune and below theme crates and apps. It defines Kit (kit.rs:211-231): Palette (68 colour fields plus 4 StateColors), Elevation (10 box-shadow lists), Glyphs, Type, Radius, Motion, and three policy fields (blend_over, ring, invalid_text). It also has about 40 builders that read only those tokens and end in .build(&kit). Overlays (Popover, Menu, Select, Tooltip, HoverCard, Combobox) return their trigger in place and push content into a layer Vec, which rune_kit::root mounts above the base (lib.rs:255-264). Content is El::anchored to a {key}-trigger wrapper.

A kit comes from one of three sources: Kit::neutral (maps rune::tok), Kit::from_palette(PaletteSeed), or a theme crate (themes/opencode, which caches a &'static Kit per dark/sRGB mode). from_palette derives OKLab layer steps, contrast-floored secondary text (bisection to 4.5:1 and 3:1), fg-alpha borders and hover, and a PaletteFocus ring. Translucent tokens are authored for sRGB blending, as Chromium does. In linear-light windows they are re-solved over a backdrop with Kit::alpha and Kit::on, using a thread-local blend mode.

Conventions: State forces visual states for galleries. ControlSize uses AppKit metrics. Acts collects handlers and attaches them only when the control is enabled. State follows three models: (1) props plus callbacks; (2) an app-owned state struct reached through an accessor closure or fn pointer (TextEdit, ComboboxState, TableState, TreeModel, PaneState, ShortcutRecorderState); (3) hidden thread-local memory (RollingText MEMORY, ScrollBar BARS keyed by runtime id, leaked arc icons).

Accessibility is thorough. Every component sets role, name, value, states and actions, and hides decorative children. 26 JSON goldens under tests/a11y/golden assert this, and tests show assistive actions, pointer and keyboard reach the same handlers. Tree (50k nodes) and Table (100k rows) are virtualised and measured at 0.4 ms p50 per scroll frame. ScrollBar runs on live values with zero view rebuilds per scroll frame.

Weaknesses: - **Consistency.** Five separate highlighted-row implementations exist (MenuItem, Select option, PopupList, List, SidebarRow). Select/Menu and Combobox/Popover use two different dropdown surfaces. Focus rings come in seven size and offset variants, and the Checkbox ring uses border_active, not border_focus. Disabled styling differs per component. Handler signatures differ under the same name (on_select with and without Tx). - **Token bypasses.** These break kit.rs:3's own rule: List and TextField hard-code TextStyle::new(14, ..), there are 40 literal radii including menu/select/dialog radius 6.0, and notes.rs uses raw .alpha(). The raw-literal lint PLAN.md promises does not exist. - **Picker performance.** PopupList/Combobox use virtualize (every row built per commit; rune's docs say to use virtual_rows past short lists), clone all options per build, and filter three times per keystroke. - **Smaller issues.** A plain Popover has no Escape path. Dialog renders nothing without on_close. Select identifies options by label. The inline Select has no focus ring (parity with the web, but fails WCAG 2.4.7). Menu radio items read as menuitemcheckbox. TextInput's copy and clear buttons aren't focusable. The ScrollBar registry clears everything at 256 entries. TextEdit is cloned twice per field build, secrets included. About 25 accessibility strings are hard-coded English. - **README drift.** It says scrollbars are not drawn, that Rune blends in linear light, that select autofocus is still separate, and that Button has 3 sizes. All are stale.

Parity with @opencode/ui comes from gallery scenes named by Storybook story id (127 scenes, 92 of them web-mirrored) and scripts/kit-diff.py. That diff is manual: no pixel goldens exist for core components, and CI runs no rune-kit tests. Maturity: working, close to solid.

Why this maturity: The component set is broad and fully used (gallery of 127 scenes, OpenCode theme, shell, tree, table). Accessibility is thorough and golden-tested, there are about 240 in-scope tests, and the data views are benchmarked at scale. It is not yet solid: components are inconsistent with each other (rows, surfaces, focus rings, disabled looks, handler signatures), they bypass their own token rule, the README has drifted, some a11y and dismissal gaps remain, and visual parity is checked by hand with no CI running the kit's tests.

Issues, most severe first
Medium
Combobox/PopupList build every row each commit and filter three times per keystroke
PopupList uses virtualize (only layout and shaping are virtual), which Rune's docs reserve for short lists and warn about past 200 rows. Combobox clones all options per build and runs filtered() (with to_lowercase per option) in build, on_change and on_key. This contradicts AGENTS.md 'Build only mounted rows: virtual_rows'.
crates/rune-kit/src/popup_list.rs:235; crates/rune-kit/src/combobox.rs:50,60-68,97,156,179,191; crates/rune/src/el/virtual_rows.rs:17-19
✓ Confirmed
Medium
Checkbox focus ring uses border_active instead of border_focus
Every other control uses c.border_focus. In from_palette kits border_active is a grey lightness step, so the checkbox ring ignores PaletteFocus and the README promise that focus rings follow border_focus.
crates/rune-kit/src/checkbox.rs:99; crates/rune-kit/src/palette.rs:214; crates/rune-kit/README.md:61-63
✓ Confirmed
Medium
Inline Select has no keyboard focus indicator
The inline trigger sets no_focus_ring() and handles no Focus state, copying the web's outline: none, so keyboard focus is invisible (fails WCAG 2.4.7).
crates/rune-kit/src/select.rs:262-264; changelog/unreleased/2026-11-07-form-control-parity.md
✓ Confirmed
Medium
Plain Popover cannot be dismissed with Escape
Popover::on_close mounts only a scrim and the title close button; the content is a non-modal dialog and nothing in overlay.rs handles Escape. Combobox adds Escape only inside its search field.
crates/rune-kit/src/overlay.rs:215-220,231-233; crates/rune-kit/src/combobox.rs:186-189
✓ Confirmed
Medium
Dialog silently renders nothing without on_close
build() returns early if on_close was never called. There is no debug assertion and no doc, which makes a non-dismissible dialog impossible and a missing handler hard to diagnose.
crates/rune-kit/src/dialog.rs:40
≈ Partly The early return is real, with no doc and no debug assertion. A non-dismissible dialog is possible: pass a no-op on_close plus click_outside(false). The close button is still drawn and does nothing, so the real gap is that there is no clean non-dismissible mode. 'Impossible' overstates it.
11 more verified issues
Medium
Select identifies options by label string
current, highlighted and on_choose compare and pass labels, so duplicate labels across groups both show checked. There are no ids or disabled options, unlike ComboboxOption.
crates/rune-kit/src/select.rs:182,205,210-212
✓ Confirmed
Medium
Token bypasses contradict 'Components never name raw colours, sizes or fonts'
List and TextField hard-code TextStyle::new(14, ..); TextArea derives its line height from a literal 13; there are 40 literal radii (menu/select/dialog/segmented 6.0, item rows 4.0, toast 8.0); notes.rs uses raw .alpha() that skips blend re-solving; Toast uses a fixed spring. The lint PLAN.md promises does not exist.
crates/rune-kit/src/kit.rs:3; list.rs:96,99,139,167; text_input.rs:486,612; menu.rs:165,347; select.rs:194,225; dialog.rs:55; notes.rs:522-526,562; toast.rs:108; PLAN.md:482
✓ Confirmed
Medium
Theme schema cannot grow without breaking theme crates
Palette (68 pub fields, 21 of them legacy), Type, Radius, Glyphs and Kit are built as exhaustive literals by theme crates, but have no compat guard and are not on the AGENTS.md literal-type list.
crates/rune-kit/src/kit.rs:22-109,211-231; themes/opencode/src/lib.rs:126,213,227
≈ Partly Palette (68 fields, 21 legacy, counted), Type, Radius, Motion and Kit are exhaustive literals in the theme crate. Glyphs is not: the theme builds it with ..glyphs::DEFAULT, so new glyphs don't break it. The in-repo theme fails to compile in the same change, so only external theme crates are at risk.
Medium
Visual parity is manual and kit tests are not in CI
kit-diff.py needs an OpenCode checkout and a GPU or lavapipe; there are no pixel goldens for core components; .github/workflows only run rune-www tests and deploys. PLAN promises screenshot diffs per component and CI goldens.
scripts/kit-diff.py:6-22; .github/workflows/www.yml:84; PLAN.md:489-491,569-570
✓ Confirmed
Low
Duplicated row, surface and close-button implementations
Five near-identical highlighted rows; two dropdown surface styles (Select/Menu layer_01+floating against Combobox/Popover surface_raised+md); close and copy buttons built three ways; three text-field paths.
menu.rs:161-236; select.rs:183-213; popup_list.rs:239-281; list.rs:175-209,98-124; shell/sidebar.rs:551-656; toast.rs:78-92; text_input.rs:339-359,641-656
✓ Confirmed
Low
ScrollBar registry clears all bars at 256 entries
When a new area arrives at KEPT, every Bar is dropped, including visible ones mid-drag. There is no per-entry LRU eviction like Budget's.
crates/rune-kit/src/scroll_bar.rs:52-55,276-283
✓ Confirmed
Low
TextEdit cloned twice per field build, secrets included
TextInput/TextArea/TextField::new clone the TextEdit, and rune::text_input clones it again. That is the whole text, marks and blocks, and it leaves unzeroed secret copies against TextEdit's replace_text guidance.
crates/rune-kit/src/text_input.rs:171,399,551; crates/rune/src/el.rs:714; crates/rune/src/edit.rs:46-48
✓ Confirmed
Low
README and doc-comment drift
The README says scrollbars are not drawn, Rune blends in linear light, select autofocus is still separate, and Button has 3 sizes. kit.rs documents disclosure motion for accordion and collapsible, which never read it.
crates/rune-kit/README.md:113,432,436,440; crates/rune-kit/src/kit.rs:207; tests/select_keyboard.rs:33-35
✓ Confirmed
Low
A11y semantic gaps
Menu radio items read as menuitemcheckbox; the indeterminate checkbox draws the check glyph; TextInput copy and clear buttons are not focusable; about 25 accessible strings are hard-coded English (Close, Copy, Clear, Loading, No results, Hide sidebar, Working…).
menu.rs:163; checkbox.rs:73,81-84; text_input.rs:342-357; feedback.rs:31,86; toast.rs:82,130; shell/split.rs:269,612,636; shell/sidebar.rs:545-547
✓ Confirmed
Low
Shell is a per-window singleton through fixed keys
SplitView and Sidebar use fixed keys (shell, main-pane, sidebar-toggle, sidebar-list) and rename uses focus_return("sidebar-list"), so two split views in one window collide.
crates/rune-kit/src/shell/split.rs:340-372; crates/rune-kit/src/shell/sidebar.rs:133,585
✓ Confirmed
Low
TreeModel has no remove
Deleting one node means clear() and a full rebuild (about 35 ms at 50k nodes).
crates/rune-kit/src/tree.rs public API (insert, clear only); README:264-266
✓ Confirmed
Strengths
  • Clean theme/component split: no OpenCode knowledge in the kit; three Kit sources (neutral, from_palette, theme crate) all fill the same schema
  • Careful colour science: sRGB-authored translucency with backdrop re-solving; OKLab-derived palettes with contrast floors and hue preservation, tested on black, white, mid-grey and warm palettes (palette.rs tests)
  • Accessibility is first-class and enforced: role, name, value, state and actions on every component, 26 JSON goldens, and tests showing assistive, pointer and keyboard input reach the same handlers
  • Consistent builder ergonomics for the common case (Builder::new().x().on_y().build(&k)), with disabled-drops-handlers built in
  • Data views built for scale: Tree (50k) and Table (100k) virtualised, with measured p50/p95 benchmarks
  • ScrollBar runs fully on live values, with zero view rebuilds per scroll frame, and follows macOS scroll-bar preferences
  • Rich behavioural test coverage: about 185 integration and 56 unit tests in scope, covering keyboard contracts, focus restore, motion and layering
  • An explicit parity workflow against Storybook (story-id gallery, kit-diff.py, CSS line citations in code)
  • Hashable Palette, Type and Radius let rows use theme tokens as memo versions
Key concepts
  • Kit token schema: Plain-data struct of semantic roles (Palette, Elevation, Type, Radius, Motion, Glyphs) that components read; a theme crate or constructor fills it per appearance
  • Builder + build(&kit): Every component is a by-value builder ending in build(&k) -> El; overlays take build(&k, &mut layer) and return the trigger
  • Overlay layer + root(): Overlay content is pushed into a Vec<El> mounted above the base by rune_kit::root, anchored to a '{key}-trigger' wrapper, escaping clip ancestors
  • Acts: A collector of boxed FnOnce(El)->El handler attachers, applied only when the control is enabled, so disabled controls drop their handlers
  • State (forced visual state): Rest/Hover/Pressed/Focus/Disabled override for galleries, like Storybook's data-state; Rest lets the runtime drive hover and press
  • ControlSize: AppKit macOS 27 control sizes (Mini to ExtraLarge) for buttons, icon buttons and switches; ButtonSize is deprecated
  • sRGB-authored translucency: Tokens match browser sRGB source-over; in linear-light windows Kit::alpha/Kit::on re-solve alpha over a known backdrop via rune::theme::for_blend (thread-local mode)
  • Kit::from_palette: Derives the whole palette from bg/fg/accent: OKLab layer steps, contrast-floored muted/faint text, fg-alpha borders and hover, status mixes, PaletteFocus ring, rings that follow border_base
Opportunities
Move PopupList to virtual_rows and memoise filteringimpact higheffort medium
Build only mounted rows; compute filtered indices once per build into a shared Rc used by on_change, on_key and on_active, keyed by (query, options version); pre-lowercase labels; accept Rc<[ComboboxOption]> instead of cloning a slice.
One shared ListRow primitiveimpact higheffort mediumre-architecture
A single row (height, padding, radius, focus_highlight, lead/label/description/trailing, check indicator) for MenuItem, the Select option, PopupItem, ListItem and later SidebarRow and TreeItem; Select gains ids and disabled options by reusing ComboboxOption.
Unified Dismiss policy for overlaysimpact mediumeffort medium
One builder-level policy (scrim, Escape, modal, focus return, click-outside) for Popover, Menu, Select, Dialog and PopupList. It fixes Popover's missing Escape and gives Dialog a non-dismissible mode instead of rendering nothing.
Token-literal lint for the kitimpact mediumeffort low
A scripts/ check that fails on TextStyle::new(, literal .radius(, Spring::new( and raw .alpha( in rune-kit/src outside neutral/palette, with an allow-list for geometric radii. Add Type/Radius roles where the web uses distinct values. It makes kit.rs:3 true and starts PLAN's raw-literal lint.
Versionable token schemaimpact higheffort highre-architecture
Split Palette into core, status and legacy sub-structs, or make it non_exhaustive with a base constructor plus struct-update, so theme crates survive new tokens; add compat tests for Palette, Type and Kit; plan to retire the 21 standard-appearance tokens.
Pixel goldens and kit tests in CIimpact higheffort medium
Render a subset of gallery scenes with rune-ref (already a dev-dependency) into checked-in goldens, and run cargo test -p rune-kit plus the a11y goldens in a workflow; keep kit-diff.py for Storybook comparison.
KitStrings for accessible textimpact mediumeffort low
An overridable table of the roughly 25 English literals (close, copy, clear, loading, no results, sidebar labels, status words) on Kit or a thread-local.
Clone-free text field buildimpact mediumeffort low
Let rune::text_input borrow or consume the TextEdit, and let TextInput hold a reference or Cow, removing two full-text copies (and secret copies) per field per rebuild.
Per-entry eviction for the ScrollBar registryimpact loweffort low
Replace clear-all at 256 with an LRU stamped by commit generation, as Budget does.
Folder reshape by capabilityimpact loweffort low
Group the 38 top-level files into forms/, overlays/, display/ and data/ before the folder-shape warning at 40; lib.rs re-exports stay flat.
Numbers, key files, roadmap and the verifier's additions
Numbers
In-scope source
47 non-test .rs files, ~14.1k lines (incl. inline test modules)
Top-level src files
38 non-test (folder-shape warns at 40)
Largest files
table.rs 818, scroll_bar.rs 725, tree.rs 704, text_input.rs 669, shell/sidebar.rs 658, shell/split.rs 656
Integration tests in scope
~185 #[test] in 33 test files plus tests/a11y (7,161 lines)
Unit tests in scope
~56 (scroll_bar 21, rolling_text 8, palette 8, shell/pane 5, popover 4, others)
A11y goldens
26 JSON files, 74.5 KB
Gallery scenes
127 (92 mirror @opencode/ui story ids, 35 rune-only)
Palette fields
68 colour fields + 4 StateColors; 21 (31%) legacy standard-appearance tokens
Radius usage
38 token reads vs 40 literal .radius(n) calls
Focus-ring variants
7 distinct (width, offset) pairs across components
Tree perf (README)
50k files: 0.4 ms/frame p50 scroll, 4 ms p95 mounting, ~35 ms model build
Table perf (README)
100k rows: 0.4 ms/frame p50, 3.4 ms p95 mounting
RollingText memory bound
512 labels / 256 KiB per thread; LCS budget 48x48
Churn
221 commits to crates/rune-kit/src, 2026-10-22 to 2026-11-07 (text_input 28, overlay 19, select 16, scroll_bar 16)
Key files
crates/rune-kit/src/kit.rs The Kit token schema (Palette, StateColors, Elevation, Glyphs, Type, Radius, Motion) and helpers (interactive, elevate, alpha, on, selection, shadow_layers, scroll_bar)
crates/rune-kit/src/lib.rs Module and re-export list, State, ControlSize, Acts handler collector, press_over/over/shadows colour helpers, root() overlay mount
crates/rune-kit/src/palette.rs Kit::from_palette / from_palette_focus: OKLab-derived semantic tokens from 3 seed colours, plus PaletteFocus
crates/rune-kit/src/neutral.rs Kit::neutral mapping Rune's core rune::tok tokens onto the schema
crates/rune-kit/src/css.rs Parses computed CSS box-shadow lists from web theme data
crates/rune-kit/src/actions.rs Button (10 variants, rolling/custom labels, help/shortcut/expanded) and IconButton, the Skin/paint model
crates/rune-kit/src/overlay.rs Placement, anchoring helpers (anchor_at, menu_anchor, fit_scroll), scrim, Popover, Tooltip/TooltipStyle, HoverCard
crates/rune-kit/src/menu.rs Menu, MenuItem, submenus, context_menu, the dismissal()/mount_dismiss modal policy shared with Select
crates/rune-kit/src/select.rs Select inline/field trigger and modal listbox, identified by label strings
crates/rune-kit/src/combobox.rs Searchable select: Popover, TextInput and PopupList, fuzzy scoring, keyboard contract
Roadmap items
  • Fix the cheap correctness and a11y gaps: Checkbox ring to border_focus, a Popover Escape/modal option, a Dialog debug_assert or non-dismissible mode, a menuitemradio role, an indeterminate dash glyph, focusable copy and clear buttons
  • Bring the README and doc comments in line with the code (scrollbars, blending default, select autofocus, sizes, disclosure motion)
  • Move PopupList/Combobox to virtual_rows with memoised filtering
  • Add a kit token-literal lint and remove the List, TextField and notes bypasses; add Type/Radius roles where needed
  • Wire cargo test -p rune-kit and the a11y goldens into CI; add rune-ref pixel goldens for a subset of gallery scenes
  • Extract a shared ListRow and a unified Dismiss policy; give Select id-based options
  • Make the token schema versionable (sub-structs or non_exhaustive with a base constructor) and add compat tests for Palette, Type and Kit
  • Add KitStrings for localisable accessible text; per-entry ScrollBar eviction; TreeModel::remove; reshape folders
Found by the verifier
Medium
aria-invalid is reported only by TextInput
Rune exposes El::invalid (ARIA aria-invalid), but only TextInput sets it. TextArea, Select, RadioGroup/RadioItem and TextField show invalid only visually (a red ring or text, or a live-region error), so assistive technology never hears that the value fails validation.
crates/rune-kit/src/text_input.rs:313 (only call); text_input.rs:487,497 (TextArea visual only); select.rs:243,304; radio.rs:56-62,168; crates/rune/src/el/a11y.rs:116-119
Medium
A non-modal Popover's content comes last in Tab order
Overlays mount after the base in rune_kit::root, and Tab follows node order. Popover neither traps focus nor moves it in on open. A keyboard user must tab through every later control in the base before reaching the popover, which stays open meanwhile. tests/popover_focus.rs passes only because the trigger is the only control in its base. Not run; inferred from the code.
crates/rune-kit/src/lib.rs:257-259; crates/rune/src/runtime/input/focus.rs:300-311; crates/rune-kit/src/overlay.rs:231-233; crates/rune-kit/tests/popover_focus.rs:7-24
Low
The ScrollBar 256 cap is thread-wide across windows
BARS is one thread_local map. Keys include the runtime id, but the len() >= KEPT check counts every window's bars, so one window with many scroll areas wipes live bar state (drag, fade, glide) in all other windows on the thread. Closed windows' entries are never pruned except by that wholesale clear.
crates/rune-kit/src/scroll_bar.rs:272-283
Low
The grouped Select listbox has no group semantics
Group headers are plain text rows inside the listbox, with no role or group container, and position_in_set counts across all groups. List, by contrast, uses role('group') and per-group sets. A screen reader hears 'n of total' across groups, with the header read as loose text.
crates/rune-kit/src/select.rs:171-178,188; crates/rune-kit/src/list.rs:142-163
15

Content rendering: markdown, diff, syntax highlighting, mermaid

solid

A stateless-builder content layer: pulldown-cmark Markdown with source maps, stream-tail settling and incremental reparse; own linear-time syntax scanners; a virtualized Myers-based DiffView; and a native 17-type Mermaid renderer (Sugiyama + isotonic positioning, steady streaming layouts). Thread-local caches handle most of the performance. The weak spots are the streaming and Mermaid paths, which rebuild whole trees every commit.

Summary (653 words)

Markdown (feature markdown, pulldown-cmark 0.13 with strikethrough/tables/tasklists only) parses into a public Block model, and keeps per-fence Source, task markers, block starts and a BlockMap of source-to-rendered byte maps alongside it (parser.rs:6-173), so Block keeps its shape (research/25). An interrupt.rs event adapter turns numbered lines that CommonMark leaves inside a paragraph into lists. Parsing is cached per full source string in a byte-bounded, commit-aware Budget (16 MiB docs, 4 MiB streams; cache.rs, budget.rs). A growing stream reparses from its last stable top-level block (extend, cache.rs:89-117). It falls back to a full parse whenever the source contains "]:" anywhere. Only one last source is kept per thread, so two concurrent streams both full-parse every commit. autolink(false) bypasses the caches entirely. stream.rs settles the tail: open emphasis, code or links draw styled, trailing markers are held back, and partial | lines wait until they are a table. All edits happen at the end, so source offsets stay valid.

Rendering (render.rs, table.rs, style.rs) builds rich text elements with colour-only syntax spans. It collapses margins as CSS does and sizes tables as a browser's auto layout does. Images, link icons, shell fences, outside list markers and the other markdown.css parity builders landed 2026-11-07. The repo has no markdown.css preset of its own, so parity is "can be styled to match", checked by OpenCode-theme golden trees. A whole-document rune::memo::cached digest (research/38) skips rebuilding static documents. It is disabled for streaming, for any closure (links, tasks, images, code frames, a custom highlighter), and for any source containing the substring "mermaid". So the agent-client case (streaming, with on_link) rebuilds every block's element tree on every commit. HTML events are dropped silently, and H5/H6 collapse to level 4.

Syntax highlighting is hand-written forward-only byte scanners for 14 language families with 11 token kinds. They cap at 32 KiB / 8,192 ranges and nest embedded code at most 3 deep, chosen over syntect and tree-sitter for linear time on untrusted input, wasm support and size (research/25). Results are cached per highlighter id, language and code in a 4 MiB Budget. App highlighters are tidied and share cache entries by closure TypeId unless keyed. A streaming fence rescans its whole prefix once per new line (capped).

Diff: diff::parse reads git patches. FileDiff::from_texts runs linear-space Myers over interned lines (MAX_D 1024), gives 3 lines of context and pairs word changes (up to 128 pairs). DiffState flattens files into keyed rows with fixed height estimates and highlights each side in 128-line chunks. DiffView draws it with virtual_rows and per-row memo. The '50k lines at frame rate' claim rests on an ignored bench with no recorded numbers. Markdown diff fences are a separate, simpler renderer that only tints lines.

Mermaid (rune-mermaid, 10.6k non-test lines) parses 17 diagram types leniently, bounded by 400 items, depth 8 and 3,000 dummy points. Flowchart, state, class, ER, requirement and C4 share a Sugiyama layout: DFS cycle breaking, doubled ranks for labels, up to 16 barycentre sweeps with cluster grouping and fewest-crossings selection, then 24 rounds of weighted isotonic regression (PAVA). Edges route as rank-axis cubics. A horizontal chart that would shrink below 0.78 to fit turns top-down. Ink flattening makes translucent strokes opaque so segment joints don't double-blend. Scenes become keyed canvas pieces, so streaming glides existing pieces and draws in new ones. steady.rs holds each build to the layout one line shorter, so a streamed diagram only grows. Scenes are cached in a 16-entry FIFO with no byte bound. A cold growing build replays up to 64 prefixes. Every render deep-clones every piece's Shape into new elements, and each build runs under catch_unwind, which does nothing on wasm.

Tests: 28 Markdown unit + 107 integration (plus 8 JSON goldens), 32 syntax, 34 diff, 138 Mermaid. Docs have drifted: README, AGENTS.md and Cargo descriptions say Mermaid draws 3 diagram types when it draws 17. Research/25's cache and token-kind facts are stale, and research/33 cites markdown.rs lines that no longer exist.

Why this maturity: Markdown, syntax and diff are heavily tested: 135 Markdown tests plus goldens, 32 syntax, 34 diff. They have been iterated on with measured performance work (research/28, 37 and 38) and handle edge cases carefully. Mermaid is broad (17 types, 138 tests) and defensively bounded, but young (27 commits since 2026-10-28) and thin per type, and its caching hasn't had the same performance scrutiny. The streaming and Mermaid render paths still rebuild whole trees each commit.

Issues, most severe first
Medium
Streaming Markdown rebuilds every block's El tree every commit
can_cache requires !streaming, so a streaming reply rebuilds, flattens and applies every block on every token. Earlier blocks are byte-identical, and the parse itself is incremental.
crates/rune-kit/src/markdown.rs:391-418; research/37 table 'Agent client / stream' Markdown share 3 -> 5%
✓ Confirmed
Medium
Incremental reparse is easily defeated
Any source containing "]:" forces a full reparse (TypeScript index signatures such as [k: string]: T are common), which makes a stream O(n^2). Only one last source is kept per thread, so two concurrent streams both full-parse every commit. autolink(false) bypasses both caches entirely.
crates/rune-kit/src/markdown/cache.rs:18-19,60,78,92; crates/rune-kit/src/markdown.rs:428-431
✓ Confirmed
Medium
Mermaid scene cache is a 16-entry FIFO with no byte bound
This breaks the repo rule that caches be bounded in bytes. A hit does not refresh an entry's place in the order. A streaming diagram inserts one entry per line and evicts other diagrams. With more than about 16 diagrams mounted, every commit misses and re-lays out all of them. A cold growing build replays up to 64 prefix layouts in one frame.
crates/rune-mermaid/src/scenes.rs:14,30-46,78-105
✓ Confirmed
Medium
Markdown containing 'mermaid' is never memo-cached, and Scene::el deep-clones shapes each render
A substring test (which also matches prose) disables the memo path. Every render then rebuilds the diagram's elements and clones every piece's Shape (Vec<Op> of point vectors) and every hover lit shape.
crates/rune-kit/src/markdown.rs:404; crates/rune-mermaid/src/parts.rs:220-227; crates/rune-mermaid/src/canvas.rs:316-383; crates/rune/src/shape.rs:49-54
✓ Confirmed
Medium
HTML in Markdown is silently dropped
Event::Html and Event::InlineHtml fall through unhandled. <br> in table cells, <kbd>, <sub> and <details>/<summary> lose content or line breaks, and no test or doc covers this. Footnotes and math are not enabled.
crates/rune-kit/src/markdown/parser.rs:435,582-637
✓ Confirmed
8 more verified issues
Low
catch_unwind guard ineffective on wasm
Mermaid builds rely on catch_unwind to contain layout panics. wasm32 targets abort on panic, so on the web a layout bug would crash the page.
crates/rune-mermaid/src/scenes.rs:49-50
✓ Confirmed
Low
H5/H6 reported as heading level 4
The parser collapses levels 4-6 to 4, and the renderer reports that 4 to accessibility.
crates/rune-kit/src/markdown/parser.rs:472-477; crates/rune-kit/src/markdown/render.rs:478
✓ Confirmed
Low
Diff highlight chunks lose lexer state
Each 128-line chunk is highlighted independently, with unknown lines blank, so multi-line comments or strings across chunk boundaries or hidden gaps colour wrong. The chunk cache is bounded by entries only and clears entirely at 512.
crates/rune-kit/src/diff/state.rs:131-138,704-740
✓ Confirmed
Low
Streaming highlight rescans whole prefix per new line
Each complete line of an open fence is a new cache key, so the whole prefix (up to 32 KiB) rescans once per line. Each prefix is also stored in the cache.
crates/rune-kit/src/markdown/render.rs:339-348; crates/rune-kit/src/syntax.rs:165-184
✓ Confirmed
Low
Steady layouts held by index for class/ER/requirement/C4
draw_layered passes empty ids, so holds are matched by node index rather than id. A node that is introduced earlier in parse order mid-stream shifts every hold after it.
crates/rune-mermaid/src/layered_draw.rs:165-178; crates/rune-mermaid/src/steady.rs:29-43
≈ Partly The mechanism is real: draw_layered passes &[] ids, and Memo::renamed returns the old memo unchanged when ids are empty. But the class, ER, requirement and C4 parsers append nodes in first-mention order, and Markdown feeds only complete lines. So the trigger, a node inserted before existing ones mid-stream, is not shown to happen. The risk is theoretical. The changelog claim 'Nodes are held by id' holds only for flowchart and state.
Low
Documentation and plan drift
The rune-kit README, AGENTS.md, rune-mermaid's Cargo description and the mermaid feature comment say Mermaid draws 3 diagram types; the code draws 17. The README says 'Layout runs once per source and is cached'. research/25 says the highlight cache keeps the last 32 blocks, uses 8 token kinds and lives under the markdown feature; the code has a 4 MiB budget, 11 kinds and an always-on module. research/33 cites markdown.rs:1556-1580, which no longer exists.
crates/rune-kit/README.md:327-330; AGENTS.md layout section; crates/rune-mermaid/Cargo.toml:6; crates/rune-kit/Cargo.toml:19; research/25-code-highlighting.md; research/33-real-bottlenecks.md:125
✓ Confirmed
Low
Diff view files over the 800-line soft cap
diff/state.rs has 885 non-test lines and diff/view.rs 862.
crates/rune-kit/src/diff/state.rs:886; crates/rune-kit/src/diff/view.rs:863
✓ Confirmed
Low
Throughput claims lack committed benches
The syntax module's '0.01 to 0.5 ms per thousand lines' and the diff view's '50,000-line diff at frame rate' have no recorded numbers. diff_50k_time is an ignored test that only prints, and Mermaid timing tests assert only < 5 s in debug.
crates/rune-kit/src/syntax.rs:23-27; crates/rune-kit/tests/diff.rs:745-822; crates/rune-mermaid/src/tests.rs:107-133
≈ Partly The syntax throughput claim has no bench, and the Mermaid tests assert only < 5 s. But the README does record diff numbers ('two 50,000-line texts diff in about 40 ms, the first frame takes about 20 ms, and a commit takes as long as a 300-line diff's') and names the bench command. Those are prose, not committed output or asserts. The notes' section 8 statement 'none recorded in docs' is wrong.
Strengths
  • Careful streaming UX: tail settling, held table headers, empty-fence suppression, colour-only highlighting and keyed blocks mean nothing flashes or remounts as text arrives (stream.rs, render.rs:288-294).
  • Precise source maps (SpanMap/BlockMap) enable find, highlights, task toggling and copy-source in exact source byte offsets, Unicode-fold aware.
  • Untrusted-input hardening throughout: linear scanners with caps and a hostile-input test, Myers MAX_D, Mermaid MAX_ITEMS/MAX_DEPTH/MAX_DUMMIES, catch_unwind, bounded dash budget (canvas.rs:144).
  • Consistent byte-bounded, commit-aware caching via Budget for parse, highlight and table widths.
  • Broad Mermaid coverage (17 types) with a well-reasoned layered layout (isotonic positioning, cluster-aware ordering, rank-axis cubic routing) and visually careful details (ink flattening, balanced label wrapping, TURN_BELOW).
  • Strong test suite: 135 Markdown tests plus 8 golden trees in the OpenCode theme, 32 syntax, 34 diff, 138 Mermaid, testing invariants such as parse counts and stream-equals-whole parse.
  • CSS-parity builders let an app reproduce OpenCode's markdown.css (margin collapse, outside markers, browser auto table layout, images, link icons) without forking the component.
Key concepts
  • BlockMap / SpanMap: Parallel tree of source-byte to rendered-byte range maps beside Block, used for find, highlights, stream marker checks and copy; keeps the public Block enum stable
  • Source (per fence): Language, length check, coloured prefix (complete lines while open) and open flag for each code/mermaid block in document order; renderer consumes them with a cursor
  • Cut / extend: Recorded top-level block starts let a grown stream reuse earlier blocks and reparse only from the last block starting on a finished line
  • Stream tail settling: parse_streaming closes open spans/links with synthetic closers, holds ambiguous trailing markers and partial table lines, falling back when a marker would show
  • can_cache memo: Whole-document rune::memo::cached by 128-bit digest when the Markdown has no closures, is not streaming and contains no 'mermaid'
  • Budget: Byte-bounded cache that never evicts entries used in the current or previous commit and evicts LRU down to 3/4 of its limit
  • Colour-only spans: Syntax highlights only set colour so shaping and glyph positions are identical with or without colour, enabling in-place colouring while streaming
  • Highlighter: Builtin scanners or app closure; cache id from closure TypeId (plus optional key); output tidied and capped
Opportunities
Per-block memo inside Markdownimpact higheffort medium
Wrap each top-level block in rune::memo::cached keyed by the block, its map, its source slice, the style hash and its key. Carry the source/task cursors from Cut data. Streaming then rebuilds only the last block, and documents with closures can still cache blocks that have no links or tasks.
Fix incremental-parse bail-outsimpact mediumeffort low
Detect only lines that can be reference definitions (line-start [label]:, allowing quote prefixes) instead of any "]:". Track last per Markdown instance or per stream key rather than per thread. Give autolink(false) a cache of its own.
Bring Mermaid caching up to the repo standardimpact mediumeffort low
Move scenes onto Budget with a byte estimate, refresh LRU order on hit, keep growing-prefix builds out of the shared pool, and memo Scene::el by scene key (or make rune::Shape Rc-backed so clones are cheap). Replace the contains("mermaid") memo gate with 'has a Block::Mermaid'.
Virtualize long Markdownimpact higheffort high
Emit top-level blocks through virtual_rows, using height estimates from cheap re-breaks of cached shapes (research/28 plan item 1), so resize and scroll cost no longer grows with note length.
Resumable scannersimpact mediumeffort medium
Make the scanners resumable at line starts with small lexer state (comment, string, template depth). Streaming fences then continue from the last state instead of rescanning the prefix, and diff chunks continue across boundaries (fixing their colour errors).
Minimal HTML subsetimpact mediumeffort medium
Map <br> to a hard break; <kbd>, <sub>, <sup>, <b>, <i> and <code> to spans; <details> to a Collapsible; anything else to literal text. Document the policy.
Unify Markdown diff fences with diff::parseimpact loweffort medium
Reuse the patch parser and word-change pairing, plus optional language colour, for diff fences.
Retained per-message document modelimpact higheffort highre-architecture
Replace the stateless 'rederive from the full string each commit' builder with an app-owned document (parsed blocks, per-block El cache, measured heights) that is updated by appends. Streaming becomes O(delta), and items 1, 2 and 4 are subsumed.
Numbers, key files, roadmap and the verifier's additions
Numbers
Markdown non-test lines
4,544 (14 files; parser.rs 779, style.rs 673, render.rs 592)
Syntax non-test lines
2,125 (scanners: c_like 504, scan.rs 410)
Diff lines
3,154 total; state.rs 885 and view.rs 862 non-test (over the 800 soft cap)
rune-mermaid lines
10,613 non-test + 2,670 test across 60 files
Mermaid diagram types
17
Markdown tests
28 unit + 107 integration (11 files) + 8 JSON goldens
Syntax tests
32 (6 + 26)
Diff tests
19 unit + 15 integration
Mermaid tests
138 across 29 test files
Cache bounds
parse 16 MiB, stream 4 MiB, highlight 4 MiB, table widths 1 MiB (Budget); Mermaid scenes 16 entries FIFO; diff chunks 512 entries
Highlight caps
32 KiB per block, 8,192 ranges, embed depth 3, regex lookahead 512 B
Mermaid bounds
MAX_ITEMS 400, MAX_DEPTH 8, MAX_DUMMIES 3000, MAX_HELD_LINES 64, 40 sequence participants
Long-note resize (research/28, M4 Pro)
50 KB: 16.1 -> 4.6 ms/frame; 200 KB: 70.6 -> 23.2 ms; open 17 ms (50 KB), 70 ms (200 KB)
Markdown share of main thread (research/37)
was up to 22% (team chat resize), now 0-7%
Key files
crates/rune-kit/src/markdown.rs Markdown builder, public Block/Inline/Table model, can_cache memo gate, render_uncached orchestration
crates/rune-kit/src/markdown/parser.rs pulldown-cmark event walk into blocks, SpanMap/BlockMap source maps, fence detection, pending-table header, cuts for incremental reparse
crates/rune-kit/src/markdown/cache.rs Thread-local parse caches (16 MiB / 4 MiB Budget) and incremental extend from last stable block
crates/rune-kit/src/markdown/stream.rs Streaming tail settling: closes open spans/links, holds trailing markers and partial table lines
crates/rune-kit/src/markdown/interrupt.rs Event adapter turning mid-paragraph 'N. ' lines into lists
crates/rune-kit/src/markdown/render.rs Blocks to El: CSS margin collapse, code/diff/mermaid/list/quote/task rendering, tab padding, copy-source
crates/rune-kit/src/markdown/table.rs GFM tables: content_widths measurement, browser auto layout, cached column widths, table style builders
crates/rune-kit/src/markdown/style.rs MarkdownStyle (~75 fields), from_kit/neutral, markdown.css parity builders, manual Hash
crates/rune-kit/src/markdown/find.rs Rendered-text search returning source byte ranges; SpanMap::map_ranges for highlights
crates/rune-kit/src/budget.rs Byte-bounded LRU that never evicts entries used in the last two commits; shared by parse, highlight, table caches
Roadmap items
  • Fix the incremental-parse bail-outs: a line-start check for reference definitions, a per-instance last, and a cache for autolink(false).
  • Add a per-block memo inside Markdown so streaming and closure-bearing documents rebuild only changed blocks.
  • Move Mermaid scenes onto Budget with LRU, memo Scene::el, and replace the contains("mermaid") memo gate.
  • Decide and document the HTML policy, and support at least <br> and simple inline tags.
  • Make the scanners resumable for streaming fences and diff chunks.
  • Virtualize long Markdown (research/28 item 1).
  • Refresh the stale docs: README, AGENTS.md, Cargo descriptions, research/25 and research/33 line refs.
  • Record release-build numbers for diff_50k_time, Mermaid 400-item layout and the scanner throughput claim.
Found by the verifier
Medium
The incremental parse is still O(document) per commit
Even when extend succeeds, it deep-clones every earlier top-level Block (String text, span and link Vecs) and every BlockMap SpanMap. cached also copies the whole source into a new Rc<str> key, then hashes and compares it. A streaming reply therefore copies and allocates O(n) per commit on the best path, and over a stream that adds up to O(n^2). This weakens the notes' framing that 'the parse itself is incremental' (issue 1) and the O(delta) goal of opportunity 8. Sharing the prefix (Rc slices or a persistent vector) would fix it.
crates/rune-kit/src/markdown/cache.rs:98 base.doc.0[..cut.blocks].to_vec(), :104-105 maps .iter().cloned(), :57 c.docs.get(src) hashes full src, :74 let key: Rc<str> = src.into()
Low
Markdown diff fences are uncapped: one row and one wrapped text per line
Block::Diff renders a keyed row plus a wrapped tabbed text for every line, with no line cap. It filters the complete highlight list once per line, which is O(lines x highlights) when find highlights are present. Code fences, by contrast, are a single text with a 32 KiB colour cap. A large diff in a streaming reply (never memo'd) rebuilds thousands of elements every commit.
crates/rune-kit/src/markdown/render.rs:351-388 (loop over src.split('\n'), all_hl.iter().filter_map per line, row().child(...wrap()))
Low
Concurrent growing streams leak dead prefixes into the STREAMS budget
Stale-prefix removal runs only when grown is Some, that is, when the new source extends last. With two streams growing in the same commit, last belongs to the other stream, grown is None, and each stream's previous string is never removed. Every commit adds a parsed copy of each stream, until LRU eviction past the 4 MiB budget (with a two-commit grace period). The notes give the full-parse cost of this case but not the memory churn.
crates/rune-kit/src/markdown/cache.rs:60 grown filter, :69-72 removal only under if let Some(last) = grown, :32 STREAMS = CACHE_BYTES / 4
Low
Diff chunks double-cache through the shared syntax cache and hit its 32 KiB cap
DiffState::highlights sends each reassembled 128-line chunk through Highlighter::highlight. That call cuts the text at 32 KiB, so for long lines (minified or generated files) only the start of the chunk gets colour. It also stores a copy of up to 32 KiB of chunk text plus its ranges in the global 4 MiB syntax CACHE, on top of DiffState's own chunk map. Scrolling a large diff churns the cache that Markdown code fences share.
crates/rune-kit/src/diff/state.rs:711-721; crates/rune-kit/src/syntax.rs:166 &code[..scan::coloured_len(code)], :181 insert with src: code.to_owned(); crates/rune-kit/src/syntax/scan.rs:76 MAX_SOURCE = 32 KiB
16

Effects, lighting, knobs and theming tokens

working

El::effect slots plus a Compositor hook give apps custom GPU passes in painter order. rune-fx (10 effects, 11 fills) is solid and well tested. rune-light (SDF shadows, GI, glass) is a fast but barely tested prototype that doesn't handle the new sRGB-blend default. Tokens come from @opencode/ui through a browser-resolved JSON file and are re-solved per blend mode. rune-knobs is a feature-gated dev panel.

Summary (534 words)

Rune's core draws one painter-ordered stream of 128-byte Instances. This area adds an escape hatch on top of it. Compositor (compose.rs:34) takes over a frame. El::effect(mark) records a KIND_EFFECT slot (slots.rs:10) that keeps its z-order, clip, rounded clip, soft edges and isolated layer. A faded slot always gets a layer, so the compositor can't forget opacity. Renderer::draw_with_backdrop calls a hook at each slot (render.rs:968-1052). Slots with effect_backdrop(true) split the pass and copy the target into a pooled viewport-sized texture (pass.rs:52-180). The hook receives EffectSite with mark, payload, scale, format, origin, in_layer, srgb_blend and backdrop.

rune-fx is a library of instanced-quad fragment shaders with no runtime dependency on rune. It has 8 pipeline families × 2 blends × N formats, each built lazily and in parallel (pipes.rs). That took a cold first glow from 1.80 s to 71 ms. Each instance is 256 B, hashes are integer only, and 1D functions run as per-frame CPU tables. Its sRGB handling is careful (bd_lin, split cover/light encode), and it has W3C blend modes, a half-res frost pyramid, a fills catalog with get/set/to_rust, and an opt-in stateful fire simulation. It has 58 tests, including 24 GPU integration tests, but no pixel goldens.

rune-light lights the UI as passes over a frame drawn by hand. It uses an exact analytic SDF field with tile culling (0.07 ms), sphere-traced soft shadows with Quílez/Aaltonen penumbrae, half-res shadows with a bilateral upsample, 5-cascade radiance GI at 1/8 res, a composite with a contrast floor for text, and a separate thick-glass renderer. Measured: 1.04 ms per frame for 4 lights at 4 Mpx, 3.44 ms with GI. It has only 4 tests, no resize, and about 90 MB of targets at 2560×1600. Its field silently drops primitives past 256 per tile, and which ones it drops is non-deterministic. It needs glyphs partitioned out, which conflicts with layer isolation. It also assumes linear base, while windows now blend in sRGB by default. The lab and cursed-settings compositors never opt out, so they probably double-encode (unverified).

Theming: theme.mjs resolves @opencode/ui's CSS tokens in Chromium. It writes theme.json (1,197 tokens per mode, shadows, and 66 numbers that nothing reads). rune::Theme::from_json decodes it. A thread-local blend mode re-solves sRGB-authored translucent tokens for linear windows (srgb_equivalent). rune_theme_opencode::build maps the tokens into rune_kit::Kit, with 4 cached kits. Light/dark follows the system through set_system_dark. Radius, type and motion are hardcoded rather than read from the numbers. theme.json hasn't been regenerated since it was imported. A separate legacy rune::tok::Theme still claims linear-light alphas.

rune-knobs: const Knob and Group values keyed to element keys, plain-data Knobs state with undo/presets/kept values, a side or floating panel built in Rune, and 40 tests. Without the panel feature, get returns defaults. rune-fx has a second, unrelated Knob type, and the lab uses that one rather than rune-knobs.

Main debt: three separate blur pyramids with different calibration. rune-fx's taps are unclamped and its σ comes out about 33% wider than nominal by core's measured table (plausible). Every backdrop slot copies the whole target, and every surface pays for COPY_SRC. Effect time is f32. Effect shapes have one radius. Each slot compositor repeats the same adapter glue. rune-fx include_str!s rune's clip.wgsl across crates. Several READMEs are stale.

Why this maturity: The core effect-slot and backdrop paths are solid and well tested, and rune-fx is solid (58 tests, careful sRGB and layer handling, lazy pipelines). rune-knobs is solid for a dev tool. rune-light is a fast prototype with 4 tests, no resize, no Rune integration, and a likely sRGB-default incompatibility. The theme pipeline works but covers only colours and shadows from one stale snapshot.

Issues, most severe first
Medium
Lighting compositors ignore the sRGB-blend default
rune-light expects linear base and text, but since fefcd431 windows premultiply in sRGB by default. The lab and cursed-settings never opt out or read Frame::srgb_blend, and their resolve encodes again, so they likely double-encode. rune-light has no sRGB-blend mode at all, unlike rune-fx.
app.rs:128 (srgb_blend: true); window.rs:454; runtime/paint/blend.rs:8-14; examples/lab/src/main.rs:152-189 (no srgb_blend(false)); examples/lab/src/gfx/gpu.rs:61-71; rg finds no srgb in lab/cursed-settings gfx; demo/lab images from 2026-10-22, before the 2026-10-29 switch. Unverified at runtime.
✓ Confirmed
Medium
rune-light field drops primitives silently and non-deterministically on overflow
Each 16×16 tile keeps at most 256 primitives within CLAMP. Extras are dropped, and which ones depends on atomicAdd order, which breaks the stated determinism guarantee on dense layouts.
crates/rune-light/src/shaders/field.wgsl:7-8, 36-41, 44-45
✓ Confirmed
Medium
rune-light needs glyph partitioning, which conflicts with layer isolation
The compositor contract forbids partitioning scopes by primitive kind, but rune-light needs text in its own target; the lab flattens opacity to cope.
crates/rune/README.md:2016-2019 and Isolated opacity section ('still uses its previous flattened-opacity semantics'); rune-light README Inputs table
✓ Confirmed
Medium
Whole-target backdrop copies per effect slot and never-freed pooled textures
split_for_backdrop copies the entire target (copy: None), plus a clear pass inside layers; core backdrop_blur copies only its region. Pooled backdrops (16-33 MB each at 4 Mpx) are never released.
crates/rune/src/render/pass.rs:63, 100-114, 200-224; backdrop_blur.rs:422; render/upload.rs:242-249; rune-fx README:331-332
✓ Confirmed
Medium
Three separate blur pyramids with inconsistent calibration and edge handling
Core backdrop_blur clamps taps to its region and uses measured SIGMAS with variance weights. rune-fx BlurPyramid doesn't clamp, so taps read stale texels outside scissored writes, and its level choice gives σ about 33% wider than its nominal 18 pt (plausible). rune-light glass runs another unscissored full-screen pyramid.
render/backdrop_blur.rs:25, 81-88; rune-fx renderer.rs:489-551, shaders/blur.wgsl:24-56; rune-light glass.rs:154-176, 314-322
✓ Confirmed
11 more verified issues
Medium
rune-light has no resize, eager pipelines and a large memory footprint
Targets are fixed at construction, so a resize rebuilds every pipeline. About 90 MB of targets at 2560×1600; the air array is allocated even without shafts.
crates/rune-light/src/lib.rs:449-650; targets.rs:48-57; examples/live.rs:165-172
✓ Confirmed
Medium
rune-light is barely tested
Only 4 tests (allocation, bind reuse, precompile). Shadow, GI and glass correctness is checked only by the light verify example, not CI.
rg '#[test]' crates/rune-light → targets.rs (3), builtin_shaders.rs (1); README Verification section
✓ Confirmed
Low
Every surface requests COPY_SRC (loses framebufferOnly on Metal) for all apps
Backdrop features force COPY_SRC on every window surface, whether or not the app uses them; I found no measurement of the cost.
crates/rune/src/window.rs:582-585
✓ Confirmed
Low
Effect time is f32
FxLayer::time and inst.t are f32, and compositors cast the f64 clock. After about a day of uptime the f32 step is about 7.8 ms, so noise-driven effects could visibly step in long-running apps.
crates/rune-fx/src/lib.rs:297; pack.rs:126; examples/showreel/src/gfx.rs:143
✓ Confirmed
Low
Effect shapes take one circular radius
Per-corner and continuous (superellipse) corners are folded to a max circular radius by every compositor, so effect outlines don't match asymmetric or continuous elements.
crates/rune-fx/src/lib.rs:88-103; examples/showreel/src/gfx.rs:154; crates/rune-fx/tests/in_layer.rs:37
✓ Confirmed
Low
Repeated slot-to-fx adapter glue, and reduced motion not propagated
Each compositor re-scans instances for KIND_EFFECT, converts units, builds FxSlots and maps site.index with an O(n²) position. EffectSite carries no reduced-motion flag, and the showreel never sets .reduced().
examples/showreel/src/gfx.rs:146-191; crates/rune-fx/tests/in_layer.rs:26-40; render.rs:119-158
≈ Partly The glue and the O(slots^2) at.iter().position lookup per hook call are confirmed. But reduced motion is reachable: Runtime::reduced_motion is a pub field that compositors can read as f.rt.reduced_motion. It is missing from EffectSite, and the showreel ignores it. The lab does pass .reduced(s.reduced).
Low
rune-fx include_str!s rune's private clip.wgsl across crate boundaries
This couples rune-fx to rune's instance fade-word packing without a dependency edge and breaks cargo package. NO_CLIP is duplicated.
crates/rune-fx/src/pipes.rs:12; lib.rs:290
≈ Partly The coupling and the duplicate NO_CLIP are confirmed. 'Breaks cargo package' is moot today. rune-fx already depends on rune-motion and rune-staging, which are publish = false, so it cannot be packaged anyway. The include is the only cross-crate source path in fx and light.
Low
Theme numbers unused; radius, type and motion hardcoded
theme.json's 66 numbers (radius-xs..xl, font sizes, line heights) are loaded, but Theme::num is never called. The kit hardcodes Radius, Type and springs, so a regenerated theme won't carry them. theme.json hasn't been regenerated since import and has no drift check.
themes/opencode/src/lib.rs:213-239; rg '\.num\(' finds no callers; git log themes/opencode/assets/theme.json → 484b7667 only
✓ Confirmed
Low
Stale docs across the area
rune-fx README says bind groups are rebuilt each prepare and tests live in lib.rs; rune-light README says the field clamp is 128 (code: 256) and its Scene example omits emission so it won't compile; rune-light lib.rs says GI is quarter-res (code: 1/8); tok.rs claims linear-light alphas; rune-knobs has misplaced doc comments.
rune-fx README:340, 343; rune-light README:27, 127; field.wgsl:7; rune-light lib.rs:11, 372; tok.rs:143; rune-knobs lib.rs:303, 567
✓ Confirmed
Low
Duplicate concepts: two Knob types and two Theme types
rune_fx::Knob and rune_knobs::Knob are unrelated, and the lab uses its own panel. rune::Theme (JSON) and rune::tok::Theme (neutral struct) share a name; tok also duplicates Kit::neutral.
crates/rune-fx/src/params.rs:7-16; crates/rune-knobs/src/lib.rs:76-93; examples/lab/src/knobs.rs:6; crates/rune/src/lib.rs:309; tok.rs:145
≈ Partly The two unrelated Knob types and the shared Theme name are confirmed. 'tok also duplicates Kit::neutral' is wrong: Kit::neutral is built from tok::theme and tok::accent. So tok is the source of the kit's neutral default, not a duplicate of it.
Low
Possible private-project names in public shader comments
rune-light shaders cite 'Arcade … packages/kit/gpu/…' while the README anonymises the same source; rune-fx cites 'psychopomp'. AGENTS.md public-repo rules apply if these are private.
crates/rune-light/src/shaders/common.wgsl:63,84; shadow.wgsl:5-6; lib.rs:209; rune-fx distort.wgsl:31; README:244
≈ Partly The names are present. But the README does not fully anonymise the source: it hides the name 'Arcade' yet lists the same packages/kit/gpu/... paths (README:97-100). 'psychopomp' is already named in PLAN.md and research/06, so it doesn't come from this area alone. Whether either project is private cannot be determined from the repo.
Strengths
  • The effect-slot design is clean: slots inherit isolation, clipping, transforms and exit fades, and carry mark and payload bit-exactly through exit transitions. It has thorough core tests (effect_slot 10, effect_data 3, backdrop_blur 11).
  • rune-fx handles sRGB-blend versus linear frames, isolated Rgba16Float layers, and backdrop encodings explicitly, with GPU tests for double-decode, fades, rounded scroll clips and negative origins.
  • Cold-start work is measured and fixed: lazy parallel pipelines (1.8 s to 71 ms to first glow) and a precompiled metallib covering rune-fx and rune-light, guarded by a test.
  • Strict culling: silent or finished layers and offscreen layers get no instance, draw or tables; is_animating lets idle windows stop ticking.
  • rune-light has strong measured performance (4 lights at 4 Mpx in about 1 ms, GI about 2.3 ms independent of emitters), plus CPU-estimator and ground-truth verification tooling and a GI inspection API.
  • The token pipeline is faithful: the browser resolves every CSS token, translucency is re-solved per blend mode with a tested browser-pixel match, and light/dark follows the system live.
  • The fill catalog (fill_styles, Param/ParamKind, get/set/to_rust) gives tools a schema and code emission without a second definition.
  • rune-knobs has a polished dev UX (tree/filter/side panel, undo/redo, presets, kept values, region outlining) with 40 headless tests and zero cost in shipped builds.
  • Docs are unusually detailed, with cost tables and integration contracts.
Key concepts
  • Effect slot: A KIND_EFFECT record that paints nothing but keeps its painter position, clip, rounded clip and enclosing layer. The compositor's hook paints there and gets an EffectSite (mark, data, scale, format, origin, in_layer, srgb_blend, backdrop).
  • Backdrop split: At effect_backdrop(true) slots and backdrop_blur records the renderer ends the pass, copies the target into a pooled per-format texture, runs EffectPhase::Backdrop(encoder), and reopens with LoadOp::Load.
  • CLIP_WGSL: Rune's clip and rounded-clip maths exported as WGSL. Effects call clip_alpha(p, clip, fade) with the slot's packed fade words to match surrounding primitives.
  • FxLayer / FxSlot: Effect params + Shape + time + seed + opacity (struct-literal friendly), plus side-array per-slot metadata (scale, clip, fade, blend, backdrop encoding), so existing literals don't break.
  • Lazy pipeline matrix: One OnceLock pipeline per (8 families × 2 blends × formats), built the first time drawn and in parallel per prepare; under Rune's Metal backend they come from a precompiled metallib.
  • Backdrop encoding / bd_lin: A uniform tells shaders whether backdrop samples are sRGB-encoded premultiplied values; they are decoded to linear before glass and blend math so sRGB-blend frames never double-encode.
  • Analytic distance field lighting: rune-light extrudes marked rounded rects into slabs, builds an exact half-res SDF from primitives, sphere-traces penumbrae to spherical lights, and runs radiance-cascade GI at 1/8 res.
  • Text policy: Lit text takes the surface's light but is clamped to [floor, ceiling] of its design colour so shadows can't crush it and highlights can't wash it out.
Opportunities
Unify the backdrop blur as a renderer serviceimpact higheffort mediumre-architecture
Expose core BackdropBlur (region-sized, clamped taps, measured σ) through EffectPhase::Backdrop, for example a blurred view for (σ, region), and have rune-fx frost and rune-light glass consume it. This removes about 22 MB per FxRenderer, fixes stale-tap leaks and σ miscalibration, and gives one budget.
Copy only the slot's reach at backdrop slotsimpact higheffort low
Pass Some(rect ± bleed) into ActivePass::split as backdrop_blur already does, and skip the full clear inside layers. This saves 16-33 MB of copy per backdrop slot per frame at 4 Mpx.
An rune_fx::Slots adapter for El::effectimpact higheffort medium
One helper that turns instances into FxLayer and FxSlot keyed by site.index, with per-corner and continuous radii in Shape, reduced motion from the runtime, and per-mark resource retention, so El::effect plus rune-fx becomes a one-liner.
Integrate rune-light into the uber pass via MRTimpact higheffort highre-architecture
The uber pass writes base colour, text colour and the surface G-buffer, so rune-light needs no second raster and no glyph partitioning; add an El::light modifier and sRGB-blend decode of base. This fixes the isolation conflict and the sRGB regression, and saves about 0.6 ms of surface and composite at 4 Mpx.
rune-light resize and leaner targetsimpact mediumeffort low
Separate pipelines from Targets and add resize(); allocate air only with shafts; consider smaller formats for visibility and a half-res surface buffer.
Deterministic field overflowimpact mediumeffort low
Sort the per-tile list, do a two-pass compaction, or fall back to brute force when the count exceeds MAX_LOCAL.
Lazy COPY_SRC surface usageimpact mediumeffort low
Reconfigure the surface with COPY_SRC only once a backdrop record appears (or measure the framebufferOnly cost first), so plain apps keep the fast path.
Epoch-relative or wrapped effect timeimpact loweffort low
Pass effect time relative to a recent epoch, or wrap periodic phases on the CPU in f64, to avoid f32 stepping in long-running apps.
Typed theme codegen with a drift checkimpact mediumeffort medium
Generate typed token constants from theme.json so missing tokens fail at compile time, route numbers into Radius/Type/Motion, add a CI drift check against a pinned @opencode/ui, and import OpenCode's other themes as PaletteSeeds or JSON variants.
One knob schema and remote tuningimpact mediumeffort medium
Express rune_fx::Knob and the fill catalog as rune_knobs knobs or a shared trait, and add a headless command for agents to set knobs (research/02 '/tweak').
Half-resolution fire with bilateral upsampleimpact mediumeffort medium
Fire is the heaviest effect (1.3-1.8 ms); the README estimates about 3× from half-res evaluation.
Golden tests for rune-fx shaders and rune-light passesimpact mediumeffort medium
Turn light verify into a test, and add pixel goldens or CPU references for key effects at fixed (t, seed), using the existing determinism.
Numbers, key files, roadmap and the verifier's additions
Numbers
rune-fx size
5,849 Rust src + 2,228 WGSL (12 shaders) + 1,511 test-dir lines; 58 #[test] (34 unit, 24 GPU integration)
rune-light size
1,742 Rust src + 1,231 WGSL (7 shaders); 4,522 example lines; 4 #[test]
rune-knobs size
3,288 lines (about 970 tests); 40 #[test]
themes/opencode size
4,511 lines (about 4,050 generated icon tables); 7 #[test]; theme.json 1,197 tokens per mode, 66 numbers
Core effect/backdrop tests
effect_slot 10, effect_data 3, backdrop_blur 11, backdrop_tests 3, theme_blend 3, srgb_blend_runtime 6
rune-fx cold first glow
71 ms (was 1.80 s); FxRenderer::new 0.1 ms (was 919 ms); 20-150 ms per new pipeline on a cold Metal cache
rune-fx per-draw GPU (M5 Max, 960k px)
glow 0.10 ms, lens 0.21, lens+frost 0.40, electric arc 0.39, fire top 1.32 (heaviest)
rune-light frame (2560×1600, 100 occluders)
1 light 0.94 ms, 4 lights 1.04, 8 lights 1.65, 4+shafts 2.20, GI only 2.69, 4 lights+GI 3.44
rune-light field pass
0.07 ms with tile culling (was 1.3 ms brute force)
rune-light target memory (computed)
about 90 MB at 2560×1600 before GI
rune-fx frost pyramid memory (computed)
about 22 MB at 2560×1600, never freed
Pipeline matrix
8 families × 2 blends × N formats (32 for 2 formats)
Caps
MAX_BACKDROP_BLURS 4, rune-fx frost about 10 per frame (64 slots / 6 mips), MAX_NATIVE_MATERIALS 4, MAX_GLASS 8, MAX_LIGHTS 8, field MAX_LOCAL 256 per tile
System material sync (research/26)
Glass synced: 1.8% of moving frames off by more than 4 px vs 29% unsynced; glass layout 0.8-2 ms of main-thread time per frame
Key files
crates/rune/src/compose.rs Compositor trait, Frame, DeviceKey, write_buffer, draw_ui
crates/rune/src/render.rs KIND_EFFECT/KIND_BACKDROP_BLUR ABI (52-68), CLIP_WGSL, EffectSite/EffectPhase/hooks (116-179), draw_with* and draw_with_effects (930-1052)
crates/rune/src/render/pass.rs ActivePass split: end pass, copy target to pooled backdrop, run Backdrop hook, reopen LoadOp::Load; ensure_backdrop pool
crates/rune/src/runtime/paint/slots.rs Builds effect slot and backdrop-blur records; a faded slot gets begin/end_layer
crates/rune/src/el/effect.rs El::effect / effect_bleed / effect_backdrop / effect_data builders
crates/rune/src/render/backdrop_blur.rs Core El::backdrop_blur: region-sized dual-filter pyramid, measured SIGMAS, MAX_BACKDROP_BLURS=4
crates/rune/src/system_material/mod.rs SystemMaterial (Glass/Popover), view assignment, PresentFlag, fallback fill, RUNE_SYSTEM_MATERIAL modes
crates/rune/src/theme.rs JSON Theme, thread-local blend mode, for_blend/srgb_equivalent re-solving
crates/rune/src/color.rs Linear Color, OKLCH authoring, Oklab animation lanes, hex decode, premul/premul_srgb
crates/rune/src/tok.rs Core neutral tok::Theme, accents, TextStyle, space/radius consts
Roadmap items
  • Confirm and fix the sRGB-default incompatibility: give rune-light an srgb_blend decode for base and text (as rune-fx's bd_lin does) and update lab and cursed-settings to read Frame::srgb_blend.
  • Make backdrop-slot copies region-scoped (rect ± bleed) and request COPY_SRC lazily; measure framebufferOnly's cost.
  • Expose core BackdropBlur to compositors and retire rune-fx's BlurPyramid (and later the rune-light glass pyramid), with one σ calibration and one per-frame budget.
  • Ship an rune-fx slot adapter (instances → layers + FxSlot, per-corner and continuous radii, reduced motion, per-mark retention) and use it in the showreel and tests.
  • rune-light hardening: resize(), deterministic field overflow, lazy air target, turn light verify into a CI test, and goldens for shadows and GI.
  • Long-term: an uber-pass MRT G-buffer and an El::light modifier, so lighting no longer needs glyph partitioning and works with isolated layers.
  • Theme: typed token codegen, numbers feeding Radius/Type/Motion, a drift check against pinned @opencode/ui, import of additional OpenCode themes, and retiring or renaming rune::tok::Theme.
  • Knobs: merge rune_fx::Knob and the fill catalog into the rune-knobs schema; add a headless set-knob command for agents.
  • Fix stale docs (rune-fx Gaps, rune-light clamp, GI resolution and Scene example, tok.rs alpha note, knobs doc slips) and anonymise external project names if they are private.
Found by the verifier
Medium
Lab and cursed-settings decode rune-light's linear output a second time
Since bc04b1dc, LightRenderer writes linear light into Rgba16Float/Rgba32Float targets: encode = !is_srgb && !float_target. Before that commit, any non-sRGB target was encoded. Both examples create the renderer with HDR (Rgba16Float) but still apply from_srgb in fs_blit, with a stale comment saying the output is 'sRGB-encoded by rune-light's composite'. Before the sRGB default, this darkened and crushed the lit stage. Since the default, it half-cancels issue 1: base is sRGB-encoded and the blit decodes, while the surrounding UI is double-encoded. The lab now runs three encodings in one frame: UI sRGB-encoded, fx linear, and the lit stage shaded in gamma space then decoded. The rune-light README 'Output' paragraph is stale for the same reason. Unverified at runtime.
crates/rune-light/src/render.rs:38-39; crates/rune-light/src/lib.rs:417-418; git show bc04b1dc (srgb_target → float_target) with git merge-base showing 4a446b49 (lab) precedes it; examples/lab/src/gfx/gpu.rs:74-79; examples/cursed-settings/src/gfx.rs:86-91; examples/lab/src/gfx.rs:379; examples/cursed-settings/src/gfx.rs:525
Medium
tok and Kit::neutral alphas are tuned for linear light but render under the sRGB default
tok.rs says its alphas are for linear-light blending, so they sit much lower than CSS equivalents. Kit::neutral is built from tok::theme with blend_over: None. theme::for_blend only compensates sRGB-authored colours in linear windows; nothing compensates linear-authored colours in sRGB windows, which are now the default. In dark mode over bg ≈ 19/255, the 5% white card_border drops from ≈ 67/255 to ≈ 30/255, and the 1.6% hover from about +22 to about +4 levels. tok.rs has had no value change since fefcd431. This affects the playground chrome (playground/view.rs:9, 217), rewind scrub, about 24 tok users and every Kit::neutral app. The notes only flagged the stale comment. Unverified at runtime.
crates/rune/src/tok.rs:143-144, 166-185; crates/rune-kit/src/neutral.rs:17-19, 136; crates/rune/src/theme.rs:70-75; git log -- crates/rune/src/tok.rs (last change 655a3dd5, docs only); CHANGELOG.md:207-212
Low
rune-fx warms only its primary format, so faded slots compile pipelines serially mid-pass
prepare calls pipes.warm(self.format, ..) only for the renderer's main format. A faded El::effect slot always draws into an Rgba16Float isolated layer. Its pipeline is therefore built lazily inside the open render pass by draw_layer_in → pipes.get, one at a time, on the first faded frame. That is often an effect's enter fade, exactly when a hitch is visible. The cost is 20-150 ms per pipeline on a cold cache where the builtin metallib doesn't apply. draw_layer_in also panics if the compositor never called add_format for that format.
crates/rune-fx/src/renderer_prepare.rs:132; crates/rune-fx/src/renderer.rs:429-436 (expect("FxRenderer::add_format first"), pipes.get); crates/rune-fx/src/pipes.rs:1-5, 83-85; crates/rune/README.md:2027-2031 (faded slot always gets a layer, Rgba16Float)
Low
No compositor honours the device_key contract
Compositor::render's doc requires keeping resources keyed by f.device_key() and rebuilding them when it changes, for example an overlay shown again on another GPU. No example, test or library helper does this. The lab and showreel keep FxRenderer and LightRenderer in Option or get_or_insert_with, keyed only on size and format. A compositor attached to an overlay that moves GPUs would use resources from the old device.
crates/rune/src/compose.rs:43-49; rg device_key over examples, crates/rune-fx and crates/rune-light finds nothing; examples/lab/src/gfx.rs:130-132; examples/showreel/src/gfx.rs:163-167

Tooling and developer experience

Agent tooling · Examples and DX

12

Agent tooling, headless mode, playground, hot reload, reference renderer, perf infra, scripts

working

A real, well-tested headless driver (same Renderer, virtual clock, scripted input, PNG/tree/trace/video/HTML) and in-window playground, plus a guarded but slow (~8 s) Subsecond hot-reload tier, a CPU oracle with zero-outlier differential tests, and careful perf methodology. None of it runs in CI, and the PLAN's inspector socket, live literals and replay recorder don't exist.

Summary (548 words)

Rune's agent tooling is a thin, faithful offscreen driver of the real Runtime and Renderer. Args::parse (crates/rune/src/tooling/args.rs:86) decides headless vs window; headless_configured (tooling/headless.rs:54–475) parses a JSON script into primitive events (script.rs:19; tap/drag/type/scroll/resize are expanded, drags at 120 steps/s), resolves a Timeline (fps default 60, marks with ±offsets), and steps rt.frame(dt). That dt is the only clock, so timers, springs and playground steps are deterministic. Each frame it feeds the due events (elements addressed by key or key path, dying on a missing key), drains requests, draws, and reads pixels back through a 3-deep ring (record.rs:13). Outputs go to ≤4 PNG worker threads, an ffmpeg pipe (mp4/mov/webm), strips/crops, a pretty JSON tree that includes the accessibility tree (trace.rs:292), delta-encoded motion-lint JSONL (with native present times under --native), a static HTML export, a --chrome traffic-light check and a rune-first-pixels startup marker. Multi-window --desktop compositing lives in desktop.rs with its own loop. Same-machine byte determinism is tested (tooling/tests.rs:486). Fonts fall back to system fonts on native, and no environment manifest is written.

The playground (playground.rs, playground/*, runtime/playground.rs) is an in-window storybook. Scenes get fresh state, Stories own erased state, pages show the real state. Triggers queue Play::after steps timed from when they were due, which makes replays frame-exact. App::headless_runtime and open_playground/playground_trigger drive it in unit tests. It has 49 tests.

Hot reload (hot.rs) uses Dioxus Subsecond 0.7.10 behind the hot feature. scripts/rune-dev polls sources every 100 ms. It sends any change outside the --patch files to a restart. The syn guard in tools/rune-dev-guard compares token contracts (only free-fn bodies may change; impl methods, consts, attributes and macros are pinned), and accepted edits are copied atomically into a mirror that dx serve --hot-patch watches. Patches apply on the devtools thread; each Runtime clears memos and re-commits on its next frame. rune::run(AppSpec) erases state into HostState; App/run_windows dispatch typed views via HotFn::current. Panicking patched views, rows, polls and on_key fall back to the startup code. --snap-on-patch/--hot-control gives agents a persistent session (tap, scroll, pause, step, quit). Measured: the toy spike ran at 989 ms median; Settings via rune-dev at about 8 s median, against a 300 ms goal. The launcher assumes maintainer infra (hivemind, the pro/studio hosts) unless --local.

rune-ref is an independent scalar transcription of shader.wgsl: strict f32, pinned soft-float libm, fp-contract off, sRGB8 quantisation after every primitive. It covers kinds 0–4 and 8–12 but not the vector kinds 5–7. It gives exact BLAKE3 goldens, CPU and GPU metamorphic properties, a 128-case proptest differential against the real Renderer at ≤2 levels with zero outlier pixels, per-pixel blame, a zero-allocation gate and a Linux instruction gate that has never run. On macOS its GPU lane now exercises the native Metal backend by default, which postdates research/24's measurements.

Perf infra: perf-profile-only benches with paired, alternating runs, medians and MAD (bench-ui/startup/live). Also real-frames and cost-attribution profilers, debug-only perf warnings, RUNE_COMMIT_BUDGET_MS, OTLP interaction timing with a frame-pointer stack-sampling watchdog, rune-perf (bounded recorder, unused in the repo) and procwatch.

Gaps: - No Rust CI except rune-www. - Five frame loops with duplicated script dispatch; one result is that a scripted resize is silently ignored in --desktop. - Stale README "Measured"/"Differences" sections. - PLAN overstates hot-reload layers 0–2 and latency. - The inspector socket, the mk CLI, the input replay recorder and research/16's compact tree/protocol are not started.

Why this maturity: The headless runner and playground are solid: broad features, 97 + 49 tests, determinism tests. rune-ref is working to solid for its covered kinds. Hot reload is a guarded prototype-to-working tier (about 8 s, maintainer-infra coupled). rune-perf and rune-register are unadopted. The inspector, replay and CI pieces of the plan are absent, so the area as a whole sits at working.

Issues, most severe first
High
No CI for tooling, playground, hot, rune-ref, alloc or instruction gates
Only site and www workflows exist; the only Rust test in CI is cargo test -p rune-www. PLAN §8 says CI runs deterministic correctness on every change.
.github/workflows/site.yml, .github/workflows/www.yml:84; PLAN.md:503
≈ Partly The core claim holds: no rune, rune-kit, rune-ref, alloc or tooling test runs in CI. But www.yml runs on pushes and PRs that touch crates/**. It builds Rune for Linux and wasm, runs 10 rune-www Runtime-level tests, and runs the --html exporter end to end. So tooling/html.rs is exercised in CI and Rune has to compile on Linux.
Medium
Duplicated frame loops and script dispatch; scripted resize silently ignored in --desktop
Five loops (headless_configured, desktop::run, hot::headless, html::settle, motion_gate). Desktop routes Kind::Resize to pointer_input→canvas_input, which returns false for it.
tooling/headless.rs:249-278 vs desktop/window.rs:316-335; desktop.rs:377-380; tooling.rs:361-374
✓ Confirmed
Medium
--snap-on-patch renders with a partially configured runtime
hot::headless sets only srgb_blend, font smoothing and scroll bars. It skips modifier_keys, tab_visits_controls, on_focus/on_ime, headless chrome inset, fit_height, transparency, compositor and playground, so it can differ from --snap.
crates/rune/src/hot.rs:317-330 vs tooling/headless.rs:107-124
✓ Confirmed
Medium
Hot reload far from target and narrow
About 8 s median save-to-GPU for Settings vs the 300 ms goal; impl-method bodies force a restart; only settings is registered as an in-repo example; the watcher runs git ls-files and stats ~1,458 files every 100 ms.
crates/rune/README.md:2797-2799; tools/rune-dev-guard/src/main.rs:52; scripts/rune-dev:37, 72-92, 140-151
≈ Partly The numbers and limits are right: about 8 s median, impl-method bodies are token-exact, only settings is in EXAMPLES, and a 100 ms git ls-files + stat poll runs over about 1,461 files today. But 'narrow' applies to in-repo examples only. scripts/rune-hot --manifest/--patch and the External crate support let out-of-repo apps use it.
Medium
Docs drift: README Measured/Differences stale, PLAN overstates hot reload
Differences says wgpu not own HAL, no AccessKit, vertical-only scroll; code has native Metal as the macOS default, accesskit deps and scroll_x. Measured is dated 2026-10-23. PLAN §5 says tokens/literals/shaders reload today and layer 3 is ~1 s; live literals and shader reload don't exist (tune! removed) and the real app measures ~8 s. README's type-erasure claim covers only rune::run.
crates/rune/README.md:2801-2821; gpu/backend.rs:28; crates/rune/Cargo.toml:57; el/scroll.rs:45; PLAN.md:281-296; CHANGELOG.md:872-876
✓ Confirmed
8 more verified issues
Medium
Determinism is same-machine only and unrecorded
Native text falls back to system fonts; the GPU backend/adapter is implicit; background threads from setup aren't awaited; trace/tree headers carry no rev, backend, adapter or font manifest.
text/families.rs:26-31; tooling/headless.rs:107; tooling/trace.rs:55-58
✓ Confirmed
Low
Mid-run die() loses outputs
process::exit(2) skips destructors: the BufWriter trace isn't flushed, PNG workers aren't joined and the ffmpeg file is truncated when e.g. a script key is missing at t>0. Unknown script fields are ignored silently.
tooling/args.rs:288-291; tooling/headless.rs:245; tooling/trace.rs:11
≈ Partly The trace BufWriter loss and the PNG worker loss are real. PNGs are written directly to their final paths, so partial files can be left. But ffmpeg is not killed and the file isn't simply truncated: its stdin closes on exit, so an orphaned ffmpeg most likely finalizes a shorter video after Rune returns, and the queued frames are lost. Unknown fields are ignored silently, but an unknown event type dies.
Low
Patches can split a frame across generations
subsecond::apply_patch runs on the devtools thread while the UI thread does per-call HotFn::current lookups; the re-commit happens on the next frame only.
crates/rune/src/hot.rs:224-237; runtime/frame.rs:383-388
≈ Partly Rune's side is confirmed: apply_patch runs in the devtools callback, HotFn::current is looked up per call, and the re-commit happens only at the next frame start. Subsecond's jump-table internals could not be checked (the crate source isn't available locally), so whether a mid-frame swap is observable is unverified.
Low
Benchmarks regex human-readable stderr
bench-ui.py and bench-live.py depend on the exact wording of the headless summary line.
scripts/bench-ui.py:56; scripts/bench-live.py:24; tooling/headless.rs:454-462
✓ Confirmed
Low
rune-ref backend under test is implicit; vector kinds uncovered
GpuRenderer uses Gpu::instance(), which is native Metal on macOS by default, while research/24's numbers predate it. Kinds 5-7 are rejected by validate. The Linux instruction gate has never run.
crates/rune-ref/src/gpu.rs:62; render.rs:509-513; rune-ref/src/lib.rs:119; shader.wgsl:440-444; research/24 'Exact gates'
✓ Confirmed
Low
Maintainer-infra coupling in public scripts
rune-dev hardcodes hivemind, build host 'pro' and hostname 'studio'; the check-*-macos scripts need CuaDriver.app and /tmp/pro-gui.lock.
scripts/rune-dev:842, 950-954; scripts/check-native-menu-macos.py:13; scripts/check-dock-menu-macos.py:2
✓ Confirmed
Low
Unadopted crates and duplicated counting allocators
rune-perf and rune-register have no in-repo consumers. Four separate counting allocators exist.
rg rune_perf/rune_register; procwatch/src/alloc.rs, tooling/test_alloc.rs, crates/rune/tests/alloc.rs, rune-ref/tests/alloc.rs
≈ Partly rune-perf and rune-register have no in-repo consumers (confirmed). But there are about 10 GlobalAlloc counting impls, not four.
Low
No native scripted replay; --native --script ignores the script
In window mode, args.script only suppresses URL opening.
crates/rune/src/window.rs:469; tooling/args.rs:214-215
✓ Confirmed
Strengths
  • Headless driver covers a very wide input vocabulary (pointer buttons, gestures, physical keys, global shortcuts, menus, pop-ups, file dialogs, drag-in files, rich paste, window resize, reopen) through the real Runtime APIs
  • Same-machine byte determinism tested, including multi-window desktop compositing (tooling/tests.rs:486)
  • Careful output engineering: pipelined readback with a serial-equivalence GPU test, fail-fast ffmpeg check before GPU init, encoder reaping, BT.709 tagging
  • Trees include the accessibility tree; traces carry intent flags, sampled tracks, scroll carry and present times
  • Playground replays are frame-exact via due-time step scheduling; real state is isolated; 49 tests
  • Hot-reload integration closes every trap research/08 found (pointer-sized closure fallback, field additions, statics, vtables) and survives panicking patches
  • rune-ref is independent, exact (soft-float libm, no FMA), has per-pixel blame, a minimized regression corpus and a zero-allocation gate; it already caught a real 83-level glyph sampling bug
  • Perf methodology is unusually disciplined: perf-profile enforcement, paired alternation, identical-binary refusal, explicit statements of what headless omits
  • Perf instrumentation costs one cached load when off; the stack sampler is lock- and allocation-free between suspend and resume
Key concepts
  • Virtual clock: Headless time is only the dt passed to Runtime::frame; timers, springs and Play::after run on rt.clock, so the same script gives the same frames
  • Script events: Timestamped JSON input (pointer, keys, physical, shortcuts, paste, wheel/gestures, files, menus, dialogs, resize, marks), addressed by xy or key path, expanded into primitive Ev before the run
  • Marks: Named script times used by --at/--start mark:NAME±S and --duration auto
  • Readback ring: Three staging buffers so the GPU renders frame n+1 while frame n maps; deliveries stay in order
  • Motion-lint trace: Delta-encoded JSONL of element rects/opacity/flags/intent per frame plus quality metrics; Scrawl-compatible
  • Playground stage: Scene/story/page state that handlers act on while open; the real state is untouched and keeps polling
  • Play::after: Trigger steps timed from when the previous step was due, for exact replays
  • HostState: Hot-build type erasure of app state so Runtime<HostState> compiles once in the rune library
Opportunities
Single HeadlessHost driverimpact higheffort mediumre-architecture
One owner of clock, script feed, request draining, GPU/readback and sinks, with per-window members; the single-window path becomes a one-member desktop. Removes duplicated dispatch (fixes desktop resize) and unifies --snap-on-patch configuration.
Persistent agent session / inspector protocolimpact higheffort mediumre-architecture
Generalize --hot-control into a JSON-lines stdin/stdout or loopback session (input any ScriptEvent, step, pause, snap, tree query, trace toggle) for all builds. Saves process, GPU and app init per query and realizes PLAN §6's inspector.
CI for correctness gatesimpact higheffort medium
Linux lavapipe job: cargo test rune/rune-kit, rune-ref CPU hashes and metamorphic, alloc gates, first instruction baseline, test-rune-dev.py; macOS runner for the GPU differential on both backends.
Compact queryable treeimpact mediumeffort low
--tree-format compact with stable short ids and only non-default fields, plus --tree-query role=/text~ filters (research/16 §4).
Environment manifest and pinned-font modeimpact mediumeffort low
Record rev/backend/adapter/OS/font hash/scale in trace, tree and first-pixels; add a bundled-fonts-only headless mode that fails on fallback.
Hot-reload latency instrumentation and narrowingimpact higheffort high
Per-stage timestamps in rune-hot-pixels, fs events instead of 100 ms git ls-files polling, views in a leaf crate, permit impl bodies on pinned types, PLAN S1b (foreground priority, fast linker, cranelift).
Structured benchmark summary lineimpact loweffort low
Emit rune-summary {json} beside the human line and switch bench-ui/bench-live off regexes.
Memoize and virtualize the playground sidebarimpact mediumeffort low
playground/* uses no memo or virtual_rows; every stage commit rebuilds the list and side column.
Extend rune-refimpact mediumeffort medium
Add kinds 5-7; run the differential on RUNE_GPU_BACKEND=wgpu and metal explicitly; record the adapter in Difference.
Live input recorder to --scriptimpact mediumeffort medium
Inverse of Ev::public so a window session replays headless (PLAN §6b bug reports are replays).
Error propagation instead of in-loop dieimpact loweffort low
Flush trace, join writers and finalize video on script errors; validate keys and unknown fields up front where possible.
One counting allocatorimpact loweffort low
Use procwatch::alloc::Counting in the test binaries.
Numbers, key files, roadmap and the verifier's additions
Numbers
tooling lines (tooling.rs + tooling/)
7,119 (2,424 test lines)
playground lines
4,182 (1,245 test lines)
hot.rs + hot_state.rs
753
rune-ref / rune-perf / procwatch / rune-staging / rune-register / rune-dev-guard
2,020 / 859 / 1,116 / 309 / 168 / 114 lines
scripts/rune-dev
957 Python lines; test-rune-dev.py 21 tests
#[test] counts
tooling 97, playground 49, hot 12, rune-ref 23 + proptest, rune-perf 16, procwatch 12, rune-register 6, guard 5, rune-staging 0 own
motion-audit
1,535 Python lines, 24 scenario files
Readback depth / PNG workers / video channel
3 / clamp(1,4) / 3
Headless Settings frame CPU (README, 2026-10-23)
mean 0.13 ms, p95 0.29 ms, first 1.4 ms, GPU init ~11 ms, 174 instances
Hot reload save→pixels
spike 989 ms median / 1,150 p95; Settings ~8 s median
rune-ref measured max delta
1 per primitive, 2 composite; gate 2 with 0 outliers; pre-fix glyph bug 83 levels / 231 px
Instruction gate
+0.5% threshold, never executed
tooling/tests.rs size
978 lines (cap 1,000)
Key files
crates/rune/src/tooling.rs AppSpec, Chrome, run/run_windows entry points, script Kind/Pos/Ev types, shared input helpers (510 lines)
crates/rune/src/tooling/headless.rs Offscreen deterministic frame loop (headless_configured), Timeline, traffic-light overlay (620 lines)
crates/rune/src/tooling/args.rs All tooling flags, headless() decision, is_headless(), die()
crates/rune/src/tooling/script.rs Script JSON parser and event expansion
crates/rune/src/tooling/record.rs 3-deep readback ring, PNG worker pool, ffmpeg video writer
crates/rune/src/tooling/trace.rs Motion-lint JSONL writer and --tree JSON (incl. a11y tree)
crates/rune/src/tooling/headless_run.rs Public HeadlessRun the app reads from init
crates/rune/src/tooling/interaction.rs OTLP interaction timing, watchdog stack sampler (interaction/*)
crates/rune/src/tooling/perf_warn.rs Debug-only perf warnings and commit budget (perf_warn/*)
crates/rune/src/desktop.rs Multi-window --desktop compositor loop (second, duplicated script dispatcher)
Roadmap items
  • Add CI: Linux lavapipe job for rune/rune-kit tests, rune-ref CPU lane, alloc gates, instruction baseline, test-rune-dev.py; macOS job for the GPU differential on both backends
  • Fix the desktop scripted-resize gap and unify script dispatch, then collapse the headless loops into one HeadlessHost
  • Bring --snap-on-patch to the same runtime configuration as --snap
  • Add an environment manifest and a pinned-font headless mode
  • Add a structured rune-summary line and port the bench scripts to it
  • Prototype a persistent JSON-lines agent session (generalizing --hot-control) as the inspector protocol
  • Add a compact queryable tree format
  • Instrument hot-reload stages, replace polling with fs events, pursue PLAN S1b to cut the ~8 s
  • Extend rune-ref to kinds 5-7 and pin and report the backend
  • Refresh README Measured/Differences and PLAN §5 to match code
Found by the verifier
Medium
The hot feature is never compiled by the documented check and test commands
hot is not a default feature, and only examples/settings enables it, through its own opt-in hot feature. So cargo check --workspace --all-targets and cargo test -p rune -p rune-kit never build hot.rs (737 lines, 12 tests) or any #[cfg(feature = "hot")] branch in the runtime, playground or headless code. With no CI either, these branches can rot unseen until someone runs scripts/rune-dev.
crates/rune/Cargo.toml:8 (default list), :19 (hot); examples/settings/Cargo.toml:9 is the only rune/hot enabler; cfg(hot) sites at runtime/frame.rs:109,382, runtime/commit/measure.rs:378,386, playground/stage.rs:107,120, tooling/headless.rs:67; AGENTS.md Commands
Low
rune-dev-guard, the hot-patch soundness guard, is outside the workspace
tools/rune-dev-guard is excluded from the workspace and has its own [workspace], so workspace check and test commands never build it or run its 5 tests. Only rune-dev builds it, on demand. A broken guard would surface only at launch.
Cargo.toml:52 exclude = ["tools/rune-dev-guard"]; tools/rune-dev-guard/Cargo.toml:7 [workspace]; scripts/rune-dev:851-853
Low
Virtual-clock traces are not byte-reproducible
Each trace line's quality object carries the measured wall-clock frame time (cpu_ms). The same script on the same machine therefore writes different trace bytes, so comparing traces across runs or revisions needs this field stripped. PNGs and the tree are unaffected.
crates/rune/src/tooling/trace.rs:225-226; tooling/headless.rs:375,392 (ms = frame_start.elapsed(), passed to tr.frame)
Low
--snap-on-patch silently ignores other headless flags
In hot builds, --snap-on-patch takes over before the script, trace, tree, video and --at handling. A combined invocation such as --snap-on-patch x.png --script s.json --tree t.json drops the extra flags without warning. This compounds issue 3: the hot PNG can differ from --snap of the same app.
crates/rune/src/tooling/headless.rs:67-70 (return before read_script at :79); crates/rune/src/hot.rs:139-142, 317-405
17

Examples, app-author developer experience and API ergonomics

working

The API is rich and its runtime diagnostics are excellent, but the 30 examples never use the performance-critical patterns the docs require. The surface is large (314 El methods). Type and identity mistakes fail silently or late. The flagship OpenCode Desktop app that drives the API is not in this repo, and no Rust CI compiles the examples.

Summary (544 words)

A Rune app is a single state type S, a view fn(&S, &mut Cx<S>) -> El, and handlers queued between frames that get &mut S. It is wired up through AppSpec (a struct of plain fn pointers, tooling.rs:17-59), App::new(spec) or run_windows. El is one concrete, non-generic builder of about 60 fields (el.rs:475). Handlers are stored as Rc<dyn Fn> and downcast to S at run time (states.rs:56-58). That keeps compiles fast and errors short, and lets playground stories and kit components with other state types share a window. Every binary carries the headless agent toolkit (about 35 flags: --snap, --tree, --script, --video, --desktop, --trace, --html), which is the strongest DX feature.

Code size is good for motion-heavy UI. hello's view is 14 lines and todo's animated list 36. A primitives-only settings window takes 375 lines; kit-based pages take about 110 lines each (cursed-settings ui.rs). Presence, springs, focus, a11y and headless tests come for free. The surface is large and uneven: 314 public El methods (51 on_* handlers spread across 7+ files, with on_x/on_x_tx/_any variants), 82 Tx, 27 Cx, 45 App and 124 Runtime methods, and 276 root re-exports with no prelude. There are three theme concepts, and tok::Theme and rune::Theme share a name. Twelve literal-frozen types (AppSpec, Env, ScrollSpec, ...) make any new field a breaking change.

Footguns are well documented: the README sections, the site's before/after Fast apps page, and scripts/app-audit, an 88-line grep that finds 1 issue in examples and 6 in rune-kit. About 15 debug-only warn_once meters name the call site and fix for idle polls, idle draws, overbuilt virtualize lists, scroll commits, hover handlers, blocking waits and slow first frames. Layout and duplicate-key messages also give the fix. Identity and type mistakes are not caught: a handler for the wrong S panics on first press with no location; unknown role strings silently become Group or Button (roles.rs:103); unkeyed dynamic children get no warning; uncoloured text draws white.

The examples, which agents are told to copy, have zero uses of virtual_rows, virtualize, memo, live_only, prewarm_gpu or on_ready. Only 4 of 30 use rune-kit; hello, settings, playground and web-showcase build switches by hand. 18 sites hard-code a dark theme. todo hard-codes a 312 pt bar width instead of w_frac. live-values and overlay hand-roll headless detection that disagrees with Args::headless on 7 flags, so --script --video runs there are not deterministic.

The OpenCode Desktop recreation is not in this repo. There are only 8 golden PNGs in demo/opencode (the commit that refreshed them changed binaries only), the theme crate, and kit shell components. The API's main consumer, and the source of most Fast-apps lessons, is outside any test here. The only Rust CI job is cargo test -p rune-www. Breaking changes (476 changelog bullets in 17 days) reach pinned apps through the changelog alone.

Several docs disagree with the code. README "Differences from PLAN.md" still says no AccessKit, vertical-only scrolling and wgpu only. lib.rs still calls itself the "first slice". tok::Theme claims linear-light alphas while sRGB is the default. memo's rustdoc example is the anti-pattern FastApps forbids. Hot reload measures about 8 s against PLAN's ~1 s and 300 ms goal. Planned features never built: the Model<T>/cx.read state, llms.txt, the inspector socket, the missing-key error, and examples-as-tests (15 of 30 examples have no test).

Why this maturity: The API is rich, used in production-like settings by an external flagship, well documented, and backed by excellent runtime diagnostics and headless tooling. But the examples cover OS and effect features without demonstrating the performance-critical patterns, half of them have no test, nothing compiles them in CI, several docs are stale, and type and identity misuse fails silently or late.

Issues, most severe first
High
Examples never demonstrate the performance-critical patterns
The docs say to use virtual_rows, memo, live_only, prewarm_gpu first in main and on_ready deferral, but none of the 30 app examples uses any of them. Agents are told to start from examples and research 16 says models copy examples, so new apps will miss these patterns until debug warnings fire.
rg counts in examples/: prewarm_gpu 0, virtual_rows 0, memo( 0, live_only 0, on_ready 0 in Rust; README.md:35-39 'start from examples/hello'; crates/rune/README.md:650
✓ Confirmed
High
Flagship OpenCode Desktop app is outside the repo and there is no Rust CI
The API's most demanding consumer and the source of most Fast-apps lessons is not compiled or tested here. The hero screenshots can't be regenerated. The only Rust CI job is cargo test -p rune-www. 476 changelog bullets in 17 days reach pinned apps through the changelog alone.
demo/opencode/*.png refreshed by binary-only commit b2deca8a; README.md:14; PLAN.md:573-580; .github/workflows/www.yml:84; CHANGELOG.md 476 bullets
≈ Partly The flagship part holds: b2deca8a changes 8 PNGs and no source, and nothing in the repo writes demo/opencode. 'No Rust CI' goes too far. www.yml runs on every change under crates/**. It compiles rune (default-features=false), rune-kit and rune-motion natively on Linux for cargo test -p rune-www and cargo run -p rune-www -- --html, and to wasm32 via scripts/web-build.sh. What CI does not do: run rune's or rune-kit's own ~2,600 #[test]s, build with default features, or compile any example. The 476 bullets are correct (CHANGELOG started 2026-10-23), and 206 more fragments wait in changelog/unreleased.
Medium
Wrong-state handlers panic late with no call site
Handlers are downcast at call time; a handler built for another state type compiles and panics on the first press with a generic message and no location.
crates/rune/src/states.rs:56-58; crates/rune/src/el/handlers.rs:9-14,60; crates/rune/src/el/virtual_rows.rs:131
✓ Confirmed
Medium
Stringly roles fail silently
An unknown role string falls back to Button or Group with no warning, and about 19 behaviour checks compare role strings (focus groups, Return handling), so a typo changes behaviour and a11y quietly.
crates/rune/src/a11y/roles.rs:103; crates/rune/src/el.rs:1188; rg 'role == "' gives 19 sites
✓ Confirmed
Medium
No diagnostic for unkeyed dynamic children
PLAN wanted keys required with an actionable error; keys are optional and an index-matched list gets no warning (only duplicates are reported).
research/06-reactivity-animation.md:168-170; crates/rune/src/input/key_diagnostics.rs (duplicates only); PLAN.md §6 'errors with fixes'
✓ Confirmed
8 more verified issues
Medium
Large, uneven API surface without a prelude
314 El methods with on_x/on_x_tx/_any variants, handlers in 7+ files, 82 Tx methods, 276 root re-exports, and three theme concepts with a tok::Theme/rune::Theme name clash; examples import up to 26 names.
awk count over impl El blocks gives 314 (51 on_*); el/layout.rs:337,366 hold handlers; tok.rs:146 vs theme.rs:29; examples/glass-panel imports 26 names
✓ Confirmed
Medium
Stale docs contradict the code
README 'Differences from PLAN.md' says no AccessKit, vertical-only scrolling and wgpu instead of the own Metal backend. The lib.rs crate doc says 'first slice'. tok::Theme says alphas are for linear light while sRGB blending is the default. memo's rustdoc example uses the virtualize().children anti-pattern.
crates/rune/README.md:2812-2821; crates/rune/src/lib.rs:1-4; crates/rune/src/tok.rs:143 vs CHANGELOG.md:207-212; crates/rune/src/memo.rs:567-571
✓ Confirmed
Medium
Hand-rolled headless detection in examples diverges from the runtime
live-values and overlay treat a fixed flag list as headless, missing --script, --video, --out, --html, --desktop and --duration, and miscounting --native --trace. A scripted video run starts the wall-clock producer thread, so the output is not deterministic.
examples/live-values/src/main.rs:137; examples/overlay/src/main.rs:70; crates/rune/src/tooling/args.rs:208-222
✓ Confirmed
Low
Defaults that render wrong in light themes
Text and fields with no colour draw white unless cx.foreground is set on every view run; 18 example sites hard-code tok::theme(true), including hello.
crates/rune/src/el.rs:638-639; crates/rune/src/runtime/cx.rs:146-153; examples/hello/src/main.rs:13
✓ Confirmed
Low
Twelve literal-frozen public types
AppSpec, Env, ScrollSpec, OverlaySpec, TextStyle, Span and others can't gain fields without breaking apps, which forces builder workarounds; ScrollSpec is a one-field struct.
AGENTS.md Changes list; examples/playground/src/main.rs:206-215 static OverlaySpec literal; examples/hello/src/main.rs:41 Env literal
✓ Confirmed
Low
Hot reload is slow and tied to maintainers' infrastructure
The default mode assumes a remote build worker and a desk Mac; only settings is registered; median save-to-GPU is about 8 s against PLAN's ~1 s measured and 300 ms goal.
crates/rune/README.md:2683-2689,2797-2799; scripts/rune-dev:38; PLAN.md:296
✓ Confirmed
Low
Example rot
todo hard-codes a 312 pt bar width instead of w_frac; the launcher needs a || unreachable!() init; web-hello keys rows by index; 57 of 128 demo files are not referenced by name; cursed-settings gags.rs is 850 lines, over the cap.
examples/todo/src/main.rs:55; examples/launcher/src/main.rs:136; examples/web-hello/src/lib.rs:33; demo/ reference scan; examples/cursed-settings/src/gags.rs
≈ Partly todo 312.0, launcher || unreachable!() and web-hello message-{i} hold. gags.rs at 850 lines is over the 800 warn line but far under the 1,500 hard cap, so it is not a violation. 57 demo files are not named by basename, but most are covered by patterns or generator output dirs (demo/text brace pattern, fx -reduced convention, demo/motion and demo/light generator outputs, kit side-* light/dark twins); about 10 are truly unlinked.
Low
Heavy default dependency tree for a hello world
hello pulls 196 unique crates on macOS, including symphonia, resvg and AccessKit by default, nine crates at two versions each (objc2 0.5 and 0.6, syn, png...), and zbus with tokio on Linux through the default dbus feature.
cargo tree -p hello -e normal --offline; crates/rune/Cargo.toml default features
✓ Confirmed
Strengths
  • Very little code for motion-rich UI: hello's view is 14 lines and todo's animated keyed list 36, with presence, springs, reduced motion and focus handled by the runtime
  • Every app binary carries a deterministic headless toolkit (--snap/--tree/--script/--video/--desktop/--trace/--html), and Runtime supports GPU-free unit tests (hello's test drives pointer events and checks spring travel)
  • Strong debug diagnostics: about 15 warn_once perf meters plus layout and duplicate-key messages that give the call site (21 #[track_caller] sites) and the fix; RUNE_COMMIT_BUDGET_MS works in release
  • Fast apps guidance is concrete and paired: README sections, site before/after snippets, and a one-second scripts/app-audit grep
  • Built-in playground (stories, variants, triggers, side controls, overlay stories) and scenes make visual checks cheap
  • Type erasure avoids deep generic errors; app crates monomorphise only small closure shims
  • Measured fast paths: settings frame 0.13 ms mean CPU, launch about 300 ms, idle 0 presents, live_only 13.7 to 2.0 ms per frame
  • Good rustdoc density (11,512 /// lines) with invariants and gotchas stated in place
Key concepts
  • AppSpec: A literal struct of fn pointers (init, view, poll, setup, on_key, scenes, fonts). It cannot capture, so capturing goes through App::new(spec).init(closure); new fields are absorbed by ..AppSpec::new()
  • Type-erased El and handlers: El is non-generic. Handlers are Rc<dyn Fn(States, &mut Tx)> and downcast to S at call time; a mismatch panics at runtime. This enables playground and kit composition across state types
  • Cx<S>: View context: env, system dark and accent, layout reads (layout_size/layout_with track the reads), and per-commit settings (reduced_motion, time_scale, foreground) that must be set on every run
  • Tx: Handler transaction, 82 methods: instant/animated/settle/live_only, wake_after, scroll requests, clipboard, window requests
  • poll contract: poll(&mut S, t, &mut Tx) -> bool must return true only when visible state changed; debug warns after 30 quiet true frames; wake_after loops need an end
  • memo / virtual_rows: The two ways to skip view work in plain Rust; memo needs a small version that covers all reads; virtual_rows builds only mounted rows; handlers must capture ids, not indices
  • live_only and Live<T>: Handlers that move only live values skip view, diff and layout (13.7 ms to 2.0 ms per frame on a 2,000-card pinch); Live<T> binds properties set from any thread
  • Headless agent toolkit: Every app binary accepts --snap/--tree/--script/--video/--desktop/--trace/--html; rune::is_headless() and tooling::headless_run() expose it to app code
Opportunities
Add a canonical feed/chat exampleimpact higheffort medium
virtual_rows with memo rows keyed by id, a Latest search box, on_ready deferral, prewarm_gpu, scroll_anchor, hover as a style, a Live typing indicator, plus a test and a script. This gives agents the OpenCode-shaped pattern library the repo lacks.
examples/README.md index and a rune::preludeimpact mediumeffort low
A table of example, what it teaches, the APIs it shows and headless commands, linked from the top README; a prelude with the ~25 names a view needs.
Debug-time handler state-type checkimpact mediumeffort low
Store a TypeId and #[track_caller] location next to each erased handler and warn at commit when it matches neither the window's nor the stage's state, instead of panicking at press.
Warn on unknown roles and unkeyed dynamic siblingsimpact mediumeffort low
Add a debug warning in roles::map's fallback arm (or role:: constants), and a once-per-site warning when a parent's children change count across commits with no keys.
Make virtual_rows imply growth and soften the assertimpact loweffort low
Set GrowthSpec::default() automatically and turn measure.rs:248's assert into a debug message with the fix.
Linux CI for examples and auditsimpact higheffort medium
cargo check --workspace --all-targets, scripts/file-size.sh, scripts/app-audit --strict examples, and the GPU-free example tests on every push.
Fix stale docs and example idiomsimpact mediumeffort low
Refresh README Differences, the lib.rs crate doc, the tok::Theme blend comment (or retune its alphas for sRGB), and memo's rustdoc example; use is_headless() in live-values and overlay; use w_frac in todo; follow system appearance in hello.
Split the 2,821-line README and generate llms.txtimpact mediumeffort medium
Topic pages or module rustdoc with an llms.txt index, so agents with a small context budget load only what they need.
Unfreeze literal types with #[non_exhaustive] plus constructorsimpact mediumeffort medium
One announced migration; AppSpec already has the ..AppSpec::new() idiom, so most apps barely change.
Ambient overlay layer for kitimpact loweffort medium
A kit layer handle carried in Cx (portal) instead of threading &mut Vec<El> through every view function.
Field-tracked or model state (PLAN §4.8 Model<T> plus cx.read) or derive(Version)impact higheffort highre-architecture
Lets views skip helpers automatically and removes most manual memo versions and stale-capture bugs; costs a second state concept and an app migration. A middle path is generation counters on sub-structs used as memo versions.
Typed El<S> in debug builds onlyimpact mediumeffort highre-architecture
Make wrong-state handlers a compile error while keeping release erased; invasive because kit and playground rely on erasure.
Numbers, key files, roadmap and the verifier's additions
Numbers
Example directories
30 (plus the motion-bento/chaos lib); 80 .rs files; 15,402 lines
Tests in examples
27 #[test] (motion-bento 14, kit-gallery 3); 15 of 30 examples have none
Script fixtures in examples
30 .json (settings 10, lab 7, kit-gallery 6)
Examples using rune-kit
4 of 30
Examples using virtual_rows/memo/live_only/prewarm_gpu/on_ready
0 / 0 / 0 / 0 / 0
El public builder methods
314 (51 on_* handlers) across 24 files; rg -c 'pub fn' over el/ gives 415 including Tx etc.
Tx / Cx / App / Runtime public methods
82 / 27 / 45 / 124
Crate root re-exports
276 pub use + 28 pub mod; no prelude
Frozen literal types
12
Debug perf warn_once sites
about 15 (idle-poll, idle-draw, overbuild, scroll, hover, instant, memo, stall, first)
app-audit findings
examples 1, rune-kit 6, themes 0
crates/rune size
151,592 lines in 619 files (27,292 in test files); 1,783 pub fn
crates/rune/README.md
2,821 lines, 29,025 words
hello dependency crates (macOS, normal)
196 unique; 9 duplicated crate names
Key files
examples/hello/src/main.rs Canonical start point the top README points agents to; 14-line view and a headless Runtime test
examples/settings/src/main.rs Full window from primitives (375 lines), scenes, drag slider, a11y roles; the measured benchmark app
examples/playground/src/main.rs App::playground, Story, triggers, variants, overlay stories, a correct poll/wake_after loop
examples/kit-gallery/src/main.rs rune-kit usage (Kit, builders .build(k, layer), rune_kit::root), every_story_builds test
examples/launcher/src/main.rs run_windows, launcher panel, global shortcut, || unreachable!() init workaround
examples/live-values/src/main.rs Live<T> producer vs rebuild bench; hand-rolled headless flag list (line 137)
crates/rune/src/tooling.rs AppSpec (fn-pointer fields, ..AppSpec::new idiom)
crates/rune/src/el.rs El struct, constructors (row/col/el/text/rich/icon/text_input), role/label/key
crates/rune/src/el/handlers.rs on_press/_tx, on_drag, drag_out: type-erased handler registration
crates/rune/src/states.rs States/downcast: runtime state-type check that panics on mismatch
Roadmap items
  • Fix stale docs (README Differences, lib.rs crate doc, tok::Theme blend comment, memo rustdoc example) and example idioms (is_headless in live-values and overlay, w_frac in todo, system appearance in hello)
  • Add examples/README.md and a rune::prelude; link the index from the top README
  • Add a canonical feed/chat example showing virtual_rows+memo, Latest, on_ready, prewarm_gpu, scroll_anchor, hover styles and Live, with a test and a script
  • Add Linux CI: cargo check --workspace --all-targets, GPU-free example tests, scripts/file-size.sh, scripts/app-audit --strict on examples
  • Debug-time checks: handler TypeId mismatch at commit, unknown role strings, unkeyed changing sibling lists; make virtual_rows imply growth
  • Split README into topic docs and generate llms.txt
  • Plan a one-time #[non_exhaustive] migration for the 12 frozen literal types
  • Measure agent first-try success (research 16's Rune-Bench) before larger API changes (handler-trait collapse, Model<T> or derive(Version) state, typed debug El<S>)
Found by the verifier
Medium
fn-pointer AppSpec callbacks push app config into process-wide statics
AppSpec's init, setup, poll, on_key and scenes are plain fn pointers, and App adds a capturing init but no capturing poll, setup or on_key. Examples therefore keep their config in global statics, so two windows or two tests that need different config cannot coexist, and agents copying them learn globals. Configuration is also split between AppSpec fields and App builders; launcher's || unreachable!() comes from the same split.
crates/rune/src/tooling.rs:17-40; app.rs pub fns (init but no poll/setup/on_key); examples/live-values/src/main.rs:4; examples/overlay/src/main.rs:4; examples/launcher/src/main.rs:20; examples/motion-bento/src/main.rs:25; examples/glass-panel/src/main.rs:83-86
Low
Virtual-list misuse panics in release builds, without a call site
The growth check is assert!, not debug_assert, so a misbuilt list crashes a shipped app instead of degrading. It names the node path but not the virtualize call site, which debug builds record as virtual_source and use only for the overbuild warning. The 'direct child of a scroll viewport' expect and 'padding must be in points' panic give neither path nor fix.
crates/rune/src/runtime/commit/measure.rs:248,249,258; crates/rune/src/el/virtual_rows.rs:31-36; crates/rune/src/runtime/commit/measure.rs:538
Low
More stale environment statements beyond the ones listed
README 'Differences from PLAN.md' also says 'no glass underlays', yet SystemMaterial::Glass wraps NSGlassEffectView. The site architecture page says 'Today both sides run on one thread', yet overlays present on a dedicated per-overlay thread. Both are text an agent loads first.
crates/rune/README.md:2815-2816; crates/rune/src/system_material/mod.rs:18-24; site/src/pages.tsx:934-936; crates/rune/src/frame/present_worker.rs:1-6; crates/rune/src/overlay/frame.rs:114
Low
The canonical template keeps its tests inline, against the repo's test-placement rule
AGENTS.md asks for tests in a sibling tests.rs or *_tests.rs, but hello (the example agents are told to start from) and nine other examples use an inline #[cfg(test)] mod tests in main.rs. The notes flagged only settings. Copying hello spreads the pattern the repo's own rules forbid.
examples/hello/src/main.rs:33-35; same inline mod tests in drag-out:64, kit-gallery:133, frosted-bar:80, knobs:80, matched:107, rich-clipboard:68, motion-bento/src/dock.rs:186; AGENTS.md Changes

Engineering and the gaps no area owned

Engineering health · Failure model · Process memory · Trust boundaries · Flagship readiness

18

Engineering system and health: tests, CI, lints, size rules, changelog process, dependencies, velocity

working

Strong local discipline (3,055 headless tests, size and folder ratchets paid down to zero exceptions, changelog fragments), but no automated gate on dev. GitHub CI only deploys the site and www page, and it runs just 10 www tests on Ubuntu with rune's default features off. All of this at about 96 commits a day, mostly from agents.

Summary (676 words)

Rune is 289,640 lines of Rust: 166k production, 93k test and 30k example, across 47 workspace members. The core rune crate alone has 103k production lines. 1,630 commits landed between 2026-10-22 and 2026-11-07. The first commit imported 52k lines. That is about 96 commits a day, with a peak of 252 and a fall to about 35 a day after Oct 30. At least one commit landed in 77% of all hours. 13 author emails exist, and one identity has 90% of the commits.

The engineering system is mostly written rules plus local scripts. AGENTS.md is the contract for agents. It covers the fast-forward-only dev branch, changelog fragments, the 800/1,500-line file caps, the 40/60 folder caps, where tests go, the literal-API structs, perf rules and public-repo hygiene. The ratchets work. When file-size.sh was added on Oct 26, its exceptions list had 176 entries, and runtime.rs was 9,266 lines. A four-day refactor campaign emptied the list. Running file-size.sh at HEAD gives 0 files over 1,500, 19 over 800, 23 warnings and 0 errors. Changelog fragments ended CHANGELOG.md edit collisions: 371 edits before Oct 27, 4 after.

Tests: 3,055 #[test] functions, 2,147 of them in rune and 450 in rune-kit. 2,138 are unit tests in src and 862 are integration tests in tests/. On top of these there are 19 harness=false GUI binaries gated by RUNE_GUI_TESTS, 22 ignored manual benchmarks and about 40 Python tests for the scripts. The main style is a headless Runtime on a virtual clock with synthetic input. There are 34 JSON goldens (a11y trees and Markdown paint) blessed with RUNE_BLESS=1, and 12 committed CoreText PNG references. rune-ref has proptest metamorphic tests and a GPU differential test. There are counting-allocator tests, hash checks for the precompiled metallib and dxbc blobs, compat guards for AppSpec, Env and the window-panel structs, a 24-scenario motion audit, and one gungraun bench that runs on Linux only. Test files skew to macOS: 38 test paths are named for macOS, CoreText or Metal, against 3 for Windows.

CI: .github has two workflows, site.yml (deploy only) and www.yml (Ubuntu: cargo test -p rune-www, wasm build, deploy). www.yml builds rune with default-features=false. Nothing in CI runs cargo test on the framework crates, clippy, fmt, file-size.sh, changelog checks, Miri, the benches, or any macOS or Windows runner. PLAN.md:426/503 promise CI correctness gates, gungraun, shuttle and Miri on every PR. None of that is wired up. research/24 says the instruction bench has never run. The README says Windows is checked only with cargo xwin clippy, yet big Windows features landed on Nov 6-7, and one wasm build break was fixed after the fact (#156).

Lints: a shared lint block was added on Oct 30. Several of its lints are relaxed to warn ('errors left'), so warnings pile up with no CI. Production code has 547 unwraps (293 of them lock().unwrap()), 148 expects, about 770 unsafe blocks in rune against 425 SAFETY comments, and 41 env::var calls under a disallowed lint. That lint's reasons cite a config.rs that does not exist. rustfmt is installed but never run on rune, which has 2,175 code lines over 120 columns. The crates have zero TODO, FIXME or HACK markers.

Dependencies: 549 lockfile packages, none from git, 30 crates duplicated (zbus 5 and 6, objc2 0.5 and 0.6, windows-sys x3, png x2). The toolchain was pinned to 1.99.1 only on Nov 6, and no crate declares a rust-version. cfg(target_os) appears 1,133 times, 893 of them macos.

Changelog: 476 folded bullets, plus 205 fragments pending since the only fold on Oct 30. 4 fragments break the one-bullet rule. The 'rev that introduced each' promise is not kept.

pack.new is an accidentally committed, now stale copy of crates/rune-fx/src/pack.rs (commit 2d92d377), safe to delete. The git pack is 155 MB, with 69 MB of video blobs in history.

Main risk: quality depends on each agent session running the right commands on the right machine. A rule-compliant but untested change on Windows, Linux defaults or wasm reaches pinned consumers with no bisect point, and fixes go forward only, with 0 reverts in history.

Why this maturity: There are rich local tests, ratchets that worked, and a disciplined changelog and perf method. But nothing enforces them automatically: no CI test, lint or format gate, no macOS or Windows runners, warnings building up, the changelog unfolded for 8 days, and PLAN's verification gates unimplemented. That is solid craft without production-grade guardrails.

Issues, most severe first
High
No CI gate runs the framework's tests, clippy or fmt
GitHub CI only deploys. The only Rust test job is cargo test -p rune-www (10 tests) on ubuntu, and rune is built with default-features=false there. The 2,597 rune and rune-kit tests, the other crates, and macOS and Windows never run automatically, so breakage is found by the next agent session.
.github/workflows/www.yml:40,84; www/app/Cargo.toml:17; crates/rune-kit/Cargo.toml:9; .github/workflows/site.yml
✓ Confirmed
High
PLAN.md CI promises are unimplemented
PLAN.md promises CI correctness on every change, gungraun and allocation gates, shuttle and Miri on every PR, scene fuzzing, and launch timestamps in CI. None are wired up. shuttle, loom, Miri and Kani are absent, and the gungraun bench has never run.
PLAN.md:389-396,426,503; research/24-reference-renderer.md:172-174; research/09-agent-native-and-perf-targets.md:394-405
✓ Confirmed
High
Windows, Linux-default and wasm builds are unverified before merge
The README says Windows is checked only with xwin clippy, yet large Windows features landed on Nov 6-7. The Linux default features (dbus/zbus, accessibility) are not compiled by any automation. A desktop change broke the wasm build, which was fixed after the fact.
crates/rune/README.md:1989; commits 98a97bbf, 58eeef5f, 90c1ff3a, de2b16de (#156)
≈ Partly README:1989 is in the overlay section: it says Windows overlay builds are checked with cargo xwin clippy only. It is not a statement about Windows in general. The wasm break is real: 90c1ff3a (#152) added the WakeEvent::Turn arm, and de2b16de (#156) put it behind cfg(not(wasm32)). But #152's own PR run (53b8dd10) failed, and the PR was merged 12 s after that run started. So the check existed and nothing waited for it. Linux defaults (dbus, accessibility) are indeed compiled by no automation. Open issue #182 is a further Windows defect found after merge.
Medium
Lint warnings build up silently
unwrap_used and expect_used are warn, and undocumented_unsafe_blocks, let_underscore_must_use and disallowed_methods were relaxed to warn ('errors left'). No CI runs clippy. Production code has 547 unwraps (293 lock().unwrap()), 148 expects, and about 350 undocumented unsafe blocks in rune (770 blocks against 425 SAFETY comments; rune-mac has 30 against 2).
Cargo.toml:104-110; counts via rg over non-test code; crates/rune/src/recorder/mod.rs (38 lock().unwrap())
✓ Confirmed
Medium
Changelog backlog and broken promises
205 fragments (about 20k words) are unfolded since the single fold on Oct 30. 4 fragments have multiple bullets. CHANGELOG.md claims each entry carries its introducing rev, but only 4 lines have a hash. There is no breaking-change marker.
changelog/unreleased/ (205 files); CHANGELOG.md:4; scripts/changelog-fold:34; commit b1504950
≈ Partly The counts hold: 205 fragments, about 20k words, one fold (b1504950), 4 multi-bullet fragments and only 4 hash lines. 'There is no breaking-change marker' is wrong: four folded entries begin '**Breaking:'. That convention is not documented, and none of the 205 pending fragments uses it.
9 more verified issues
Medium
Monolithic core crate
rune has 103k production lines (176k total) in one crate, the GPUI compile-time trap that research/04 warns against. Incremental test builds and the blast radius of a change both grow with it.
research/04-language-gpu-renderer.md:39; crates/rune (780 files)
≈ Partly The size is right: 780 files, 176,200 lines, about 103k production lines. But research/04:39 names two causes, monomorphized view trees and 100k+ LOC crates, and advises splitting widget crates, which Rune did (rune-kit, motion, fx, mermaid). The core crate is the remaining part of the risk. No compile time was measured, so the incremental-build cost is inferred.
Medium
Many environment-dependent skips
67 early-return skip sites (fonts, adapters, system fonts), so text and pixel tests pass vacuously on bare machines. CI would need fonts and lavapipe to mean anything.
crates/rune/src/text/tests.rs:22-457; crates/rune/src/text/pixel_compare_tests.rs:8
≈ Partly The count depends on the pattern: 38 literal eprintln!("skip sites, 46 with skip in the first string argument, and 63 for any (e)println mentioning skip. The '67' was not reproduced. 'Pass vacuously on bare machines' goes too far. Native builds bundle Inter, so most text tests have fonts, and the skips are for CJK or system fonts and GPU adapters. pixel_compare_tests and core_text_tests compile only on macOS, so on Linux CI they do not run at all. Most of the 3,055 tests are headless and need neither fonts nor lavapipe. Severity is low, not medium.
Low
clippy.toml disallowed-method reasons point at nonexistent code
'read env in config.rs at startup' and 'use config::now()', but rune has no config.rs or config::now. There are 41 env::var calls in 32 files, and env::var_os (82 calls) is not covered.
clippy.toml:6-9; git ls-files shows only examples/motion-bento/chaos/src/config.rs
✓ Confirmed
Low
rustfmt installed but never applied to rune
rust-toolchain.toml installs rustfmt, and only 3 crates have a rustfmt.toml. rune (default width 100) has 10,892 lines over 100 columns and 2,175 code-only lines over 120. A stray cargo fmt would churn thousands of lines.
rust-toolchain.toml; crates/rune-kit/rustfmt.toml; crates/rune/src/a11y/actions.rs:51,123,180
✓ Confirmed
Low
Stray pack.new at repo root
A stale 368-line copy of crates/rune-fx/src/pack.rs, accidentally committed. It differs in 16 lines after df3db113 and nothing references it.
pack.new; commit 2d92d377; diff pack.new crates/rune-fx/src/pack.rs
✓ Confirmed
Low
Docs drift
The README's 'Differences from PLAN.md' still says no AccessKit, wgpu instead of own Metal, and vertical-only scrolling, but AccessKit and the native Metal backend are default features. The 'Measured' numbers carry no date or rev.
crates/rune/README.md:2801-2821; crates/rune/Cargo.toml:46,51
✓ Confirmed
Low
Test rules partly broken
122 inline cfg(test) modules remain against the sibling tests.rs rule, and 3 test files exceed the 1,000-line cap (sticky.rs 1,173, edit/rich_tests.rs 1,056, edit/tests.rs 1,021). rune-staging has 0 tests. crates/rune/src has 41 files, past the 40-file folder warning.
AGENTS.md:25; scripts/file-size.sh --warn-only output
✓ Confirmed
Low
Repository growth from media
The pack is 155 MB after 17 days. History holds 68.6 MB of video blobs (three versions of demo/rune.mp4 at 13.7-22 MB) and 71.6 MB of PNG. ff-only dev means history can't be cleaned.
git count-objects; git rev-list --objects blob sizes
✓ Confirmed
Low
Duplicate dependency generations
30 crates have multiple versions, including two async D-Bus stacks (zbus 5 via accesskit_unix and zbus 6 direct) and objc2 0.5 and 0.6, which rune requests directly as objc2 and objc2-video.
Cargo.lock; crates/rune/Cargo.toml (objc2 0.5.2, objc2-video = objc2 0.6, zbus 6)
✓ Confirmed
Strengths
  • File-size ratchet paid down from 176 exceptions to 0 in four days. HEAD has 0 files over 1,500 lines, and both exception lists are empty.
  • Large deterministic test suite: 3,055 #[test], a test/prod line ratio of 0.56 (0.65 in rune), headless on a virtual clock, with golden bless workflows.
  • Changelog fragments removed the CHANGELOG.md hotspot (371 edits before Oct 27, 4 after).
  • Small, behaviour-described commits: median 118 changed lines and 4 files.
  • Compat tests guard downstream literal APIs (app_spec_compat, env_compat, window_panel_compat).
  • Unusual quality tooling: motion audit with a finding taxonomy, counting-allocator tests, perf-profile-only bench guard, metallib freshness hashes.
  • Public-repo hygiene holds: the AGENTS.md grep finds no home paths, session ids or tailnet hosts in tracked files.
  • No git dependencies or [patch] overrides. Cargo.lock is committed, and scripts use --locked.
  • Unsafe is FFI-shaped and confined to platform files, and 8 crates have no unsafe at all.
Key concepts
  • Ratcheting exceptions: Size and shape violations are listed with ceilings that only go down (--update-exceptions lowers them, --allow-raise needed to add). Both lists are now empty.
  • Changelog fragments: One file per change in changelog/unreleased/<date>-<slug>.md, folded into CHANGELOG.md by scripts/changelog-fold. This removed edit collisions on CHANGELOG.md.
  • Headless runtime tests: Runtime::new plus frame(dt) and settle_all on a virtual clock, with synthetic input and assertions on elements, rects and a11y JSON. Deterministic and needs no GPU.
  • RUNE_BLESS goldens: JSON a11y-tree and Markdown paint goldens, rewritten with RUNE_BLESS=1. A failure prints the first differing line.
  • RUNE_GUI_TESTS: Env gate for 16 test files (19 harness=false binaries) that open real windows or overlays on a desktop session.
  • Literal-API compat guards: Tests that build AppSpec, Env and similar structs exhaustively, so that adding a pub field fails in-repo before it breaks a downstream app.
  • Shared lint block: A cross-repo lint template in Cargo.toml and clippy.toml, with some lints relaxed to warn ('errors left'). Not enforced by CI.
  • Build workers / build queue: Off-repo Mac and Linux machines (leases, the build Mac) that scripts expect for GPU, bench and hot-reload work. Nothing in the repo defines or automates them.
Opportunities
Add a framework CI workflow (ubuntu, macOS, windows)impact higheffort low
PR and push: file-size.sh, changelog-fold --check plus a fragment format check, cargo test for rune, rune-kit, rune-motion, rune-mermaid, rune-fx and rune-ref, cargo check --workspace --all-targets with default features on all three OSes, a wasm32 check with defaults, and clippy -D for lints that are already clean. Use rust-cache, and lavapipe on Linux.
Count-ratchet for lint debtimpact mediumeffort low
Report counts of production unwraps, undocumented unsafe blocks and env::var calls, and fail when they go up (the same pattern as file-size.sh). Fix the clippy.toml reasons, and forbid(unsafe_code) in the 8 crates with no unsafe.
Changelog fold cadence with revs and breaking markersimpact mediumeffort low
Fold daily, stamp each entry with its fragment's first-commit hash so CHANGELOG.md:4 becomes true, validate one bullet per fragment, and add a 'Breaking:' prefix convention for pinned consumers.
Decide a formatting policyimpact loweffort low
Either a rustfmt.toml that matches the house style plus one reformat, or drop rustfmt from the toolchain and document manual formatting.
Delete pack.new and add a stray-file checkimpact loweffort low
Remove the stale copy, and have CI reject tracked *.new, *.orig and *.bak files.
Split the rune crate behind a facadeimpact higheffort highre-architecture
Split along the existing folders: core (runtime, el, layout, platform-free), render (gpu, metal), text, shells (platform, window, overlay, native_*), media (video, recorder), tooling (playground, dev). Keep rune as a re-export facade. This cuts incremental compiles, isolates FFI unsafe so the core can forbid unsafe, and makes cross-OS CI cheaper.
Cheap research/14 'adopt now' gatesimpact mediumeffort medium
Miri on rune-taffy, rune-staging, rune-ref and procwatch. Run the gungraun bench on a hosted ubuntu runner (no special hardware needed). A loom or shuttle model of the Latest and present-time handoff.
Move demo media out of gitimpact loweffort low
Release assets or LFS for mp4 files and large PNGs, keeping posters in-tree. This slows future pack growth, since history can't be rewritten.
Issue template for the agent-issue contributing modelimpact mediumeffort low
Ask for platform, pinned rev and a headless repro (--script, --tree or --snap output), so incoming agent issues are actionable and reproducible.
Numbers, key files, roadmap and the verifier's additions
Numbers
Rust lines (total / prod / test / example)
289,640 / 166,242 / 93,112 / 30,136
rune crate lines (total / prod)
176,200 / 103,401 (780 files)
#[test] functions
3,055 (rune 2,147; rune-kit 450; mermaid 138; motion 93; fx 58); 2,138 in src, 862 in tests/
Ignored tests
22
harness=false GUI test binaries
19 in rune (RUNE_GUI_TESTS-gated, 16 files)
Goldens
26 a11y JSON + 8 Markdown JSON + blocks.txt + 12 CoreText PNG
Bench targets
1 (gungraun, Linux only, never run per research/24)
GitHub workflows
2 (site deploy; www test+deploy on ubuntu only)
Files over 800 / over 1500 non-test lines
19 / 0 (exceptions lists empty; had 176 on 2026-10-26)
Test files over 1,000 lines
3
Commits / days / per day
1,630 / 17 / about 96 (peak 252 on 2026-10-23)
Commit size median / p90 / p99 (lines)
118 / 714 / 3,538
Author emails
13 (top identity 90%)
PR-referenced commits / merges / reverts
56 (up to #190) / 9 / 0
Key files
AGENTS.md Agent contract: commands (:14-15), ff-only dev (:21), changelog fragments (:22), size/shape caps (:23-24), test placement (:25), literal-API structs (:29), motion audit (:41), public hygiene (:43-54)
Cargo.toml Workspace members (47), profiles (dev deps no debug :58, perf :67-74), shared lint block with relaxations (:91-110)
clippy.toml Test allowances; disallowed env::var and SystemTime::now, with reasons pointing at a nonexistent config.rs
.github/workflows/www.yml Only Rust CI: ubuntu, cargo test -p rune-www (:84) with rune default-features=false, wasm build, Cloudflare deploy
.github/workflows/site.yml Docs site deploy only; no type-check or PR trigger
scripts/file-size.sh Non-test line counter (awk brace tracking), 800/1500 caps, ratcheting exceptions, GitHub annotations unused by any workflow
scripts/folder-shape.sh Prefix-family and folder-breadth checker (40 warn / 60 error), ratcheting exceptions
scripts/file-size-exceptions.txt Empty (header only); had 176 entries on 2026-10-26
scripts/changelog-fold Folds changelog/unreleased fragments into CHANGELOG.md ## dev; no validation, no revs, unguarded lines.index (:34)
changelog/unreleased/ 205 pending fragments (2026-10-29..11-07), 4 with multiple bullets
Roadmap items
  • Delete pack.new, and add a CI check that rejects tracked scratch files.
  • Add .github/workflows/rust.yml: file-size.sh, changelog-fold --check plus a fragment lint, and cargo test for rune, rune-kit, rune-motion, rune-mermaid, rune-fx and rune-ref on ubuntu (lavapipe, fonts), macOS and windows; cargo check --workspace --all-targets with default features; a wasm32 check.
  • Add a clippy job with -D for the lints already clean, plus count ratchets for unwrap_used, undocumented_unsafe_blocks and disallowed_methods; fix the clippy.toml reasons.
  • Set a formatting policy (a rustfmt.toml matching the house style, or drop rustfmt).
  • Fold the changelog on a cadence, stamp revs, and add a Breaking: marker convention.
  • Run Miri on small unsafe crates and the gungraun bench on a hosted ubuntu runner; build a loom/shuttle model of the main/render handoff.
  • Plan the rune crate split behind a facade (core, render, text, shells, media, tooling).
  • Add an issue template for the agent-issue model (platform, rev, headless repro).
  • Move demo media to release assets or LFS; refresh README's Measured and Differences sections with dates and revs.
Found by the verifier
High
The one CI check never gates a merge: PRs merge within seconds and dev has no required checks
The dev ruleset enforces only non_fast_forward and deletion. It has no required status checks. Across the 40 latest merged PRs, the median time from opening to merge is about 15 s, and a www.yml run takes 2-3 min. Of 68 www runs since the workflow began on 2026-11-06 05:06 UTC, 13 failed. #123 (toolchain pin) merged over a failing PR run, and dev's page build stayed red from 17:16 to 18:25 UTC. #152 merged 12 s after its PR run started; that run then failed, and #153, #154 and #155 merged onto a red dev before #156 fixed the wasm build. The PR flow exists, but no check holds a merge.
gh api repos/anomalyco/rune/rules/branches/dev returns only non_fast_forward and deletion. gh pr list --state merged gives open-to-merge gaps of 3-56 s for most PRs. gh run list --workflow www.yml: 53b8dd10 PR failure at 21:51:30, 90c1ff3a push at 21:51:42, failures for a0ad6c9f, 1d57a1a7 and 2391f391, then de2b16de success at 22:11.
Medium
Shader freshness hashes depend on checkout line endings, and the check runs only on Windows
There is no .gitattributes. render/dxbc.rs:45 uses the precompiled DXBC uber shader only when the blake3 of the WGSL text matches UBER_DXBC_WGSL_BLAKE3. That constant was computed from a CRLF checkout, while the repo and cargo git checkouts are LF. So Windows apps silently compile the shader at runtime. The freshness test compiles only under cfg(all(test, target_os = "windows")), so no Mac or Linux run, and no CI, can catch it. Open issue #182 reports it.
crates/rune/src/render/dxbc.rs:45, :94-96. crates/rune/src/render/uber_dxbc_hash.rs:2. crates/rune/src/render/dxbc_tests.rs:91-112. git ls-files has no .gitattributes. gh issue view 182 is open.
Medium
Crates that have a rustfmt.toml are not formatted either
The note frames the gap as rune lacking a config. But rustfmt --check under rune-kit's own rustfmt.toml (max_width 120, Max heuristics) would still change 63 rune-kit files. From crates/rune/src/lib.rs it would change 597 files (about 115k diff lines). A format gate would need a one-time reformat of nearly every file in the workspace, which is a large collision event for parallel agents.
rustfmt 1.10.0 --check --edition 2024 crates/rune-kit/src/lib.rs gives 63 'Diff in' files. The same on crates/rune/src/lib.rs gives 597 files and 115,341 +/- lines. crates/rune-kit/rustfmt.toml.
Low
No Rust CI and no pinned compiler for the first 15 days (~1,560 commits)
www.yml first ran on 2026-11-06 (053a27ae), and rust-toolchain.toml was added the same day (4ca68356, #123). Before that, nothing compiled Rust automatically, and agent sessions could use different compilers. About 1,560 of the 1,631 commits on dev were never checked against a common toolchain or any automated build.
git log -- .github shows www.yml was added in 053a27ae (2026-11-05 21:03 -0800). The earliest gh run list entry is 2026-11-06T05:06:06Z. git log -- rust-toolchain.toml gives 4ca68356. 1,561 commits are dated before 2026-11-06.
19

Failure model end to end: panics, errors, logging and recovery

prototype

Rune has no failure policy: in a release native build any app or Rune panic ends the process, either by exit 101 or by abort depending on the macOS entry point; device loss is silent; ~94 production eprintln sites are the only diagnostics; and recovery exists only in islands (overlay surfaces, image decode, Mermaid, hot mode).

Summary (610 words)

Rune's failure handling is a set of local fixes, each added after a crash was found: hex#979 overlay surfaces, image codec panics, Mermaid layout, duplicate keys, window creation and winit's NSNull KVO abort. No module, research note or PLAN section owns the policy as a whole.

Panics. Release native builds unwind, because no profile sets a panic strategy. Rune catches nothing around view, handlers, poll, AppHandle::update closures, on_ready or init. The only catch around app code is measure.rs:378-405, and it is behind feature="hot". So the outcome is set by winit 0.30.13's glue. On macOS, frames started by winit's CFRunLoop observer (request_redraw, proxy wakes, AboutToWait) are caught by stop_app_on_panic, which stops NSApp and re-raises the panic from run_app. The process exits with code 101, with no crash report, and Rune's post-loop cleanup is skipped. Frames run inside winit's objc2-0.5 extern "C" methods abort: the synchronous live-resize draw, drawRect:, physical observations at rest, and the app's on_focus called from Runtime::window_focus. Windows catches the panic in winit's runner and re-raises it; Linux unwinds normally. On the web, wasm traps (the abort strategy): the canvas freezes, the console hook logs the panic, and every catch_unwind there does nothing. Mermaid's catch works on native only.

FFI. About 69 Rune-defined callbacks cannot unwind: 37 named extern "C" (22 of them panel_bridge expansions), 11 declare_class methods, 11 block2-0.5 blocks and 10 extern "system". Seven are C-unwind. About 10 of them catch, mainly the menu, shortcut, tray, reopen, open-url, popup and drag sinks. The rest are small, but a few unwrap locks inside system hooks (the WH_MOUSE_LL hook, Metal's presented handler). Recorder::request_permission runs the app's callback uncaught on AVFoundation's queue. Rune's catches cannot cover the bigger exposure: winit dispatch nested in AppKit callbacks.

GPU. Lost is treated as Outdated and reconfigured, never recreated. A window whose reconfigure is refused (Unconfigured) is retried every 250 ms. On wgpu backends the next acquire then panics in wgpu's default handler, and resize, create and launch-drawables use the raw configure. Overlays drop the surface correctly. No device-lost or uncaptured-error handler is registered anywhere. wgpu 30 filters DeviceLost out of the error sink, so loss most likely freezes on a stale frame, and the app is never told; this corrects note 07's "default panic". The Metal backend's error hooks are no-ops and its allocation failures panic. LayerHost reconfigures a lost surface on every tick and caches a failed GPU forever. Web ends the app on any acquisition miss.

Diagnostics. There are 9 typed error types, 37 pub fns returning Result<_, String>, 5 polled accessors (window_error, OverlayHandle::failure, take_menu_errors, take_shortcut_errors, NativeSurface::last_error), and about 94 production eprintln sites. log is only a dev-dependency (the brief says otherwise), and Rune makes zero log:: calls. Rune's output cannot be routed or silenced. It is invisible in GUI launches and discarded on wasm, where std's stderr is a sink.

Poisoning. About 290 production lock().unwrap() sites against about 41 tolerant ones. App panics rarely poison anything, because Rune takes data out of a lock before calling app closures. The real cascades come from Rune-internal panics in locked sections, worker threads, Drop during unwinding, and FFI hooks.

Environment variables. 22 RUNE_* names are read outside tests, and about 13 change release behaviour. RUNE_DIRS_ROOT, RUNE_PREFS_DIR, RUNE_DISABLE_DXBC, RUNE_METAL_CAPTURE, RUNE_OVERLAY_TRACE_INPUT, RUNE_PERF_SLOW_MS and the OTEL loopback variable are missing from the README. Shipped apps also parse Rune's dev CLI, and a malformed value exits with status 2.

The highest-leverage fix is one catch_unwind boundary in impl ApplicationHandler for Windows that defers resume_unwind until after run_app. Next come a diagnostics channel (a diag! macro routed through log, plus App::on_diagnostic and a crash-file panic hook), then device and surface recovery built from the overlay's existing device-change path.

Why this maturity: As a policy it is unplanned and undocumented, and it behaves differently per platform: no release panic boundary, no device-loss handling, no diagnostics channel. The individual islands (overlay surface refusal, image codec catch, Latest and present-worker catches, Mermaid guard, hot-mode fallback, startup Results) are careful and tested, so the components are at working level while the cross-cutting model is at prototype level. About 20 of 2,147 tests cover failure paths, and none covers release-mode panics, FFI aborts, device loss or surface Lost.

Issues, most severe first
High
Any app or Rune panic ends a shipped app, with platform- and entry-dependent outcome
No catch around view, handlers, poll, update, on_ready or init in default builds. On macOS, observer-driven frames give exit 101 with no crash report and skipped cleanup; live-resize, drawRect:, synchronous physical observations and on_focus run inside winit's extern "C" methods and abort. Windows and Linux exit 101; the web traps and freezes.
runtime/commit/measure.rs:377-405 (cfg hot only); winit-0.30.13 macos/event_loop.rs:439-460, 301-308; app_state.rs:323; objc2-0.5.3 declare_class.rs:981; window/events.rs:286-291; runtime/frame.rs:57; commit 6450ee57 message
✓ Confirmed
High
Window surface that refuses reconfiguration panics on the next acquire
Missed::Unconfigured is retried in 250 ms for windows, but wgpu-core has already taken the presentation, so get_current_texture reaches the error sink and the default handler panics. Window resize, create and launch-drawables call the raw Surface::configure, which panics directly on refusal. The overlay drops the surface; the window does not. This is hex#979 still possible for main windows on wgpu backends.
window/pacing.rs:74-76,114,145-163; window/draw.rs:172-175; window/win.rs:53; window/create.rs:139; window/draw.rs:343; wgpu-30.0.1 backend/wgpu_core.rs:4023-4033, 692-694; wgpu-core-30.0.1 device/resource.rs:5368-5372; overlay/surface.rs:186-191
✓ Confirmed
High
No device-loss handling; loss is silent and the app is never told
No set_device_lost_callback or on_uncaptured_error anywhere. wgpu 30 drops DeviceLost errors from the sink (it does not panic, contrary to note 07), so a TDR or eGPU unplug most likely freezes the window on a stale frame; Validation status maps to Timeout and keeps the loop turning. On the Metal backend the hooks are no-ops and command-buffer status is never checked.
rg set_device_lost_callback: only gpu/metal/device.rs:143-144; wgpu_core.rs:304; window/pacing.rs:95; note 07 issue 4
✓ Confirmed
Medium
No diagnostics channel; log is a dev-dependency
About 94 production eprintln! sites, 0 log:: calls; log is only under [dev-dependencies]. The output cannot be routed or silenced, is lost in Finder/GUI launches, and is discarded on wasm (std stderr sink). Many app-relevant failures (window surface refused, open_url failed, transparency unavailable, display link down, popup errors) reach only stderr. Prefixes are inconsistent.
crates/rune/Cargo.toml:173-175; window/pacing.rs:147,155; open_url.rs:153; window/create.rs:126; platform/display_link.rs:110-138; popup_menu/mod.rs:377
≈ Partly The log dev-dependency, the 0 log:: calls and the stderr-only output are confirmed (107 eprintln! in non-test files, before excluding inline test modules). Too strong: a failed display link is publicly visible as WindowHandle::surface_stats().pacing == Pacing::Failed(status). A refused surface is visible only as SurfaceCounts::outdated, with no separate count. So those two failures do not reach only stderr.
Medium
Lost surfaces are reconfigured forever, never recreated
Lost is mapped to Outdated, so windows and overlays reconfigure every 250 ms indefinitely. LayerHost reconfigures every tick and reports animating:true, spinning the host's display link; its SHARED_GPU OnceLock caches Err for the process lifetime.
window/pacing.rs:94,114; platform/embed.rs:14-20,172-179
≈ Partly The SHARED_GPU OnceLock<Result> caching Err is confirmed. LayerHost is Apple only, and neither the wgpu-hal Metal backend nor Rune's own Metal backend ever returns Outdated or Lost, so LayerHost's per-tick reconfigure loop cannot run. On Vulkan, a truly lost surface fails again in vkCreateSwapchainKHR, which becomes InvalidSurface (Validation). That gives Unconfigured: the window panics (issue 2) and the overlay drops itself. It does not loop forever. The endless 250 ms loop happens only when reconfigure succeeds but acquisition keeps failing.
9 more verified issues
Medium
The web has no failure model
wasm32-unknown-unknown aborts on panic, so the Mermaid and Latest catches do nothing; image decode has no catch on the web at all; any non-success acquisition ends the app; panics never show the on-page error overlay; RefCell borrow flags stay set after a trap (inferred).
scripts/web-build.sh:126; platform/web.rs:57,220-238,532-535; image.rs:125; rune-mermaid/src/scenes.rs:50
✓ Confirmed
Medium
App code runs uncaught on OS threads and in extern "C" work functions
Recorder::request_permission runs the app callback inside AVFoundation's completion block (block2 0.6, unwinding into libdispatch); main_queue::on_main runs video drive closures in an extern "C" dispatch work function.
recorder/macos.rs:95-99; recorder/mod.rs:302-304; platform/main_queue.rs:12-16; video/macos.rs:121,184,493,572,887
✓ Confirmed
Medium
Catches in Rune's callbacks cannot cover nested winit dispatch
standard_macos action and OverlayPanel::sendEvent wrap or forward into winit's keyDown/sendEvent; a panic aborts in winit's innermost extern "C" frame before Rune's catch sees it.
native_menu/standard_macos.rs:85-91,111-113; platform/macos.rs:57-62
✓ Confirmed
Low
Poison unwraps inside non-unwinding callbacks and Drop
The WH_MOUSE_LL hook unwraps the observers mutex; Metal's presented handler and the nextDrawable swizzle unwrap mutexes; Overlay::drop and release unwrap shared.native and would double-panic during an unwind. About 290 production lock().unwrap() sites against about 41 tolerant ones.
platform/win32/pointer.rs:20; frame/present_time.rs:302,318; overlay/surface.rs:177,214; note 18
≈ Partly The WH_MOUSE_LL unwrap and the Metal presented-handler unwrap are confirmed. The nextDrawable swizzle is extern "C-unwind" and runs on the caller's thread under a Rust msg_send, so it unwinds rather than aborts. The Overlay::drop/release unwrap cannot realistically double-panic: every shared.native lock site holds the lock only for one assignment whose value is evaluated first, so the mutex never poisons. The counts are plausible (331 lock/read/write().unwrap() in non-test files, including inline test modules).
Low
Metal backend panics instead of reporting
Buffer and texture allocation use expect, unsupported features panic, and error scopes always return None, which silently disables the hex#979 protection on the macOS default backend.
gpu/metal/resource.rs:152,289; gpu/metal/mod.rs:158-162; gpu/metal/device.rs:146-147
≈ Partly The expect calls and the unsupported! panics are confirmed. 'Silently disables the hex#979 protection' overstates it: the native backend's configure only sets CAMetalLayer properties and has no refusal mode, so there is nothing to catch. And on wgpu, OOM also panics in the default handler, because Rune installs no uncaptured handler, so Metal is not worse there.
Low
Shipped apps parse Rune's dev CLI and exit 2 on bad values
App::try_run parses std::env::args into Rune's Args; --size/--scene/--theme/--snap etc. are live in release; die() calls exit(2).
app.rs:496-500; tooling/args.rs:85-91,109-160,288-291
≈ Partly Confirmed, and wider: -h/--help also prints Rune's help and exits 0. But App::args(argv) is a documented opt-out for apps that own their command line. is_headless() and extra_args() still parse the process arguments.
Low
Latest panics are indistinguishable from None and wake nothing
land() sets settled and returns before the waker, so is_pending flips without a frame and there is no failure state.
latest.rs:286-299; latest/pool.rs:107-109
✓ Confirmed
Low
Undocumented release-affecting env vars
RUNE_DIRS_ROOT, RUNE_PREFS_DIR (move user data), RUNE_METAL_CAPTURE (changes shader path), RUNE_DISABLE_DXBC, RUNE_OVERLAY_TRACE_INPUT, RUNE_PERF_SLOW_MS and the OTEL loopback variable are not in the README.
dirs.rs:35; prefs.rs:158; gpu/metal/builtin.rs:42-49; render/dxbc.rs:83; platform/macos.rs:271; tooling/interaction.rs:76; tooling/interaction/gate.rs:38-53
✓ Confirmed
Low
eprintln! can itself panic on EPIPE inside non-unwinding callbacks
Rust ignores SIGPIPE; a closed stderr pipe makes eprintln! panic, including in catch handlers inside extern "C" callbacks, which then aborts.
native_menu/macos.rs:28; platform/reopen.rs:83; open_url/incoming.rs:193
✓ Confirmed
Strengths
  • Islands of recovery are careful and tested: image decode panic (image.rs:812), Latest panic (latest/tests.rs:171), present-worker re-raise (present_worker_tests.rs:53), memo unwind guard (memo.rs:872), hot fallbacks (4 tests), refused configure on the noop backend (window/tests.rs:490), Mermaid prefix fuzzers.
  • Rune releases locks before calling app closures (app.rs:758-770, latest/pool.rs:106, Shared::wake), so app panics do not poison shared state.
  • The sinks that run app-facing callbacks from FFI (menus, shortcuts, tray, reopen, open-url, popup, drag-out) all catch panics.
  • Startup failures are Results with clear messages (try_run, no window server, Gpu::try_new adapter fallback, window_error).
  • The overlay path recovers from a refused surface and already contains device-change renderer rebuild plus atlas invalidation, the building blocks for device-loss recovery.
  • Hot mode shows the runtime can rebuild after a view panic against retained state.
  • Careful details: ready_signal at_exit uses try_lock; panel_bridge and drop use poison-tolerant locks; the display link failure is reported once per sleep and retried at most once a second.
Key concepts
  • Observer path vs AppKit-callback path (macOS): winit 0.30.13 catches panics only in its CFRunLoop observers (stop_app_on_panic, re-raised after NSApp.run); panics inside its objc2-0.5 extern "C" view/delegate methods abort. The same app bug exits 101 or aborts depending on entry.
  • Missed: window/pacing.rs enum for a frame with no drawable: Occluded, Timeout, Outdated (incl. Lost), Unconfigured (configure refused; wgpu panics on the next drawable unless the surface is dropped).
  • Scoped configure: window::configure pushes Validation/Internal error scopes so a refused configuration returns Err instead of hitting wgpu's panicking default handler (hex#979). Not used by window resize/create/launch-drawables; no-op on the Metal backend.
  • surface_refused / fail: Overlay-only recovery: hide, drop surface and native owners, record failure, mark Unavailable; next show retries.
  • original_only / patched_or_original!: Hot-mode fallback: rebuild with startup code against retained state after a patched view/poll/on_key panics.
  • Take-then-release locking: Rune takes queued updates and wakers out of mutexes before calling app closures, so app panics poison nothing shared.
  • Polled error accessors: window_error, OverlayHandle::failure, take_menu_errors, take_shortcut_errors, NativeSurface::last_error: the only app-visible reports for most runtime failures; no callback or channel.
  • wgpu DeviceLost filtering: wgpu 30 handle_error_inner returns early for ErrorType::DeviceLost (surfaced only via set_device_lost_callback, which Rune never registers), so device loss is silent; OOM/validation still panic.
Opportunities
One panic boundary in ApplicationHandler for Windowsimpact higheffort low
Wrap new_events/resumed/user_event/window_event/about_to_wait/exiting in catch_unwind, stash the payload, call event_loop.exit(), and resume_unwind after run_app (as winit's Windows runner does). Gives macOS one consistent exit path, ends the aborts in live resize/drawRect/on_focus, runs post-loop cleanup, and creates the single hook for reporting.
Opt-in release degrade policy (App::on_panic)impact higheffort mediumre-architecture
Keep the last committed tree or rebuild as hot mode does after a view panic; drop the failing action for handlers; disable poll after a panic; drop the failing update; deliver a PanicReport (phase, location, message). Needs an audit of mid-frame invariants in measure_view (memo/spare_nodes/layout swaps).
Unified diagnostics channel and crash fileimpact higheffort mediumre-architecture
An internal diag!(level, area, ...) macro routed through log (promote it from dev-dependency), with stderr fallback and console.* on wasm; App::on_diagnostic for structured app-facing events (surface refused, device lost, display link down, open_url failed, menu/shortcut/window/overlay errors) replacing the 5 polled accessors; a panic hook that writes a crash file under AppDirs and os_logs on macOS, so exit-101 panics leave evidence.
Device and surface recoveryimpact higheffort highre-architecture
Register set_device_lost_callback/on_uncaptured_error on every Gpu; on loss mark the Gpu dead, drop renderer and surfaces, re-run Gpu::for_surface, invalidate atlas and images (reuse the overlay's device-change branch). Recreate surfaces on Lost; drop window surfaces on Unconfigured like overlays; route resize/create/launch-drawables through scoped configure; check MTLCommandBuffer status on the Metal backend; retry on web and listen for device.lost; stop caching Err in LayerHost's SHARED_GPU and back off on Lost.
ffi_guard helper plus a lintimpact mediumeffort low
guard(what, default, f) catches, reports and returns a default; apply it to the ~59 non-unwinding and 7 C-unwind Rune callbacks; add a scripts/ check that refuses new extern "C"/system fns, declare_class methods or blocks without it.
Poison policyimpact mediumeffort low
Use parking_lot (already a metal-backend dependency) or a lock_or_recover helper for state valid after partial updates; mandatory inside FFI callbacks and Drop impls.
Fix the window Unconfigured path nowimpact higheffort low
Smallest high-value GPU fix: on Missed::Unconfigured or a failed reblend, drop the window surface and recreate it on the next frame or open (mirror Overlay::surface_refused), and use window::configure in win.rs:53 and create.rs:139.
Gate the dev CLI and document env varsimpact loweffort low
Parse Rune flags only in debug builds, behind App::dev_args(), or under a --rune- prefix; add RUNE_DIRS_ROOT, RUNE_PREFS_DIR, RUNE_METAL_CAPTURE, RUNE_DISABLE_DXBC and OTEL to the README env table.
Latest failure stateimpact loweffort low
Add a Failed(String) settle that wakes the UI, so a panicked job can render an error instead of silently ending pending.
Numbers, key files, roadmap and the verifier's additions
Numbers
catch_unwind production sites (rune)
16 (13 in default builds, 3 hot-only) + 1 in rune-mermaid; 0 around app view/handler/poll/update in default builds
Rune-defined non-unwinding FFI callbacks
~69: 37 named extern "C" (22 panel_bridge expansions), 11 declare_class methods, 11 block2-0.5 blocks, 10 extern "system"
Unwinding FFI callbacks
7: 4 extern "C-unwind" fns + 3 block2-0.6 blocks
Callbacks with a panic catch
~10
eprintln! in crates/rune/src
149 total, ~94 production, <10 debug-gated
log:: calls in library code
0 (log is a dev-dependency)
Production lock().unwrap()
~290 (note 18: 291)
Poison-tolerant lock sites
~41 production; 56 unwrap_or_else(|e| e.into_inner()) including tests
Device-lost / uncaptured-error handlers registered
0
Raw Surface::configure calls on window/LayerHost/web paths
8 (window 3, LayerHost 3, web 3 minus 1 shared); scoped configure used at 5 sites
Public typed error types
9 with std::error::Error impls; 37 pub fns return Result<_, String>
Polled error accessors
5 (window_error, OverlayHandle::failure, take_menu_errors, take_shortcut_errors, NativeSurface::last_error)
RUNE_* env names read outside tests
22; ~13 affect release builds; 12 mentioned in README; 51 env::var/var_os calls outside tests
Background thread spawns in rune src
37
Key files
crates/rune/src/runtime/commit/measure.rs measure_view: the only catch around app view code (lines 378-405), hot feature only; fallback rebuild with fresh Cx and emptied memo
crates/rune/src/hot.rs view_or_original (56-73) and patched_or_original! (77-89): hot-mode panic fallbacks for view, poll, on_key; RUNE_HOT/RUNE_DEV_GUARDED
crates/rune/src/memo.rs memo scope Guard pops on unwind (539-543), so a caught view panic leaves no stale scope (test 872)
crates/rune/src/window/event_loop.rs run_configured: run_app then post-loop cleanup (84-91) that an unwinding panic skips; RecreationAttempt test
crates/rune/src/window.rs ApplicationHandler for Windows (232-318), the natural single panic boundary; scoped configure() (595-608) vs raw configure; validate().expect at 248
crates/rune/src/window/events.rs input queued; synchronous draw during macOS live resize (286-291) and Windows size-move (296-300), the abort-prone path
crates/rune/src/window/pacing.rs Missed mapping (Lost treated as Outdated, Validation as Timeout), retry backoff, acquire with reconfigure; Unconfigured retried for windows
crates/rune/src/window/draw.rs window acquire/missed_frame; raw configure for launch drawables (343)
crates/rune/src/overlay/surface.rs overlay attach with scoped configure, surface_refused drops the surface (186-191); device-change renderer rebuild + atlas invalidation reusable for recovery
crates/rune/src/overlay.rs Overlay::fail: eprintln + shared.failure + Availability::Unavailable (486-490)
Roadmap items
  • 1. Add the catch_unwind boundary in impl ApplicationHandler for Windows, with deferred resume_unwind and post-loop cleanup, so macOS behaves one way (low effort).
  • 2. Fix the window Unconfigured path: drop and recreate the surface as overlays do, and use window::configure for resize, create and launch-drawables.
  • 3. Introduce diag! routed through log (promote it to a real dependency) with stderr and console fallbacks; convert the ~94 eprintln sites by audience; add a crash-file panic hook.
  • 4. Add App::on_diagnostic and fold window_error, overlay failure and the menu, shortcut and native-surface errors into it.
  • 5. Register device-lost and uncaptured-error handlers; implement Gpu teardown and rebuild per host, reusing the overlay device-change branch; treat Lost as recreate; check Metal command-buffer status.
  • 6. Add an ffi_guard helper on every Rune callback, plus a scripts/ lint; switch FFI and Drop lock sites to poison-tolerant locks.
  • 7. Opt-in App::on_panic degrade policy (keep the last tree, drop the action, disable poll) after an invariant audit of measure_view and apply; consider making it the default.
  • 8. Web: show panics in the page error overlay via a custom hook, retry acquisition, and guard image decode.
  • 9. Gate the dev CLI in release builds; document the remaining RUNE_* and OTEL variables; add tests for release panic paths (headless runtime catch), window Unconfigured and LayerHost Lost.
Found by the verifier
High
macOS launch-time panics abort (SIGABRT), not exit 101
winit 0.30.13 dispatches NewEvents(Init) and Resumed from the applicationDidFinishLaunching: declare_class method (plain extern "C") with no stop_app_on_panic. Rune's Windows::resumed then does a series of things in that frame. It runs the factory and windows::validate(..).expect("window keys"), then calls spec.start. That reaches App::into_parts, which runs the app's init, and runtime_for, which runs setup. During create it calls on_created, on_window and on_focus, and on macOS it draws the first frame synchronously, which runs view. So the most common class of release panic (startup unwraps, bad config) aborts on macOS. The notes' section 3.1 says init runs 'before the event loop: plain unwind out of main', which is wrong for the window path.
winit-0.30.13 src/platform_impl/macos/app_state.rs:64-67,107-148 (dispatch_init_events at the end), event_loop.rs:292-299; crates/rune/src/window.rs:238-255,247,434; app.rs:522-527; tooling.rs:146-148; window/create.rs:226-253
Medium
Every existing panic guard silently needs panic = "unwind"
The image-codec guard, the Latest pool, the Mermaid scene guard, the menu, shortcut, tray, reopen, open-url and drag sinks, and the present worker all use catch_unwind. Only the hot-mode README paragraph says recovery needs unwinding. An app that sets panic = "abort" in its release profile, a common size setting, loses every guard with no warning. The README promise that a panicking codec fails only that image then becomes a process abort. No profile or doc in the repo addresses this.
crates/rune/README.md:1767 vs 2771 (only unwind mention); Cargo.toml profiles set no panic strategy; crates/rune/src/image.rs:126-132; latest/pool.rs:107-108; rune-mermaid/src/scenes.rs:50
Medium
A truly lost window surface on Vulkan ends the app
Acquire returns Lost, which Rune maps to Outdated and reconfigures through the scoped configure. vkCreateSwapchainKHR fails with SURFACE_LOST, which becomes hal Lost and then wgpu-core InvalidSurface (Validation, captured by the scope). That gives Missed::Unconfigured, which a window retries in 250 ms. By then wgpu-core has already dropped the presentation, so the next get_current_texture returns NotConfigured and wgpu's default handler panics. So 'Lost is reconfigured forever' is really 'Lost crashes the app' for windows on Vulkan, and for overlays it is fail-and-hide.
wgpu-hal-30.0.1 src/vulkan/swapchain/native.rs:236-246; wgpu-core-30.0.1 src/device/resource.rs:5366-5388; present.rs:134-151,168-172; crates/rune/src/window/pacing.rs:94,114,141-160
Low
Tray on_event runs off the UI thread and is uncaught on Linux
Tray::new takes an app closure that the docs say 'runs on the tray's thread'. On Windows the tray wndproc catches it. In the Linux SNI backend it runs inside zbus interface methods on the rune-tray tokio thread with no catch (containment by tokio/zbus is inferred, since zbus source was not in the registry). The notes' threading list of 'app code off the UI thread' leaves it out.
crates/rune/src/tray.rs:80-82,91-96; tray/sni.rs:56-63,96-105,155-168; tray/win32.rs:100
19

Process-wide state, cache inventory and memory budget across subsystems

prototype

Each cache in Rune is bounded and tested on its own, but nothing owns the whole-process budget: every window and overlay duplicates its text system, atlases and pixel copies, kit caches share one thread commit counter across windows, RollingText history leaks between windows, the soak test checks nothing on macOS, and the "70 MB vs 50 MiB" miss compares the footprint of a settings window with an RSS target for hello.

Summary (645 words)

I read the code at 1571ad57 and ran nothing; no prebuilt hello or settings binary exists and builds were off-limits. So I took no new measurements. Every number below comes either from the code (sizes × counts) or from research/34, the README and commit 6fa2aaf6.

Ownership tiers. All windows and overlays run on the main thread, each with its own Runtime and Renderer. They share one GPU device through gpu_pool (window/create.rs:100-113, overlay/surface.rs:64-90). Each Runtime has its own TextSystem (fontique Collection, layout, glyph-replay and colour caches, glyph atlas CPU pages; text.rs:138-195), ImageAtlas (pixels.rs:238) and MemoCache. Each Renderer makes a 2048² R8 glyph atlas texture eagerly (render.rs:763), plus image pages, a grow-only instance buffer, the El::cache LRU, backdrops, a blur pyramid and two Staging sets. The main thread holds COMMITS, a second full TextSystem for measure() (measure.rs:41-45), and the kit caches: Markdown 16+4 MiB, highlights 4 MiB, table widths 1 MiB, RollingText 512/256 KiB, ScrollBar 256, and Mermaid 16 FIFO.

Inventory. Under crates/ there are 112 thread_local! in 93 files, or 86/68 excluding the tests/ and examples/ dirs. There are 80 static Mutex/OnceLock/LazyLock and 47 static atomics. Most are scoped context stacks or once-flags. About 20 hold real data. Some caches break the AGENTS.md "bound in entries and bytes, counting pixels" rule: - No byte bound: the image atlas (no cap, page 0 pinned), Mermaid scenes, diff chunks, video posters, and the GPU pools (transient layers, backdrops, pyramid, instance buffer). - No bound at all: atlas None entries, trak/primary_* tables, ColorIcons.kinds, and key_diagnostics WARNED. - Estimate-only bytes and an unbounded "kept" set: layouts and the kit Budget caches.

Cross-window leakage. Core text caches age by a per-runtime generation, so they are isolated. The kit Budget protects entries by the thread-wide commit_generation (budget.rs:92). An idle window loses protection after two commits of a busy one. Two windows that commit alternately each lose protection for their own previous commit, which can thrash. Markdown has one incremental-stream slot per thread (cache.rs:60,78). RollingText is keyed by label key alone (rolling_text.rs:233-247), although Button::rolling documents the key as unique "in the window". Two surfaces using the same key diff against each other's text: a correctness bug. ScrollBar is keyed by runtime id, but its cap clears every window's bars at 256.

Adding up. Fixed cost per surface: a 4 MiB atlas texture (zero-filled at creation on native Metal), a 4 MiB calloc CPU page, 3 drawables and a full collection scan (6 symbol + up to 16 CJK files). For an overlay HUD the atlas is 11× its three drawables. Budget ceilings per window are about 39 MiB CPU plus 8–32 MiB of atlas and 64 MiB of El::cache on the GPU, and the image atlas, layers and backdrops have no cap. Per thread, about 37 MiB of stale entries. Everything per window scales linearly with N windows + M overlays. Images, emoji and colour icons each exist three times (source, ImageAtlas CPU page, GPU texture), and once more per window.

Idle footprint. PLAN.md:518 targets ≤50 MiB RSS for hello. Hello measures 33 MB footprint on Metal and 34 MB on wgpu, against RSS of 92.5 and 95.1 MB (research/34:633-641). So hello misses on RSS by about 1.8× and passes on footprint. The 70 MB settings number is footprint. The README's own +14 MB per drawable fits a model of 28 MB baseline + 3 drawables × 14 MB = 70 MB, so about 60% of it would be drawables; that window is larger than examples/settings. The backends differ by about 1 MB at idle.

Long sessions. overlay_soak allows 48 MB of growth. Measured: lavapipe 180→181 MB, WARP 139→135 MB. But memory_mb() returns 0.0 on macOS (overlay_soak.rs:72-73), and the test exercises no caches. Things that never shrink: the instance buffer, backdrops, the second glyph atlas page, image page 0 (one emoji pins 8 MiB per window), atlas None entries, and scratch high-water marks.

Why this maturity: Each cache is bounded and tested on its own, which is solid at the component level. But no whole-process budget, report, gauge or test exists. There are no cross-window tests, the macOS soak check is empty, and the headline target is measured with the wrong metric and workload.

Issues, most severe first
Medium
RollingText history crosses windows
MEMORY is per thread and keyed only by the RollingText key. Two surfaces using the same key diff against each other's last text, rolling unchanged characters and choosing the wrong direction. The 512/256 KiB bound is also shared, so one window evicts another's labels.
crates/rune-kit/src/rolling_text.rs:82-84, 233-247, 267; actions.rs:257-260 says 'unique in the window'
✓ Confirmed
Medium
The memory target is an unmet RSS number, and the 70 MB comparison mixes metrics
PLAN targets hello ≤50 MiB RSS. Hello measures 92.5–95.1 MB RSS but 33–34 MB footprint. The 70 MB is a settings window's footprint, with app, window size and backend unrecorded.
PLAN.md:518; research/34-own-gpu-plan.md:633-641; crates/rune/README.md:694-696; local/docs/notes/01-vision.md:204
✓ Confirmed
Medium
The soak test asserts nothing on macOS
memory_mb() returns 0.0 off Windows and Linux, so the 48 MB growth check passes trivially on the main platform. The test also exercises none of the content caches.
crates/rune/tests/overlay_soak.rs:15-18, 72-73, 112
≈ Partly Only the memory check is empty on macOS. The failure and device-count asserts still run. On macOS park_gpu drops the device and renderer, so after both overlays hide, the next show makes a new device. By reading, starts == 1 would fail on macOS rather than pass trivially. The test also draws text, and each show rebuilds the renderer and invalidates the glyph atlas, so it does exercise the atlas resend path.
Medium
Eager 4 MiB glyph-atlas texture per surface
Every Renderer creates a 2048² R8 texture whether or not text shows. It is zero-filled, so resident, on native Metal. For a HUD overlay that is 11× its three drawables; window + 2 overlays = 12.6 MB of atlas textures.
crates/rune/src/render.rs:763; gpu/metal/device.rs:117-122; atlas.rs:6
✓ Confirmed
Medium
Image-atlas CPU pages duplicate source pixels; page 0 is pinned
Every image, emoji and colour icon exists in three copies (source, CPU page, GPU texture), and again per window. Page 0's slots are never dropped, so one emoji pins 4 MiB CPU + 4 MiB GPU per window. No entry or byte cap; standalone pages up to 256 MiB.
crates/rune/src/pixels.rs:238-336 (copy 278-291, page-0 rule 302-303); runtime/paint/helpers.rs:253
≈ Partly The three copies per window are right, and the page-0 page (4 MiB CPU + 4 MiB GPU) stays once it holds any slot. But page-0 slots are dropped: when the atlas is full and page 0 wasn't shown, allocate() starts it over. 'No cap' means no configured cap. Slots off page 0 live only while shown, so the atlas is bounded by the visible set plus page 0, not unbounded over time.
8 more verified issues
Medium
Grow-only GPU pools and pinned pages over long sessions
The instance buffer only grows (+2 native spares). Backdrops are never freed. The pyramid is kept while blurs stop. The second glyph page stays (needed ≥ 2). Image page 0 stays. Scratch Vecs keep their high-water mark.
render/upload.rs:216; render/pass.rs:200-224; backdrop_blur.rs:253-256; text/atlas.rs:272-294; runtime.rs:416-418
✓ Confirmed
Medium
No subsystem memory accounting
Rune registers no procwatch gauges; heap tags are per thread; heap.live counts calloc'd 4 MiB atlas pages that aren't resident; LayerStats omits the atlas, image pages, backdrops, pyramid and drawables.
rg finds no Gauge use in crates/rune or rune-kit; procwatch/src/alloc.rs:10-12; render/layers.rs:128-199
✓ Confirmed
Low
Kit Budget protection is per thread, not per window
Protection uses the thread-wide commit_generation. An idle window's docs and highlights become evictable after two commits of another window. Two alternately committing windows each lose their previous commit's protection, and can thrash once the combined working sets exceed a budget.
crates/rune-kit/src/budget.rs:60-67, 87-109; runtime/cx.rs:30-39; runtime/commit.rs:85
✓ Confirmed
Low
One incremental-stream slot per thread
Markdown's last is a single per-thread slot, so two streams in one window or across windows force full reparses every commit.
crates/rune-kit/src/markdown/cache.rs:16-20, 60, 78
≈ Partly last changes only on a miss: a hit returns before line 78. So only streams that grow in the same span lose the incremental parse; a finished stream or a static doc doesn't overwrite it. A missed effect: when the grow path fails, the old prefix isn't removed, so interleaved streams leave dead prefixes in the 4 MiB STREAMS budget until LRU eviction.
Low
Caches without byte bounds, and a ScrollBar clear that crosses windows
Mermaid scenes (16 FIFO, hover states as keys) and diff chunks (512 then clear) count no bytes. ScrollBar clears every window's bars at 256.
crates/rune-mermaid/src/scenes.rs:14-44; rune-kit/src/diff/state.rs:723-727; scroll_bar.rs:55, 280-282
✓ Confirmed
Low
Full-page re-uploads after a re-show
invalidate()/resend marks all 2048 rows dirty and reads the whole 4 MiB CPU page. That likely faults never-written calloc pages into footprint (unmeasured) and stages 4 MiB through a chunk too large to keep, on every overlay re-show with release_gpu_when_hidden.
text/atlas.rs:189-195; render/upload.rs:201, 381-388; overlay/surface.rs:122-123; window/lifecycle.rs:308-309; rune-staging/src/lib.rs:33-35
✓ Confirmed
Low
Unbounded small maps
Atlas None entries, trak/primary_traks/primary_axes, ColorIcons.kinds and failed images, drop DESTS (never removed, pointer reuse), and key_diagnostics WARNED keyed by data-derived strings in release builds.
text/atlas.rs:254-255; text/trak.rs:204; text.rs:186-189; color_icon.rs:17-21; platform/macos/drop.rs:36, 102-114; input/key_diagnostics.rs:158
≈ Partly Atlas None entries are kept by design, and a test asserts it. primary_traks/primary_axes are keyed by weight.to_bits(), so they grow under weight animation, and a family change clears them. But traks is keyed by (blob id, face index), so loaded fonts bound it. ColorIcons.kinds is keyed by &'static Icon address, so the program's icons bound it, not data. DESTS (never removed) and the release-build key_diagnostics WARNED are confirmed.
Low
Duplicate font state
N+1 fontique collections, one per runtime plus the measurer, each scanning 6 symbol files and up to 16 CJK files. Measure() shapes text a second time in a separate cache.
text/system_fonts.rs:124-167; text/measure.rs:210-237; text/families.rs:38-45
✓ Confirmed
Strengths
  • Almost every individual cache has an explicit bound and a test (stale layouts, glyph replay 4096/8 MiB, atlas 8-page ceiling, RollingText 512/256 KiB, ink 1024/256 KiB, cursors 32/8 MiB, staging 8/4 MiB, El::cache 64 MiB).
  • Core text caches age by a per-runtime generation, so a busy window can't age another window's layouts.
  • The device is shared across windows and overlays, with parking that fixed the hex#1268 GB-per-hour growth (measured flat on lavapipe and WARP).
  • Colour budgets are soft by design, so a visible emoji set is never flushed every frame.
  • Scoped thread-local stacks (memo, snapshot, blend mode, view scope) are restored per build and don't leak.
  • procwatch exists with footprint, peak, RSS, a counting allocator and gauges: the tools for whole-process accounting are in the repo.
  • Backend memory claims were checked with paired runs (research/34), and the 330 MB vs 1.5 GB scare was traced to unpaced headless runs.
Key concepts
  • Ownership tiers: Process (FONTS, wgpu instances, ImageCache, the shared device) > main thread (COMMITS, measurer, kit caches) > Runtime per window or overlay (TextSystem, ImageAtlas, MemoCache) > Renderer per window or overlay (atlas textures, pools, staging, drawables).
  • commit_generation: A thread-wide count of commits across all windows (cx.rs:30-39). Kit Budget uses it for its 'used in the last two commits' protection; core text uses a separate per-runtime generation.
  • Kit Budget: Byte-estimated LRU (budget.rs) that never evicts entries used in the current or previous thread commit and evicts the rest to 75% of the limit on an insert over it.
  • Per-thread measurer: A second full TextSystem per thread behind measure/advance/content_widths/ink. It is rebuilt when fonts change and calls end_commit every 512 calls.
  • CPU shadow copies: Glyph and image atlas pages keep a full CPU copy, for dirty-row upload and a resend after a lost staging chunk or a new device. Image pages duplicate pixels the Pixels frame already holds.
  • Drawable model: Idle footprint ≈ baseline (~28 MB, hello minus IOSurface) + k drawables × W×H×4; k = 2 while launching, then 3.
  • Footprint vs RSS: phys_footprint (dirty + compressed, what Activity Monitor and jetsam count) against RSS, which includes shared framework and mmapped font pages. PLAN's Mac target is RSS; the iPhone target is footprint.
Opportunities
Key per-window history by runtime idimpact mediumeffort low
RollingText MEMORY keyed (current_runtime_id(), key); kit Budget protection by (runtime id, per-runtime commit); per-entry ScrollBar eviction with a commit stamp; per-stream last slots in Markdown.
Make the soak test real on macOS, and add a content soakimpact mediumeffort low
Use procwatch::usage().footprint (as a dev-dependency) on macOS. Add a soak that scrolls Markdown with emoji, images and blur, baselined after the budgets fill.
Memory report and gaugesimpact higheffort low
Register procwatch gauges for glyph/image atlas CPU and GPU, layers, backdrops, pyramid, staging and drawables. Add Runtime/Renderer::memory_report() and show it in dev_stats, so Snapshot::unaccounted becomes meaningful.
Restate the Mac target as footprint and pin the workloadimpact mediumeffort low
Use phys_footprint like the iPhone target. Record the window pixel size and backend; measure examples/settings and hello by the research/34 protocol.
Growable first glyph atlas pageimpact mediumeffort medium
Start at 512² (256 KiB) and grow to 2048². Saves about 3.9 MB GPU and CPU per small window or overlay; 7.8 MB for a window plus two overlays.
Two drawables at restimpact higheffort medium
Go to 3 only during sustained presenting. Under the drawable model this saves one W×H×4 per idle window (5.2 MB for examples/settings, 14 MB for the README's window).
Drop the CPU shadow copiesimpact higheffort medium
Image atlas: stage from the Pixels frames directly and resend from the sources; release page 0. Glyph atlas: stage masks directly and re-rasterize on device loss, or write a Shared texture on Apple (research/17:165).
Byte-budget the GPU pools and the remaining cachesimpact mediumeffort medium
A budget for transient layers, backdrops and the pyramid, with idle release. Put Mermaid scenes and diff chunks under Budget with byte estimates; make the Mermaid FIFO an LRU; test the byte estimates against real allocation.
One text core per thread and deviceimpact higheffort highre-architecture
Share one Collection, shaping cache (keys already include scale), colour store and glyph atlas (with the texture on the shared device) across all windows and overlays, as research/11:191 planned. The measurer becomes the same instance.
Process memory governorimpact higheffort highre-architecture
A registry where every cache reports bytes and entries and exposes evict-to-target. One enforcement point for the AGENTS.md rule, a report, and a response to OS memory pressure, which matters for the iPhone 40 MiB target.
Numbers, key files, roadmap and the verifier's additions
Numbers
thread_local! under crates/
112 in 93 files; 86 in 68 excluding tests/ and examples/ dirs; 74 in 61 in src excluding *tests.rs
static Mutex/OnceLock/LazyLock (excl. tests/examples dirs)
80 in 57 files (73 excluding *tests.rs); 47 static atomics
Caches inventoried
30 (table in notes §4); ~13 break the entries+bytes rule fully or partly
Hello idle footprint (research/34)
33 MB native Metal / 34 MB wgpu
Hello idle RSS (research/34)
92.5 MB Metal / 95.1 MB wgpu vs 52.4 MB (50 MiB) target
Settings idle footprint (README)
70 MB (77 before the idle fix; +14 MB per extra drawable)
Glyph atlas per surface
4 MiB GPU (eager) + 4 MiB CPU calloc per page; steady 2 pages, max 8 (32+32 MiB)
Per-thread stale cache ceilings
≈37 MiB (Markdown 16 + streams 4 + highlights 4 + widths 1 + measurer 3 + cursors 8 + small)
Per-window CPU budget ceilings
≈39 MiB (layouts 3 + replay 8 + colour 16 + icons 4 + atlas 8) + uncapped image atlas
Overlay soak
allows 48 MB; measured lavapipe 180→181 MB, WARP 139→135 MB; macOS check returns 0.0
Drawable size at 2×
hello 1.0 MB, examples/settings 5.2 MB, 1600×1000 pt 25.6 MB (×3 at rest)
Cache tests in scope
quality 22, text 20, scroll_bar 21, layer_cache 21, pixels 14, memo 14, upload 11, procwatch 10, rolling_text 8, glyph_cache 5, budget 1; cross-runtime 0
Focus-file lines
8,946 lines across 22 files
Key files
crates/rune/src/text.rs TextSystem struct (138-195): the per-runtime collection, caches, atlas, colour stores; begin_frame colour eviction (423-448)
crates/rune/src/text/layout_cache.rs Stale-layout eviction: STALE_BYTES 3 MiB, 64 B/byte + 2 KB estimate, per-runtime generation
crates/rune/src/text/glyph_cache.rs Glyph replay cache: 4096 entries / 8 MiB / 2 MiB per entry
crates/rune/src/text/atlas.rs Glyph atlas: 2048² R8 pages, 2 steady / 8 max, CPU copy per page, None entries never pruned (254)
crates/rune/src/text/color_icon.rs Colour icon images, 4 MiB soft budget; kinds map never pruned
crates/rune/src/text/measure.rs Process FONTS Mutex and the per-thread MEASURER TextSystem; evicts every 512 calls
crates/rune/src/pixels.rs ImageAtlas: uncapped 1024² RGBA CPU pages, standalone pages up to 8192², page 0 pinned (302-303)
crates/rune/src/image.rs ImageCache: Weak dedup map, 4 decoder threads, no byte bound
crates/rune/src/render/layers.rs El::cache 64 MiB LRU; transient layer targets with no budget
crates/rune/src/render/backdrop_blur.rs Blur pyramid: grows to the largest region, never freed when blurs stop
Roadmap items
  • Fix the RollingText key scope and add cross-runtime isolation tests (RollingText, Budget, ScrollBar cap).
  • Make overlay_soak measure footprint on macOS; add a content soak (Markdown, emoji, images, blur).
  • Register procwatch gauges and add a memory report for atlases, image pages, layers, backdrops, pyramid, staging and drawables.
  • Measure hello and examples/settings by the research/34 protocol (footprint by category, both backends, window size recorded); restate the Mac target as footprint.
  • Try 2 drawables at rest and a growable first atlas page; measure against the drawable model.
  • Remove the image-atlas CPU copy and release page 0; then the glyph-atlas CPU copy.
  • Byte budgets and idle release for transient layers, backdrops and the pyramid; Mermaid and diff caches under Budget.
  • Design a shared per-thread/device text core and a process memory governor.
Found by the verifier
Medium
macOS release_gpu_when_hidden overlays remake the device and renderer on every show
Off macOS, a hidden overlay parks its device and renderer for 5 minutes, which is the hex#1268 fix. On macOS park_gpu just drops them. So after all surfaces hide, each show makes a new Gpu, a new Renderer with its uber pipeline, a zero-filled 4 MiB atlas texture, new staging, and a full atlas resend. The soak test's starts == 1 assert would fail on macOS by reading, so nothing tests device reuse or memory on the main platform.
crates/rune/src/render/warmup.rs:14-19; crates/rune/src/overlay.rs:888-905; crates/rune/src/overlay/surface.rs:65-86, 118-123; crates/rune/src/overlay/options.rs:199-201; crates/rune/tests/overlay_soak.rs:82, 111
Medium
Each overlay builds a full TextSystem at App::overlay time, before launch, shown or not
App::overlay calls Overlay::new, which runs TextSystem::for_window right away. That registers up to 16 CJK files and the symbol fonts into a fresh fontique collection, and callocs a 4 MiB glyph page. It all happens on the main thread during setup, before the first frame and whether or not the overlay ever shows. A tray app with several overlays pays this per overlay, at launch. That goes against the 'Launch fast' rule to start slow work after the first frame.
crates/rune/src/app.rs:249-252; crates/rune/src/overlay.rs:393-399; crates/rune/src/text.rs:258-277; crates/rune/src/text/system_fonts.rs:133
Low
The stale-layout budget is per cache, three caches per TextSystem
end_commit applies evict with STALE_BYTES (3 MiB) separately to layouts, elisions and runs. A TextSystem, and the per-thread measurer, can keep up to 9 MiB of stale entries, not 3 MiB. The note's per-window and per-thread totals (§7.2, §9.2) understate this.
crates/rune/src/text/layout_cache.rs:45, 50-56, 92-96
Low
Interleaved Markdown streams leave dead prefixes in the stream budget
When last belongs to another stream, grown is None. The stream's previous prefix is then not removed, so every commit inserts a whole new copy (2×len + 64×cuts + 128 estimated bytes), and the old ones stay until LRU eviction. Two or more streams that grow together fill the 4 MiB STREAMS budget with dead prefixes, and once it is full every insert runs evict()'s sort.
crates/rune-kit/src/markdown/cache.rs:32, 60, 67-78; crates/rune-kit/src/budget.rs:82-109
19

Trust boundaries: untrusted content and local control channels

working

Clipboard, URL and secret handling are well defended and tested, but SVG decoding, native image paths, Markdown nesting depth and web href sinks have no bounds or filters, and the exporter and argv tooling surfaces stay live in release builds.

Summary (624 words)

Rune has no single security layer. Each subsystem defends its own entry point.

**Strong defences:** - Tx::open_url (open_url.rs:57-94) is strict: at most 8192 bytes, no whitespace, controls or unsafe characters, well-formed percent escapes, only http, https or mailto, authority checks, 26 test cases. Headless runs record links and never open them. - The clipboard is read on a worker thread. HTML is capped at 4 MiB and cleaned by a fail-closed tokenizer (clipboard/html.rs, 55 attack cases plus linear-time and stability tests). - macOS RTF is converted with AppKit's RTF reader and HTML writer, never WebKit's HTML reader, with a 1 MiB cap. - Pasted PNG and TIFF images have byte and pixel caps, and TIFF dimensions are checked before AppKit sees the data. - Rich import keeps only a safe subset at depth ≤ 512. Mention pills restore only from Rune's own copy, checked by a keyed fingerprint. - The secret contract (El::secure) is broad: zeroized buffers, redacted Debug, no caches, no copy or IME. Secrets are excluded from elements(), --tree, the web mirror, the export, the event log and interaction spans. - Code highlighting (32 KiB, 8,192 tokens) and Mermaid (400 items, depth 8) are capped. - The codec surface is trimmed: the image crate has PNG and JPEG only, and resvg has no raster images and no text.

**Gaps on the flagship's untrusted-content path:** 1. **SVG.** svg_rgba uses usvg::Options::default(), so SVGZ decompression is unbounded, <image href> reads any local path with std::fs::read (/dev/zero exhausts memory, a FIFO hangs a decoder), entity expansion has no total limit, there is no time bound, and on web the raster runs on the main thread. 2. **Native images.** ImageCache::url and ImageCache::file read any path with no size or file-type check, and the url_set SVG size is not clamped. 3. **Markdown nesting.** Depth is uncapped and the renderer is recursive, so adversarial model output can plausibly overflow the main-thread stack. Not verified. 4. **Web hrefs.** The DOM mirror (bridge.js:353) and the --html export (export.rs:102, css.rs:270) publish hrefs with no scheme filter. El::href(untrusted) is an XSS sink on web, and an export turns any Markdown javascript: destination into a live link. Mirror text runs alone are filtered. 5. **Web image fetch.** It requests any URL with no policy hook, so a Markdown image is an exfiltration channel. The body is read whole and decoded before the size check. 6. **Revealed passwords.** Revealed secure inputs put plaintext into live AccessKit TextRuns, which contradicts the El::revealed doc.

**Local channels:** - There is no inspector socket (PLAN diverged). - The OTLP exporter posts to loopback only (default 127.0.0.1:27686) with no auth. It sends normalized route and control key paths, timings and stack symbols, never text. It is compiled into release builds and turned on by RUNE_PERF=1 or an ambient loopback OTEL_EXPORTER_OTLP_ENDPOINT alone, and while on it suspends the UI thread to sample stacks. - --hot-control is a file polled every 16 ms with no auth. It needs the hot feature and RUNE_DEV_GUARDED, and it writes PNG and tree snapshots. The devserver IP is not checked to be loopback before patches are loaded with dlopen. - procwatch::serve filters peers to loopback but has no Host check, serves one client at a time, and has no callers in the workspace. - Release binaries still parse --snap, --tree, --html, --script and --native from argv.

**Distribution:** - Only the opt-in macos-background-cursor feature uses private symbols (CGS, through dlsym), which is an App Store rejection risk. Notarization is unaffected. - Runtime class patching uses public objc runtime API, which is allowed but fragile across winit and AppKit updates. - The repo's installer has no hardened-runtime, timestamp or notarization path.

**Dev tooling:** rune-dev rsyncs untracked files to build hosts, excluding only .env*, *.pem and *.key.

Maturity: working.

Why this maturity: Input-side defences (URL check, HTML sanitizer, rich import, secret contract, clipboard bounds) are careful and adversarially tested. But there is no unified policy: href sinks disagree. Several resource sinks on the flagship's main untrusted path (SVG, native image paths, Markdown depth, web fetch) are unbounded and untested. There is no fuzzing. Developer channels (exporter, argv tooling) stay live in release builds.

Issues, most severe first
High
SVG decode unbounded in memory and time; reads local files
svg_rgba caps only the compressed input (32 MiB) and uses usvg::Options::default(). SVGZ is decompressed with an unbounded read_to_end. <image href> runs std::fs::read on any path: /dev/zero exhausts memory, a FIFO hangs a decoder, nested local SVGs render. The DTD entity cap is 255 references per top-level reference with no total limit. No time bound on filters. On web the raster runs on the main thread. Reached through ImageCache::load/load_mime/svg and the web url fetch, so through any Markdown image wiring.
crates/rune/src/image.rs:432-447; usvg-0.45.1/src/parser/mod.rs:129-138; usvg-0.45.1/src/parser/image.rs:85-113; roxmltree-0.20.0/src/parse.rs:424-497; crates/rune/src/image/from_url.rs:85
✓ Confirmed
High
Markdown nesting depth uncapped; plausible stack-overflow crash
pulldown-cmark does not limit blockquote or list nesting. Rune pushes a container per level, builds nested Block::Quote/List and renders recursively, so a few KB of '>' or '- ' from a model could abort the app. No adversarial-depth test exists.
crates/rune-kit/src/markdown/parser.rs:496-503; crates/rune-kit/src/markdown/render.rs:279,553; pulldown-cmark-0.13.5/src/firstpass.rs:55 (only math/link limits)
✓ Confirmed
Medium
DOM mirror and --html export publish unfiltered hrefs (javascript: sink)
Mirror link items set el.href = item.h with pointer-events:auto. The export writes El::href and every TextSpec link id (Markdown destinations) escaped but not scheme-checked. Only mirror text runs use webLink. So El::href(untrusted) is an XSS sink on web, and a Markdown javascript: link becomes live in an export. No tests.
crates/rune/src/platform/web/bridge.js:248-250,274-279,353; crates/rune/src/runtime/web/export.rs:102; crates/rune/src/runtime/web/export/css.rs:270; crates/rune/src/el/a11y.rs:81-94
✓ Confirmed
Medium
Native ImageCache::url/file read any local path, unbounded
A path or file: URL is read with std::fs::read; no regular-file or size check. An app passing Markdown image sources to it lets model output render local images or SVGs, hang a decoder on a FIFO, or exhaust memory. url_set passes the listed width as the SVG raster size unclamped (20000w gives a 1.6 GB pixmap).
crates/rune/src/image/from_url.rs:53,111-129; crates/rune/src/image.rs:103-111
✓ Confirmed
Medium
Web image fetch has no policy hook; body and decode unbounded
fetchImage requests any URL (the request reaches the server even when CORS later fails, the classic Markdown-image exfiltration channel), reads the whole body, and decodes with createImageBitmap before the maxSide check, contrary to the comment.
crates/rune/src/platform/web/platform.js:59-60,68-87
✓ Confirmed
10 more verified issues
Medium
Revealed secure inputs expose plaintext to live AccessKit TextRuns
a11y_text_nodes emits TextRuns for every input from edit.display(), which returns the plaintext when revealed. The El::revealed doc promises no accessibility text. The hidden single-line mask leaks the length. --tree omits runs, so tests miss it.
crates/rune/src/a11y/text.rs:90-96; crates/rune/src/edit/display.rs:224-235; crates/rune/src/el.rs:836-840; crates/rune/src/a11y/tests.rs:290-301
≈ Partly Rune's TreeUpdate does carry plaintext TextRun values for revealed secure inputs, which breaks the El::revealed doc at the data level. But secure inputs map to Role::PasswordInput. accesskit_consumer leaves TextRun nodes out of the platform tree. For PasswordInput it also masks both the text-range text and the derived value with U+2022 whenever the runs hold more than one distinct character. The macOS adapter reads text through those paths. So assistive clients see bullets, not plaintext. Two narrow gaps remain: a secret made of one repeated character, which AccessKit leaves unmasked, and any consumer of the raw tree. The 'length leak' matches native secure fields and AccessKit's own one-bullet-per-character masking. Severity should be low, not medium.
Medium
Interaction exporter enabled in release by ambient env
RUNE_PERF=1 or a loopback OTEL_EXPORTER_OTLP_ENDPOINT turns on OTLP posts (normalized key paths that can carry user words, stack symbols, exe name, pid) to a fixed loopback port any local user can bind, and starts UI-thread suspension for stack sampling. Not feature-gated.
crates/rune/src/tooling/interaction/gate.rs:13,38-68; crates/rune/src/tooling/interaction/export.rs:72-180,218-227; crates/rune/src/tooling/interaction/names.rs:71-116; crates/rune/src/tooling/interaction/stack.rs:113-127
✓ Confirmed
Medium
Release binaries accept developer argv flags
Args parse the process argv unless App::args is used: --snap/--tree/--html/--trace write files, --script (+ --native) injects input. Contradicts PLAN's dev/test-only tooling and 'no socket' release intent.
crates/rune/src/tooling/args.rs:88-118,120-193; crates/rune/src/tooling.rs:131; PLAN.md:122,321
✓ Confirmed
Medium
rune-dev syncs untracked files to remote build hosts with a 3-pattern denylist
git ls-files --others --exclude-standard (or os.walk for non-git external crates) filtered only by path prefix and .env*/.pem/.key, so credentials.json, id_* keys, .p12, .npmrc and tokens in .cargo/config.toml are rsynced. The build host is fully trusted (its dylibs run on the desk Mac).
scripts/rune-dev:59-104,136-137,700-729,436-463
✓ Confirmed
Low
Hot devserver IP not loopback-checked before dlopen of patches
connect() takes DIOXUS_DEVSERVER_IP from env and subsecond::apply_patch loads libraries the server names. Dev-only: hot feature plus RUNE_DEV_GUARDED.
crates/rune/src/hot.rs:161-177,213-238
✓ Confirmed
Low
procwatch::serve: no Host check, serial, no auth
Any bind address; only loopback peers answered; 1 s read timeout serves one client at a time (stall/slowloris); DNS rebinding can read the JSON. No callers in the workspace.
crates/procwatch/src/lib.rs:521-545
✓ Confirmed
Low
Drops and plain-text paste unbounded
Plain clipboard text is unbounded; HTML over 4 MiB is copied before being dropped; arboard decodes Windows/Linux images before the 64 MP check; drag image data is written unbounded on the main thread with TIFF converted there; rune-drops temp folders are never cleaned.
crates/rune/src/clipboard/native.rs:44-64; crates/rune/src/clipboard/macos.rs:63-66; crates/rune/src/platform/macos/drop.rs:190-233
✓ Confirmed
Low
Inconsistent scheme sets and sanitizer over-claim
open_url allows http/https/mailto; edit/html adds tel and relative; the sanitizer adds cid and data:image and keeps remote src/srcset/poster/ping despite the doc's 'drops anything that can ... load something'; mirror webLink is case-sensitive; AccessKit set_url accepts anything with '://'.
crates/rune/src/open_url.rs:78-91; crates/rune/src/edit/html.rs:32-51; crates/rune/src/clipboard/html.rs:4,24-27,277-295; crates/rune/src/a11y/text.rs:124
✓ Confirmed
Low
No notarizable packaging path; private API and class patching fragility
The installer signs without --options runtime, --timestamp or entitlements and falls back to ad hoc silently. macos-background-cursor dlsyms private CGS symbols (App Store rejection risk). Runtime patching of winit classes (method_setImplementation on WinitWindowDelegate, object_setClass on views, class_addMethod on the app delegate) is public API but fragile.
scripts/mac_app_install.py:138-143; crates/rune/src/platform/macos/cursor.rs:146-164; crates/rune/src/platform/macos/appearance.rs:32-43; crates/rune/src/window/mac.rs:34-50; crates/rune/src/platform/reopen.rs:96-115
≈ Partly The signing call has no --options runtime, --timestamp, entitlements or notarytool step. But the ad hoc fallback is not silent: it prints 'mac-app: signing identity failed; signing ad hoc' to stderr. And scripts/mac-app is a local installer, not a distribution pipeline. The CGS dlsym is feature-gated, and nothing in the workspace enables the feature except one example's required-features. The patching sites are as described.
Low
Incoming URL strings unbounded
GURL strings of any length go to the hook; the launch-time pending queue has no cap.
crates/rune/src/open_url/incoming.rs:101-113,188-194
✓ Confirmed
Strengths
  • open_url validation is strict and consistent with the web openLink/resolveLink checks; 26 URL test cases; headless runs never open links
  • sanitize_html has 55 adversarial cases (entity tricks, NULs, CSS comments, abrupt comments, CDATA, raw-text elements) plus linear-time and stability tests
  • Clipboard IO never runs on the event thread; RTF and TIFF conversions are bounded (1 MiB RTF, 256 MiB TIFF with a pre-decode dimension check, 64 MP)
  • Forged mention pills from other apps are rejected by a keyed fingerprint
  • The secret contract is unusually thorough and tested (secure_text.rs, 10 tests, 804 lines): zeroizing, redacted Debug, cache bypass, conceal on exit, events redacted, secret clipboard copies excluded from history and cleared
  • --tree and elements() never carry secure text; the web mirror and export skip inputs
  • Interaction spans never carry typed text; key presses are named key_edit
  • Decoder panics are caught per image; raster decode has dimension and allocation limits
  • Highlighters and Mermaid have explicit work caps
Key concepts
  • Validate at the action: Markdown and El links carry raw destinations; Tx::open_url checks the scheme when the app asks. Any other sink (DOM mirror, --html export, AccessKit url) must re-check, and two do not.
  • untrusted(): ClipboardContent::untrusted runs sanitize_html on every clipboard reply and scripted paste (clipboard.rs:207, runtime/input/keys.rs:296).
  • Own-pill fingerprint: A keyed hash of text, pill ranges and pasteboard revision so mention pills restore only from Rune's own last copy.
  • Secure contract: El::secure / TextEdit::secure: zeroized buffers, redacted Debug, no caches, copy, undo or IME; excluded from elements(), --tree, mirror and export; revealed keeps the protections except the live AccessKit TextRuns.
  • Interaction gate: One cached byte deciding OTLP export: on with RUNE_PERF=1 or a loopback OTEL_EXPORTER_OTLP_ENDPOINT; compiled into release builds.
  • usvg default resolver: usvg::Options::default() resolves <image href> by reading the path from disk and renders nested SVG files; SVGZ is decompressed with no cap.
  • webLink: bridge.js prefix test (https://, http://, mailto:) used for mirror text runs only; El::href link items bypass it.
Opportunities
One trust module and URL classifier for every sinkimpact higheffort low
Share one Link classifier across open_url, edit/html, the sanitizer, mirror JSON, the --html export, AccessKit set_url and Markdown; filter hrefs in Rust before JS or HTML; add javascript: tests for mirror and export.
Harden svg_rgbaimpact higheffort medium
Custom ImageHrefResolver (data: only or none); pre-decompress SVGZ through Read::take(64 MiB); parse with roxmltree nodes_limit and no DTD, then Tree::from_xmltree; clamp px to 4096 everywhere (incl. url_set); rasterize SVG in a worker or in slices on web.
Structural caps and adversarial tests for Markdownimpact higheffort low
Flatten quote and list depth beyond about 32, cap blocks and table columns; tests with >x100k, -x100k, 10k-column tables and 1 MB of '*'.
Untrusted image API and Markdown image/favicon policyimpact higheffort medium
Native url never reads disk; file is explicit, refuses non-regular files and caps bytes; Markdown gets an images and favicon policy (allowlist, proxy or offline) documented as the exfiltration defence.
AccessKit secure TextRunsimpact mediumeffort low
No TextRun values (or always the mask) for secure inputs, revealed or not; test both states.
Release gating for the exporter and argv toolingimpact mediumeffort low
Ignore an ambient OTEL endpoint unless debug_assertions or explicit RUNE_PERF=1, or put it behind a feature; ignore tooling argv in release unless RUNE_TOOLING=1 or App::args is set.
Fuzz the parsersimpact higheffort medium
cargo-fuzz targets for sanitize_html, parse_html, unpack_cf_html, check_link, tiff_dimensions_ok, Markdown parse+render and svg_rgba under memory and time limits.
Sandboxed content-decoding helper processimpact higheffort highre-architecture
Decode untrusted SVG, RTF and images in an XPC service, low-integrity process or seccomp child with no file or network access, returning RGBA via shared memory at the existing Decoded/mip seam, so out-of-memory, hangs and codec bugs cost a helper, not the app.
rune-dev sync allowlist and secret-name warningsimpact mediumeffort low
Sync only source and asset extensions or honour .rune-dev-ignore; warn on credential-like file names.
procwatch Host check and per-connection handlingimpact loweffort low
Reject Host headers other than 127.0.0.1 or localhost, use short timeouts or one thread per connection, add an optional token.
Notarizable packagingimpact mediumeffort medium
Add hardened runtime, timestamp, entitlements and a notarytool step to scripts/mac-app; fail loudly when a given identity fails.
Move drop image writes off the main thread and clean tempimpact loweffort low
Byte cap, worker-thread TIFF conversion, remove rune-drops/<pid>-* at exit and at launch.
Numbers, key files, roadmap and the verifier's additions
Numbers
In-scope lines (wc, incl. scripts and tests in-file)
~16,900
sanitize_html attack cases
55 (5 #[test] in clipboard/html.rs)
open_url URL cases
26 (3 #[test]); incoming_tests 8
Secure-text tests
runtime/tests/secure_text.rs 10 tests, 804 lines; a11y/tests.rs 14
Web mirror/export tests
a11y_tests 7, export/tests 6, html_tests 2; 0 javascript: scheme tests
Network listeners in rune crate
0 (procwatch::serve is the only TcpListener in the workspace; no callers)
Outbound local channels
OTLP exporter (loopback, default 127.0.0.1:27686), dioxus devserver (hot only)
RUNE_*/OTEL_* env vars read
~24 distinct
Caps
URL 8192 B; rich clipboard 4 MiB; RTF into AppKit 1 MiB; PNG 32 MiB/64 MP; TIFF 256 MiB; raster 8192^2 + 256 MiB alloc; SVG input 32 MiB (pre-decompress); icon px <=1024; svg px==0 <=4096; edit html depth 512; highlight 32 KiB/8192 tokens; Mermaid 400 items/depth 8; Markdown cache 16 MiB
Unbounded sinks found
SVGZ decompress, SVG href file read, native image file read, web fetch body, Markdown nesting depth, plain-text paste, drop image data, incoming URL length
Fuzz targets
0
Key files
crates/rune/src/open_url.rs Outbound link classifier (check_link) and per-OS openers; headless capture of link requests
crates/rune/src/open_url/incoming.rs GURL Apple-event handler and Inbox; raw myapp:// strings to App::on_open_url
crates/rune/src/clipboard/html.rs sanitize_html tokenizer, URL and CSS checks, CF_HTML unpacking, 4 MiB cap
crates/rune/src/clipboard/macos.rs Pasteboard reads, RTF-to-HTML via AppKit, TIFF dimension pre-check, image caps
crates/rune/src/clipboard.rs Clipboard worker, Purpose and Forms, untrusted() on every reply, secret copies, own-pill fingerprint
crates/rune/src/edit/html.rs Safe-subset HTML import (is_safe_href, MAX_DEPTH 512) and export for TextEdit
crates/rune/src/image.rs Decode dispatch, raster Limits, svg_rgba with usvg::Options::default()
crates/rune/src/image/from_url.rs ImageCache::url/url_set; native file_path reads any path; url_set SVG size not clamped
crates/rune/src/platform/web/platform.js fetchImage (unbounded body, decode before size check), openLink/resolveLink scheme checks
crates/rune/src/platform/web/bridge.js DOM mirror; text runs filtered by webLink, El::href link items unfiltered (line 353)
Roadmap items
  • Ship a shared trust::Link classifier and filter every href in the mirror, the export and AccessKit; add javascript: tests
  • Replace usvg::Options::default() with a data:-only resolver, bounded SVGZ decompression, a roxmltree nodes_limit and no DTD; clamp the SVG size in url_set
  • Cap Markdown quote and list depth and total blocks; add adversarial depth and width tests
  • Split native ImageCache::url from disk reads; refuse non-regular files and cap read size; document an image and favicon allowlist for Markdown
  • Suppress secure TextRun values in AccessKit for revealed inputs; add a test
  • Gate the OTLP exporter and argv tooling flags out of release unless explicitly requested
  • Add cargo-fuzz targets for the parsers and decoders
  • Tighten rune-dev sync to an allowlist
  • Add hardened-runtime and notarization to scripts/mac-app
  • Later: a sandboxed decode helper process for SVG, RTF and images
Found by the verifier
Medium
Media URLs are an untrusted entry point the inventory omits (unbounded download, Rust Ogg/WebM decoding, multi-GB WAV temp files)
With the default ogg-audio feature on macOS, Player::url, Player::audio and Player::request download the whole body through a synchronous NSURLConnection with no size cap. They also read file: paths and local files with std::fs::read. Then they demux and decode Ogg or WebM in pure Rust (symphonia, opuscule), and stream up to MAX_SAMPLES (about 4 GiB of 16-bit PCM) to a WAV under $TMPDIR/rune-audio for each clip. A small, highly compressed Ogg (Opus DTX or silence) can expand roughly 100-1000x onto disk. It is a third-party codec surface on bytes that may come from outside, the same class of problem as image and SVG decoding, and question (1) asked for every entry point.
crates/rune/Cargo.toml:8,26-29,142-144; crates/rune/src/video/mod.rs:229-247; crates/rune/src/video/macos.rs:233-241,270-303; crates/rune/src/video/foreign.rs:16-18,33-40,180-211,227-236
Medium
SVG <use> fan-out amplifies past the proposed fixes; usvg's own caps were not noted
usvg expands every <use> by copying the referenced subtree into its svgtree (parse_svg_use_element, then parse_xml_node). It rejects only self-recursion, depth over 1024, and more than 1,000,000 svgtree nodes. A few KB of plain SVG, with ten nested groups of ten <use> each, reaches the 1M-node cap with no DTD and no SVGZ. Each of those nodes is then converted, and resvg renders it with filters and strokes at up to 4096 px a side, on a decoder thread natively or on the main thread on web. Opportunity 2 (roxmltree nodes_limit, allow_dtd false, SVGZ take()) bounds XML nodes, not usvg's expanded tree, so it leaves this route open. A budget on the converted tree, or a time or worker bound, is also needed. The notes' 'no limit' wording also misses that usvg does stop at depth 1024 and 1M nodes.
usvg-0.45.1/src/parser/svgtree/parse.rs:172-216 (depth > 1024), 392-394 (nodes > 1_000_000), 545-620 (use expansion with only recursion checks); usvg-0.45.1/src/parser/mod.rs:109-125; crates/rune/src/image.rs:436; crates/rune/src/image/from_url.rs:85
Low
--html export writes native file-image paths (home folder) verbatim into <img src>
ImageCache::file and native ImageCache::url record the path as the Pixels source URL (path.to_string_lossy()). The export writes it as the src attribute. A static export of a view that shows an image by absolute path therefore publishes the local absolute path (for example /Users/<name>/...) in the page. It also points readers at a file they cannot fetch. This is part of 'what data leaves the process' through the export, and the notes did not cover it.
crates/rune/src/image.rs:271-277; crates/rune/src/pixels.rs:62-64,74-76; crates/rune/src/runtime/web/export.rs:83,103-108
19

OpenCode Desktop (M3) readiness map and the streaming data-in path

working

Every M3 screen has its layout piece in Rune or rune-kit (the shell, transcript growth, Markdown and diff are solid). The gaps are composites (command palette, prompt input, tool rows), two scaling defects (eager PopupList rows; streaming Markdown rebuilds the whole message on each delta) and the desktop services a replacement needs. The flagship harness was in the repo as examples/opencode until d1634c68 (2026-10-26), so CI could reproduce the goldens again after a port.

Summary (546 words)

M3 (PLAN.md:573-580) lists the sidebar and session list, a streaming transcript, the composer, a diff view, a command palette and popovers/menus. Mapped against code: the shell (SplitView, Sidebar with virtual_rows, SidebarRow with avatar, subtitle and RowStatus, TabStrip, WindowTitlebar; 3,339 lines, 45 tests) is working to solid. The exception is TabStrip: 1,227 lines and 0 tests. Transcript motion is solid: growth stacks, El::streaming, stream edges, reveal and Tx::settle implement all eight of research 18's guarantees except paced chunk reveal. Markdown (streaming tail settling, incremental parse) and DiffView are solid (note 15). The composer has the core pieces: TextArea auto_grow, Mark::Pill with insert_pill and replace_with_pill, PopupList for @ and / popovers, Latest for queries, on_input_paste with images on all three desktops. Missing are a kit PromptInput, prompt history, attachment chips and paste forwarding in kit fields. There is no CommandPalette, and the fuzzy scorer is private. Tool, reasoning and subagent rows are app compositions of Collapsible, Card, Spinner and fold_glide.

The key historical finding: the flagship was in the repo as examples/opencode until d1634c68 (2026-10-26). It had 3,199 src lines, a seeded synthetic fixture (2,450 lines plus a 374-line generator), element-tree goldens, scripts, motion-audit scenarios, and a live.rs SSE client using ureq. Every demo/opencode PNG dates from 2026-10-22 and came from that example. Since then 476 changelog bullets landed, so the hero and README stills are stale and nothing reproduces them.

Data-in path: a background thread pushes to an mpsc inbox and calls the setup waker (AppHandle::wake). That posts one EventLoopProxy WakeEvent::App per call, with no pending-flag coalescing at the source. drain runs the queued updates and calls request_redraw. At the next frame, poll drains the inbox once, and at most one commit runs per frame. Commits per second are about min(delta rate, display Hz, 1/commit cost), so about one commit per SSE delta at typical rates. View runs per commit: 1, or up to 3-4 when layout reads move (PASSES=2) or focus or caret reads re-measure. With virtual_rows plus memo, only mounted rows build and unchanged ones are memo hits. The streaming row's Markdown is never cached. Each commit it rebuilds the message's whole El tree, deep-clones earlier Blocks and copies and hashes the source, so cost is O(message), not O(delta). Measured on a 1,200-message, 22 MB transcript with a 7.2k reply (research/37:61): frame CPU p50 0.82, p95 1.59, max 2.38 ms, 0 frames over budget. Extrapolated from research 28 (no streaming bench exists): about 2.5 ms per commit at 50 KB and 10-14 ms at 200 KB, which cannot hold 120 Hz.

Backpressure: only frame coalescing, self-regulation and hidden-window economy. There is no stream primitive, no bounded queue, no throttle and no paced reveal.

Services across the three desktops: prefs (all three, but fsync runs on the calling thread), dirs, and toasts exist. Notifications and window-frame restore are macOS-only through rune-mac. Deep links work only on macOS. Single instance, auto-update and crash reporting are missing everywhere, and nothing reads window position back. The screens are closer to ready than the shell services a replacement would need (PLAN §12 question 4).

A synthetic CI harness is feasible at medium effort: resurrect examples/opencode fixture-only, port it to SplitView, Sidebar, TabStrip and virtual_rows, split view.rs, emit JSON tree goldens on Linux CI and regenerate PNG stills on a Mac.

Why this maturity: The parts M3 needs are working to solid: shell 45 tests, virtual_rows 25, Markdown 135, diff 34, combobox/popup/menu/select ~40, growth/stream runtime tests. But no in-repo app composes them since 2026-10-26, nothing exercises the networked data-in path end to end, TabStrip is untested, composites (palette, prompt input, tool rows) don't exist, desktop services are macOS-only or absent, and no CI runs any of it

Issues, most severe first
High
Flagship not in repo; hero and README stills are stale and irreproducible
All demo/opencode PNGs were produced on 2026-10-22 by examples/opencode, which was removed on 2026-10-26. 476 changelog bullets have landed since. README hero, crates/rune/README.md stills and the www site present them as current output
git log -- demo/opencode (484b7667, b2deca8a, 023f3a32, 0b280581 all 2026-10-22); d1634c68; CHANGELOG.md:1120; README.md:14; crates/rune/README.md:302,941; www/app/src/sections.rs:87-96
✓ Confirmed
High
Desktop services needed to replace Electron are missing
No auto-update, crash reporting or single instance anywhere. Notifications and window-frame restore are macOS-only (rune-mac). Deep links are macOS-only (Win/Linux start a new process with launch args and nothing forwards them). No getter for window position or maximized state
crates/rune-mac/src/notify.rs:1-6,64-75; crates/rune-mac/src/lib.rs:12-35,76-95; open_url/incoming.rs:1-19; window/handle.rs:55-116 (setters only); rg for set_hook/single-instance/updater finds nothing
≈ Partly Confirmed: there is no panic hook (hot reload uses catch_unwind, not set_hook), no single-instance lock or forwarding, and no updater. Notifications are macOS-only, and the Windows tray has no NIF_INFO balloon. Deep links are macOS-only. Wrong: 'no getter for window position'. El::on_screen_layout reports screen rects that include the window content origin, synced on all platforms except Wayland, and WindowHandle::with_raw_handle exposes the native handle. What is missing is a direct outer-frame and maximized getter, and a cross-platform save and restore helper.
Medium
Streaming Markdown costs O(message) per delta
can_cache is false while streaming, so every commit rebuilds the message's whole El tree, flattens and applies it. The parse cache deep-clones earlier Blocks and copies/hashes the source. Fine at 7 KB (measured); an estimated ~2.5 ms at 50 KB and 10-14 ms at 200 KB, which breaks 120 Hz
crates/rune-kit/src/markdown.rs:392,208; markdown/cache.rs:74,92,98; research/28-resize-rewrap.md:83-96 (50 KB view 0.78, flatten 0.85, apply 0.81; 200 KB 23 ms split)
✓ Confirmed
Medium
PopupList/Combobox build every row each commit
The @-mention and /-command popover uses eager .virtualize on built children, so a mention list over a large repo costs O(files) per keystroke
crates/rune-kit/src/popup_list.rs:235; note 14 issue 1
✓ Confirmed
Medium
TabStrip has 1,227 lines and zero tests
Reorder, tear-out, overflow and middle-click close state machine is covered only by an example and a motion-audit scenario
crates/rune-kit/src/shell/tab_strip.rs (558) + tab_strip/{tab.rs 437, drag.rs 232}; rg -l TabStrip crates/rune-kit/tests returns nothing; commit 721db315
✓ Confirmed
6 more verified issues
Low
No source-side wake coalescing or bounded queue for streams
AppHandle::wake/update post one EventLoopProxy event per call, and each runs a full drain. Requests::updates and app mpsc queues are unbounded; producers get no backpressure. live::Wake has a pending flag but it is crate-private
app.rs:661-664, 746-751; window/lifecycle.rs:85-97; live.rs:277-296
✓ Confirmed
Low
Layout reads multiply view runs per commit
settle_layout_reads re-measures up to 2 more times, and focus/caret re-measure adds 1. A transcript that reads its streaming row's size can run the view 3-4 times per delta, each re-running mounted row builders
runtime/layout_read.rs:39 (PASSES=2), 409-428; runtime/commit.rs:92-101
≈ Partly The mechanism is confirmed, but the bound is understated. The focus re-measure and the caret re-measure each call settle_layout_reads again (up to 2 more passes each), so a worst-case commit runs the view 1+2+1+2+1+2 = 9 times. A view that reads a growing streaming row's size usually pays 2 runs (one re-measure, then it settles), not 3-4. The correct line range is commit.rs:97-109, not 92-101.
Low
Kit text fields don't forward on_input_paste
A composer built from kit TextArea cannot take pasted images or attachments without dropping to core text_input
crates/rune-kit/src/text_input.rs:80-112 (EditActs: edit, submit, key, change); crates/rune/src/el.rs:927
✓ Confirmed
Low
Prefs::set fsyncs on the calling thread
Whole-file rewrite plus sync_all (F_FULLFSYNC on Apple) runs in handlers if called there; saving pane widths per drag step would stall frames
crates/rune/src/prefs.rs:108-145 (sync_all at 139)
✓ Confirmed
Low
No command palette or public fuzzy scorer
There is no CommandPalette component. Combobox's scorer is private, greedy, and returns no match positions
crates/rune-kit/src/combobox.rs:43-67; lib.rs pub use list
✓ Confirmed
Low
Doc drift
README:326 says a lazy view API is a remaining optimization although virtual_rows exists. Site alt text calls home.png 'the home screen with a prompt field' (it shows a search field and session list). incoming.rs doesn't say that Win/Linux links start a second process
crates/rune/README.md:326 vs 721; www/app/src/sections.rs:94; open_url/incoming.rs:17-18
✓ Confirmed
Strengths
  • Every M3 screen has its layout primitive: shell (SplitView, Sidebar with virtual_rows, SidebarRow status slots, TabStrip, WindowTitlebar), transcript growth with stream edges, Markdown, DiffView, PopupList, Select/Combobox, Menu/Popover, Toast
  • Frame-coalesced data path: any number of updates or inbox items between frames make one commit; hidden windows apply data without building views
  • Measured streaming on a real 1,200-message 22 MB transcript is well inside budget: frame CPU p50 0.82, p95 1.59, max 2.38 ms, 0 frames over (research/37:61)
  • Research 18's DOM-learned guarantees (time-based growth, last-line hold, settle on open, fade-in-place exits) are implemented in Rune, not left to apps
  • Composer core is strong: atomic Mark::Pill mentions with undo and copy/paste round-trip, image paste on all three desktops via on_input_paste, file drop
  • Latest and Live/LiveText give clean off-thread request/response and no-commit high-rate values
  • The removed examples/opencode, with its seeded synthetic fixture and timed event playback, is a ready-made M3 harness one git show away
Key concepts
  • examples/opencode (removed): In-repo flagship until d1634c68 (2026-10-26): 3,199 src lines, synthetic fixture.json with timed /api/event playback, live.rs ureq SSE client, element-tree goldens; source of all demo/opencode stills
  • Frame-coalesced commit: poll runs once per frame and queued AppHandle updates drain before it; any number of deltas between frames become one commit
  • Source-side wake: AppHandle::wake/update post one EventLoopProxy event per call (no pending flag), unlike live::Wake which coalesces until drained
  • View runs per commit: 1 normally; up to +2 when layout reads move (PASSES=2) and +1 for focus or caret re-measure; each measure re-runs mounted virtual_rows builders
  • Streaming Markdown cost: never memo-cached; each commit copies/hashes source, deep-clones earlier Blocks, rebuilds the whole message El tree, flattens and applies it: O(message) per delta
  • Growth stack + stream edges: GrowthSpec{spring, edge}, El::streaming, reveal word fade, Tx::settle: Rune's implementation of research 18's DOM timeline guarantees
  • virtual_rows vs virtualize: virtual_rows builds only mounted rows at layout time; virtualize on built children builds every row each commit (research 33 root cause 1; PopupList and the removed example used it)
  • Composer pills: Mark::Pill atomic runs in TextEdit, insert_pill/replace_with_pill, pill_style; PopupList for the popover; Latest for the query
Opportunities
Resurrect a fixture-only examples/opencode as the M3 harnessimpact higheffort medium
Restore from d1634c68^, drop live.rs and the sqlite tab read (or feature-gate them), port to SplitView/Sidebar/TabStrip and virtual_rows+memo, and split view.rs under the cap. Add scenes for each still, JSON tree goldens on Linux CI, PNG regeneration on a Mac, the opencode motion-audit scenarios, and a real-frames config with 50-200 KB synthetic replies
rune::Inbox<T> stream primitiveimpact mediumeffort low
push from any thread, a pending flag so one wake covers many pushes (as live::Wake does), drain() in poll, an optional entry/byte bound with a drop or block policy. Gives apps coalescing and backpressure
Per-block memo in streaming Markdown; Rc<str> Block textimpact higheffort medium
Cache each finished top-level block's El by digest so a delta rebuilds only the last block. Make Block text shared so cache extend stops deep-cloning (note 15 opp 1)
PopupList/Combobox on virtual_rows and a public fuzzy scorer with match rangesimpact mediumeffort low
Fixes O(n) per keystroke for mention lists, and enables palette highlighting
Kit composites: CommandPalette, PromptInput, ToolCall/Reasoning rowimpact mediumeffort medium
Dialog + field + virtual list + scorer. TextArea + pills + mention PopupList + on_input_paste + attachments + history. A fold_glide disclosure row
Desktop services sibling crateimpact higheffort high
Single instance with argument/URL forwarding (Unix socket or named pipe), Windows toast and Linux org.freedesktop.Notifications (existing zbus feature), a window geometry getter plus WindowState saved via Prefs, a panic hook to dirs.logs(), an update-check hook
Paced reveal option in GrowthSpec and async Prefs writesimpact loweffort low
DOM-style 24 ms chunked backlog pacing with a trailing-partial-word hold. Debounced background prefs saves
Typed transcript model in rune-kitimpact higheffort highre-architecture
A Transcript owning messages, parts, per-part parsed documents, per-block El caches and measured heights. It accepts typed deltas parsed on a worker and delivered via Inbox, and renders through virtual_rows with per-part memo. Per-delta cost becomes O(delta) + O(mounted memo hits); the OpenCode mapping stays in the app
Numbers, key files, roadmap and the verifier's additions
Numbers
Removed examples/opencode
3,199 src lines (view.rs 1,226) + 2,450-line fixture + 374-line generator; removed d1634c68 on 2026-10-26
demo/opencode goldens
8 PNGs (7 at 2560x1640, one 6016x2568), all last generated 2026-10-22; 476 changelog bullets since
shell/ size and tests
3,339 lines; 45 tests (shell 24, shell_desktop 15, pane 5, reorder 1); TabStrip 1,227 lines, 0 tests
Data-in core tests
app.rs 19, latest 17, live.rs 3, prefs 6, virtual_rows 25, incoming 8, rune-mac notify 3
Agent client stream frame CPU (research/37:61)
p50 0.82 / p95 1.59 / p99 1.97 / max 2.38 ms, 0 over 8.3 ms (1,200-message 22 MB transcript, 7.2k reply)
Agent client stream at research/33
p50 1.14 / p95 5.52 ms, 2 of 1,980 over; streamed chunk commit 4.2 ms; 177 MB malloc while streaming; 63-193 ms transcript load before first frame
Commits per SSE delta
~1 when delta rate < display rate; at most 1 per frame
View runs per commit
1 typical; up to 3-4 with moving layout reads (PASSES=2) plus focus/caret re-measure
Streaming Markdown per commit (estimate from research/28)
~0.3 ms at 7 KB, ~2.5 ms at 50 KB, ~10-14 ms at 200 KB
Rust CI jobs
1 (cargo test -p rune-www); no kit, runtime or flagship job
Key files
crates/rune/src/app.rs AppHandle::update/update_if/wake (645-664), Shared::drain coalescing (765-770); 19 tests incl. updates_that_change_nothing_build_nothing (1062)
crates/rune/src/window.rs waker = EventLoopProxy WakeEvent::App per call (415-417), live waker (463), setup_waker = AppHandle::wake (542-545), drain_frame (559-562)
crates/rune/src/window/lifecycle.rs drain(): runs queued updates, decides quiet, request_redraw (85-145); poll_hidden (152)
crates/rune/src/runtime/frame.rs Runtime::update_if (137-148), per-frame poll (424-433), single commit decision (536-560)
crates/rune/src/runtime/commit.rs commit: measure, settle_layout_reads, focus/caret re-measure (78-110) -> view runs per commit
crates/rune/src/runtime/layout_read.rs PASSES=2 extra measures when layout reads move (39, 409-428)
crates/rune/src/live.rs Live/LiveText latest-wins values with coalesced Wake pending flag (277-296); no commit
crates/rune/src/latest.rs latest-wins background request/response with debounce and 4-worker pool
crates/rune/src/el/virtual_rows.rs index-built lazy rows, the transcript/session-list virtualizer (39-85), 25 tests
crates/rune/src/el/growth.rs El::streaming, arrives_whole, fold_glide for transcript rows
Roadmap items
  • Restore a fixture-only examples/opencode from d1634c68^, ported to today's shell and virtual_rows, with JSON tree goldens in a new Rust CI job
  • Regenerate demo/opencode from it, or mark the stills as historical
  • Add rune::Inbox<T> (coalesced wake, bounded drain) and document the SSE -> inbox -> poll pattern
  • Per-block memo for streaming Markdown and shared Block text; then a typed Transcript model in rune-kit
  • Move PopupList/Combobox to virtual_rows; publish a fuzzy scorer with match ranges; build CommandPalette and PromptInput composites; forward on_input_paste in kit fields
  • Add TabStrip tests
  • Desktop services crate: single instance with URL forwarding, Win/Linux notifications, window geometry save/restore, panic-to-log hook, update-check hook
  • Benchmark streaming 50-200 KB synthetic replies with scripts/real-frames.py to replace the extrapolations
Found by the verifier
Medium
Finished Markdown in a realistic transcript is not auto-cached either
can_cache is false not only while streaming. It is also false with on_link, code_frame, link_favicon, images, on_image, a non-builtin highlighter, selectable+copy_source, or any source containing the word 'mermaid'. A chat transcript that opens links and puts copy frames on code blocks rebuilds every mounted message's full El tree on each commit, including each streaming delta. Each of those messages also clones its source into Markdown::new and hashes it in doc_cached, unless the app wraps rows in memo. Research 38's automatic Markdown cache doesn't reach the flagship's likely setup. The notes' claim that the rest of the transcript costs 'one memo hit per mounted row' holds only if the app memoizes.
crates/rune-kit/src/markdown.rs:391-418 (can_cache conditions; memo::cached only when true); research/38-view-rerun-and-commit-cost.md:30-35
Medium
'\]:' and cut-0 fallbacks turn a delta into a full-message reparse
extend returns None, which forces a full parse_streaming of the whole source, when the source contains "]:" anywhere. That is common in code: Python a[1:]:, d[k]:, TS [key: string]: T. It also returns None when the reusable cut is at 0 (a reply that is one long block, such as one big fence). parse_streaming can run parse_doc up to four times. Section 4.5 estimates cost only from research 28's non-streaming view, flatten and apply numbers, where the parse was a cache hit, so parse is missing from the per-delta cost.
crates/rune-kit/src/markdown/cache.rs:89-93; crates/rune-kit/src/markdown/stream.rs:23-53
Low
Research 33 numbers attributed to the removed example
Research 33 was written on 2026-10-29 at c83aa06b, three days after examples/opencode left. Its 'agent client' is an out-of-repo app. Section 4.6 calls the 63-193 ms transcript load 'the removed example's'. Section 4.3 says the example's eager virtualize 'is research 33's root cause 1', but root cause 1 is the team chat app. The pattern is the same; the attribution is wrong.
git log research/33-real-bottlenecks.md (4d52ded8, 2026-10-29); research/33-real-bottlenecks.md:24-27,47,82,119-127
Low
Prefs is last-writer-wins on the whole file
Each Prefs keeps its own in-memory map and rewrites the whole file on each set or remove, and nothing watches the file. Two handles, per window or per process (for example a second instance launched by a deep link on Windows or Linux), silently drop each other's keys. set also rewrites and fsyncs when the value is unchanged. This matters for the per-window state restore the notes propose to build on Prefs.
crates/rune/src/prefs.rs:16-19 (doc: whole rewrite, nothing watches), 93-97, 108-112
07

Platform coverage

macOS is where Rune is most complete, and also where most of the platform code is. Everything rides on winit 0.30, patched from outside: class patching, naked-asm trampolines and isa swizzles on macOS, window subclasses on Windows, layer-shell and portals on Linux. Windows and Linux work but have thin edges. The web is a working prototype that powers the public site. iOS is an embedding spike with no text input and no accessibility.

Feature coverage per platformCounts over the 27 features in the matrix below.
macOS19 · 5 · 3
Windows10 · 10 · 7
Linux5 · 14 · 8
Web3 · 7 · 14
iOS1 · 5 · 18
YesPartialNo
Lines that name a targetLines matching target_os = "…" or target_arch = "wasm32" across crates/.
macOS892
Windows192
wasm32 (web)186
iOS113
Android104
Linux97
Source: rg -c over crates/.
FeaturemacOSWindowsLinuxWebiOS
GPU backendYesRune's native Metal by default; wgpu Metal opt-outYeswgpu DX12 via DirectComposition, Vulkan fallback, FXC bytecodeYeswgpu Vulkan (no GL backend)YesWebGPU; WebGL2 opt-in feature, untestedPartialwgpu Metal default, native Metal opt-in
App shellPartialwinit 0.30 plus class patching, panels, isa swizzlesPartialwinit plus SetWindowSubclassPartialwinit X11/Wayland plus layer-shell and portalsPartialwinit canvas plus DOM bridge, one app per pagePartialLayerHost embedding only
Multiple windowsYesYesPartialWayland hide destroys the window, no positioningNoone canvasNo
Overlays / HUDsYesNSPanel adoption, levels 25-27, all SpacesYestopmost no-activate window, LL mouse hookPartialX11 override-redirect; layer-shell rebuilt blocking on every show; XWayland on GNOMENoNo
Overlay inputPartialno wheel, secondary click, IME or secure inputPartialsame subsetPartiallayer-shell has no wheel, no key repeat, no IMEn/an/a
Custom titlebarYestraffic lights and drag regionsYesWM_NCCALCSIZE frame with drawn caption buttonsNosystem frame or Adwaita CSDn/an/a
IME / text inputPartialwinit, no document contextPartialwinit IMM32, not TSFPartialwinit text-input-v3 / XIMYessliding 512-UTF-16 textarea (not positioned at caret)No
AccessibilityYesAccessKitYesAccessKit UIAYesAccessKit AT-SPIPartialown DOM reading mirror, no widget states, inputs skippedNo
Native app menu barYesNoNon/an/a
Pop-up / context menusYesNSMenuYesTrackPopupMenuExNoapp draws its ownNocancelledNocancelled
TrayNoYesShell_NotifyIconYesSNI over D-BusNoNo
Global shortcutsYesCarbon RegisterEventHotKeyYesRegisterHotKeyYesXGrabKey; Wayland portal (blocks startup per shortcut)NoNo
File drop inYespositions, file promises, image dataPartialpaths plus cursor samplingPartialX11 paths; none on WaylandNoNo
Drag outYesNoNoNoNo
Rich clipboardYesHTML, RTF, PNG, TIFFPartialHTML, imagePartialHTML, PNG, no RTFPartialasync Clipboard API text/html/pngNo
File dialogsYesrfd behind native-file-dialogYesrfd behind native-file-dialogPartialportal, unparented on WaylandNorefusedNorefused
System materials (glass)YesNSGlassEffectView/NSVisualEffectView synced, ~80 fpsPartialfallback fillPartialfallback fillPartialfallback fillPartialfallback fill
Frame pacingYesCVDisplayLink per surface with admission and Low Power capPartialFIFO, latency 2, 1 s steady presenting for VRRPartialFIFOPartialrAF, no quiet skip on timer wakesPartialhost CADisplayLink, no quiet skip
Text rasterizationYesCoreGraphics port, FontSmoothing OnYesCoreGraphics port, Off with Chromium-fitted gammaYessame as WindowsYessame, bundled fonts only (no system fallback)Yes
Video playbackYesAVFoundation, zero-copy IOSurfaceNofails with placeholderNofails with placeholderNoa drawn surface ends the appNo
Native surfacesYesbyte frames and IOSurface CVPixelBuffersPartialbyte frames and D3D shared textures (one GPU copy)Partialbyte frames onlyNoPartialbyte frames only
Audio and recordingYesAVPlayer (+Ogg/WebM via ogg-audio), AVAudioRecorderNoNoNoNo
OS notificationsPartialrune_mac::notify, bundled signed apps onlyNoNoNoNo
Incoming deep linksYesget-URL Apple eventPartiallaunch args of a new process, no single instancePartiallaunch args of a new process, no single instancePartialsame-tab routerNo
Hot reloadPartialSubsecond, ~8 sPartialSubsecondPartialSubsecondNoNo
GPU device-loss recoveryNoNoNoNoNo
CI coverageNonever compiledNonever compiledPartialdefault-features-off build plus 10 rune-www testsPartialwasm build of rune-www onlyNo
08

Cross-cutting risks

These problems belong to no single subsystem, so no single area reader owned them. The synthesis stage collected them and checked the load-bearing ones against the code.

High
CI is advisory, narrow and two days old
Only www.yml builds Rust: rune with default-features off for Linux and wasm, 10 rune-www tests, the --html exporter. No required checks on dev; PRs merge before the run finishes. Never compiled anywhere automatic: rune default features, any macOS or Windows code, the hot feature, rune-dev-guard. Never run: rune's 2,147 and rune-kit's 450 tests, motion gate, file-size ratchet, rune-ref, alloc tests, Playwright smoke, clippy, fmt. At ~100 commits/day with fix-forward on a fast-forward-only branch and apps pinning revs, regressions are found by the next agent session.
.github/workflows/www.yml:9-25,84; www/app/Cargo.toml:17; crates/rune-kit/Cargo.toml:9; dev ruleset has only non_fast_forward and deletion; 13 of 68 runs failed; #152-#155 merged onto red dev (notes 13, 18 verification)
High
The main thread carries every frame stage and every synchronous platform call
No render thread exists and on default macOS nothing leaves the main thread. Beyond motion, this surfaces as first-use shaping/raster stalls (9-38 ms), font discovery per TextSystem before the first frame (also per overlay at App::overlay), blocking Wayland layer-surface creation on every show, portal shortcut registration at startup, drag-out snapshot readback in CursorMoved, full-size first image upload, lazy layer pipeline compiles (~89 ms cold), Prefs::set fsync, Glass layout (0.8-2 ms, ~80 fps). A future render thread needs a Send paint snapshot first, because build() reads most of Runtime.
window/draw.rs:280-286; overlay/frame.rs:113 (!gpu::native); gpu.rs:33-36; platform/layer_shell.rs:378,408-410; drag_out/mod.rs:300-347; prefs.rs:139; research/26, research/33 (notes 02, 04, 07, 08, 09, 10, 11, 19-gap-4)
High
No failure model
Panics end shipped apps and the outcome depends on the entry point: on macOS observer-path panics exit 101 with no crash report, while AppKit-callback and launch-time panics abort; Windows/Linux exit 101; web traps and freezes. Every guard silently needs panic=unwind. A window surface that refuses reconfiguration panics on the next acquire; device loss is filtered by wgpu and handled nowhere (most likely a silent stale frame); the native Metal backend never checks command-buffer status. log is a dev-dependency only; ~94-107 production eprintln! sites are the only diagnostics, invisible in GUI launches and dropped on wasm.
runtime/commit/measure.rs:377-405 (hot-only catch); winit stop_app_on_panic only on observers; window/pacing.rs:94,114; window/win.rs:53; wgpu_core.rs:304; gpu/metal/device.rs:143-147; crates/rune/Cargo.toml:173-175 (note 19-gap-1 verification)
High
Untrusted content reaches unbounded sinks on the flagship path
Model output is attacker-influenced. SVG decode has unbounded SVGZ inflate, <image href> reading any local path (FIFO hang, /dev/zero OOM), <use> fan-out to usvg's 1M-node cap and no time bound; Markdown nesting depth is uncapped with recursive render (stack overflow plausible, unproven); native ImageCache::url/file read any path with no size or file-type check; web fetchImage has no policy hook (exfiltration channel); media URLs download whole bodies synchronously and decode Ogg/WebM to multi-GB temp WAVs. El::href and Markdown link ids are written unchecked into the DOM mirror and --html export (javascript: sink, latent).
image.rs:432-447; usvg parser/image.rs:85-113; markdown/parser.rs:496-503, render.rs:279,553; image/from_url.rs:111-129; platform/web/platform.js:62-87; bridge.js:353; export.rs:102; video/macos.rs:286-303 (notes 11, 13, 19-gap-3)
Medium
Stringly-typed identity with linear scans
Identity is a slash-joined path String; about 35 linear nodes.iter() path scans remain in hot input paths although an O(1) path_ids + node_index exists; anchors and Cx::layout match the first key in tree order; 19 role string comparisons plus VERTICAL_ROLES/LIST_ROLES route keys and unknown roles silently become Button/Group; Chord and Shortcut grammars read the same strings differently; Select keys options by label.
runtime/types.rs:91; input/keys.rs:226; hit.rs:182; gesture.rs:163; interaction.rs:54; anchor.rs:7-9; a11y/roles.rs:103; focus.rs:6,10; chord.rs vs shortcuts/parse.rs:56; select.rs:182 (notes 04, 05, 09, 14, 17)
Medium
Per-runtime duplication alongside thread-scoped caches that leak across windows
Every window and overlay builds its own TextSystem (font collection with up to 16 CJK + 6 symbol files, caches), glyph atlas (page 0 eagerly 4 MiB GPU, 11x an overlay HUD's drawables), image atlas and pipelines, plus a thread-wide measure() TextSystem. Meanwhile kit caches are per thread: Budget protection uses the thread COMMITS counter (two windows thrash), Markdown keeps one stream slot, RollingText history is keyed by label alone (a correctness leak between a window and an overlay), ScrollBar clears every window's bars at 256.
text.rs:258-277; render.rs:763; text/measure.rs:41-45; budget.rs:92; markdown/cache.rs:60,78; rolling_text.rs:82-84; scroll_bar.rs:280-282 (notes 08, 14, 15, 19-gap-2)
Medium
Memory bounds incomplete, GPU pools grow-only, no accounting, target metric mismatched
Image atlas has no cap and pins page 0 once any image/emoji/colour icon shows; Mermaid scenes, diff chunks, video posters and several small maps lack byte bounds; transient layers, backdrops (never freed), the blur pyramid (shrinks with the window, never freed; ~86 MB at 5K) and the instance buffer have no budget. No subsystem reports bytes. PLAN's target is RSS for hello while the quoted 70 MB is a settings window's footprint; the soak test's memory check is empty on macOS.
pixels.rs:302-303; rune-mermaid/src/scenes.rs:14-44; render/pass.rs:200-224; backdrop_blur.rs:254; upload.rs:216-220; tests/overlay_soak.rs:72-73; research/34:633-641 (notes 07, 11, 19-gap-2)
Medium
The sRGB-blend default transition is unfinished
Since fefcd431 windows blend in sRGB. The CAMetalLayer sRGB colorspace tag is dropped on every reconfigure on both Apple backends, including LaunchDrawables ~1 s after launch (P3 effect still open); tok and Kit::neutral alphas were tuned for linear light and never retuned (unverified at runtime); rune-light assumes linear inputs and the lab/cursed-settings encode and decode in partly cancelling ways; the text coverage gamma doc contradicts code; source text flights bypass the gamma.
platform/macos.rs:180-195; gpu/metal/surface.rs:111; window/draw.rs:341-344; tok.rs:143; rune-light composite.wgsl; examples/lab gfx/gpu.rs:51-79; text.rs:398-405; runtime/motion/flights.rs:214 (notes 07, 08, 16)
Medium
Two macOS GPU paths double the test matrix
Native Metal (default) and wgpu Metal (opt-out, iOS default, default-features-off builds, CI) differ in present worker use, occlusion lookup, command-buffer shape, error reporting and memory. Native Metal validates nothing, panics on descriptor-level features the automatic fallback cannot see, has no macOS 13 floor, and is what rune-ref's GPU lane tests on a Mac although research/24's tolerances were measured on wgpu. Neither path builds in CI.
gpu/backend.rs:30,112-127; gpu/metal/device.rs:83,146-147; gpu/metal/mod.rs:158-162; pipeline.rs:177; rune-ref gpu.rs:62 (notes 03, 07, 10, 12)
Medium
Systemic doc drift
README Differences from PLAN.md is false in almost every line (no AccessKit, vertical-only scroll, wgpu on macOS, no glass underlays, three fragment paths); Measured is undated and pre-Metal; PLAN §4.2/§4.3/§5/§13, the internal site (render thread, linear blending, borrowed GPUI rope), WEB.md (fixed canvas, no WebGL, nonexistent dev feature), kit README (3 Mermaid types vs 17), research notes citing deleted code, clippy.toml pointing at a nonexistent config.rs. The changelog promises revs that 4 of 476 bullets carry; 205 fragments are unfolded.
crates/rune/README.md:2801-2821; lib.rs:1-4; PLAN.md:23,552,616; site/src/content.tsx:59-63,201-215,311; WEB.md:89,124-128,230; CHANGELOG.md:3-4 (notes 01, 02, 03, 07, 12, 13, 15, 17, 18)
Medium
Dependency fragility under hand-patching
Rune patches winit internals by class name, KVO behaviour and delegate identity but depends on winit ^0.30.13, so an app's cargo update can pull an unchecked 0.30.x (most hooks fail closed and silently drop a fix; the KVO one brings back an abort). taffy 0.15 is a caret requirement while rune-taffy transmutes its private CompactLength. Apps take Rune as a git dependency so Rune's lockfile never applies. 30 crates have duplicate versions; no rust-version; toolchain pinned only on 2026-11-06.
crates/rune/Cargo.toml:65,67; platform/macos/appearance.rs:33-43; panel_bridge.rs; rune-taffy/src/style/mod.rs:40-61; Cargo.lock (notes 05, 10, 18)
Medium
Duplicated loops and parallel implementations
Four hosts own a frame loop and five headless loops plus two script dispatchers exist; fixes land per host (quiet-frame skip never reached web or LayerHost; --desktop ignores scripted resize; --snap-on-patch skips configuration and other flags). Same pattern: three blur pyramids, two motion checkers with a shared kind name of different meaning, two Knob and two Theme types, ~10 counting allocators, five kit row implementations, two diff renderers, three web semantic projections.
window/pacing.rs; platform/web.rs:509-562; platform/embed.rs:171-176; desktop.rs:380; hot.rs:317-330; backdrop_blur.rs vs rune-fx renderer.rs vs rune-light glass.rs; motion_gate/check.rs:38-66 vs scripts/motion-audit/analyze.py (notes 06, 10, 12, 13, 14, 16)
Medium
Flagship outside the repo and examples that don't teach the rules
examples/opencode (3,199 lines, seeded synthetic fixture, goldens, motion scenarios) was removed on 2026-10-26; the README hero, README stills and www page still show its 2026-10-22 output, 681 changelog bullets ago. No in-repo large app exists, and none of the 30 examples uses virtual_rows, memo, live_only, on_ready, prewarm_gpu or Latest; hello builds controls by hand in an always-dark theme.
d1634c68; demo/opencode/*.png; README.md:14; examples/ (0 hits); examples/hello/src/main.rs (notes 17, 19-gap-4 verification)
Low
Determinism is same-machine only and unrecorded
rune-motion math uses FMA where hardware has it; runtime steppers (scroll momentum, rebound, growth) use platform libm; system font fallback is unpinned; the backend silently switches to wgpu when a compositor wants unsupported features; trace lines embed wall-clock cpu_ms. Nothing records rev, backend, adapter or font set in artifacts. Only rune-ref's CPU lane is strict.
rune-motion/src/math.rs:3-20; runtime/motion/tracks.rs:191; growth.rs:328,372; text/families.rs:26-31; render.rs:517-519; tooling/trace.rs:55-58,225-226 (notes 02, 06, 12)
Low
Literal-frozen public types and silent misuse
Twelve types are frozen as struct literals (and #[non_exhaustive] cannot fix it because it also forbids struct-update syntax); kit Palette/Type/Radius/Kit are exhaustive literals in theme crates; Runtime has 28 pub fields. Wrong-state handlers panic at first press with no call site; virtual-list misuse asserts in release; unknown roles and unkeyed dynamic children pass silently; uncoloured text draws white.
AGENTS.md:29; states.rs:56-58; runtime/commit/measure.rs:248-258; a11y/roles.rs:103; el.rs:638 (notes 04, 14, 17)
Low
Hygiene debt with no counter
546 production unwraps (292 lock().unwrap()), ~248 undocumented production unsafe blocks, env::var calls under a warn-only 'disallowed' lint, rustfmt never applied (597 rune files and 63 rune-kit files would change), 19 files over the soft cap, 122 inline test modules against the sibling rule, stray pack.new, a 155 MiB pack with three versions of demo/rune.mp4. Nothing reports these counts over time, unlike the file-size ratchet that worked.
Cargo.toml:91-110; clippy.toml:6-9; scripts/file-size.sh --warn-only; pack.new; git count-objects (note 18 verification)
09

The engineering system

The engineering system is strong when an agent runs it and weak when nobody does. The rules in AGENTS.md are enforced by ratchet scripts. The file-size ratchet went from 176 exceptions to 0 in four days and ended edit collisions on runtime.rs. One changelog fragment per change ended collisions on CHANGELOG.md. Commits are small (median 118 changed lines) and well described. The test suite is large, headless and deterministic on one machine.

None of it runs on its own. The only Rust CI is www.yml: two days old and advisory. It builds rune with default features off for Linux and wasm and runs 10 tests. Default features, any macOS or Windows code, the hot feature and rune-dev-guard are never compiled automatically. The dev ruleset blocks only force-pushes and deletion. 13 of the 68 www runs since 6 November failed, and pull requests merged onto a red dev.

  • 2
    GitHub workflows, both built to deploy
  • 10
    Rust tests CI runs: rune-www on Linux, default features off
  • 0
    required checks on dev
  • ~15 s
    median pull request, open to merge
  • 109 / 139
    commits since 4 Nov pushed straight to dev
Tests per crate#[test] functions. rune-taffy's 10 include proptest-driven parity tests against upstream Taffy.
rune2,147
rune-kit450
rune-mermaid138
rune-motion93
rune-fx58
rune-knobs40
rune-ref23
rune-perf16
procwatch12
rune-taffy10
rune-theme-opencode7
rune-register6
rune-mac5
rune-light4
rune-staging0
Source: rg -c '#[test]' per crate.

Debt with no counter

MeasureCountNote
Production unwrap() calls546292 are lock().unwrap()
Production unsafe blocks without a safety comment~248the lint warns; the shared policy says deny
Files rustfmt would change597 + 63rune + rune-kit; never applied
thread_local! blocks71in rune; 112 across crates
Rc / RefCell lines in core173 / 121against tenet 7's no-Rc/RefCell rule
Packages in Cargo.lock54930 with several versions; hello pulls 196 crates
Files over the 800-line soft cap190 over the 1,500 hard cap
Repository pack155 MiBabout 72 MB of video and 75 MB of PNG blobs
Changelog476 + 205folded bullets + pending fragments; 4 marked Breaking

The risk in agent velocity

Too few tests is not the risk. The risk is in how agents work. Each agent runs a subset of the tests on its own machine. The cheapest way to get green is to bless a golden, allowlist a check or skip a test, and all of that can happen inside the commit that needed it. Defects are fixed forward (no reverts in 1,630 commits), with no bisect point, on a branch apps pin and that can never be rewritten. Determinism holds on one machine only. Spring math fuses multiply-add on aarch64 but not on x86 without FMA. Native builds fall back to system fonts. Every trace line carries a wall-clock cpu_ms. So goldens blessed on a Mac may not hold on Linux CI, which is why the plan's “CI goldens on all three desktops” can't just be switched on.

10

Making it a better system

Keep the algorithms. Re-architect the middle into three owners with typed boundaries, and put a gate around the whole before changing any of it.

Every independent assessment converged on one diagnosis: four architects, each with a different lens, and a cross-lab peer (gpt-6-astra). Rune lacks boundaries it can enforce. There is no boundary between the presented scene and app state, between the runtime and its four hosts, between the platform and the text being edited, or between a change and the apps that pin dev. They differed mostly on order. The peer wanted the presentation boundary first and an independent presenter as the goal. The performance lens showed that moving today's O(N) paint walk to another thread would not make it fit in 8.3 ms. Both are right, and they meet at one artifact: a retained, Send paint list compiled at commit time. It is the biggest single-thread win, and it is the snapshot a presenter thread needs.

The target therefore has three owners. A platform shell owns OS objects and synchronous callbacks and speaks Rune's own event and text-input protocols. An application side owns S, handlers, the view, commit, layout and editing, and stays on the main thread for every app. A presentation side owns the paint list, one SurfaceHost frame core, the renderer and telemetry. All three run on the main thread today. The plan makes their boundaries explicit and typed first. Only where telemetry shows main-thread work dropping more than about 1% of motion frames does presentation move to its own thread.

If I could do only three things

1. Gate dev. A required merge-queue check (workspace tests, default-feature, hot and wasm builds, semver-checks) and a verified branch that apps pin, fast-forwarded only when the platform matrix passes. This review found a regression in HEAD; this is the cheapest fix with the widest effect.

2. Own text input and make editing incremental. A Rune TextInputClient protocol implemented once over TextEdit, generalizing the web bridge's 512-unit window, with a macOS NSTextInputClient view first. Then per-paragraph layout with range-delta undo, which a spike already took from 15.2 ms to 0.10 ms. The composer is the centre of the flagship.

3. Build the paint list behind a differential harness. Split build.rs, assert byte-identical instance streams against the current walk, then patch O(changed) per frame with transform groups for scroll. That fixes the measured over-budget scroll, and it decides the presenter-thread question with data.

Target architectureThree owners with typed boundaries, shared services, and a verification pipeline around them. The presenter thread (orange) is built only if telemetry trips its gate.
Platform shellmain threadApplication sidemain threadPresentation sidemain now · own thread later, if measuredshell::Eventpointer, wheel phase, KeyCode, focusTextInputClient adaptersAppKit view · TSF · text-input-v3HostRequest queuetyped OS side effectswinit adapter (Win, Linux)exact pin + hook canaryOwned macOS shell (later)retires trampolines, swizzlesAppPart<S>state, view, handlers, pollRuntimeCoreTreeInputMotionPaintRequestsReportsDiagnosticsCommit pipelinebounded view runs · pool pre-shapingComposite text layoutper paragraph · range-delta undoPaintList (Send, SoA)patched O(changed) per frameSurfaceHostclock · admission · recoveryrune-render + rune-abirenderer, Metal, shared ABIFrameTelemetry ringinput → present latencyPresenter threadonly if >1% motion frames dropShared servicesFontStoreone per processGlyphCoreatlas per deviceComponent storeper runtime, evictedGPU pool budgetsaged, byte-cappedVerificationscripts/verifyone entry for agents and CIT1 · required merge queue≤15 min, LinuxT2 · platform matrixfast-forwards verifiedT3 · nightlyMiri, mutation, soaks
Source: judgment stage, merging four lens assessments and the gpt-6-astra peer.
Every component, its thread and what it replaces
ComponentThreadResponsibilityReplaces
shell::Event + per-backend translatorsmainOne Rune-owned input/lifecycle event stream (pointer, wheel phase and timestamp, KeyCode, focus, scale, occlusion, text-input calls)winit types in AnyHost, the PhysicalKeyCode alias, winit types spread across 61 files
TextInputClientmainDocument-range IME protocol over TextEdit: UTF-16 ranges, replacement ranges, first_rect, index_at, purpose; IME commits grouped into the typing undo runwinit's four-variant Ime stream; overlays with no IME
RuneTextView, later RuneWindow/RunePanel (macOS)main (AppKit)NSTextInputClient first responder; later owned window and panel classespanel_bridge naked-asm trampolines, KVO swap, view swizzles
SurfaceHost + Backing traitmain; present worker for wgpu windows on Windows/LinuxFrame clock, admission, quiet skip, acquire/backoff, checked configure, device-loss recovery, telemetry stamps, present strategy (inline/worker/CATransaction)four duplicated host frame loops (window, overlay, web, LayerHost)
HostRequest queue + PlatformStatemainTyped side effects from runtime to OS; cursor, IME area, secure inputabout 20 ad hoc pub request fields drained from 9 host files
FrameTelemetry ringwritten by main, the display-link thread and the Metal completion threadInput arrival, tick target, commit/scene/paint split, acquire waits, encode, present, presentedTime; derived input-to-present latency, missed presents, main-busy motion dropsnothing (end-to-end latency is unmeasured today)
RuntimeCore subsystemsmainTree, Input, Motion, Paint, HostRequests, Reports, Diagnostics; per-feature dense index lists; frame_step as named phases251-field Runtime<S> implemented generically across 93 files
AppPart<S> / AppHooksmainThin typed shell: state, view, poll, key/focus/IME hooksS-generic code spread across the whole runtime
Component service storemainPer-runtime component memory, commit-generation eviction, byte gauges; documented cached/digest APIkit thread_locals (RollingText, ScrollBar, Markdown, syntax, table); hidden current_runtime_id and memo::cached
Commit pipeline with parallel pre-shapemain + scoped worker poolBounded, counted view runs; O(changed) flatten/place/text layout; width-independent shaping of cache misses off mainserial shaping inside the Taffy measure callback; up to 9x9 view runs; force_all fallback
Composite text layout + range-delta undomain (shaping on pool)Per-paragraph layouts with a prefix index for caret, hit and IME mappingwhole-field layout per keystroke and full-snapshot undo
FontStorediscovery worker; shared read from any threadProcess-wide shared font collection and source cache, lazy discovery, OS fallback queriesper-TextSystem collection built with shared: false
GlyphCore + GPU pool budgetsmain (GPU owner)Per-device shared atlas pages; transient layers, backdrops, pyramid and instance buffers aged and byte-budgeted with gaugesper-renderer atlases; grow-only GPU pools
PaintList (compile, patch, groups, hits)main now; presenter thread laterRetained Send presentation model, O(changed) per-frame patching, transform groups through a side vertex streamimmediate-mode build() over the whole tree (kept as reference and fallback)
Presenter thread (gated)dedicated thread per deviceSamples a Scene copy, patches, encodes and presents without calling app code; latest-wins scrollPLAN §3's never-built render thread and command channel
rune-abi, then rune-rendern/aShared instance ABI and clip WGSL; renderer and GPU backends as leaf crates behind rune re-exportsthree drifting ABI copies; rune-fx include_str! of rune's clip.wgsl
rune-app services (opt-in)main + service threadsSingle instance, deep links into the running process, notifications, macOS tray, crash hook, window-frame persistencenothing on Windows/Linux today
scripts/verify + T1/T2/T3 + verified branchCIOne verdict locally and in CI; required merge queue; platform matrix; app-pinnable rev; auto-bisect; canonical deterministic laneadvisory www.yml only

Twenty recommendations, ranked

Impact against effortEach dot is a recommendation, numbered by rank and coloured by priority. The shaded corner holds the cheap, high-impact work. Hover a dot for its title.
1122334455667788991010High impact, lower effortEffort score (1 = small, 10 = very large)Impact score1234567814169101112171315181920
P0P1P2P3
Scores 1–10 assigned by the judge.
1

Required T1 merge-queue gate, exact pins for depended-on internals, .gitattributes

P0cost Mrisk mediumPhase 1

Why. Nothing stops a broken commit from reaching dev, which apps pin. Every later re-architecture needs a gate to verify it.

Evidence. Verified: .github/workflows holds only www.yml and site.yml; the only Rust tests are cargo test -p rune-www on ubuntu (www.yml:40,84). There is no .gitattributes. winit is a caret 0.30.13 (crates/rune/Cargo.toml:67). Taffy is a caret 0.15 while rune-taffy transmutes its private CompactLength (style/mod.rs:44,91).

Change. verify.yml on merge_group, pull_request and push. Jobs: ratchets; cargo check --workspace --all-targets with default features; --features hot; rune-dev-guard; wasm web-hello with defaults; a check-only matrix for darwin, windows-msvc, linux-gnu, ios and wasm; partitioned workspace nextest. Make the checks required and turn on the merge queue (rebase method); agents enqueue instead of pushing. Pin winit =0.30.13 and taffy =0.15.0, add a size and round-trip assertion for the transmute, and add *.wgsl text eol=lf.

Expected gain. About 3,000 tests and all default-feature builds gate every merge. Silent undefined behaviour and fail-open hooks become compile or test failures. Breakages are caught in about 15 minutes, before merge.

Raised by: verification lens, platform lens, architecture lens, gpt-6-astra, synthesis §11.1
2

Per-surface frame telemetry: input-to-present latency, missed presents, main-busy motion drops

P0cost Mrisk lowPhase 1

Why. PLAN §8's latency and missed-present targets are unmeasured. The pacing, threading and paint-list decisions need data.

Evidence. Input arrival is stamped (input/time.rs) and presentedTime is recorded only under --trace (frame/present_time.rs); the two are never joined. pace() and nextDrawable block on main before the build. The Glass 80 fps cap was found only by screen capture (research/26).

Change. An allocation-free FrameRecord ring per surface in frame/telemetry.rs, read through accessor methods. Stamps: input arrival, target, commit/scene/paint split, acquire waits, encode, submit, present, presentedTime, view runs per commit. Derived: input-to-present latency, a presents-per-refresh histogram, missed and doubled presents, and motion frames missed because main was busy. Plus a windowed scripted run on a reserved Mac.

Expected gain. Enabling. It turns unmeasured targets into numbers, supplies the go/no-go metric for the presenter thread, and gives before/after evidence for #5, #9, #11, #12 and #15.

Raised by: perf lens, gpt-6-astra
3

API-stability gate: semver-checks against verified, API snapshot, compat tests for every frozen type, consumer canary

P0cost Mrisk lowPhase 1

Why. Apps pin dev revs and dev moves about 100 commits a day. Today breaks are found only downstream.

Evidence. Only 3 of the 12 literal-frozen types have compat tests (app_spec_compat.rs, env_compat.rs, window_panel_compat.rs). lib.rs has 268 pub use lines and there is no snapshot. The changelog has 4 Breaking markers in 476 bullets. No example exercises memo or virtual_rows (verified), and the opencode fixture was removed.

Change. cargo semver-checks with the baseline at the latest verified rev, required in T1. A checked-in public-API text snapshot as the readable diff and agent API map. Exhaustive-literal compat tests generated from one literal_api.list. Restore a fixture-only examples/opencode canary and build it in T1.

Expected gain. Breaks are refused at merge, not discovered at the next pin bump. Breaking markers become required. Agents get a generated API map.

Raised by: architecture lens, verification lens
4

Rune-owned TextInputClient protocol, macOS RuneTextView, IME in overlays

P0cost Lrisk mediumPhase 1-2

Why. The composer is the centre of the flagship, and IME is PLAN's top risk. The protocol makes TSF and iOS adapters, not new designs.

Evidence. Verified: edit/ime.rs has only Preedit, Commit, Enabled and Disabled. No call to set_ime_purpose exists anywhere. overlay/any_host.rs has no Ime arm. The web runtime already has the sliding 512-UTF-16 window design.

Change. runtime/text_input/: selected and marked ranges, text_in, set_marked and insert with a replacement range, first_rect, index_at, command, purpose. Implement it against TextEdit by generalizing the web Mirror. Group IME commits into the typing undo run. Add a macOS RuneTextView inside winit's content view as first responder while a field has focus. Route overlays through the same client. TSF comes later. Opt-in through an App builder method and an env switch, then a Hex soak and a default flip.

Expected gain. Press-and-hold accents, dictation, reconversion, emoji-picker replacement, candidate windows at the caret, CJK in overlay palettes, and correct undo grouping on macOS.

Raised by: platform lens, gpt-6-astra, synthesis §11.8
5

Land the research/26 pacing fix

P1cost Srisk mediumPhase 1

Why. A frame over about 4.2 ms of CPU costs a whole refresh. Glass windows sit near 80 fps. The fix has already been measured.

Evidence. Verified: permits() measures the half-period gate from the last present (platform/display_link.rs:240-244). research/26:57-59: measuring from frame start gave 98.5% of frames at one period, and frame start plus a GPU wait before the transaction present gave 99% with 1.6% edge misses.

Change. Measure the half period from the previous frame's start and keep the 3/4-period target-spacing rule. Wait for GPU completion before presentsWithTransaction presents. Update the burst test. Keep a revert switch for one release. Add a motion-audit scenario with a synthetic 5 ms frame.

Expected gain. Glass windows go from about 80 to about 118 fps. App frames of 4.2-8.3 ms stop halving the cadence.

Raised by: perf lens, platform lens, research/26
6

Per-paragraph composite text layout with range-delta undo

P1cost Lrisk mediumPhase 2

Why. Typing in long fields misses the frame budget, and undo collapses at large sizes.

Evidence. Research numbers: 12 / 46 ms per keystroke at 50 / 200 KB; 19 ms in research/38. The research/32 spike went from 15.2 to 0.10 ms with 384/384 exact runs under three rules. text.rs keys one layout by the whole text, and history stores full snapshots.

Change. A text/composite/ module: split at newlines, cache each paragraph's Parley layout under its own shape key, and keep a (byte_start, y_top, line_start) prefix index. Build in the spike's three rules. Store undo as range deltas validated by length and hash. Enable above a size threshold first, with a differential test against whole-text layout. TextEdit.text stays a String.

Expected gain. A 50 KB keystroke drops from about 12-19 ms to about 0.1-1 ms. Full undo depth holds at 200 KB.

Raised by: perf lens, gpt-6-astra, research/32
7

Failure and correctness floor: surface-scoped panic teardown, device-loss recovery, checked configure, measure-fingerprint fix, content admission budgets

P1cost Mrisk mediumPhase 1-2

Why. Apps stay open all day and render model output. Failures are silent or fatal, and the policy is inconsistent across hosts.

Evidence. Verified: gpu/metal/device.rs:143-144 device-lost and uncaptured hooks are no-ops. The measure fingerprint in flatten.rs omits blocks and exact_lines, which break_key (text/hash.rs:68) includes. Windows use the raw configure while overlays use the checked one. Commit moves nodes out and restores them through explicit paths (commit.rs:118-122). SVG, Markdown and image sinks are unbounded (synthesis §7.7).

Change. Device-loss and uncaptured-error handlers set a health flag. The host recreates the GPU and re-uploads from the CPU copies that already exist, with a RUNE_GPU_FAULT injection switch. All configure calls go through the checked path. Include blocks and exact_lines in the measure fingerprint. Add decoded-work budgets for SVG, Markdown depth and images. Add a panic boundary that tears down and reports the affected surface and never resumes mid-commit.

Expected gain. No frozen or aborted windows after driver updates or GPU switches. No stale heights after block-format edits. Untrusted content gets bounded cost.

Raised by: gpt-6-astra, platform lens, synthesis §7.3, §7.7
8

Runtime-scoped component service store to retire kit thread_locals

P1cost Mrisk lowPhase 2

Why. Per-thread caches are shared by every surface, which causes cross-window bugs. The kit depends on hidden internals that a third-party crate could not use.

Evidence. Verified: rune-kit rolling_text.rs:82 holds a thread_local MEMORY keyed by the label string alone (:233). There are thread_locals in markdown, syntax, table and scroll_bar too. The kit calls #[doc(hidden)] memo::cached.

Change. rune::component::with_store::<T: Service>, resolved through the per-window scope stack that memo already uses. Service::commit_end(gen) and bytes() feed eviction and procwatch gauges. Promote cached/digest to documented API. Migrate one kit cache per PR.

Expected gain. Fixes the RollingText cross-window bug and the ScrollBar and Budget cross-window thrash by construction. One bytes hook covers all component caches. rune-kit then uses only public API.

Raised by: architecture lens, gpt-6-astra, synthesis §7.5
Recommendations 9 to 20
9

SurfaceHost frame core + shell::Event + typed HostRequest + FramePacket

P1cost Lrisk mediumPhase 2

Why. Four hosts copy the frame loop, so fixes land per host. The host boundary is defined in winit types. Compositors are coupled to the runtime's internals.

Evidence. Verified: Presented::unchanged is called only at window/draw.rs:158 and overlay/frame.rs:54, so web and LayerHost present every frame. clock.advance is called in four hosts. compose.rs Frame has pub rt: &mut Runtime<S>. The window/draw.rs draw function is about 240 lines.

Change. Extract SurfaceHost (clock, admission, quiet skip, acquire, checked configure, recovery, telemetry, present strategy) behind a Backing trait. Runtime::frame_out returns FramePacket, a drain of HostRequest values, and PlatformState. Add a read-only FrameView for compositors and keep Frame.rt deprecated for one cycle. Add a Rune KeyCode with the same variant names and a From impl for winit's type. Port LayerHost or overlay first and the window last, keeping drop order.

Expected gain. Pacing, quiet-frame and configure fixes reach all hosts at once. Web and iOS stop presenting unchanged frames. Headless tests can assert on side effects. Prerequisite for a present worker and a presenter thread.

Raised by: perf lens, architecture lens, platform lens, gpt-6-astra
10

Split Runtime<S> into a non-generic RuntimeCore of owned subsystems

P1cost Lrisk mediumPhase 2-3

Why. The god object is an edit-collision point. Generic code is monomorphised per state type. Ownership rules are not enforced by the compiler.

Evidence. Verified: 251 field lines (runtime.rs:366-801) and 110 #[path] lines. 93 files implement Runtime<S>, of which 15 read the S-typed fields (the lens said 94 and 13). runtime.rs was touched by 23 of the last 256 commits. The Measurement/Measured split proves the borrow-split pattern.

Change. Runtime<S> { app: AppPart<S>, core: Core }, with Tree, Input, Motion, Paint, HostRequests, Reports and Diagnostics as Default-constructible subsystems. Move one field family per PR, starting with hover. Add accessors before deprecating pub fields. A last mechanical PR turns S-free impls into impl Core. frame_step becomes named phases with an order test. Measure llvm-lines and --timings before and after.

Expected gain. Feature PRs stop touching runtime.rs. Generic code per app shrinks to about 15 files. Cross-subsystem writes show in signatures.

Raised by: architecture lens, gpt-6-astra
11

Per-feature index lists, Scene dirty list, slot_of, paint subtree skips

P1cost Srisk lowPhase 2

Why. An animating frame runs about 6-8 O(N) passes to find the handful of nodes that matter.

Evidence. Verified: runtime/paint/build.rs:36-55 clears and resizes the scratch arrays to n_nodes every frame. Scroll watches, step_scroll and Scene present_dirty scan everything. The research/37 scan spike gave −17% p50 on the long card, and frames over budget fell from 221 to 178.

Change. Dense lists owned by each subsystem: scroll viewports, on_scroll_offset, drawn_rect, visible_rows, loops, sticky, flights. A Scene push-on-dirty list expanded through pre-order ranges. A slot_of Vec in place of hash lookups. subtree_end skips. Assert in debug that each list equals a full scan.

Expected gain. 5-20% of animating-frame CPU on trees with 5k+ nodes. The dirty list is the input the PaintList needs.

Raised by: perf lens, research/37
12

Remove one-off main-thread stalls: shared lazy FontStore, pipeline prewarm, chunked image upload, async Wayland surfaces

P1cost Mrisk mediumPhase 2

Why. Hitches come from single long frames on the only thread.

Evidence. Verified: text.rs:260 builds the Collection with shared: false, and CJK and symbol fonts are registered per TextSystem. Lazy layer pipelines take 89 ms cold (research/34). First-mount shaping takes 27-38 ms (research/33). layer_shell uses blocking dispatch on show.

Change. A process-wide FontStore built on the prewarm thread, with CJK and symbol fallbacks discovered on a worker and OS fallback queries on a miss. Prewarm layer, composite and backdrop pipelines after on_ready. Upload large images over several frames. Async layer-shell configure. Prefs writes and drag-out snapshots off main. Parallel pre-shaping follows.

Expected gain. Removes 9-89 ms single-frame hitches. Font discovery leaves the launch path. One font mapping set instead of N.

Raised by: perf lens, platform lens
13

T2 platform matrix, fast-forward-only verified branch, auto-bisect, canonical deterministic lane

P1cost Lrisk mediumPhase 2

Why. Apps pin revs that no machine has checked on their platform. Goldens hold only on one machine.

Evidence. There is no macOS or Windows runner. rune-ref accepts only kinds 0-4 and 8-12 (lib.rs:119, verified). FUSED is set per architecture (rune-motion math.rs:11-14, verified). Native builds use system fonts. Traces carry wall-clock cpu_ms. The rendering harness needs a GPU device (headless.rs:138, verified).

Change. Post-merge lanes: macOS with both backends, Windows including dxbc tests, Linux lavapipe running the rune-ref differential, and web smoke. On green, fast-forward verified; on red, run git bisect and open an issue. A canonical mode with bundled fonts, platform-independent spring math, an environment manifest in goldens and no cpu_ms. Extend rune-ref to kinds 5-7. Self-hosted runners only on push and dispatch.

Expected gain. Apps get a trustworthy rev. Platform regressions are named within about an hour. One golden set covers every OS.

Raised by: verification lens, gpt-6-astra
14

Count budgets on canonical scenes and the motion audit as gated tests

P1cost Mrisk lowPhase 2

Why. The counters exist, but nothing gates on them. The mandatory motion audit is never enforced.

Evidence. FrameStats (runtime/types.rs:440) and frame/profile.rs counters exist with no budgets. motion-audit/run.sh never calls analyze.py --fail. The two checkers have drifted apart (27 Rust kinds against about 22 Python kinds).

Change. perf/budgets/<scenario>.json for about 10 scenes: view runs, commits, shaped runs, glyph rasterizations, instances, upload bytes, allocations. Lowering is free; raising needs --allow-raise and a fragment. Run the 36 motion scenarios as gate_rows debug tests, with Rust RULES as the only checker and allowlists committed next to the tests.

Expected gain. The regressions that research 31-38 found by hand fail at the commit that causes them, with no flaky retries.

Raised by: verification lens
15

Retained, Send, data-oriented PaintList with a differential harness and GPU transform groups

P2cost XLrisk highPhase 3 (phase 0 at end of Phase 2)

Why. The paint walk is the measured over-budget work in scroll frames. It is also the presentation model any future presenter thread needs.

Evidence. Verified: build.rs runs immediate mode over the whole tree, and instances are absolute rects. research/37: the paint walk is 25-62% of a scroll frame and the board long-card p95 is 15.2 ms, while research/37:174 rates retained paint 'Later, high risk'. Node holds Rc<Layout> (runtime/types.rs:97, verified).

Change. Phase 0: split build.rs by area in its own PR and add a differential harness that asserts byte-identical instance streams and hits. Phase 1: retained patching for frame, opacity and colour-only frames, falling back to build() otherwise. Phase 2: transform groups through a side vertex stream and a group buffer, leaving Instance unchanged. Phase 3: widen coverage until fallbacks are under 1%. RUNE_PAINT=legacy as the revert.

Expected gain. 20-50% less scroll-frame CPU on large trees. Board long-card p95 under 8.3 ms. Static subtrees cost about zero per frame. GPU upload per scroll frame drops to the group table.

Raised by: perf lens, gpt-6-astra, architecture lens (arena variant)
16

Default-on elision: kit cached() components, Versioned<T>, debug handler-type checks, teaching examples

P2cost Mrisk mediumPhase 2-3

Why. Elision is opt-in and almost nothing opts in, so real apps pay full rebuilds on every keystroke and token.

Evidence. Verified: rune-kit has 3 non-test memo( calls, and none of the 30 examples uses memo, virtual_rows or live_only. research/38: automatic Markdown cached took md-same from 0.851 to 0.167 ms. states.rs expect() panics without a call site.

Change. Apply cached(digest) to pure-data kit components. Add Versioned<T>, which bumps a generation on DerefMut. In debug builds, store a TypeId and #[track_caller] location with each handler and check them at commit. Add a perf_warn when an unchanged subtree rebuilds repeatedly. Rewrite hello and add a large virtual_rows and memo example.

Expected gain. 40-80% lower commit time on memo-friendly trees. Stale memo versions and wrong-state handlers become debug errors that name the line.

Raised by: perf lens, architecture lens
17

Per-platform TextProfile with an Electron parity lane, starting with Windows fractional scaling

P2cost Mrisk mediumPhase 3

Why. Matching OpenCode's Chromium text look is a top PLAN risk, and nothing has measured it off macOS.

Evidence. Verified: text/macos/hint.rs:44-46 accepts only integer ppem from 7 to 18, so at 125% only 12 px text is hinted among 11-14 px. Off macOS, smoothing is Off plus a fitted gamma (text.rs:96-98). No parity numbers are committed.

Change. Extend kit-diff to capture the Electron app on Windows (100/125/150%) and GNOME, and commit ink-ratio and MAE goldens. Add an internal TextProfile with a fractional-ppem vertical fitter, with system contrast and fontconfig settings honoured. Add an LCD tier only if grayscale misses its numbers. Route flights through the profile's coverage exponent.

Expected gain. Sharp body text in the most common Windows configuration, and a measured answer to the parity risk.

Raised by: platform lens
18

Memory: per-device GlyphCore, aged and budgeted GPU pools, gauges, footprint target

P2cost Mrisk mediumPhase 3

Why. Memory scales with surface count, not content. Transient GPU pools grow and are never freed.

Evidence. render.rs:763 allocates atlas page 0 per renderer (2048² R8). Backdrops are never freed (render/pass.rs:200-224). The instance buffer only grows. The hello RSS is 92.5 MB against a 50 MiB target, while footprint is 33 MB (research/34).

Change. Shared atlas pages per device, with lazy page 0. Pool transient layers by node identity with frame-age eviction and a byte budget. Free backdrops and the pyramid after N frames without blur. Skip the zero-fill for render targets that are always cleared. Shrink the instance buffer. Add procwatch gauges per pool. Restate the idle target as footprint.

Expected gain. About −4 MiB per overlay or text-free window. About 86 MB returned at 5K when blur stops.

Raised by: perf lens, gpt-6-astra, synthesis §7.6
19

Opt-in desktop app services crate

P2cost Mrisk lowPhase 3

Why. Replacing the Electron app needs single instance, deep links, notifications, crash capture and a macOS tray.

Evidence. No single-instance mechanism exists in crates/. tray.rs:9 says macOS is not supported. Notifications exist only as rune_mac::notify. Gap note 4 §5.

Change. crates/rune-app with SingleInstance (named mutex and pipe on Windows, D-Bus or an abstract socket on Linux), notifications (WinRT toast, freedesktop), an NSStatusItem tray, a crash hook, and window-frame persistence with fsync off the UI thread. Each has a headless fake. Auto-update stays with the app.

Expected gain. Closes the 'replace Electron' gaps except auto-update.

Raised by: platform lens
20

Rewrite PLAN now; gate a per-device presenter thread on telemetry

P3cost XLrisk highPhase 0 (docs) / Phase 4 (thread)

Why. The docs describe a render thread that does not exist. The thread's goal is right, but nothing measures yet whether it would pay.

Evidence. Verified: Host holds the Runtime and the Renderer together. Node holds Rc layouts. The present worker is macOS-only and skipped on native Metal (overlay/frame.rs:111-113). FrameClock keeps time across late frames. research/37 found 0 frames over budget in chat and notes.

Change. Stage 0, now: rewrite PLAN §3, tenet 2, PLAN.md:30 and rune-motion's description to describe the staged design. Stage 1 is #9 and #15. Stage 2: a window present worker on wgpu backends. Stage 3, only if more than about 1% of motion frames are missed because main was busy: an opt-in per-window presenter (WindowOptions builder) that owns the renderer, a PaintList snapshot, a Scene copy and scroll state, with headless running the same logic synchronously.

Expected gain. Docs stop misleading agents immediately. Later, running motion and scroll never wait for app code on opted-in windows.

Raised by: perf lens, architecture lens, gpt-6-astra

The roadmap

Phases on a week axisThe low and high estimates are the judge's guesses for one agent-driven team. Phase 4 starts only when its gates trip.
Phase 0 · Tell the truth2–3 days
Phase 1 · Close the loop2–3 weeks
Phase 2 · Fix the cliffs, name the seams4–8 weeks
Phase 3 · Presentation model, platform depth2–3 months
Phase 4 · Gated independence, new shellslater, when gates trip
Low estimateHigh estimate

Phase 0: Tell the truth

Make the docs match the code so agents stop designing against a render thread that does not exist · 2-3 days

  • Rewrite PLAN §3, tenet 2, the PLAN.md:30 row and rune-motion's crate description to say the main-thread model is current and the presenter is a gated stage
  • Update README Measured and Differences sections with dates and revs
  • Add .gitattributes (*.wgsl text eol=lf and other hashed inputs)
Exit criteria
  • No doc states a render thread or command channel as current
  • The gate for building a presenter thread is written down

Phase 1: Close the loop

Every change is gated, user-perceived latency is measured, and API breaks are caught before merge · 2-3 weeks

  • #1 T1 merge-queue gate with exact winit and taffy pins
  • #2 frame telemetry ring
  • #3 semver-checks against verified, API snapshot, generated compat tests, opencode fixture canary
  • #5 research/26 pacing fix, verified with telemetry
  • #7 cheap half: checked configure everywhere, measure-fingerprint fix, surface-scoped panic teardown
  • #4 started: the TextInputClient protocol and the headless IME replay tests
Exit criteria
  • dev advances only through the merge queue with T1 required
  • Input-to-present p50/p95 and missed presents reported on a ProMotion Mac
  • semver-checks and compat tests are required checks; the opencode fixture builds in T1
  • At least 97% of Glass frames at one refresh period

Phase 2: Fix the cliffs and name the seams

Typing and IME feel native, all hosts share one frame core, and component memory is per runtime · 4-8 weeks

  • #4 shipped on macOS (RuneTextView; overlays take IME)
  • #6 composite paragraph layout and delta undo
  • #7 device-loss recovery with fault injection; content admission budgets
  • #8 component service store
  • #9 SurfaceHost, shell::Event, HostRequest, FramePacket
  • #10 RuntimeCore split, first field families
  • #11 index lists and Scene dirty list
  • #12 stall removal and shared FontStore
  • #13 T2 matrix, verified branch, bisect, canonical lane
  • #14 count budgets and motion gate
  • #16 Versioned<T> and debug handler-type checks
  • #15 phase 0: split build.rs and add the differential harness
Exit criteria
  • 50 KB keystroke p95 at or below 2 ms
  • macOS press-and-hold, reconversion and emoji replacement work; overlays take IME
  • All four hosts use SurfaceHost; web and LayerHost skip quiet frames
  • No kit thread_local holds per-surface state
  • Apps pin a verified branch
  • Count budgets gate T1
  • Injected device loss recovers without a restart

Phase 3: Presentation model and platform depth

Retained O(changed) paint, finished subsystem split, platform text parity and product services · 2-3 months

  • #15 PaintList phases 1-3 with transform groups
  • #10 finished; impl Core
  • #16 kit cached components and teaching examples
  • #17 TextProfile and parity lane
  • #18 GlyphCore and GPU pool budgets
  • #19 rune-app services
  • rune-abi, then rune-render leaf crates
  • Web DOM mirror derived from the AccessKit tree
  • TSF adapter on Windows
  • Parallel pre-shaping on the FontStore
Exit criteria
  • PaintList differential harness passes across all suites; fallbacks under 1% of frames
  • Board long-card scroll p95 under 8.3 ms
  • Windows and Linux parity numbers committed as goldens
  • About −4 MiB footprint per overlay
  • Single instance and notifications work on Windows and Linux

Phase 4: Gated independence and new shells

Motion that never waits for app code where measurements justify it; owned shells where winit is a liability · later; start only when the gates trip

  • #20 stage 3 presenter thread, opt-in per window, only if more than about 1% of motion frames are missed because main is busy
  • Owned macOS RuneWindow and RunePanel; retire panel_bridge
  • iOS UIKit adapter on LayerHost with UITextInput and accessibility from AccessKit
  • winit-free web adapter and web size budget
Exit criteria
  • A deliberately stalled 30 ms commit drops zero frames of running animation on opted-in windows
  • Zero idle submissions on all hosts
  • The macOS shell runs without trampolines, KVO swaps or swizzles

Where the reviewers disagreed

Presentation thread: now or gated

Positions. The peer ranks the missing presentation boundary first and wants a presentation executor, a separate app executor and a transaction protocol. The perf lens wants a gated frame thread only after a Send paint list. The architecture lens wants docs now, a present worker on wgpu, and a thread only if stalls are measured.

Resolution. All three agree the boundary is the problem. The spot-check confirms that build() reads Rc layouts and most of Runtime. Build the Send PaintList first, on main; it is the presentation model the peer asks for. Gate the thread on the telemetry metric. Reject the separate app executor (app state is !Send user Rust). Accept typed in-process transactions as the shape of the channel; reject a serializable wire protocol first.

Rope versus per-paragraph layout

Positions. The peer wants a rope or piece-tree document type with indexed conversions. The perf and platform lenses want a composite layout and UTF-16 windows over the existing String.

Resolution. Composite layout plus delta undo first: the spike removes the measured cost, and TextEdit.text is a pub String. The peer is right that a rope alone fixes neither shaping nor Markdown. An additive Document type is reconsidered only if telemetry or count budgets show string copying dominating at flagship sizes.

Retained paint list timing

Positions. research/37 rates it 'later, high risk'. The perf lens says start at P1. The architecture lens proposes a generational node arena at P3.

Resolution. Start phase 0 (the build.rs split and differential harness) once the index lists land and telemetry gives numbers. Ship patching in Phase 3. The node arena stays deferred: it targets commit fragility, not the measured frame cost.

Scope of the crate split

Positions. The verification lens wants a broad split (tooling, shells, render, text, core) behind a facade. The architecture lens wants leaves only. The peer says to split after ownership boundaries exist.

Resolution. rune-abi now-ish, rune-render after FramePacket. Split wider only after RuntimeCore and T1/T2 exist. Moving tangled modules into separate crates does not untangle them.

API gate mechanism

Positions. The architecture lens wants a checked-in public-API snapshot. The verification lens wants cargo-semver-checks against the verified rev.

Resolution. Both, with different jobs. semver-checks blocks merges. The snapshot is the readable diff and the agent API map.

Does headless need a GPU

Positions. The synthesis says no. The peer says the rendering harness creates a GPU device.

Resolution. Both are partly right (headless.rs:138 confirms the device). Runtime::new plus rt.frame tests need no GPU and run in T1 on hosted runners. Snap and pixel lanes need lavapipe or self-hosted GPUs and run in T2.

PresentWorker coverage

Positions. The synthesis and two lenses say overlays present from a worker on wgpu, Windows and Linux included. The peer says it is macOS-only.

Resolution. The peer is correct. The branch is under #[cfg(target_os = "macos")] and skipped on native Metal (overlay/frame.rs:111-113), and present_worker.rs is macOS-gated. A window present worker on Windows and Linux is new work, not reuse.

Panic boundary semantics

Positions. The synthesis proposes one panic boundary in ApplicationHandler. The peer warns that unwinding mid-commit leaves nodes moved out.

Resolution. Tear down and report the affected surface. Never resume, because commit restores moved nodes only through explicit paths.

Weight of size and hygiene metrics

Positions. The verification lens leans on debt counts (unwraps, unsafe, file counts). The peer says these are not architectural verdicts.

Resolution. Agree with the peer. Debt counters stay as cheap ratchets at low rank. Ownership, failure semantics and workload scaling drive the ranking.

Exact winit pin

Positions. The platform and verification lenses want =0.30.13. The risk is resolver errors for apps that use another 0.30.x.

Resolution. Pin it, with a Breaking fragment. Those apps were already running unverified class-patch hooks.

Priority of the RuntimeCore split

Positions. The architecture lens says P0. The others put it after the gates.

Resolution. P1, starting in Phase 2. A 93-file refactor under about 100 commits a day needs T1 to verify each step.

What to keep, and what not to do

Keep as it is

  • The app model: one S, plain fn(&S,&mut Cx)->El views, a type-erased El, queued &mut S handlers
  • Closed-form springs with exact retarget velocity, the SoA AnimationStore, and FrameClock's catch-up split (MAX_GAP 250 ms)
  • Layout once at the target and edge-based layout motion; views never run for animation, hover, scroll or live values
  • Idle is free: ControlFlow::Wait at rest, and quiet frames that take no drawable
  • Acquire-before-build ordering
  • The native Metal backend model (one command buffer per frame, IN_FLIGHT 2, precompiled pipelines with a runtime fallback), and wgpu on DX12, Vulkan and WebGPU
  • Taffy via rune-taffy, and Parley/HarfRust/fontique on every platform
  • The deterministic CoreGraphics-port rasterizer (vary it with profiles; do not replace it with OS rasterizers)
  • The shape-key/break-key split and the glyph replay cache
  • AccessKit on the desktops, with assistive actions running the same handlers
  • The web sliding-textarea IME design, as the template for the native protocol
  • The Measurement/Measured split, exhaustive destructuring in memo reuse, and the El/Node/Instance size budgets
  • The Compositor hook and effect slots (narrow what Frame exposes; keep the hook)
  • rune-motion, rune-taffy and rune-staging as dependency-light leaf crates
  • rune-ref's strict-f32 oracle design, the motion gate's allowlist model, and the zero-allocation tests
  • The file-size and folder-shape ratchets, changelog fragments, and the paired --profile perf measurement culture
  • dev fast-forward-only, and the feature-flag, env-switch and soak-then-flip migration template

Do not

  • Do not build PLAN §3's serializable command channel or split-process mode before a Send paint list exists
  • Do not move the O(N) paint walk to another thread before it is O(changed)
  • Do not change the public 128-byte Instance; carry group ids in a side vertex stream
  • Do not introduce signals, Model<T>, read tracking, a view macro or El<S>
  • Do not add #[non_exhaustive] to literal-built types; it forbids struct-update syntax outside the crate
  • Do not add pub fields to AppSpec, Env, RunOptions, TextStyle or the other literal-built types; use builder methods
  • Do not replace TextEdit.text: String with a rope, or tie IME to a rope rewrite
  • Do not build a separate off-main app executor
  • Do not own Vulkan or DX12 backends, replace Taffy or Parley, build a shaped-word cache, add a per-frame arena, or revive MTLBinaryArchive
  • Do not make the GPU-springs spike the animation path
  • Do not split the core crate broadly before RuntimeCore and T1/T2 exist
  • Do not replace winit everywhere at once, fork it, or bump it before the platform matrix and hook canaries exist
  • Do not ship LCD subpixel text by default without committed parity numbers
  • Do not put product services into the core crate unconditionally
  • Do not start the iOS shell before the text-input protocol and SurfaceHost exist
  • Do not gate on wall-clock timings on hosted runners; gate on counts
  • Do not let CI auto-bless goldens, or let an agent weaken a check without a trailer and evidence
  • Do not run self-hosted runners on pull_request events in this public repo
  • Do not reformat 597 files in one commit, and never rewrite dev or verified
  • Do not catch panics and resume mid-commit

Risks of the re-architecture

  • PaintList divergence: fades, clips, sticky headers, hover, flights, El::cache and exit masks each have edge cases. Without a byte-identical differential harness and a counted fallback, the retained path can drift silently from build().
  • RuntimeCore split collisions: a 93-file refactor under about 100 commits a day collides with in-flight agent work. Do one field family per PR, behind accessors, only after T1 gates.
  • SurfaceHost drop order: window and surface drop order is load-bearing (window/native.rs). Encode it in Backing tests, or the shared core reintroduces crashes on close.
  • Text-input focus regressions: making RuneTextView first responder can break key routing, menus and shortcuts that today go through WinitView. Keep it opt-in until a Hex soak passes.
  • Pacing change: it alters every app's timing. Keep a revert switch and check the cadence histogram on ProMotion and 60 Hz displays.
  • Exact dependency pins can cause resolver conflicts in downstream apps. Mark them Breaking and document the pin.
  • Canonical lane: changing FMA use moves spring outputs in the last bit. The motion goldens need one dedicated re-bless commit.
  • Presenter thread: real concurrency (Scene copy divergence, stale hit lists, scroll ownership) in a codebase with no loom or shuttle tests. The telemetry gate must stay honest.
  • Merge-queue throughput: if T1 goes past about 15 minutes, agents route around it. Keep T1 lean and push the matrix to T2.
  • Narrowing Compositor Frame.rt can strand external compositors in apps. Keep it deprecated for a stated window.
  • Composite text layout: bidi base direction, line-top rounding and alignment rules must hold exactly. Ship behind a size threshold with a differential test before making it the default.
11

How this review was made

The review ran as one workflow of 52 agents on rev 1571ad57. Eighteen readers each covered one area: docs, research notes, crates and scripts. Each wrote 2,500 to 6,000 words of notes with path:line evidence and returned a structured summary. A separate skeptic re-checked every issue claim, opportunity premise and plan-versus-code claim against the code, and appended a verification section to the notes. A completeness critic found four gaps no area owned (failure model, process memory, trust boundaries, flagship readiness), and those got their own reader and verifier. A synthesis stage read everything and built the end-to-end picture. Four architects then assessed it, each through one lens: performance, architecture, platform and verification. gpt-6-astra gave an independent cross-lab opinion through Codex. A judge spot-checked the load-bearing claims of the top proposals and ranked them.

No agent ran a build. The only things I executed were the test run and its parent-commit comparison, the line-count, history and hour-of-day measurements, and grep counts. Every performance number in this report comes from the project's own research notes and README, as cited, and was not re-measured here. Those numbers come from Apple silicon, and headless numbers leave out GPU upload and presentation.

How the review was run
18 area readerscode + docs + research18 skepticsre-check every claimCompleteness critic4 gap areas addedSynthesisend-to-end picture4 lens architects+ gpt-6-astra peerJudgespot-checks, ranks
What the skeptics found, per areaIssue claims re-checked against the code: 225 confirmed and 75 partly confirmed, 0 refuted. Of 534 factual premises behind opportunities and plan claims, 8 were refuted and corrected in the notes.
Vision and roadmap5 · 5
Research 01–177 · 4
Research 18–388 · 4
Runtime core11 · 2
Layout7 · 5
Motion and scroll12 · 3
Renderer and GPU12 · 2
Text and editing9 · 4
Input and accessibility12 · 3
Platform shells11 · 4
Media14 · 3
Agent tooling8 · 5
Web target11 · 4
Kit components14 · 2
Markdown, diff, Mermaid11 · 2
Effects and theming12 · 4
Examples and DX11 · 2
Engineering health10 · 4
Failure model9 · 5
Process memory9 · 4
Trust boundaries13 · 2
Flagship readiness9 · 2
ConfirmedPartly confirmedRefuted
Source: the verify stage of the workflow.

Notes

This page is built from about 1.2 MB of per-area notes: one file per area with path:line evidence and its verification section, plus the synthesis and the full judgment. The notes stay private, and this page carries their findings.