Skip to content

Ariadne shell SH3: scenes of mounted documents, scene windows, a world clock per scene - #1597

Merged
transfix merged 7 commits into
masterfrom
tfx/shell-sh3-scenes
Nov 28, 2026
Merged

transfix merged 7 commits into
masterfrom
tfx/shell-sh3-scenes

Conversation

@transfix

@transfix transfix commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

Phase SH3 of the Ariadne shell (docs/roadmap/ARIADNE_SHELL.md 4.3, 4.4): a mounted document keeps its scene, for load: and mounts: alike, and shows it in a scene window of its own. Each world steps on a clock of its own.

What it does

Loader (loader.cpp)

  • The document's scene parsing is now parse_scene_blocks, shared by the document and its fragments.
  • expand_load keeps a fragment's scene:, scenes:, data:, assets: and keys: on the mount, as Widget::mount_scene (MountScene, new inc/cvc/ariadne/mount_scene.h).
  • A fragment with a scene: gets its scene window: a window ariadne_scene in its own tree, titled by its name, holding one viewport (scene_window, fill). It shows once <sub>.ariadne.scene is 1.
  • load: takes view: window and in_background: run|hold. mounts: takes in_background: (a value or { bind }). background: already names every widget's backdrop, hence in_background.
  • A dataset whose URI is an argument is not loaded in a mount, with a warning.

Runtime (ariadne.cpp)

  • A mount's datasets are bound at its sub-prefix just before its state:/init:: a load: as it is first drawn, a mounts: entry as it opens (and again when parsed again).
  • Runtime::scene_mounts() lists the mounts with a scene, datasets or keys: every load: not under repeat: and every open entry, less quit applications. Each comes with hold: the load's in_background, else the entry's background, else the slot's in_background. The list is false while a new tree is pending.

AppRuntime

  • Each drain, it realizes the scenes of mounts new to that list (SceneAdapter::realize_mount(id, scene, scenes, sub_prefix)).
  • It takes down the ones that left the list or were parsed again (clear_mount), and passes hold_mount.
  • It writes <sub>.ariadne.scene.
  • The "not drawn in a mount yet" warning is gone. A mounts: entry with a scene is still refused, naming gl.scene, on a host without one.

cvcGL adapter (AriRuntime.cpp)

  • Each mount gets a SceneGraph at its sub-prefix on a viewport of its own, mount:<sub>. Its camera is <sub>.viewers.main.camera (new viewer argument on addSceneViewport / addMirrorViewport), framed on its scene as the main view is.
  • The viewport is opaque, with the scene's own background, lights and shadow chain.
  • Its scenes: get mount:<sub>|scene.<id>, with state at <sub>.scenes.<id>.
  • AriRuntime::mounted_scenes() lists them; the golden harness waits on their volren raycasts and pending work as on the document's.

Views (scene_views.cpp)

  • A viewport's scene is resolved by the scope it is drawn in. A mounted document's own viewports find their mount's scene and scenes:. scene: { mount: <as> } is a further view (a mirror) of the scene at includes.<as>.
  • The scene window's view is the scene's own viewport drawn into the window's texture: no mirror, no extra shadow pass.
  • Views of a mounted scene are named after the mount, so two documents' views of one name never meet. Their cameras keep the document's name (<sub>.viewers.<view>.camera).
  • fill: true makes a viewport fill the rest of its window.
  • SceneViews::scene_drawn says which scenes a view drew last frame.

Clocks

  • New cvc/core/scene_clocks.h: the app's per-scene clocks by state prefix (add_scene_clock, remove_scene_clock, and scene_clock(app, prefix): the nearest clock at or above the prefix, else app.world_clock()). They are kept in an app.slot, not a static.
  • A mounted scene's clock is made before its world, at its clock: hz, else at the quantum of the clock above it (the shell's).
  • The scene drives that clock (RealizedScene::scene_world_clock, SceneClockDriver and SceneWorld::build given a clock, use_vehicle_clock(clock, ...)). Its physics, animations and <sub>.sim.* are therefore its own.
  • A held world (hold and no view drew it last frame) runs no time; its on_tick: and actions still run.
  • cvcGL's water, weather, L-system, world, swarm and vehicle nodes read cvc::scene_clock(app, their prefix). For a document's own scene that is still app.world_clock().

