Skip to content

nav: belief (observed) material kernels and golden (B1) - #742

Merged
transfix merged 1 commit into
masterfrom
feat/nav-belief-material-kernels
Oct 20, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/nav-belief-material-kernels

Conversation

@transfix

Copy link
Copy Markdown
Owner

This is B1 of docs/roadmap/NAV-BELIEF-MATERIAL-ROADMAP.md: the kernels that build material planes from what a belief plane has seen, plus the golden that GRL-SNAM's numpy twin is held to. It follows §9's recommended column. It is additive and off by default.

inc/cvc/nav/belief_material.h

  • belief_material_params: the pinned unseen values (unknown_risk 0, unknown_hard 0), unknown_gate_hard (on), the seen rule (ray-cast by default, or a range disc) and an optional shorter material range.
  • belief_material_inputs: the truth rasters where seen, the pinned values elsewhere. material_build runs unchanged on the result.
  • belief_gate_surface: hard_b | occ | (unknown_gate_hard & !seen), plus its metres clearance through the same chain set_material and MaterialRuntime use. witness_gate runs unchanged on it.
  • seen_disc: the optional disc rule, with the arithmetic of a np.linspace scan.
  • belief_material.cpp is built with -ffp-contract=off, like material.cpp.

sense_batch (grid_nav.h)

  • Optional belief_planes::material_seen / material_changed and sense_agents::material_range_m.
  • The material mask covers the touched cells within the material range, measured from the agent's cell. At the sense range it grows exactly as ever_seen does.
  • Left null, every output is byte-identical, and the existing nav_test suite passes unchanged (61/61).

pycvc (new symbols only)

  • nav_belief_material_inputs
  • nav_belief_gate_surface
  • nav_seen_disc
  • nav_sense_batch_material: the sense plus the material mask. nav_sense_batch now shares its implementation and keeps its signature and behaviour.

Tests

nav_belief_material_test has 11 cases:

  • the select, the gate surface (the OR and the clearance), and the disc against a full linspace scan;
  • a null mask changing nothing;
  • the mask at the sense range equal to ever_seen;
  • a shorter range equal to a cast at that range;
  • material_changed per plane;
  • occlusion hiding material behind a building;
  • every cell seen giving back the truth planes;
  • NavBeliefMaterial.Golden.

Golden 1 is src/cvc/tests/data/belief_material_golden.json (110 KB). It runs four cases over three sense ticks and two planes:

  • the defaults;
  • a 7 m material range;
  • the disc;
  • pessimistic pins with unseen cells open to the gate.

For each case, tick and plane it records the SHA-256 of 12 rasters (the material mask, the planning occupancy, risk_b, hard_b, the 6 material planes, the gate surface and its clearance) and the gate's outputs. The inputs are in the file, and so are the full arrays of one plane. CVC_BELIEF_MATERIAL_GOLDEN_WRITE=1 rewrites it.

Measured:

  • GRL-SNAM main's numpy references reproduce all 432 values bit for bit, on its pure-Python path (no pycvc): BeliefGrid.sense, to_occupancy, MaterialGrid, MaterialRuntime and witness_gate_batch.
  • test_pycvc_nav_belief reproduces the golden through the pycvc bindings.
  • nav_material_test passes (29/29).

Next is B2: sim_world::set_material_belief, which uses these kernels.

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.
@transfix
transfix merged commit 8b5c0ca into master Oct 20, 2026
24 checks passed
transfix added a commit that referenced this pull request Oct 20, 2026
# Conflicts:
#	docs/NAV_MATERIAL.md
transfix added a commit that referenced this pull request Oct 21, 2026
…emented (#755)

The status line of docs/roadmap/NAV-BELIEF-MATERIAL-ROADMAP.md still said B3 follows. B1 (#742), B2 (#744) and B3 (#746) have all merged, built with section 9's recommended column.
@transfix
transfix deleted the feat/nav-belief-material-kernels branch October 29, 2026 20:52
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