Repository navigation
nav: sim_world belief (observed) material (B2) - #744
Merged
Merged
Conversation
belief_material.h holds the pieces that build material planes from what a belief plane has seen (docs/roadmap/NAV-BELIEF-MATERIAL-ROADMAP.md, B1): - belief_material_params: the pinned unseen values (risk 0, hard 0), whether an unseen cell blocks the witness gate (yes), the seen rule and the material range; - belief_material_inputs: the truth rasters where seen, the pins elsewhere; - belief_gate_surface: hard_b | occ | unseen and its metres clearance, the chain set_material uses; - seen_disc: the optional range-disc rule, in numpy linspace arithmetic. material_build and witness_gate run unchanged on their output. sense_batch keeps an optional material-range mask (belief_planes::material_seen / material_changed, sense_agents::material_range_m); left null, every output is byte-identical. pycvc: nav_belief_material_inputs, nav_belief_gate_surface, nav_seen_disc and nav_sense_batch_material, all new symbols. nav_sense_batch now shares its implementation and is unchanged. Tests: nav_belief_material_test (11 cases). NavBeliefMaterial.Golden writes src/cvc/tests/data/belief_material_golden.json: four cases (the defaults, a 7 m material range, the disc, pessimistic pins with unseen cells open to the gate), three sense ticks, two planes, the SHA-256 of every raster and the gate's outputs. GRL-SNAM's numpy references (BeliefGrid.sense, MaterialGrid, MaterialRuntime, witness_gate_batch) reproduce all 432 values bit for bit. test_pycvc_nav_belief reproduces the golden through pycvc.
sim_world::set_material_belief(risk_raw, hard, mc, bp, material_every) builds the material planes from what each belief plane has seen (docs/roadmap/NAV-BELIEF-MATERIAL-ROADMAP.md, B2). The truth is one world plane; one material + gate plane is kept per belief plane: - its seen mask is the sense ray-cast's field of view (sense_batch's material mask; ever_seen at the default range), or the range disc; - its planes are material_build of belief_material_inputs; - its gate surface is belief_gate_surface over the plane's own planning raster (belief_occ(m)), not truth. A plane's planes are re-derived on a sense tick on which its mask grew, its gate surface also when its occupancy changed, at most once every material_every sense ticks, in parallel across planes. The drive and the gate are unchanged. It replaces set_material and is replaced by it; clear_material turns both off. It throws under freeze_sense, for invalid params, for a material range above the sense range, or for material_every < 1. Read surface: material_seen, material_plane_data, material_gate_hard, material_clear_m and material_version; raster_version also bumps when a material mask grows. pycvc: nav_sim_world_set_material_belief and nav_sim_world_material_seen, new symbols; every throwing precondition is checked before the GIL is released. Tests: SimWorldBelief, 8 cases in nav_belief_material_test. With every cell seen it gives set_material's planes, gate surface and clearance byte for byte; an unseen hazard has no barrier; the throws; private planes see only their own agents; re-derivation exactly when a mask grows, at material_every 1 and 3; the shorter range and the disc; set_material and clear_material replace it; runs are deterministic. test_pycvc_nav_belief drives a sim_world through the bindings. The existing nav, material, terrain, stats, route-follower and binding suites pass unchanged.
transfix
changed the base branch from
feat/nav-belief-material-kernels
to
master
October 20, 2026 16:01
…erial-sim # Conflicts: # bindings/pycvc/test_pycvc_nav_belief.py # docs/NAV_MATERIAL.md # docs/roadmap/NAV-BELIEF-MATERIAL-ROADMAP.md # src/cvc/tests/nav_belief_material_test.cpp
…as a macro MSVC sees `far` (minwindef.h) as an empty macro, so the declaration read as `..., = phi[...]` and the Windows lanes failed with a syntax error.
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.
This is B2 of
docs/roadmap/NAV-BELIEF-MATERIAL-ROADMAP.md:sim_worldbuilds its material planes from what each belief plane has seen, using B1's kernels.On top of B1, #742, merged as 8b5c0ca. master is merged in (b4b9bb0), so the diff is B2's change alone. It follows §9's recommended column. It is additive and off by default.
sim_world::set_material_belief(risk_raw, hard, mc, bp, material_every = 1)The truth is one world plane, because material is world state. One material plane and one gate plane are kept per belief plane, and agents index them by
map_id.Each plane's inputs
sense_batch's material mask. At the default range this isever_seen(m). A shortermaterial_range_mkeeps only the cells within it, andseen_rule::discuses the range disc instead.material_buildonbelief_material_inputs.belief_gate_surfaceover the plane's own planning raster (belief_occ(m)), not truth. With the defaultunknown_gate_hard, a ray through unseen ground never certifies a detour.When planes are rebuilt
material_everysense ticks, and planes are rebuilt in parallel.Interaction with the existing calls
set_materialand is replaced by it.clear_material()turns both off.freeze_sense(nothing is ever seen), for invalid params, for a material range above the sense range, and formaterial_every < 1.Read surface
material_seen(m),material_plane_data(m),material_gate_hard(m),material_clear_m(m)andmaterial_version(m).raster_version(m)also bumps when a material mask grows.Memory: about 36 bytes per cell per belief plane, as the header notes.
pycvc (new symbols)
nav_sim_world_set_material_belief: every precondition that throws is checked before the GIL is released.nav_sim_world_material_seenTests
SimWorldBeliefadds 8 cases tonav_belief_material_test:set_material_beliefgivesset_material's planes, gate surface and clearance, byte for byte.material_every1 and 3.set_materialandclear_materialreplace it.test_pycvc_nav_beliefalso drives asim_worldthrough the bindings.These existing suites pass unchanged (counts are passing tests):
nav_testnav_material_testnav_coef_train_testnav_stats_testnav_terrain_testnav_route_follower_testnav_binding_test