Hosts that draw no mounted scene (2e7df5f)

  • Only cvcGL's windowed host draws a mounted scene. ari on FTXUI or tvision has no scene adapter: a mounts: slot refuses a document with a scene (it needs gl.scene, SH1's check), and a load: runs without its scene, with a warning.
  • The scene window stays hidden there. The Windows menu lists the loader's scene window only while its <sub>.ariadne.scene is 1, so these hosts no longer offer an item that opens nothing.

Shell and docs

  • components/shell.ari binds the slot's in_background to shell.settings.hold_background. No settings page yet; that is SH14.
  • Docs: ARIADNE.md §5.18 (scenes of mounted documents), §6.3, §6.8, §11. "As built in SH3" notes in ARIADNE_SHELL.md 4.3 and 4.4; the 4.2 note is updated.

Tests (the SH3 row of section 5)

  • AriadneLoader.AFragmentsSceneIsParsed: a fragment's scene, scenes, data (relative to its own directory), assets, keys, view/in_background, and its scene window, for a load: and load_mount alike. Also the slot's in_background, and an argument dataset left out with a warning.
  • AriadneMounts.AMountsSceneIsRealizedAtItsSubPrefix (stub adapter):
    • two entries and a load: are realized at their own sub-prefixes with their own scenes;
    • their data is bound before init: reads it;
    • holds follow the load:, the slot's key and an entry's own background;
    • closing one clears only it.
  • cvcgl_ariadne_mount_scenes: four applications in a slot, 63 checks.
    • Each scene is realized apart: nodes only in its own graph, state and camera under its sub-prefix.
    • Each scene window draws its own viewport into the window's texture, and the shell's scene: { mount: a } viewport is a further view.
    • A node's visible: show follows <sub>.show, not the shell's show.
    • Clocks over one second at a fixed dt: 30 Hz gives 30 ticks, 60 Hz gives 60, and one without a rate steps at the shell's 50, beside the shell's own 50.
    • A background world steps with its window closed; a held one does not, and goes on when reopened.
    • Close takes its viewport, scene and clock down.
  • AriadneMounts.AHostThatDrawsNoSceneListsNoSceneWindow: with no adapter (ari), with an adapter that draws no mounted scene, and with one that does. The scene window is listed in the Windows menu only in the last case, and the first warns.
  • Golden scene_windows: two applications' scene windows overlapping, the front one with a volren node, each with its own background and lights.

Local results (Windows, MSVC Release, cvcGL + ImGui, RTX 4070)

  • New tests: AFragmentsSceneIsParsed, AMountsSceneIsRealizedAtItsSubPrefix, AHostThatDrawsNoSceneListsNoSceneWindow and cvcgl_ariadne_mount_scenes (63/63) all pass.
  • Core suites, all passing:
    • runtime 385 (on master with SH11 merged in), loader 283, host 69, scene_world 154 (1 skipped by design), schema 14 (1 skipped by design), requires 20, deep nesting 19, scene_swarm 7, data 19.
  • cvcGL: ctest -R "^cvcgl_(ariadne|viewport|imgui|ari_switch|volren|lowmem)" passes 57 of 58. The one failure is cvcgl_imgui_context_menu, whose 16 clipboard checks fail on this box only: an agent session has no Windows clipboard, as noted for SH8. The cvcGL physics, entities, swarm, wheeled-look, world and tree tests all pass.
  • Goldens under llvmpipe: the other documents give the same results with and without the node-clock change, pixel count for pixel count:
    • pass: context_menu, grid, menus, orthoslicer, scene, volume_grid, volume_grid_quad, volume_grid_segment, widgets, windows;
    • fail, as on master's build here: contour_tiler, skeleton, molecule_skeleton and volume_grid_contours (no cvc::planar/libigl here), and view_stacking and volren_views. This box's VTK lacks the lighting-uniforms and finish-every-render patches that CI's cvc.7 has (SH2's notes).

