Skip to content

nav: the world-to-navigator glue in C++ (L0, last part: world_grid) - #1120

Merged
transfix merged 1 commit into
masterfrom
feat/world-grids
Nov 10, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/world-grids

Conversation

@transfix

Copy link
Copy Markdown
Owner

L0's last part in ARIADNE_WORLDS.md (section 14): the world-to-navigator glue in C++. Until now only the pycvc_gl.cars template turned a world into what sim_world plans on, in Python. With this, L0 (the local, headless world runtime) is done, and L1's world_source builds on it.

cvc::nav::world_grid (new inc/cvc/nav/world_grid.h). Any world (a generated world, a data bundle's city, a flat square) becomes the navigator's grid:

  • make_grid(world, cell, half) over the terrain, or a square half m either side of its centre; make_grid(world, min_x, min_y, max_x, max_y, cell) over an extent, cut to whole cells. The occupancy is world_planes' (navigate-role meshes, hard ground, deep water), with a wall round the edge so no agent leaves the grid, and the terrain's height.
  • flat_grid(half, cell): an open walled square.
  • signed_distance(g), in metres: positive in the free samples, negative in the blocked ones.
  • free_points(g, sdf, seed, n, clearance, min_sep): drawn with splitmix64, so every platform draws the same points (std::uniform_*_distribution don't; that is what tripped nav: sim_world's agents at run time, a policy each, and identity (L0, third part) #1077's test on macOS).
  • configure(cfg, g, scale) fills a sim_world::config's grid fields.

The runtime. SceneWorld::world_geometry(node, &rev) gives the world a generated or data node makes, with its revision. SceneWorld::grid(node, cell, half) gives that world's grid, made once per world revision, cell and half; a new world (Regenerate, a reloaded dataset) gives a new grid.

pycvc

  • nav_world_grid(world, cell, half=0), nav_world_grid_extent(...) and nav_flat_grid(half, cell) return a world_grid: occupancy(), height() and signed_distance() as numpy arrays, plus free_points(seed, n, clearance, min_sep), occupied(x, y), bounds() and cell().
  • AriApp.grid(node, cell, half=0) gives it for a scene node on the world the headless runtime runs.

pycvc_gl.cars keeps its own Python copy for now: it moves onto the gym in L4, and changing its grid now would change existing runs' starts.

Docs: the roadmap's "World to navigator" row, section 14's list, and the L0 row (done); ARIADNE.md's planning-grid paragraph.

Tests (Windows Release)

  • New nav_world_grid_test, 7 tests:
    • the walled grid, the crop and whole-cell cut, and the flat square;
    • the signed distance's values;
    • free points: clear, apart, the same per seed, and the first one pinned;
    • the config filled;
    • what it refuses.
  • AriadneSceneWorld.AWorldNodesGridFollowsItsWorld: a generated world's grid, cached, cropped, and new after Regenerate.
  • test_pycvc_world_geometry gains test_nav_world_grid, and test_pycvc_ariadne gains AriApp.grid checks.
  • After a full build, 1,265 of 1,266 related ctest tests pass (matching [Aa]riadne|[Nn]av|pycvc_world|pycvc_ari|cvcgl_ariadne|SceneWorld|[Pp]hysics). The one failure, AriadneComponents.ShippedComponentsLoadClean, came from L1 component files that were in the working tree but are not part of this PR.

cvc::nav::world_grid turns any world (a generated world, a data bundle's
city, a flat square) into the grid sim_world plans on: world_planes'
occupancy walled at the edge, the terrain's height, the signed distance,
free points drawn the same way on every platform (splitmix64), and a
sim_world config. SceneWorld::world_geometry / grid give a generated or
data node's world and its grid, made once per world revision; pycvc's
nav_world_grid and AriApp.grid. L0 is done.
@transfix
transfix merged commit 6875607 into master Nov 10, 2026
26 of 30 checks passed
@transfix
transfix deleted the feat/world-grids branch November 10, 2026 07:37
transfix added a commit that referenced this pull request Nov 10, 2026
…ld panels (#1123), ocean shore (#1128)

Also #1124, #1115 and #1120.

Conflicts, both sides kept:
- ariadne.h: post_signal also hands the signal to the event tap, and
  stays a host-thread call outside a pump, as post_input is. The tap is
  set on the drain's thread, which is the host thread.
- ariadne.cpp: deliver_input and post_signal post to the document's
  scheduler (current_sched) when a resident takes the event, and queue it
  for the tap when the tap takes that kind. post_signal keeps its
  assert_outside_pump. The tap's events are handed over in drain_begin,
  after the input residents and before the has? snapshot, so what they
  start runs in the frame's pump.
- ariadne_script_engine_test.cpp: this branch's isolated-document tests
  and master's hook tests, all kept.

A lane's hook residents run on the host thread: a document that uses an
engine stays there (require_host_thread), so the hook queues and the
receiver's start_process need no more.
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