Skip to content

Belief-material controller, its .cvcnm contract and Austin evaluation tooling - #141

Merged
transfix merged 12 commits into
mainfrom
feat/belief-material-controller
Nov 8, 2026
Merged

transfix merged 12 commits into
mainfrom
feat/belief-material-controller

Conversation

@samp830

@samp830 samp830 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A public, range-limited belief-material controller for GRL-SNAM. Samyak wrote it as the follow-up to the CVC-DBG/grl-snam-dbg#106 review, and Joe finished it for merge.

It is built on the existing material stack rather than parallel copies:

  • BeliefGrid material tracking
  • the belief MaterialRuntime
  • material_patch_belief
  • CoefEnergyNetMaterial(risk_channels=3) and .cvcnm v2
  • the single witness gate
  • integrate_surrogate_material
  • the shared palette

What it adds

  • BeliefMaterialSensor: ray-cast sensing into a BeliefGrid, keeping a belief MaterialRuntime current.
  • BeliefMaterialController: builds the model's inputs from observed geometry and the belief patch, gates lam_soft, and runs rollouts and live kwargs through the shared integrator.
  • Training batches: belief_material_training.build_belief_material_training_batch builds batches for both MaterialTrainer front ends.
  • Waypoint scorer: material-aware local waypoints (material_waypoint), whose rays use MaterialRuntime.ray_profile.
  • Routes: generic route manifests with split validation (material_routes).
  • Evaluation: four-arm evaluation (fixed_lambda, force_only, waypoint, learned) with paired route statistics and route-cluster bootstrap CIs (material_evaluation).
  • Austin entry points: grl-snam austin-material-routes, austin-material-train and austin-material-evaluate.
  • Pinned corpus: the Austin route manifest at experiments/austin_material/routes.json.
  • Bug fix: material_nav.load_geometry_weights now maps a legacy CoefEnergyNet obs_enc.mlp.* checkpoint onto the material net. Before, warm starts left the obstacle encoder random without warning.

Changes made while finishing the review

  • The feature frame is recorded in the checkpoint.
    • The controller feeds robot-relative obstacle and goal tokens divided by 20 m. train_coef_energy and eval_coef_energy feed absolute metres instead.
    • A BeliefMaterialContract now goes into the .cvcnm meta. It records the frame, the scale, the hazard barrier's k_sharp / d_hat_sdf_m, the gate trigger and the geometry d_hat.
    • from_cvcnm refuses a file without a contract, and decide, rollout and live_material_kwargs refuse a runtime built with other constants.
    • No libcvc change is needed: libcvc reads the token layout but builds no features of its own, and keeps meta as an opaque string.
  • Training targets:
    • Each sample now starts from the teacher's arrival velocity. Previously it started at the velocity that reaches the target, so a force-free coast hit the target exactly and the loss penalised every force.
    • The shared λ regulariser is off by default, because it pulls toward λ_max / 2.
    • training.json reports the trained λ heads' spread next to the fixed values.
  • The Austin bundle is checked, not just named. Every mask read must match the pinned cy-pca/scene-austin-south 1.0.0+cvc.3 file hashes. The hashes are recorded in the manifest and in the training and evaluation reports.
  • Route corridors are separated.
    • Routes in different splits keep their whole direct segments at least 60 m (the sensor range) apart. The generator and the validator both enforce this.
    • The corpus was regenerated, with ids from 500 so they don't reuse fix(coef_train): align native-surrogate default lr to the M10 corrected barrier #106's 400s.
    • The committed generator reproduces it byte for byte from the pinned bundle; the previous manifest also reproduced exactly.
  • Waypoints:
    • ray_profile uses the witness gate's own ray walk, which also handles anisotropic rasters.
    • The scorer no longer steps past a goal closer than one usable ray.
  • Tests and docs:
    • New tests for routes, waypoints and ray walks, and an end-to-end routes → train → .cvcnm → four-arm evaluation smoke test (about 8 s).
    • A docs section in docs/MATERIAL_NAV.md.

Validation status: no performance claim

