Repository navigation
nav: the world-to-navigator glue in C++ (L0, last part: world_grid) - #1120
Merged
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
L0's last part in ARIADNE_WORLDS.md (section 14): the world-to-navigator glue in C++. Until now only the
pycvc_gl.carstemplate turned a world into whatsim_worldplans on, in Python. With this, L0 (the local, headless world runtime) is done, and L1'sworld_sourcebuilds on it.cvc::nav::world_grid(newinc/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 squarehalfm 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 isworld_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_*_distributiondon'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 asim_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(...)andnav_flat_grid(half, cell)return aworld_grid:occupancy(),height()andsigned_distance()as numpy arrays, plusfree_points(seed, n, clearance, min_sep),occupied(x, y),bounds()andcell().AriApp.grid(node, cell, half=0)gives it for a scene node on the world the headless runtime runs.pycvc_gl.carskeeps 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)
nav_world_grid_test, 7 tests:AriadneSceneWorld.AWorldNodesGridFollowsItsWorld: a generated world's grid, cached, cropped, and new after Regenerate.test_pycvc_world_geometrygainstest_nav_world_grid, andtest_pycvc_ariadnegainsAriApp.gridchecks.[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.