Not verified / not built

  • Golden images, taken from CI (0735f61).
    • The image first written here came from a local VTK without cvc.7's lighting-uniforms patch, so its back window was lit wrongly. CI's Windows and Linux jobs draw it the same (largest channel difference 2), so scene_windows.png is now the Windows job's image.
    • scene_windows.macos.png is from the ci/full/shell-sh3-scenes run (46079742689, at 8547151), job package-macos / libcvc-release-grpc. It has 759 px beyond 40 against llvmpipe, at the edges of the shapes and of the volren.
    • In that run, every failing package job failed only on scene_windows, except macOS libcvc-release-grpc. That job also failed PhysicsFieldWakeShore.CrossPlatformGoldenHash and PhTrain.TheTapesDerivativesMatchFiniteDifferences, master's macOS FMA failures that tests: the wake, boat-plant and tape tests without FMA contraction (master's macOS lanes) #1606 addresses. cvcgl_lowmem_fastdraw failed once and passed on retry.
    • The new images have not been through a macOS run yet; this PR's own CI runs no macOS lane.
  • Not built in SH3:
    • a mounted scene's world: block (vehicles);
    • binding its keys: (SH7);
    • view: main (SH6);
    • a repeated load:'s scene (warned);
    • a world for a mounted scene on a host without a scene adapter;
    • a mounted scene in arigl's terminal mode. TerminalScene has no realize_mount, so the scene is ignored with a warning. TerminalScene provides gl.scene, so a mounts: slot there opens such an application rather than refusing it.
  • Clock lookups. cvcGL's water, weather, L-system, world, swarm and vehicle nodes now look their clock up by bind prefix (the same app clock for a document's own scene). A nav_swarm node's navigator (scene_swarm.cpp) still steps on the app's clock, so in a mounted scene it follows the shell's.
  • No browser run.

…d clock per scene

A mounted document keeps its scene, for load: and mounts: alike
(docs/roadmap/ARIADNE_SHELL.md 4.3, 4.4).

- Loader: parse_scene_blocks is shared by a document and its fragments;
  expand_load keeps a fragment's scene:, scenes:, data:, assets: and keys: on
  the mount (Widget::mount_scene, mount_scene.h) and adds its scene window.
  load: takes view: window and in_background: run|hold; mounts: takes
  in_background: (a value or { bind }).
- Runtime: a mount's datasets are bound at its sub-prefix before its init:;
  Runtime::scene_mounts lists the mounts with a scene and whether each world
  holds in the background.
- AppRuntime realizes and clears the mounts' scenes from that list
  (SceneAdapter::realize_mount / clear_mount / hold_mount).
- cvcGL: each mount gets a SceneGraph at its sub-prefix on a viewport of its
  own (camera at <sub>.viewers.main.camera); its scene window draws that
  viewport into the window's texture; viewport scene: { mount: <as> } is a
  further view; fill: fills a window.
- Clocks: cvc/core/scene_clocks.h keeps a clock per mounted scene on the app;
  each world steps at its clock: hz or the shell's rate, and a held world
  stops while its scene is drawn nowhere. cvcGL's water, weather, L-system,
  world, swarm and vehicle nodes read their scene's clock.
- Tests: AriadneLoader.AFragmentsSceneIsParsed,
  AriadneMounts.AMountsSceneIsRealizedAtItsSubPrefix,
  cvcgl_ariadne_mount_scenes, golden scene_windows.
- Docs: ARIADNE.md 5.18, 6.3, 6.8, 11; "As built in SH3" in ARIADNE_SHELL.md.
… proxy shape

