The flow in 3D
The Flow page's third view: the account's flow as a lit, inspectable 3D scene, beside the existing 2D canvas (egui) and a plain table. Written 2026-12-02 with the first step of it.
1. What it is, and what it is not
The scene draws only what holger sends the Flow page: the flow's watch (ObjectService.Watch of <account>/-/flow), the same one model (flow_view::FlowModel) the 2D canvas reads. Nothing in it is simulated.
| Drawn | From |
| a slab per repository; a disc per registry, holger or place an arrow names | the flow's ends (FlowModel::ends) |
| where each stands, left to right along the arrows | FlowModel::columns |
| an arrow per arrow, Pull and Push apart, its checks counted | the arrow objects |
| how much has moved along an arrow (its brightness) | the arrow's moved counter |
| what waits or lies held on an arrow, or in a repository | waiting, held, the held objects |
| a pulse travelling an arrow | an arrow's moved counter going up while the page is open: the new moves, gathered into one pulse per arrow per update (its size says how many) |
| a mark on an arrow, a line on a slab | what a module adds to the flow (flow_parts::Additions) |
What Holger 4 does not send, and the scene therefore does not draw: bytes or throughput, uploads and downloads, cache hits and misses, replication or synchronisation traffic, verification timings, failed operations as events. Counters that existed before the page opened are drawn as brightness, never replayed as traffic. The page says so in words.
Not built, because the server has nothing to show: an exploded OCI image (Holger 4 serves rust, pip and advisories repositories, no OCI), storage nodes, replication targets. Those wait for holger to have them.
The look (finishes, light rig, geometry, camera presets) follows art/style-guide/HOLGER-3D.md; how it is made and reviewed, with before-and-after frames and scores, is art/README.md and art/reviews/.
2. Decisions
Beside, not instead. The 2D canvas stays the default and keeps every browser test that reads it (data-places, data-added). The 3D view is chosen per viewer (kept in localStorage), and the table is the view wherever WebGL2 is missing. One watch, one model, three views.
In the core, not a crate. crates/holger-ui-core/src/viz/. cargo xtask feature-tree holds every crate under crates/ to a module or a named non-module, and the console's default to nothing; the scene is neither a module of holger's nor optional, so it is a directory of the core. It names no module (rule 1): a module's marks reach it through Additions, as they reach the 2D canvas.
Pure first. Everything that decides something is plain Rust and host-tested: the scene's input and its bounds (viz::scene), where things stand (viz::layout), the pulses (viz::traffic), the camera (viz::camera), picking (viz::pick), the quality ladder (viz::quality), the theme's colours (viz::color). Only viz::stage (three-d) and viz::view (the Leptos part) are wasm.
three-d 0.19, no default features. Evaluated against:
| verdict | |
| three-d 0.19 (MIT) | chosen: PBR materials, instancing, shadow maps, on a glow context we make; with no features it has no window, no loaders, no text, no HTTP. It uses glow 0.17, the version eframe already links: no second GL binding. |
| glow alone | the fallback if three-d ever goes: all of three-d's shaders and PBR would be ours to keep |
| wgpu / WebGPU | not on every browser a restricted site runs; a much larger tree |
| Bevy | an engine, not a renderer: far too large for one page |
| kiss3d, rend3 | kiss3d brings its own window and loop; rend3 is archived |
Its own camera, its own picking. Orbit, zoom, pan and their easing are viz::camera, and so is the ray a click casts (camera::ray, the inverse of camera::project, from the same pose and field of view three-d draws with), tested against the slabs' boxes and the arrows' paths in viz::pick. No GPU read-back. The first-party ray is host-tested end to end (pick::a_click_on_a_framed_end_picks_it); three-d's own pixel-to-ray helper is not used.
Labels are HTML. Names are drawn by the page over the canvas, in the console's own font, projected from the scene each frame the camera moves: crisp at any size, selectable, read by a screen reader, and no font or text-shaping crate in the bundle.
Theme from the page. Colours are the console's CSS custom properties (--bg, --surface-raised, --line-strong, --live, --warn, …) read when the view starts and when the theme changes: light, dark and surprise follow with no second palette to keep.
3. Security
- CSP unchanged. The console already needs
'wasm-unsafe-eval'for its wasm; WebGL needs nothing more, and the scene loads no script, font, image, model or shader from anywhere.connect-src 'self'is untouched: the scene makes no request at all, it reads the model. - No user shader, no asset loading. three-d's shaders are constants compiled into the bundle; every mesh is built in Rust (
viz::stage). three-d-asset is linked with no loaders. - Untrusted input, bounded. Everything the scene draws passes
viz::scenefirst: at mostMAX_NODESends andMAX_LINKSarrows, names cut toMAX_LABELcharacters with control characters dropped, counters saturating. Pulses are capped (MAX_PULSES), gathered per arrow, and live a fixed time. Past the bounds the scene says what it left out; the table shows everything. - No credentials reach it: it gets the model, never the session.
- Authorization is holger's. The scene shows what the watch sends this person; it is not a boundary of any kind.
- No
unsafein first-party code.
4. Performance
- Lazy. No context, no mesh, no frame until the 3D view is chosen.
- On demand. A frame is drawn only while something moves (a pulse, the camera easing) or after a change; at rest the loop stops. Hidden tab, another view or leaving the page stops it too.
- Built once. The geometry is built when the flow's shape changes (a repository or an arrow comes or goes:
FlowModel::graphs); a counter only changes a colour or a pulse. - Instanced. The pulses are one instanced mesh.
- Adaptive.
viz::qualitysteps down (pixel ratio, then shadows) when frames run long, and back up with hysteresis; the canvas says its quality and frame time indata-qualityanddata-frame-ms. - Context loss stops the loop and says so; a restored context builds the scene again.
5. Accessibility
The canvas is an addition: the table view says everything the scene does, and is the view without WebGL2. The canvas takes the keyboard (arrows turn, +/- zoom, 0 resets, space pauses, Escape clears the selection), the selected end or arrow is described in an HTML panel beside it, and prefers-reduced-motion turns pulses into a still highlight and the camera's easing into a cut.
6. Supply chain
New crates in Cargo.lock (wasm only, through holger-ui-core):
| crate | why | licence | note |
| three-d 0.19.0 | the renderer | MIT | active (asny), no default features |
| three-d-asset 0.10.0 | three-d's CPU-side types | MIT | no features: no loaders, no reqwest |
| cgmath 0.18.0 | three-d's maths | Apache-2.0 | unmaintained (RUSTSEC-2026-0196), no vulnerability: pure arithmetic, no I/O. Ignored in deny.toml with that reason. The scene's own maths is first-party (viz), so leaving three-d for glow alone is the way out if it ever matters. |
| approx 0.4.0 | cgmath's float comparisons | Apache-2.0 | |
| open-enum 0.5.3 (+derive) | three-d's GL enums | Apache-2.0 | |
| libm 0.2.16 | maths for no_std paths | MIT | rust-lang |
| instant 0.1.13 | three-d's window timer | BSD-3-Clause | unmaintained (RUSTSEC-2024-0384): only three-d's winit window uses it, which is off; dead code here. Ignored in deny.toml with that reason. |
glow 0.17, half and thiserror were already in the tree. None of these crates is in the shipped program's tree (cargo deny --manifest-path crates/holger-ui/Cargo.toml check, the CI row): they are in the wasm console's. Found before this change and not of it: the workspace's cargo deny check already fails on epaint_default_fonts (egui's fonts: OFL-1.1 and Ubuntu-font-1.0) and on url (RUSTSEC-2026-0592).
7. Measured, 2026-12-02 (first step)
Against the a-to-f demo (9 ends, 7 arrows), in the rig's headless Chromium on SwiftShader, a CPU rasteriser (browser-tests/examples/flow_shots.rs):
| frame time at rest (camera easing) | 24–30 ms, quality high |
| frame time with 5 pulses travelling | 48–58 ms |
| frames drawn with nothing moving | none (the loop stops) |
a real cargo fetch through A |
5 pulses, one per arrow itoa / ryu moved along; the status line counts them |
| no WebGL at all (the console's in-app browser) | the table is the view; 3D is offered disabled with why; the 2D drawing says it needs WebGL; the watch is followed all the same |
These say nothing of a GPU: measure on real hardware before claiming 60 frames a second.
Looking at it. With a console running and a token in a file:
cd browser-tests
CHROME=/usr/bin/google-chrome HOLGER_TOKEN_FILE=~/holger-dev/token \
cargo run --example flow_shots -- http://localhost:3210 /tmp/shots # 2D, 3D dark/light/narrow/picked, table
CHROME=/usr/bin/google-chrome HOLGER_TOKEN_FILE=~/holger-dev/token \
cargo run --example flow_shots -- http://localhost:3210 /tmp/shots --live # waits for a real move, then two frames
The canvas says what a check reads: data-quality, data-frame-ms, data-pulses, data-picked (n2, l4), data-pick-at.
8. Not done yet
- An operator's switch for all of 3D. Today it is per viewer (the view switch, kept in the browser) and per browser (no WebGL2, no 3D). A build-time switch would be a cargo feature, and
cargo xtask feature-treeholds the console'sdefaultto nothing and its features to holger's modules: it needs the owner's word whether a non-module feature (off by default, 3D then opt-in) or a console-server setting is the way. - Measure on real hardware: integrated GPU and a discrete one.
- Browser tests of the 3D view of its own (the canvas's
data-*say enough to write them). - A server-side signal for live traffic beyond
moved(holger has none yet): bytes, downloads, cache hits. Without it the scene draws moves and nothing more. - The same stage for a package's security (verdicts, SBOM) once holger's objects say enough; an OCI explorer once Holger 4 serves OCI.