Skip to content

nav_stats: drive telemetry base stats (Track 1d) — completes Track 1 - #424

Merged
transfix merged 1 commit into
masterfrom
feat/nav-stats-drive-telemetry
Sep 26, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/nav-stats-drive-telemetry

Conversation

@transfix

@transfix transfix commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Track 1d — the final Track-1 sub-PR (follows #421/#422/#423). Captures the deep drive.cpp telemetry drive_step otherwise discards (mu/mrisk/ext_force/CoefMLP α,β,γ+lam/steer/binding) and reduces it per vehicle. Additive / off-by-default.

Drive kernel (drive.{h,cpp}, material.h)

  • New drive_telemetry struct.
  • rollout_impl gains an optional drive_telemetry* tel. Write-only temporaries capture values the kernel already computes; the terminal if (tel) write runs after o/th/sp/minclr are stored, so a null tel is byte-identical on every path (plain / material / ext). clearance+binding are the per-tick min over substeps (barrier active any substep); steer/mu/mrisk are the last substep.
  • drive_step / _material / _ext gain a trailing tel and route straight to rollout_impl, leaving the public bicycle_rollout* (training) API untouched.

Stats (nav_stats.{h,cpp})

  • Stdlib-only drive_sample POD → nav_stats.h stays free of drive.h; the caller maps drive_telemetry → drive_sample (ext_mag = std::hypot). nav_samplers.drive feed.
  • veh_nav_stats.{drive_steps, alpha/beta/gamma_mean, mu_mean/mu_min, mrisk_mean/max, ext_force_mean, steer_abs_mean/max, binding_steps}; nav_scorecard.{mean_alpha/beta/gamma/mu/mrisk/ext_force}. JSON emit (mu_min via num_sentinel).

Byte-identity (the load-bearing invariant)

Pinned by DriveTelemetry.NullTelIsByteIdenticalAndPopulates (plain) and NullTelByteIdenticalOnMaterialAndExtPaths (material + ext). The existing rollout gradient/parity tests are unmoved (they'd break if telemetry perturbed the rollout numerics). 42 rollout/material/train tests pass.

Review

4-lens adversarial review (byte-identity / correctness / serialization+parity / portability+API): no blockers or majors — byte-identity holds by construction, the reroute is arg-for-arg identical to the old wrappers, reductions verified against hand-computed values. Fixes applied: binding/clearance now use the per-tick minclr (was last-substep — undercounted mid-tick engagement for nsub>1), std::hypot named in the contract, drive_telemetry↔drive_sample lockstep noted, and the byte-identity test extended to the material + ext paths.

Test

9/9 nav_stats_test + 27 nav_material_test pass (5 pinned corpus cases byte-identical)

Completes Track 1 (libcvc cvc::nav base). Next: Track 2 (grl-snam Python parity twin) and Track 3 (downstream extension layer + the state-tree raster bridge).

Capture the deep drive.cpp telemetry drive_step otherwise discards, additive /
off-by-default, and reduce it per vehicle in the collector.

Drive kernel (drive.{h,cpp}, material.h):
  - new drive_telemetry {alpha,beta,gamma,lam_soft, mu,mrisk, ext_fx/fy, steer,
    curvature, clearance, binding}.
  - rollout_impl gains an optional `drive_telemetry* tel`; write-only temporaries
    capture the values it already computes and the terminal `if (tel)` write runs
    AFTER o/th/sp/minclr are stored, so a null tel is byte-identical on every path
    (plain / material / ext). clearance + binding are the per-tick MIN over
    substeps (barrier active any substep); steer/mu/mrisk are the last substep.
  - drive_step / _material / _ext gain a trailing `tel` and route straight to
    rollout_impl, leaving the public bicycle_rollout* (training) API untouched.

Stats (nav_stats.{h,cpp}):
  - stdlib-only drive_sample POD (nav_stats.h stays free of drive.h); caller maps
    drive_telemetry -> drive_sample (ext_mag = std::hypot). nav_samplers.drive feed.
  - veh_nav_stats.{drive_steps, alpha/beta/gamma_mean, mu_mean/mu_min,
    mrisk_mean/max, ext_force_mean, steer_abs_mean/max, binding_steps}; collector
    accumulates in step(), finalizes means in finish().
  - nav_scorecard.{mean_alpha/beta/gamma/mu/mrisk/ext_force} over drive-carrying
    runs. JSON emit for all (mu_min via num_sentinel).

Byte-identity pinned by DriveTelemetry.NullTelIsByteIdentical* on the plain,
material and ext paths (the rollout gradient/parity tests are unmoved too). New
DriveTelemetryReduction case pins the collector math against hand-computed values.
The 5 original corpus cases stay byte-identical. Contract (last-substep vs
per-tick-min, ext-magnitude collapse, drive_sample<->drive_telemetry lockstep,
int64 widths) hardened per an adversarial review. Roadmap: Track 1 complete.

9/9 nav_stats_test + 27 nav_material_test pass.
@transfix
transfix merged commit af66f05 into master Sep 26, 2026
17 of 18 checks passed
@transfix
transfix deleted the feat/nav-stats-drive-telemetry branch September 26, 2026 01:36
transfix added a commit that referenced this pull request Sep 26, 2026
…b-3 PRs open (#427)

Reflect actual state: Track 1 (a-d) MERGED (#421-#424), Track 2 MERGED (GRL-SNAM#96),
Track 3a MERGED (cvcdbg#128/#129), Track 3b-1 MERGED (#425). Track 3b-2 (raster bridge,
#426) + Track 3b-3 (RF publisher + demo3 wiring, cvcdbg#130) PRs open in CI. Document the
3b split (3b-1 base/formation, 3b-2 version-gated volume rasters, 3b-3 RF+demo) and the
Track-4 reserved RF fields (composite_score / cvar_jam_loss / worst_jam_loss).
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