The results table in the first version of this description has been removed. It could not be reproduced:

  • Its route seed (20261029) is in no committed file.
  • Its λ = 0 baseline is not one of the evaluator's arms.
  • The fixed-λ, force-only and waypoint arms and the CIs were not reported.

A smoke run on the pinned Austin bundle shows why the λ heads have nothing to learn yet. It used a random geometry backbone, so it checks plumbing only. With the current defaults on Austin's 15 m grid:

  • the soft gate never fired (gate_active_fraction 0.0, since the 0.30 trigger equals foliage risk);
  • the hazard barrier's 3 m reach is a fifth of a cell;
  • after 40 updates the learned λ equalled the fixed values exactly.

Reporting a result needs three things:

  1. a published, pinned Stage-1 geometry checkpoint;
  2. barrier and gate constants tuned on validation;
  3. the full four-arm evaluation over at least 3 seeds.

The training stage runs on the torch path only for now, because the native MaterialTrainer has no way to freeze the geometry backbone. Those are follow-ups. This PR lands the controller, the contract and the evaluation machinery.

samp830 and others added 12 commits October 27, 2026 20:13
…he .cvcnm

The controller feeds robot-relative tokens divided by 20 m, unlike train_coef_energy's
absolute metres, and nothing in the file said so. A BeliefMaterialContract (frame, scale,
barrier and gate constants, geometry d_hat) now goes into the .cvcnm meta; from_cvcnm
refuses a file without one, and decide/rollout/live_material_kwargs refuse a runtime built
with other constants. load_cvcnm/save_cvcnm carry meta through, and CoefEnergyNetMaterial
stores its patch_size.
…t was trained

Each sample started at the velocity that reaches its target, so a force-free coast hit it
and the trajectory loss penalized every force. Start from the teacher's arrival velocity
instead. Turn the shared lambda regularizer off by default (it pulls toward lambda_max/2),
take the barrier and gate constants from the contract in both training and evaluation,
and report the trained lambdas' spread. Adds an end-to-end routes -> train -> evaluate test.
The archive hash can't be checked after install, so check the sha256 of every mask the
material experiments read and refuse a mismatch; record the hashes in route manifests,
training and evaluation reports.
…rpus

Endpoint separation let test routes cross training corridors. Routes in different splits
now keep their whole direct segments at least the sensor range (60 m) apart, enforced by
the generator and the validator. Route ids start at 500 so they don't reuse #106's 400s.
routes.json is regenerated from the pinned bundle and reproduces byte for byte.
…the goal

ray_profile reuses the witness gate's ray walk (one cell per step, the same rounding and
bounds rule, anisotropic rasters handled) with an explicit clearance, default 0. The scorer
returns the goal when it is closer than a usable ray instead of stepping past it, and its
fallback reports when material closed every ray.
@transfix transfix changed the title Feat/belief material controller Belief-material controller, its .cvcnm contract and Austin evaluation tooling Nov 7, 2026
@transfix
transfix merged commit 31410d8 into main Nov 8, 2026
5 checks passed
@transfix transfix mentioned this pull request Nov 8, 2026
transfix added a commit that referenced this pull request Nov 8, 2026
Two PRs since v0.3.0:

- The material trainers default to semi-implicit Euler, as libcvc #981
  (#160). MaterialTrainer, MaterialTrainerTorch and the torch
  geom_rollout_min_clear take semi_implicit=True by default;
  semi_implicit=False keeps explicit Euler. A pycvc older than libcvc #596
  refuses the new default and says to pass semi_implicit=False.
- The belief-material controller, its .cvcnm contract and the Austin
  evaluation tooling (#141): BeliefMaterialSensor and
  BeliefMaterialController, training batches for both MaterialTrainer front
  ends, the material waypoint scorer, route manifests and four-arm
  evaluation, and `grl-snam austin-material-routes`, `austin-material-train`
  and `austin-material-evaluate`. It also fixes material_nav's warm start
  from a legacy CoefEnergyNet checkpoint, which left the obstacle encoder
  random.

No packaging changes: the three cvcpkg columns move to upstream_version
0.3.1 and its dist-info path, and cvc_revision stays 1 for the new upstream
version.
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.

2 participants