Skip to content

Ariadne: the fog-of-war ghost as a document (nav_fog_ghost.ari), on a nav_swarm arena with a stale map - #1589

Merged
transfix merged 4 commits into
masterfrom
feat/ariadne-nav-fog-ghost
Nov 28, 2026
Merged

transfix merged 4 commits into
masterfrom
feat/ariadne-nav-fog-ghost

Conversation

@transfix

@transfix transfix commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

The fog-of-war "ghost" story is now an Ariadne document that arigl runs, on a 2-D map by default. It replaces the C++ nav_fog_ghost, which #1568 retires. It is in the browser gallery as nav_fog_ghost_ari, and the old nav_fog_ghost address opens it.

The document

examples/ariadne/documents/nav_fog_ghost.ari:

  • One vehicle crosses a 200 m open field with a stale map. The map shows a 100 m wall across its path that the field doesn't have.
  • Its A* route over its belief bends round the wall's south end. As it nears, its 35 m sensor wears that end away. The route is planned again through the gap, and the vehicle drives straight through where the wall stood.
  • The wall's north end never comes within the sensor's range, so it stays standing.

What's drawn:

  • The ground shows what the vehicle knows: never seen is near black, remembered is dim, in view now is lit.
  • Its belief is an LED grid: a red light where the field has a wall, an amber light for a ghost.
  • The phantom stands as a see-through amber wall that wears away cell by cell.
  • The blue plan runs to the carrot and on to the waypoint, with the cyan route ahead and the yellow track behind.
  • Also: the sensor ring, the start pad and the GOAL.
  • A four-beat caption runs at 0.5x story pace:
    • "MAP: wall ahead. TRUTH: open field."
    • "Belief is all it has, so it detours."
    • "SENSOR: nothing there. Replanned."
    • "Straight to the goal, through a wall that was never there."

Controls:

  • --view 3d (or M) shows a perspective orbit.
  • Scenario, or --scenario dynamic: an honest map and a second vehicle crossing the path.
  • The panel has world speed, sensor range and plant, with Apply / Restart.

Vehicles are drawn by the swarm's agents layer (look: humvee), which since #1569 resolves the Humvee through Ariadne's shared vehicle look; it draws arrows where no Humvee model is installed. The document loads no model itself. This branch is rebased on #1569 and doesn't touch the agents layer.

Library pieces

All in the nav_swarm node: scene_swarm.h, swarm_nodes.h, docs/ARIADNE.md §5.4 "Swarms".

New props:

  • arena:: an open field in metres with walls:, and phantoms: that are only in the map the vehicles set out with (swarm_city::prior, arena_swarm_city).
  • vehicles:: listed starts and goals, each vehicle its own target.
  • route: belief: an 8-connected A* route over each belief plane, planned again on the worker whenever a belief flip changes some plane's map.
  • range (sensor range) and sense_ticks (navigator steps between senses; default 4, so existing documents are unchanged).

New keys:

  • phantoms and range: what the next build makes.
  • Stats time, range, ghosts, ghosts0 and replans.

New API:

  • SceneSwarm::belief(), ghosts(), routes() and route_cursor().
  • The frame's carrots: sim_thread::snapshot now carries carrot.

New and changed swarm_layers:

  • New: ghosts, plan, route and sensor.
  • city takes belief: true (the LED grid) and draws an arena's walls.
  • path takes up to 1024 segments and every:.

Fixes found on the way

  • The swarm's city ground never repainted. setTexture keeps a copy-on-write share of the image, so the layer's later fog.data() painted a private copy the texture never saw. The synthetic city's fog in nav_city_swarm.ari was frozen at its first paint too. The layer now paints through the pixels it took before setTexture, as the C++ demo did.
  • Trails were dotted when the world ran slower than the view. Trails now sample on navigator frames, not view frames. A jump is now three vehicle lengths (at least 3 m) rather than a fixed 3 m.
  • The ground quad now spans the cells' full extent, so each texel column lies under its cell.

