Skip to content

Ariadne: the ports drive in their document's world node, which libcvc's SceneWorld runs - #196

Merged
transfix merged 2 commits into
mainfrom
feat/one-world
Nov 20, 2026
Merged

transfix merged 2 commits into
mainfrom
feat/one-world

Conversation

@transfix

Copy link
Copy Markdown
Contributor

GRL-SNAM's Ariadne ports built a second copy of their world in Python. This PR moves them onto one world description: the document's world node, which libcvc's SceneWorld runs. It is the GRL-SNAM side of libcvc's ARIADNE_WORLDS section 18 ("the holon is the world"), as agreed on dev.tx.wtf (ws:libcvc #86–#98).

What changes

  • The documents declare their worlds. The scrub, live, fleet and replay documents each have scene nodes with world:, and scene: world: { source: data, cell: 2 } picks the one on:
    • data: the city node, source: { data: city } with body: {};
    • generated: the gen node, type: generated_world, with the generator's settings on the node (seed 7, 500 m, ...) and body: {};
    • flat: the Cars template's flat world, a 193.6 m square and four walls with body: static. Its grid is at half a Humvee (nav_grid.flat.cell, 2.42 m) and samples the same as pycvc_gl.cars.flat_world.
    • run.world, run.uri, run.data_path, run.crop and the world.* lines are gone from every init:. The grid's crop is the document's nav_grid.half (600).
    • live and fleet show libcvc's world_source window (Source, the generator's settings and Regenerate, Load another city) in place of the Cars template's cars_world_choice / cars_world.
  • grl_snam/ariadne/_world.py is the one place a port reads its world:
    • --world NAME sets the document's scene.world.source;
    • --uri / --bundle load a city into its data.city, as (data-load "city" ...) does;
    • --set world.seed=4 asks the generated_world node for a new world;
    • world(host) waits for the world on and returns what the port drives on. The navigator's grid comes from pycvc.AriApp.grid(node, cell, half). The terrain's height and the geometry the plant collides with come with it.
  • The hosts (live, fleet, replay, scrub) call it in place of pycvc_gl.cars's make_world, show_world, load_data_world and draw_world.
    • fleet rebuilds its squad when scene.world.rev moves, after the World window changes the source, regenerates or loads a city.
    • Run logs and scrub reports still record the world as run and world_keys, now filled from the document. replay and scrub --view choose it in their document again, and logs from before read the same way.
  • The duplicates:
    • _host.document_city, _host.load_document's bundle swap and its installed-bundle fallback, and _cars.city_of are gone. _world.city replaces them.
    • demos/_common.py's loaders are thin: load_city, then libcvc's rasterizer. The VTK rasterizer fallback is gone. They stay for the hosts with no document: VolRover3 and the recording tools (tools/austin.py).
    • load_city passes the app. On libcvc 4.0, pycvc.load_city_bundle takes it first (libcvc#1119), so the one-argument call open_city and tools/austin.occupancy made failed on the pinned release.
  • The trace recorder and player run on a pycvc.world_clock of their own. A document with a world has libcvc's scene clock drive the app's world clock every frame, and with both on it the replay departed at tick 523 (tests/test_lab_acceptance.py). They watch scene.world.source and nav_grid in place of run, and leave out the generated_world node's own status, stats and job keys.

Measured (libcvc 4.0.0, pages.yml's closure, CPU)

  • SceneWorld's grid is the one the ports had. On the scrub page's generated world (seed 7, 500 m), it is 501 × 501 with 46 802 blocked, 0 cells differing from pycvc_gl.cars's World, with equal heights. On Austin small, cropped to ±600 m, it is 601 × 601 with 106 168 blocked, 0 cells differing.
  • The scrub runs do not move. retrain/seed0 was re-deployed with this branch: 41 checkpoints × 2 plants, 1200 ticks each on the generated world. Each of the 82 run logs is identical, array for array, to scrub: the Humvee by default (no driving through buildings), a Plant combo, and a UI guide #192's cached deploy, with the same start, goal and world info. Every metric agrees at float32, the lean log's precision.
    • The scenario hash still changes (the recorded world_keys now hold every generator key the node seeds), so the Pages build deploys every run again. Its cache key moves with grl_snam/** anyway.
  • Tests:
    • New: tests/test_ariadne_world.py, 18 tests:
      • the documents declare their worlds and none picks one in init:;
      • the grid a port drives on is AriApp.grid's, node for node, by a spy on it;
      • switching worlds is a document change: the document's own source, then scene.world.source, then a generator key; run.world does nothing;
      • the grid a drawn host makes equals SceneWorld's, sample for sample;
      • the city is not fetched while another world is on;
      • Austin's data world;
      • an offscreen host checked against what SceneWorld publishes.
    • Locally, on main after scrub: the Humvee by default (no driving through buildings), a Plant combo, and a UI guide #192: all of tests/test_ariadne_*.py and tests/test_lab_acceptance.py pass with GRL_SNAM_ARIADNE_GL=1, 163 tests.
    • The whole suite, before the rebase: 1270 passed and 18 skipped. The one failure, test_coph_golden's g2s_exp rounding, also fails on the base branch with this machine's mpmath.
    • black 26.5.1 and ruff 0.16 (CI's versions) are clean.
  • The scrub page. A scrub-only page was assembled from this branch with the re-deployed seed0 runs, on ariglx-web 4.0.0. It passes pages/smoke.mjs 4/4 in headless Chrome 152: the page starts, shows a checkpoint of both plants' runs, draws the world they were deployed on, and has no CSP violation. The city the document names is not fetched while the generated world is on.

Behaviour that changes

  • When the document's city cannot load (offline, no cache), the port says why and stops. The installed bundle no longer stands in; --bundle DIR points the document at it.
  • While another world is on, the data store's network stays shut, so the city the document names is not downloaded. The scrub page's deploy on the generated world no longer fetches Austin.

Still beside SceneWorld, and whose it is

  • The plants are the Cars template's (pycvc_gl.cars.Cars: sim_world with plant_host), so _world.world hands them a pycvc_gl.cars.World over SceneWorld's grid and the world's geometry. They move into the document's world in libcvc's OW7 (the OW2 owner's). The same goes for nav_native's obstacle boxes on flat ground and squad.py's own sim_world.
  • A drawn host's grid. Under a window, offscreen or in the page, AriApp.grid returns None on libcvc 4.0 and on master: it reads AppRuntime::scene_world(), which is empty when a renderer runs the world. _world then makes the grid as SceneWorld does (cvc::nav::make_grid), over the same world, and checks it against scene.world.grid.*. Reading running_world() there would remove this. Raised on ws:libcvc.
  • A generated world's geometry, which the plant collides with, is generated again in Python from the node's keys. SceneWorld's world_geometry / generated_world have no Python binding. Raised on ws:libcvc.
  • The crop (nav_grid.half) cuts the grid only, while the bodies and the drawing are the whole city. It becomes the data node's region in libcvc's world bundles (GB2, docs(ARIADNE_WORLDS): a generated world is a bundle (section 18.8, Q17) transfix/libcvc#1380). The water collider's level arrives there too.
  • coph-cars (ariadne: coph-cars, CoPH driving the cars template (T4, demo 2b, exploratory) #193) drives the Cars template's own runner and flat world (pycvc_gl.cars.run, flat_world), none of the helpers this PR changes, so it stays as it is until OW7.
  • Nav materials and the flat walls as colliders are the OW2 owner's (OW7). The plants still see surfaces only as blocked or free, and the walls are bodies in SceneWorld but not in the plants' physics.

The Pages build pins libcvc 4.0.0 and has every binding used here. Merge waits on Joe's OK.

…'s SceneWorld runs

The scrub, live, fleet and replay documents declare their worlds as scene nodes with `world:`
(data: the city its data: block names; generated: libcvc's generator, its settings on the node;
flat: the Cars template's walled square) and `scene: world: { source }` picks the one on. Their
init: no longer sets run.* or world.*.

grl_snam/ariadne/_world.py is the one place a port reads its world: --world is the document's
scene.world.source, --uri / --bundle a data-load into its data.city, a world.* key a new
generated world; the navigator's grid is SceneWorld's (pycvc.AriApp.grid), and a drawn host,
where AriApp.grid finds no world on libcvc 4.0, makes it as SceneWorld does and checks it against
scene.world.grid.*. The plants stay the Cars template's until libcvc's OW7, on a
pycvc_gl.cars.World over that grid and the world's geometry.

The hosts drop pycvc_gl.cars's make_world / show_world / load_data_world / draw_world;
_host.document_city, its installed-bundle fallback and _cars.city_of go; demos/_common's loaders
are thin (and pass the app libcvc 4.0's load_city_bundle takes). live's traces run on a world
clock of their own, since a document with a world has its scene drive the app's.

Grids are identical to cars.py's on the scrub world and Austin; retrain/seed0 re-deployed on both
plants gives identical run logs. New: tests/test_ariadne_world.py.
… the one asked for (a page runs no frame before the port's program returns)
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