Skip to content

Ariadne shell SH4: a volren node draws in every view - #1498

Merged
transfix merged 1 commit into
masterfrom
tfx/shell-sh4-volren-views-c15e6d
Nov 24, 2026
Merged

transfix merged 1 commit into
masterfrom
tfx/shell-sh4-volren-views-c15e6d

Conversation

@transfix

Copy link
Copy Markdown
Owner

Phase SH4 of the Ariadne shell design (docs/roadmap/ARIADNE_SHELL.md 4.4, "Volumes in every view"): a volren node now draws in every view, not only the main one. Joe rejected the main-view-only limit; per-view restyling of volumes is SH5 and is not here.

What changed

  • VolRenNode::viewProp(renderer) / releaseViewProp(renderer), the interface VolSliceNode already has. A view gets its own quad showing its own raycast: that renderer's camera, at its size times volren.resolution_scale, with its own picture, depth map and job.
  • One job slot per renderer. The worker keeps a latest-wins slot for the node's own renderer and one per view, and serves them in turn on the node's one raycaster. So the views share its thread pool, its cached shadow maps (they don't depend on the camera) and the app's CUDA device cache, and one view's camera moving never replaces another view's job. The single-threaded wasm path still raycasts inline.
  • When a view raycasts: only when its camera or size, the node's transform or clip planes, or the settings change (or on every draw, with volren.continuous). Never while it is hidden, and only on frames it draws, so refresh_hz throttles it.
  • Depth test per view: at each draw the quad reads that view camera's near and far and the GL viewport (from vtkOpenGLState). The shader takes a new volrenOrigin uniform, so it samples the picture relative to the view's own rect. The node's own renderer sets it to (0, 0), which is the same arithmetic as before.
  • A view's quad takes the volumes' world box as its VTK bounds instead of the quad's, so framing, clipping range and culling see what the view shows. It casts no shadow.
  • When a view goes: releaseViewProp, or the view's renderer being destroyed (a weak pointer; the next tick prunes it), drops its quad and any job of its not yet started.
  • converged() now also covers the views drawn since the last tick, so the golden harness waits for them. viewStats(renderer) reports a view's jobs launched, frames applied, its raster and whether it has settled.
  • scene_views.cpp: three lines in View::draw's volume branch. The mirror filter returns viewProp(vp->renderer()) instead of nullptr, for camera: main views too, since their size is their own. A volren node takes no override: yet (SH5).
  • GeometryNode::bindShaderTextures takes an optional list to record the textures it activates, so a view's quad releases its own texture units after its draw. With no list, it behaves as before.
  • orthoslicer.ari (the example and its golden): the slice view now hides the bunny's raycast (tags: [raycast] / hide: [raycast]), so the slice view still shows the slice alone and the golden is unchanged. Say if you'd rather the slice view showed the raycast.
  • Docs: ARIADNE.md 5.18 drops the "main view only" limit and describes the cost per view. VOLREN_API.md gains a "Views" paragraph.

Tests

  • New golden volren_views: one volren bunny in the main view and in two viewports from other cameras (azimuth 90, and azimuth -40 with elevation 60). Two rods pass through the body, so every view shows their ends outside the surface and their middles hidden by it. Written under llvmpipe (cvcpkg's Mesa 25.3.6, Windows build); on this machine's Intel Arc GPU it matches within channel difference 25, with no pixel beyond the 40 tolerance.
  • cvcgl_ariadne_views:
    • every view (own camera, camera: main, an overridden one) draws a quad of its own over the node's shaders, at its own raster (140x105 for a 280x210 view at scale 0.5);
    • a view whose camera does not move launches no job over 20 frames;
    • a view whose camera moves raycasts again and leaves the others alone;
    • on CUDA, every view raycasts again on the device;
    • releaseViewProp drops a view, and clearing the document's views drops the rest, their quads freed.

Verified locally

Windows, MSVC Release, ImGui on, CUDA 12.5 on an RTX 4070 Laptop GPU (sm_89):

  • cvcgl_ariadne_views: 74 of 74 checks pass, the CUDA check included.
  • The cvcgl_* ctest sweep: 132 of 134 pass, including cvcgl_volren_node, cvcgl_clip_planes, cvcgl_ariadne_realize, cvcgl_multi_app and the shader-texture users. The 2 failures (cvcgl_volume_grid_contours, cvcgl_contour_lab) are because this build lacks cvc::planar (Clipper2/CDT).
  • cvcgl_ari_golden under llvmpipe: volren_views and orthoslicer match, and so do the other goldens this build can render. skeleton and molecule_skeleton need mesh_lab, and contour_tiler and volume_grid_contours need cvc::planar; this build has neither.
  • On the Intel Arc GPU, orthoslicer misses its golden by 630 px. The base commit misses by exactly the same numbers, so it predates this change.

Not verified

  • Linux and macOS CI. macOS draws volren edges a pixel apart from llvmpipe (it needed orthoslicer.macos.png), so volren_views may need a .macos.png from the macOS CI artifact.
  • The browser (wasm) build.
  • Views drawn into textures (SH2, in flight). They should keep working through the same per-renderer interface; what viewProp needs from a view's renderer is listed in the SH4 notes for the SH2 session.

VolRenNode raycasts once per renderer that shows it, as VolSliceNode sweeps once
per view. viewProp(renderer) gives a view a quad of its own showing a raycast of
its own: that renderer's camera, at its size times volren.resolution_scale, with
its own picture, depth map and job. The worker keeps one latest-wins job slot per
renderer and serves them in turn on the node's one raycaster, so views share its
thread pool, its cached shadow maps and the app's CUDA device cache, and one
view's camera moving never replaces another's job. A view raycasts again only
when its camera or size, the node's transform or clip planes, or the settings
change, never while hidden, and only on frames it draws (so refresh_hz throttles
it). Its depth test reads the view camera's near and far and the draw's GL
viewport at each draw. releaseViewProp, or the view's renderer going, drops it;
converged() now covers the views drawn since the last tick.

The views' mirror filter returns the node's per-view prop instead of leaving it
out (camera: main views too: their size is their own). A volren node takes no
override: yet (SH5). GeometryNode::bindShaderTextures can record the textures it
activates for another actor, so a view's quad releases its own units.

orthoslicer's slice view hides the bunny's raycast (tag raycast), keeping the
slice alone as before. New golden volren_views: one volren node in the main view
and two viewports from other cameras, depth-tested against two rods in each.
cvcgl_ariadne_views checks each view's own quad and raster, that a still view
does not raycast again, that a moving one does without touching the others, the
CUDA path, and that a released or vanished view drops its raycast and quad.
ARIADNE.md 5.18 and VOLREN_API.md describe the per-view cost.
@transfix
transfix merged commit 2c80272 into master Nov 24, 2026
35 of 36 checks passed
@transfix
transfix deleted the tfx/shell-sh4-volren-views-c15e6d branch November 24, 2026 03:44
transfix added a commit that referenced this pull request Nov 24, 2026
#1507)

The test runs three Argon2id hashes at libsodium's MODERATE limits (256 MB each: the backup, the
wrong passphrase, the restore) through run(), whose default deadline is 60 s. On macOS Release CI
it takes 29-35 s, so the limit had under 2x headroom. On a slow macos-latest runner (run
45150947475, PR #1498) all three ctest attempts hit the deadline at 78-85 s, while
E2eeVectors.BackupsAreTxwtfs, which has no deadline, went from ~30 s to 78 s on the same runner.

This one call now passes 240 s: the work is unchanged, and it still stays under the 300 s ctest
gives a PR's tests, so a real hang still fails as "timed out" from the test itself. The store has
no test-only way to choose lighter KDF limits (backup always uses MODERATE), and adding one only
for this test is not worth it. The file's other run() calls do no Argon2id, and e2ee_test.cpp
calls backup and restore synchronously with no deadline of its own.
transfix added a commit that referenced this pull request Nov 24, 2026
… ...) into p9/volume-grid-segment

#1464 checks every load against the closed schema, which already takes a
color picker's fmt: rgb | hex. ColorWidgetFmtHexDrawsTheHexPicker counted
every warning of its fmt: hsv load; it now counts the loader's own, as
#1464's loader tests do, and checks that the schema flags that fmt where
it is when the validator is built in.
transfix added a commit that referenced this pull request Nov 25, 2026
…' after #1452, Cmd+Z in the context-menu test

The ci/full run of the first commit (45375289474) passed the six new macOS
goldens on all four lanes and left two failures:

- cvcgl_ari_golden: volren_views (#1498), 882 px beyond +-40. Its four lanes'
  frames are byte-identical, the same picture with box edges and the volren's
  shading a pixel apart. Committed as volren_views.macos.png.
- cvcgl_imgui_context_menu (#1476): "ImGui's undo takes the paste back". The
  test pressed ImGuiMod_Ctrl+Z. With ConfigMacOSXBehaviors (on Apple),
  io.AddKeyEvent swaps Cmd and Ctrl, so that arrives as Super and InputText
  doesn't undo. The test now presses ImGuiMod_Super there, the key a Mac's
  Cmd arrives as, which ImGui turns into its shortcut key. Checked against
  ImGui 1.92.9 with a standalone InputText: with macOS behaviours Ctrl+Z
  leaves 'abc' and Super+Z undoes to 'ab', and the reverse without them.

Master since then has #1452, which re-captured volume_grid, _quad and
_contours for its Segmentation tab and added volume_grid_segment (366 px on
macOS). Their .macos.png are the v4.0.8 tag run's (45478904899) frames,
byte-identical across the four lanes, and the same pictures as the llvmpipe
goldens.
transfix added a commit that referenced this pull request Nov 25, 2026
…t, ci/full for new goldens (#1526)

* cvcgl_ari_golden: macOS goldens for the six mesh and volume documents added since 11-20

contour_tiler, skeleton, molecule_skeleton, volume_grid, volume_grid_quad and
volume_grid_contours were added between 2026-11-20 and 11-23 with llvmpipe
goldens only. Pull requests skip the macOS package lanes, so none of them was
compared under the Apple Software Renderer before it merged. Since then all
four macOS package lanes have failed cvcgl_ari_golden on master and on the
v4.0.3 to v4.0.6 tags: 1,066 to 4,889 px beyond +-40, with the same counts in
every run.

The macOS frames are the same pictures. Edges of lines, translucent surfaces
and nearest-sampled texels land a pixel apart, as on orthoslicer. On
volume_grid_quad the Probe tab's Min/Max is also one float32 ulp off on the
arm64 runner. The four lanes' frames are byte-identical, so the v4.0.6 tag
run's (45246162146) are committed as <name>.macos.png, as docs/ARIADNE.md
describes. ARIADNE.md now says to run a new golden through ci/full/** before
it merges.

* macOS: volren_views and volume_grid_segment goldens, the volume grids' after #1452, Cmd+Z in the context-menu test

The ci/full run of the first commit (45375289474) passed the six new macOS
goldens on all four lanes and left two failures:

- cvcgl_ari_golden: volren_views (#1498), 882 px beyond +-40. Its four lanes'
  frames are byte-identical, the same picture with box edges and the volren's
  shading a pixel apart. Committed as volren_views.macos.png.
- cvcgl_imgui_context_menu (#1476): "ImGui's undo takes the paste back". The
  test pressed ImGuiMod_Ctrl+Z. With ConfigMacOSXBehaviors (on Apple),
  io.AddKeyEvent swaps Cmd and Ctrl, so that arrives as Super and InputText
  doesn't undo. The test now presses ImGuiMod_Super there, the key a Mac's
  Cmd arrives as, which ImGui turns into its shortcut key. Checked against
  ImGui 1.92.9 with a standalone InputText: with macOS behaviours Ctrl+Z
  leaves 'abc' and Super+Z undoes to 'ab', and the reverse without them.

Master since then has #1452, which re-captured volume_grid, _quad and
_contours for its Segmentation tab and added volume_grid_segment (366 px on
macOS). Their .macos.png are the v4.0.8 tag run's (45478904899) frames,
byte-identical across the four lanes, and the same pictures as the llvmpipe
goldens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant