Skip to content

belief-material: the contract takes only JSON numbers, and visible obstacles sort stably - #163

Merged
transfix merged 1 commit into
mainfrom
fix/belief-material-stable-strict
Nov 9, 2026
Merged

transfix merged 1 commit into
mainfrom
fix/belief-material-stable-strict

Conversation

@transfix

@transfix transfix commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

These are the two Python-side changes for libcvc's twin of the belief-material controller. The C++ spec is transfix/libcvc#1053 (docs/roadmap/NAV-BELIEF-MATERIAL-CONTROLLER-ROADMAP.md), and Joe settled its decisions E1–E10 on the first-column picks. C1, the contract and inputs, depends on both.

  • E6, the contract's value types. BeliefMaterialContract now accepts only a string feature_frame and real numbers. Until now "5", true and null were stored as given and validated through float(); they are now refused. Integers are stored as floats, so to_meta writes 20.0 for a file that said 20, as libcvc's to_meta will (byte-compared by the golden).
  • E5, the obstacle tie order. scan_visible_geometry sorts by distance with kind="stable", so equal distances keep argwhere's row-major order. Equal distances are common on a grid, and numpy's default sort is unstable on arrays of more than 16 entries. On the new test's 9 × 9 scene it picks (5, 5) at the cutoff where the stable order picks (3, 5). libcvc's visible_obstacles uses the same order.

No committed result changes. There is no trained Austin checkpoint yet, and the route corpus does not depend on the obstacle order.

Tests:

  • test_contract_takes_only_json_numbers_and_a_string_frame (5 cases);
  • test_contract_stores_integers_as_floats;
  • test_visible_geometry_breaks_distance_ties_in_row_major_order.

Locally on Windows, with the cvcpkg cp312 prefix (torch 2.8 CPU):

  • tests/test_belief_material_controller.py, test_austin_material_evaluation.py and test_austin_material_training.py: 40 passed;
  • black --check and ruff check: clean.

docs/MATERIAL_NAV.md documents both rules.

The golden generator for libcvc's C1 (T-a in the spec) builds on this branch and follows as its own PR.

…stacles sort stably

libcvc is twinning the belief-material controller (transfix/libcvc#1053, its
NAV-BELIEF-MATERIAL-CONTROLLER-ROADMAP.md). Joe settled its two Python-side
decisions:

- E6: BeliefMaterialContract accepts only a string frame and real numbers.
  "5", true and null were stored as given; they are now refused. Integers are
  stored as floats, so to_meta writes 20.0 for a file that said 20, as the
  C++ to_meta does.
- E5: scan_visible_geometry sorts by distance with kind="stable". Equal
  distances keep argwhere's row-major order, so the max_obstacles cutoff picks
  the same set on both sides. numpy's default sort is unstable on arrays of
  more than 16 entries. On the new test's 9 x 9 ring it picks a different
  cell at the cutoff.

No committed result changes. There is no trained Austin checkpoint, and the
route corpus does not depend on the obstacle order.
@transfix
transfix merged commit 96fcbeb into main Nov 9, 2026
4 of 7 checks passed
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