Repository navigation
quest(m1/rune-spike): the Rune spike report, stay on egui for now - #98
Conversation
Quest-Claim: 4471c34739a6a3ef
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head 01155741b7ad044433d493a600315796316bf1bf against base 0e09fec4b72074315cced19229c1faf89b0b8d5f, with the separate prototype at fb395b35678f8f96654ea87f463738df4e57721c as supporting evidence.
No actionable findings. The report covers the quest's requested comparison and keeps prototype code off main. The prototype's GPU adoption and direct texture bindings support the same-device/no-copy account; drag/edit and Cut use existing studio machinery. Benchmark scripts compare both UIs in one build, including a monitors-only egui layout. The missing dock and deterministic headless-cut limitation are disclosed.
Direction: retaining egui is a proportionate recommendation given the reported frame-time parity and additional integration work; no production migration is proposed here.
Verification limits: GitHub-only static review of both changed documents, prototype integration, GPU patch and benchmark scripts. I did not reproduce timings, run or build either UI, inspect rendered pixels, or validate macOS. Raw benchmark logs and element-tree output were not available in the pinned prototype. Repository guidance and pinned quest context were read as source; quest context was not executed.
(Written by review (OpenAI))
|
Decision (maintainer, /quest-complete): ✅ Stay on egui, and file the Rune issues so a later move is cheaper. Filed: anomalyco/rune#230 (an app can't give Rune its wgpu device) and anomalyco/rune#231 (rune-taffy vs taffy's (Written by Claude Opus 5.5) |

