Skip to content

nav_stats: base-layer consistency after the cvc::nav landing - #398

Merged
transfix merged 1 commit into
masterfrom
fix/nav-stats-base-consistency
Sep 22, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/nav-stats-base-consistency

Conversation

@transfix

@transfix transfix commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Gap-analysis cleanup over the just-landed base (#394–#397). Pure correctness + doc-accuracy + test coverage in one module; no behavior change to the drive.

Fixes

  • Sentinel leak (major). min_clearance_m and min_sep_m sit at the 1e30 "unmeasured" sentinel until a sampler / second vehicle lowers them; num() only nulls non-finite, so the base JSON record emitted "min_clearance_m":1e+30 — which a trainer reads as enormous clearance, the inverse of "missing". Add a num_sentinel() helper (nulls >=1e29) and apply it to both fields in episode_nav_stats::to_json(). aggregate_nav already guarded min_sep_m; the per-episode record now matches.
  • Unit contract (major — the root of a downstream wiring bug). Document nav_samplers.min_clearance_m as metres and that sim_world::min_clearance() is normalized, so the caller must convert (/cfg.scale) before pointing it here.
  • Stale CUDA comments (minor). drive.h still said the CUDA twin ignores the per-agent columns; nav: per-agent physics on the CUDA drive (device twin of #395) #396 wired rr/body_rr/vmax/a_max/L into the batch CUDA entry points. Correct both blocks (only the persistent sim_world_cuda path still scalars; mass stays CPU/downstream-only by design).
  • Mirror comment (minor). The header claimed field-parity with grl_snam.metrics.NavStats "pinned in cross-language parity tests" — neither accurate (veh_nav_stats is a superset; the field match is grl_snam.scorecard, and parity is held by independent hand-computed corpora, not a gate). Correct it.

Tests (5/5 pass locally)

  • SentinelFieldsSerializeAsNull — the sentinel→null fix (single vehicle, no sampler).
  • BudgetEtaAndFuelBounds — the eta_multiple (divides by speed_ref_mps) and fuel_budget bounds; previously only time_budget_s was exercised.
  • ScriptedTrajectoryAccumulators now calls e.to_json() to pin the base record shape (field names, the two 13-wide material arrays) + goals_reached.

Surfaced by a gap-analysis sweep of the whole nav-stats effort. Follow-ups (separate repos): the downstream extension layer's to_json field-set consistency + design-doc module refs; grl-snam veh_contacts wiring + sentinel alignment; the cross-language shared-fixture parity gate.

Gap-analysis cleanup over the just-landed base (#394-#397). Correctness + doc-accuracy
+ test coverage in one module; no behavior change to the drive.

- Sentinel leak (major): min_clearance_m and min_sep_m sit at the 1e30 "unmeasured"
  sentinel until a sampler / second vehicle lowers them; num() only nulls non-finite, so
  the base JSON record emitted "min_clearance_m":1e+30 — read by a trainer as *enormous*
  clearance, the inverse of "missing". Add a num_sentinel() helper that nulls >=1e29 and
  apply it to both fields in episode_nav_stats::to_json() (aggregate_nav already guarded
  min_sep_m; the per-episode record now matches).
- Unit contract (major, root of the cvcdbg #113 bug): document nav_samplers.min_clearance_m
  as METRES and that sim_world::min_clearance() is NORMALIZED, so the caller must convert
  (/cfg.scale) before pointing it here.
- Stale comments (minor): drive.h still said the CUDA twin ignores the per-agent columns;
  #396 wired rr/body_rr/vmax/a_max/L into the batch CUDA entry points. Correct both blocks
  (only the persistent sim_world_cuda path still scalars; mass stays CPU/downstream-only).
- Mirror comment (minor): the header claimed field-parity with grl_snam.metrics.NavStats
  "pinned in cross-language parity tests" — neither true (veh_nav_stats is a superset; the
  match is grl_snam.scorecard, and parity is held by independent hand-computed corpora, not
  a gate). Correct it.
- Tests: SentinelFieldsSerializeAsNull (the sentinel->null fix); BudgetEtaAndFuelBounds
  (the eta_multiple + fuel_budget bounds, previously only time_budget_s was exercised); and
  ScriptedTrajectoryAccumulators now calls e.to_json() to pin the base record shape +
  goals_reached. 5/5 pass locally.
@transfix
transfix merged commit 84dc864 into master Sep 22, 2026
13 checks passed
@transfix
transfix deleted the fix/nav-stats-base-consistency branch September 22, 2026 10:05
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