The viewer argument SH3 added to ViewportManager::addSceneViewport made SWIG wrap
it with *args, so the hook's bare 'scene' was undefined: pycvc_proxy_hooks failed
and pycvc_gl_viewport / pycvc_gl_keepalive crashed adding a viewport. The hook now
reads the scene from the proxy's locals, under 'scene' or args[1].
The image written here came from a VTK without cvc.7's lighting-uniform
patch, so the back window's shapes were lit as the front window left them.
CI's Windows and Linux jobs draw it the same (largest channel difference 2);
this is the Windows job's image. The macOS image is from the ci/full run's
package-macos / libcvc-release-grpc job: 759 px beyond 40 against llvmpipe,
at the shapes' and the volren's edges.
docs/ARIADNE.md: the mounts entry keys keep both SH3's background and SH11's net_policy, credential_store and e2ee_store.
…s drawn

On a host that draws no mounted scene (ari on FTXUI or tvision, with no
scene adapter; arigl's terminal scene, whose realize_mount says no) a
load:'s scene is ignored with a warning and its scene window stays hidden,
but the Windows menu still offered it, an item that opened nothing.

The menu item of the loader's scene window now carries its
<sub>.ariadne.scene key and is listed only while that is 1.
AriadneMounts.AHostThatDrawsNoSceneListsNoSceneWindow covers no adapter,
an adapter that draws no mounted scene, and one that draws it. ARIADNE.md
5.18 says what each host does with a mounted scene.
@transfix
transfix merged commit 136a5fc into master Nov 28, 2026
33 of 34 checks passed
@transfix
transfix deleted the tfx/shell-sh3-scenes branch November 28, 2026 15:04
transfix added a commit that referenced this pull request Nov 28, 2026
Conflicts kept both sides: the mounts: slot's grants:/deny: next to its
in_background: (widget.h, the schema), a load:'s command line and keys'
defaults next to its datasets (emit_container, open_mount, hot reload),
a load:'s grants next to its scene plan (plan_windows_menu), grants.cpp
next to table_emit.cpp, and the docs' shell.apps entry list.
load_mount_checked keeps SH7's prefix-aware message for gl.scene and
drops the "not drawn in a mount yet" warning, as SH3 did.

As agreed for whichever of #1597/#1598 merged second, a fragment's keys:
are SH7's alone (MountGrants::keys, held with delegate.keys):
MountScene::keys, its parse in parse_mount_scene, its term in the null
check and its two asserts in AriadneLoader.AFragmentsSceneIsParsed are
gone, and the docs and comments that listed keys with a mount's scene and
datasets say so.
transfix added a commit that referenced this pull request Dec 1, 2026
…1628)

#1597's recipe / ubuntu-22.04 / Release job (run
46117980396) failed in "Install cvcpkg" when cvcpkg.org answered one
503 to `curl -fsSL https://cvcpkg.org/install.sh | sh`; the site was
back minutes later. .github/actions/cvcpkg-cli already re-runs the
installer up to five times (20/40/60/90 s apart), but 18 steps still
piped install.sh (or install.ps1) straight to a shell.

- ci-recipe.yml: its POSIX and Windows install steps become one
  `uses: ./.github/actions/cvcpkg-cli` with the same 2.5.14 pin. The
  action installs to the same $RUNNER_TEMP/cvcpkg-bin and adds it to
  GITHUB_PATH, as those steps did.
- ci.yml (12 jobs), publish-cvcgl-wasm.yml (3) and
  publish-pycvc-gl-wasm.yml (1): each gets an "Install the cvcpkg CLI"
  step with the old step's `if:`, and the old step loses its curl line
  and its ~/.local/bin PATH lines. These jobs never pinned a version,
  so they pass `version: latest` and keep taking the registry's newest
  (2.5.15+cvc.1 today), not the action's 2.5.14.
- cvcpkg-cli/action.yml: `version: latest` leaves CVCPKG_VERSION empty,
  which both installers read as "newest". The description cites the
  503.

ci.yml stays CRLF.
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