Skip to content

scorecard: mirror the cvc::nav Track-1 base fields (Python parity, Track 2) - #96

Merged
transfix merged 1 commit into
mainfrom
feat/nav-stats-python-parity
Sep 26, 2026
Merged

transfix merged 1 commit into
mainfrom
feat/nav-stats-python-parity

Conversation

@transfix

Copy link
Copy Markdown
Contributor

Track 2 of the nav-stats cross-repo build — the Python twin of the merged C++ cvc::nav base (transfix/libcvc #421–#424). Brings grl_snam.scorecard field-for-field and value-for-value in step, so a grl-snam eval and a cvcdbg dbg_arrival_check3 --episodes run report identical base scorecard numbers.

What lands (grl_snam/scorecard.py)

  • NavCoverage dataclass (twin of nav_coverage) + compute_coverage reducer — plane-major indexing, a single broadcast truth plane, believed_free/phantom over the binary to_occupancy output (same p_thresh 0.5 / band 0.15 / optimistic contract).
  • VehStats += convoy_id, formation_parent, slot_error_mean_m, formation_arrived, stall_steps, closest_approach_m, sense_flips, drive_steps, {alpha,beta,gamma,mu,mrisk,ext_force}_mean.
  • EpisodeStats.coverage; NavScorecard += the Track-1 scorecard fields (formation rates, progress means, mean_coverage, mean_sense_flips, drive means) + to_dict.
  • aggregate_nav reduction mirrors the C++ exactly: formation-mission convoy keying, coverage over all episodes, sense_flips/stall over all runs, closest over finite runs, drive means over drive_steps>0 runs.

Parity

test_scorecard.py += 7 cases pinned to the same hand-computed values as the C++ nav_stats_test feature-ON cases (formation 0.5/0.5/10.75; progress 4/2; coverage 0.625/0.25/0.625/0.25 → means 0.5; sense_flips 5; drive α2/β4/γ2/μ0.5/mrisk0.5/ext2). 11/11 pass, ruff clean.

An adversarial 3-lens cross-language review (aggregate / compute_coverage / corpus) confirmed 0-ULP parity — identical accumulators, divisors, and branches. The only constructible divergence needs an invalid convoy_id < 0 (unreachable from the collector; Python's dict is more robust than the C++ vector index) — now documented as a >= 0 contract. Stale cvc::dbg doc references corrected to cvc::nav.

The collector-layer twin (from_nav_stats seeding the new per-step fields + a formation_slot sampler hook) follows with the drive/training integration, mirroring the deferred C++ sim_world wiring.

…ack 2)

Bring the Python base scorecard field-for-field in step with the merged C++
cvc::nav base (transfix/libcvc #421-#424), so a grl-snam eval and a cvcdbg
dbg_arrival_check3 --episodes run report identical base numbers.

  - NavCoverage dataclass (twin of nav_coverage) + compute_coverage reducer
    (plane-major idx, broadcast single truth plane, believed_free/phantom over the
    binary to_occupancy output — same p_thresh 0.5 / band 0.15 / optimistic).
  - VehStats += convoy_id, formation_parent, slot_error_mean_m, formation_arrived,
    stall_steps, closest_approach_m (1e30 sentinel), sense_flips, drive_steps,
    {alpha,beta,gamma,mu,mrisk,ext_force}_mean.
  - EpisodeStats.coverage; NavScorecard += the Track-1 scorecard fields (formation
    rates, progress means, mean_coverage, mean_sense_flips, drive means) + to_dict.
  - aggregate_nav mirrors the C++ reduction exactly: formation-mission convoy
    keying, coverage over ALL episodes, sense_flips/stall over ALL runs, closest
    over finite runs, drive means over drive_steps>0 runs (0-ULP, verified).
  - test_scorecard.py += 7 cases pinned to the SAME hand-computed values as the C++
    nav_stats_test feature-ON cases (formation 0.5/0.5/10.75; progress 4/2; coverage
    0.625/0.25/0.625/0.25 -> means 0.5; sense_flips 5; drive a2/b4/g2/mu.5/mr.5/ext2).

Cross-language parity confirmed by an adversarial 3-lens review (aggregate /
compute_coverage / corpus): identical accumulators, divisors and branches; the only
constructible divergence needs an invalid convoy_id<0 (unreachable from the
collector) — documented as a >=0 contract. Stale cvc::dbg doc references corrected
to cvc::nav. 11/11 test_scorecard pass.

The collector-layer twin (from_nav_stats seeding the new per-step fields + a
formation_slot sampler hook) follows with the drive/training integration, mirroring
the deferred C++ sim_world wiring.
@transfix
transfix merged commit b6ddf4b into main Sep 26, 2026
3 checks passed
@transfix
transfix deleted the feat/nav-stats-python-parity branch September 26, 2026 01:24
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