Tests

  • ariadne_scene_swarm_test, 12 tests, passing five runs in a row:
    • the arena's raster;
    • the props;
    • listed vehicles and the phantoms key;
    • the whole ghost story, on the worker and on the frame's thread: the route bows about 55 m round the phantom, the sensor wears at least a quarter of it away, the route straightens, the vehicle arrives, and the far end still stands.
  • cvcgl_ariadne_swarm, 42 checks, including a new ghost section:
    • the new layers' meshes;
    • the ghost wall wearing away;
    • the ground texture's texels read back through VTK: in view lit, and the cleared lights out (240 → 164 amber texels).
  • ariadne_loader_test ShippedExamplesDeclareWhatTheyNeed loads the new document.

Screenshots of the map mid-story are in the session's notes (the ghost wearing away, the plan against the track). The new gallery thumbnail is examples/web/gallery-assets/img/nav_fog_ghost_ari.jpg.

arigl-web

This PR's paths don't trigger CI's arigl-web job, so I checked it locally. I built single-threaded arigl-web from this branch, against the recipe's wasm deps (as build-wasm.sh with no examples). I served it with the document and opened index.html?src=nav_fog_ghost.ari in Chromium.

  • It loads and runs with no warnings.
  • The story plays through: at 5.08 s of world time the phantom is down to 31 cells and the plan runs straight, with "SENSOR: nothing there. Replanned."; by 9.6 s the track reaches the GOAL.
  • Apply / Restart rebuilds it in place.
  • No Humvee model is installed in the browser, so the vehicle draws as the agents layer's arrow. The C++ demo drew a glyph there too.
  • A follow-up: the agents layer could take a data: look (cvcpkg://cy-pca/vehicle-humvee), as the world's vehicles do.

Rebase

#1568 rewrites examples/nav/NAV_DEMOS.md and removes the old nav_fog_ghost entry from demos.json. I'll rebase once it lands: the fog-ghost row becomes one row in its new "rendered demos" table, and the redirect stays.

… nav_swarm arena with a stale map

The C++ nav_fog_ghost (retired by #1568) as an Ariadne document that arigl runs, on a 2-D map by
default. One vehicle crosses a 200 m open field with a stale map that shows a wall across its
path; its A* route over its belief bends round the wall's end, its sensor wears the phantom away,
the route is planned again and it drives straight through where the wall stood. The ground shows
what it knows, with an LED per believed wall (red real, amber ghost); the phantom stands as a
see-through amber wall that wears away; the blue plan to the carrot against the yellow track, the
cyan route ahead, the sensor ring, the start and the GOAL; a four-beat caption at 0.5x. Scenario
dynamic: an honest map and a second vehicle crossing the path. In the gallery as
nav_fog_ghost_ari, and the old nav_fog_ghost address opens it.

The library pieces, in the nav_swarm node (scene_swarm.h, swarm_nodes.h, ARIADNE.md §5.4):
- arena: an open field in metres, walls:, and phantoms: in the vehicles' starting map only
  (swarm_city::prior, arena_swarm_city), with the phantoms key choosing it at each build;
- vehicles: listed starts and goals, each its own target;
- route: belief: an 8-connected A* route over each plane's belief, planned again on the worker
  whenever a belief flip changes some plane's map;
- range and sense_ticks (the range key too); stats time, range, ghosts, ghosts0 and replans;
  SceneSwarm::belief(), ghosts(), routes(); the frame's carrots (sim_thread::snapshot::carrot);
- the ghosts, plan, route and sensor layers; the city layer's belief: true (the LED grid) and an
  arena's walls; path up to 1024 segments; the city ground under the cells' full extent.

Tests: ariadne_scene_swarm_test (the arena's raster, the props, listed vehicles and the phantoms
key, and the whole ghost story on the worker and on the frame's thread) and cvcgl_ariadne_swarm (a
ghost section: the new layers' meshes, and the ghost wall wearing away).
…ls sample on the navigator's frames, sense_ticks

- city layer: the fog and the lights are painted through the pixels taken before setTexture
  shares the image. The image is copy-on-write, so fog.data() after it painted a private copy
  the texture never saw, and the ground stayed as it was built (the synthetic city's fog too).
  cvcgl_ariadne_swarm reads the texture's texels back: in view lit, the cleared lights out.
- trails and path sample every `every` navigator frames, not view frames, and a jump is three
  vehicle lengths (at least 3 m): at the story's half speed the track was dots.
- nav_swarm's sense_ticks: the navigator steps between senses (4); the ghost senses every 2, as
  the C++ demo did.
- The caption's discovery beat fires once a quarter of the phantom is sensed away: the far end
  never comes within the sensor's range. stats.time to the hundredth; "1 vehicle".
- The gallery thumbnail, and the old nav_fog_ghost address as a redirect to the document.
@transfix
transfix force-pushed the feat/ariadne-nav-fog-ghost branch from 7f8f7dc to 3c4f358 Compare November 27, 2026 08:37
transfix added a commit that referenced this pull request Nov 27, 2026
…, nav_fog_ghost, nav_finale) (#1568)

The rendered cvc::nav demos are Ariadne documents and hosts now: nav_city_swarm.ari and
nav_city_drive.ari (the swarm and the drive as documents, faster than the programs were),
nav_scrub, nav_convoy, world_lab.ari, and the fleet swarm (#1547) in the gallery. The four C++
programs that drew the swarm through cvcGL by hand go, with their nav_common and its test. Each
loaded and fitted its vehicle model its own way (nav_common's load_vehicle_template), so none of
them could draw the Humvee in parts (vehicle-humvee 1.0.0+cvc.5) with turning wheels; Ariadne's
one vehicle look can.

- examples/CMakeLists.txt: the four targets, nav_demo_common and nav_common_test gone. The wasm
  gallery builds nav_scrub as its only nav program; its bundle preload (the Austin scene and the
  shared Humvee) stays, and the trained-weights preload (CVC_WASM_NAV_WEIGHTS), which only the
  swarm and the drive read, goes.
- The gallery (demos.json) and its thumbnails lose the three pages. deploy-pages,
  publish-cvcgl-wasm and publish-cvcpkg stop building, installing or expecting them; the
  gallery's WebGL-shim check reads nav_scrub.js in place of nav_city_drive.js; grl-snam-weights is
  no longer installed for the browser build (the documents fetch the policy themselves).
- libcvc-examples ships the cvcGL scene demos, the three headless nav CLIs (nav_swarm_demo,
  nav_train_demo, nav_material_demo, which load no models and stay) and the documents;
  libcvc-examples-web drops grl-snam-weights.
- NAV_DEMOS.md describes the documents and the CLIs; the docs and comments that pointed at the
  programs say they are retired.


The documents' headers and vehicle_view.cpp's fitted_model comment no longer name the deleted programs or nav_common's load_vehicle_template. After #1547, the old nav_city_swarm and nav_city_drive gallery addresses redirect to the fleet swarm (nav_fleet_swarm_ari), and NAV_DEMOS.md lists it; the old nav_fog_ghost address is left to the Ariadne fog ghost (#1589).
…' retirement (#1568)

demos.json: master's order and redirects (nav_city_swarm and nav_city_drive open the fleet swarm),
with the fog ghost's card after nav_scrub and the old nav_fog_ghost address redirecting to its
document. NAV_DEMOS.md: master's page, with a row for nav_fog_ghost.ari.
@transfix
transfix enabled auto-merge (squash) November 28, 2026 00:42
@transfix
transfix merged commit 3a6f9dc into master Nov 28, 2026
30 checks passed
@transfix
transfix deleted the feat/ariadne-nav-fog-ghost branch November 28, 2026 15:36
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