Problem
quest/m1/rune-spike.md asked whether the studio's UI should move from egui to Rune, by prototyping its hardest part, the Preview and Program monitors (live compositor textures, drag-to-edit items, the Cut button), and reporting frame time against egui, docking, sharing the compositor's wgpu textures, how rune-kit fits, headless testing, and the cost of a pre-release dependency that takes no pull requests. moq-dev/studio#85 (rune-fx inside egui) feeds the verdict.
This PR deletes the quest. The prototype stays off
main, onspike/rune-ui(fb395b3).Recommendation: stay on egui for now
Rune draws the monitors as well as egui does, but moving buys no measurable frame time and costs a fork of Rune today, a hand-built dock, and a dependency that changes about a hundred commits a day. Revisit if Rune gains an "adopt the app's device" API and a dock, or cuts releases. Keep using rune-fx inside egui as moq-dev/studio#85 does.
The prototype
With the
runefeature andSTUDIO_UI=rune,moq-studio show.tomlopens a Rune window instead of the egui one (rs/moq-studio/src/spike.rs, 760 lines, about 100 of them benchmark logging):El::effect) by aCompositorhook, sampled in place on the device the compositor renders on. No copy.snapmodule (hit testing, aspect-keeping resize, smart guides, Shift and Ctrl), committed through the sameeditand undo gestures. Selection handles, hover outline, and guides are Rune elements over the picture.Controlsthe egui panels and hotkeys fire.The headless run below: Break picked, its person dragged and selected, then Cut. The Program monitor still shows Main's frame; see Headless testing.
Findings
Frame time: parity, at the display's rate
Measured as moq-dev/studio#96 (merged) found egui must be: the studio as a Wayland client of headless sway on
nixos2(Intel composites a 1600x1000 output at 60 Hz, the RTX 2070 renders the studio), not Xvfb. One release build (--features rune,openh264) serves both UIs, with #96's temporary egui instrumentation applied. Scene: 1920x1080 at 30 fps, a color, an image, and a looping H.264 clip (NVDEC) in two scenes. Runs alternated egui, egui, Rune, twice; each line is the median of 32 to 34 windows of 60 frames after a 10 s warm-up, and the worst window's max.cpu_usagefor egui, Rune'supdate_ms + encode_msfor Rune. On the same two monitors the two are within 0.2 ms of each other, both well under 1 ms. The full egui dock costs about 0.8 ms more, for fourteen more panels.Sharing the compositor's wgpu textures: needs a Rune change
moq_video::render::request_devicewith DMA-BUF import and an exported timeline semaphore for zero-copy capture and encode, which Rune's device lacks, so Rune has to adopt the studio's.sh/rune-spike/rune.patchaddsrune::adopt_gpu(Gpu), used by windows and headless runs (about 30 lines). With it, the textures draw in place.Compositorwith its own WGSL, pipeline per target format, bind groups, and Rune's clip maths (about 250 lines), where egui needsregister_native_texture(about 30). It handles clipping, isolated layers, and both blend modes correctly, so it is more capable, but every app-drawn texture costs that.metal-backend), whose device is not wgpu's; sharing would needGpuBackend::Wgputhere. Not built or tested.Compositor::rendergetsf.device, and wgpu compares devices by id, which can collide across instances (Rune's own comment, hex#982), so the spike cannot reliably detect a missing adoption.Docking: hand-built
rune-kit has no dock. Its shell is a fixed
SplitView(resizable, collapsible sidebar and inspector around a main pane). egui_dock's tabbed, splittable, rearrangeable fifteen-panel layout would be the studio's to build: split panes fromPaneState-like drag handles and tab strips fromSegmentedControl, with drag-to-rearrange and floating windows from scratch. The prototype lays the two monitors side by side and does not attempt it.rune-kit fit: good for controls, gaps for an editor
Button,SegmentedControl, andCheckboxdropped in with a neutral dark theme and look more finished than egui's defaults;Select,Menu,TextInput,Tree, andTableexist for the other panels.DragValue(used for durations, sizes, filter amounts), and diagonal resize cursors (Cursorhas only column and row resize; the prototype shows a crosshair at corners, or would needCursorImagePNGs).poll: the view re-runs only whenpollsays what it shows changed. The studio's state lives behind the engine's lock and changes on the program clock, so each panel needs a snapshot to diff (Shownin the prototype). egui's immediate mode needs none. The lock waits stay near zero either way.Headless testing: works, with the patch, and one gap
RUNE_ARGS="--script drag.json --snap out.png --tree tree.json"ran a scripted scene pick, a drag (the item moved and saved to the scene file, snapped), and Cut, then wrote a PNG with live compositor textures and an element tree with keys, text, and rects (Preview: Break,Program: Break,cut to \Break``). egui has nothing comparable in this repo.kio::clock.The pre-release dependency
devin 17 days (24 to 273 a day), 476 changelog entries, no releases, and 87 open issues. Apps pin adevrev.adopt_gpu, above.FlexWrapexhaustively, and moq-scene's blitz (HTML overlays) turns on taffy'sflexbox_balance, which adds variants, sorune-taffydoes not compile in the studio's graph. The patch adds a wildcard arm. Cargo also resolved taffy 0.15.1 before the spike pinned 0.15.0 to match Rune's lock.Cargo.lock(accesskit, zbus, symphonia, resvg, among others).libxkbcommonandlibwayland-clientat build time; the dev shell provides neither, so the spike linked withLIBRARY_PATHfrom nixpkgs. A move would add them to the flake.~30.0.1, the same as moq-video today; a wgpu bump in moq would wait on Rune's, and the other way round.Impact
quest/m1/rune-spike.mdand its link inquest/m1/README.md, m1's last child, so m1's## Requiredheading goes too.main; public API and wire: none.Choices made without asking
b99c7b0, the rev rune-fx already uses, so one Rune is in the graph.sh/rune-spike/setup.shapplies the patch where the root[patch]points), rather than forking Rune on GitHub.rind0.1.12 and 0.2.0, both inmain's lockfile (see Follow-ups).Follow-ups
adopt_gpuand the taffy wildcard, a dock, and a numeric field.main's graph carriesrind0.1.12 (the moq workspace) and 0.2.0 (throughrind-rcgen0.1.14 in moq-tokio), and the fat-LTO release link ofmoq-studio --features rune,openh264failed withsymbol '.Lrsaz_2k_loop20' is already definedand similar. Not reproduced on a cleanmainbuild here, so worth confirming before planning.Review
Skipped as too trivial, at head 0115574: the diff against
mainonly deletesquest/m1/rune-spike.mdand its link and heading inquest/m1/README.md(30 lines, no code).quest check --base origin/mainpasses (35 documents ok). The prototype onspike/rune-uiis evidence for this report, not for merging, and was not reviewed.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code