Repository navigation
nav_native: collect base NavStats on the native sim_world path - #86
Merged
Merged
Conversation
The native path (NativeSimWorld, driving the torch-free C++ cvc::nav::sim_world) gains base-stats collection via the world's INTERNAL nav_stats collector (libcvc #402) — the 3rd grl-snam base-stats source after the pure-Python SdfNavigator and the vectorized Swarm, so all three collect the same base row. - NativeSimWorld.begin_nav_stats(...): arm the C++ collector (captures the current pose as the episode start; call before the first step). nav_stats(): json.loads the episode record. episode_stats(): map it into a scorecard EpisodeStats via from_nav_stats, mirroring Swarm.episode_stats — the C++ record already carries min_sep_m, per-vehicle veh_contacts and time_to_goal_s, so they come across for free. - HAS_SIM_WORLD_NAVSTATS feature flag (hasattr nav_sim_world_begin_nav_stats) keeps the module import-safe on a pycvc built before the bindings shipped; the gated test in tests/test_sim_world_parity.py skips until then. Depends on transfix/libcvc#402 (the sim_world internal collector + pycvc bindings). Runs in CI once #402 is published in the nightly pycvc (pycvc recipe cvc_revision bump). Deferred: material_time_share (no per-point palette on sim_world), set_identity, exact Swarm<->native bit parity.
This was referenced Sep 22, 2026
transfix
added a commit
that referenced
this pull request
Sep 22, 2026
…umer (#87) The base nav_stats collectors (Swarm #84, native #86) and the scorecard (#82) had no production consumer — the corpus aggregation was demonstrated only in tests. Add a scorecard eval CLI that runs a CoefMLP checkpoint over a scene corpus with the Swarm's base collector and aggregates one NavScorecard: the RF-free fitness row grl-snam uses to rank its own base-policy checkpoints (design §7, PR5 training bridge). - grl_snam/tools/scorecard_eval.py: load_model (a grl-snam train .pt or the bias net) + scene_specs (city corpus) + evaluate(scenes/agents/steps/grid/contact_r) -> Swarm(collect_stats=True) per scene -> episode_stats() -> aggregate_nav -> NavScorecard. Prints a compact row + the full JSON (the record a campaign ranks on), optional --json. Convention matches the other `python -m grl_snam.tools.X` tools (coef_eval/coef_train). - tests/test_scorecard_eval.py: a tiny corpus reduces to a well-formed, in-range card; seeds give distinct corpora; the default (no checkpoint) is the bias net. 3 pass, and the CLI runs end-to-end locally (torch 2.12 via the cvcpkg .venv). The scorecard field-mirrors the C++ nav_scorecard + the native collector, so a checkpoint scores identically whichever path evaluates it. Follow-up (optional): register as a `grl-snam scorecard-eval` Click subcommand; a --native flag to score via NativeSimWorld.
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.
The native path (
NativeSimWorld, driving the torch-free C++cvc::nav::sim_world) gains base-stats collection via the world's internalnav_statscollector (libcvc #402) — the 3rd grl-snam base-stats source after the pure-PythonSdfNavigatorand the vectorizedSwarm, so all three collect the same base row.What
NativeSimWorld.begin_nav_stats(...)— arm the C++ collector (captures the current pose as the episode start; call before the firststep()).nav_stats()—json.loadsthe episode record.episode_stats()— map it into a scorecardEpisodeStatsviafrom_nav_stats, mirroringSwarm.episode_stats. The C++ record already carriesmin_sep_m, per-vehicleveh_contactsandtime_to_goal_s, so they come across for free.HAS_SIM_WORLD_NAVSTATSfeature flag (hasattr nav_sim_world_begin_nav_stats) keeps the module import-safe on a pycvc built before the bindings shipped; the gated test intests/test_sim_world_parity.pyskips until then.Validation
Module imports cleanly and the flag/methods resolve; the test skips gracefully on a pycvc without the bindings (verified locally). It runs in CI once #402 is published in the nightly pycvc (pycvc recipe
cvc_revisionbump — in flight).Depends on transfix/libcvc#402. Deferred:
material_time_share(no per-point palette onsim_world),set_identity, exactSwarm↔native bit parity.