Repository navigation
nav_stats: progress-to-goal base stats (Track 1b) — stall_steps + closest_approach_m - #422
Merged
Merged
Conversation
…sest_approach_m
Add an always-on progress measure to the RF-free cvc::nav base, computed
collector-side from the snapshots + goal the collector already holds:
- veh_nav_stats.closest_approach_m: nearest the vehicle got to its objective.
Seeded to straight_m at begin_episode (finite from t=0 for any collected
episode; 1e30 default only for a hand-built record -> null on emit), then
min of per-step distance-to-goal.
- veh_nav_stats.stall_steps: steps that fail to beat the closest-so-far by
more than nav_stats_params.stall_progress_eps_m (default 0.05 m, strict).
- nav_scorecard.{mean_closest_approach_m (finite runs only), mean_stall_steps}
+ aggregate_nav.
- JSON emit: episode per-vehicle (closest via num_sentinel), scorecard means.
Deliberately NOT read from sim_world::stall_/best_/init_: sim_world's stall_ is
a reset-happy streak counter and best_/init_ are in normalized units, and
neither exists in grl-snam -- reading them would break the C++<->Python
fixture-parity invariant. The collector definition is portable, so the grl_snam
Python twin reproduces it bit-for-bit from the same trajectory (0.05 m is a
shared cross-repo constant). Roadmap Track 1b bullet corrected accordingly.
Additive/off-nothing: the 5 pinned corpus cases stay byte-identical; new
ProgressStallAndClosestApproach case pins the feature (dg 7,7,3,3,0 -> 2 stalls,
closest 0; corpus mean stall 4, mean closest 2). 7/7 nav_stats_test pass.
Contract wording (header comment + eps boundary + scorecard 0-fallback) tightened
per an adversarial review so the Python twin cannot pick the wrong side.
This was referenced Sep 25, 2026
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.
Track 1b of the nav_stats intrinsic-stats build (follows #421). Adds an always-on progress-to-goal measure to the RF-free
cvc::navbase, computed collector-side from the snapshots + goal the collector already holds.What lands
veh_nav_stats.closest_approach_m— nearest the vehicle got to its objective. Seeded tostraight_matbegin_episode(finite from t=0 for any collected episode; the1e30default is only for a hand-built record → serializednull, aggregated out), thenminof per-step distance-to-goal.veh_nav_stats.stall_steps— steps that fail to beat the closest-so-far by more thannav_stats_params.stall_progress_eps_m(default 0.05 m, strict<).nav_scorecard.{mean_closest_approach_m(finite runs only), mean_stall_steps}+aggregate_nav.closest_approach_mvianum_sentinel), scorecard means.Why collector-side, not
sim_worldgettersThe roadmap originally said "fill from
sim_worldgetters." On inspection that's wrong:sim_world::stall_is a reset-happy streak counter (zeroed on escapes/mode-transitions) andbest_/init_are in normalized units — and neither exists in grl-snam. Reading them would break the C++⟷Python fixture-parity invariant. The collector definition is portable, so thegrl_snam.metricstwin reproduces it bit-for-bit (0.05 m is a shared cross-repo constant). The Track 1b roadmap bullet is corrected in this PR.Parity
The 5 pinned corpus cases stay byte-identical (new fields only; no existing accumulator touched; no raw
1e+30emitted). NewProgressStallAndClosestApproachcase pins the feature against hand-computed values:dg = 7,7,3,3,0→ 2 stalls, closest 0; corpus mean stall 4, mean closest 2.Review
Ran a 4-lens adversarial review (parity / numeric-edge / serialization / portability). No functional defect — parity and no-sentinel-leak both hold, arithmetic is correct. It surfaced contract/doc ambiguities that would bite the Python twin (a stale header comment about the sentinel, the exact-eps boundary wording, eps as an undocumented shared constant); all fixed here so the twin cannot pick the wrong side.
Test