Repository navigation
nav_stats: belief-coverage + sense-flips base stats (Track 1c) - #423
Merged
Merged
Conversation
Add the epistemic counterpart to the motion stats, additive / off-by-default:
- nav_coverage {explored_frac, visible_frac, believed_free_frac, phantom_frac}
+ episode_nav_stats.coverage; nav_scorecard.mean_coverage.
- compute_coverage(truth, belief, everseen, lastvis, planes, cells): a PURE
reducer over the belief rasters (plane-major; truth is one shared plane
broadcast per cell). explored=ever seen, visible=in view, believed_free=
belief FREE, phantom=believed OCCUPIED where truth is FREE. Null/empty ->
all zero. Kept out of the collector so it stays raster-free.
- veh_nav_stats.sense_flips (int64) + nav_samplers.sense_flips feed; collector
sums the per-step per-agent delta. nav_scorecard.mean_sense_flips.
- JSON: episode nested "coverage" + per-veh "sense_flips"; scorecard nested
"mean_coverage" + "mean_sense_flips".
Both coverage (over the binary to_occupancy output) and sense_flips (the
sense_batch flips[] count) are bit-identical to the grl-snam twin given matching
inputs. The header pins the shared contract so Track 2 can mirror it exactly:
the to_occupancy binarization literals (p_thresh 0.5 / band 0.15 / optimistic),
the plane-major + broadcast-truth flattening, the int64 width (LP64 == LLP32),
and the divide-by-total mean convention (distinct from the finite-only min_sep
rule). All from an adversarial review; no logic changed.
The 5 pinned corpus cases stay byte-identical; new CoverageReducerAndSenseFlips
case pins the feature (explored 5/8, phantom 2/8; mean_coverage 0.5, mean_sense_
flips 5). 8/8 nav_stats_test pass.
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 1c of the nav_stats intrinsic-stats build (follows #421, #422). Adds the epistemic counterpart to the motion stats — belief coverage + sense-churn — additive/off-by-default.
What lands
nav_coverage {explored_frac, visible_frac, believed_free_frac, phantom_frac}+episode_nav_stats.coverage+nav_scorecard.mean_coverage.compute_coverage(truth, belief, everseen, lastvis, planes, cells)— a pure reducer over the belief rasters (plane-major;truthis one shared plane broadcast per cell): explored = ever seen, visible = in view, believed_free = belief FREE, phantom = believed OCCUPIED where truth is FREE. Null/empty → all zero. Kept out of the collector so the collector stays raster-free (mirrors themin_clearancecaller-provides pattern).veh_nav_stats.sense_flips(int64_t) +nav_samplers.sense_flipsper-step feed; collector sums the per-agent delta.nav_scorecard.mean_sense_flips."coverage"+ per-veh"sense_flips"; scorecard nested"mean_coverage"+"mean_sense_flips".Portability (Track 2 will mirror this in
grl_snam)Both are bit-identical to the Python twin given matching inputs. The grl-snam survey confirmed all four rasters + the
flips[]count exist on the Python side ((M,H,W)shape, reallast_visible). The header pins the shared contract so the twin can't desync: theto_occupancybinarization literals (p_thresh 0.5/band 0.15/ optimistic), the plane-major + broadcast-truth flattening, theint64width (LP64 == Windows/LLP32), and the divide-by-total mean convention (deliberately distinct from the finite-onlymin_seprule).Parity
5 pinned corpus cases stay byte-identical; new
CoverageReducerAndSenseFlipscase pins the feature against hand-computed values (explored 5/8, visible 2/8, believed_free 5/8, phantom 2/8; corpus mean_coverage 0.5, mean_sense_flips 5).Review
4-lens adversarial review (parity / numeric-indexing / serialization / portability): no functional defect — the
truth[c]shared-plane indexing, phantom/free logic, denominator, and null guards all verified correct; JSON re-parsed cleanly. It surfaced thelong→int64Windows-width fix and three contract-spec gaps (unpinned binarization literals, implicit plane-major/broadcast obligation, divide-by-total vs finite-only) — all fixed here as type/doc hardening so the Track 2 twin has exact values to implement against.Test