Skip to content

grl-snam ariadne scrub: watch it learn, every checkpoint of a training run deployed (Phase 4b) - #181

Merged
transfix merged 1 commit into
mainfrom
feat/checkpoint-scrubber
Nov 14, 2026
Merged

transfix merged 1 commit into
mainfrom
feat/checkpoint-scrubber

Conversation

@transfix

Copy link
Copy Markdown
Contributor

This is Phase 4b of the plan, the checkpoint scrubber. It builds on #175 (live --arms) and #176 (the run log and replay).

grl-snam ariadne scrub run/history.jsonl                           # Austin, kinematic
grl-snam ariadne scrub run/history.jsonl --world flat --ticks 600
grl-snam ariadne scrub run/history.jsonl --headless --report scrub.json

What it does

Deploy and cache.

  • scrub reads the checkpoints from a learning history, each with the policy it saved (its blob, a .cvcnav or a .pt).
    • A relative path is taken as relative to the history's directory.
    • Blobs that are missing are listed and skipped.
  • Each policy is deployed headless on one scenario: libcvc's sim_world on --plant (kinematic by default), from the scenario's start to its goal, for --ticks ticks.
  • Each run is cached as a run log at <history>.scrub/<blob sha256>-<scenario hash>.npz.
  • The scenario hash covers:
    • the world (its run.* keys, plus a generated world's world.*);
    • the start, goal, seed, ticks and plant;
    • the policies' frame (--scale, otherwise the first .pt checkpoint's);
    • the settings given on the command line;
    • libcvc's version.

One path with live --arms. make_fleet, begin_stats and tick_arms are factored out of live.run_arms. Live and scrub both drive through them, so checkpoint 0 deployed by the scrubber is live --arms untrained=<step-0 blob>, tick for tick (tested).

The view, docs/scrub.ari.

  • Picking checkpoint k: a combo, a slider, Previous / Next, or a click on either chart. It opens on the history's pick; --at K picks another.
  • The episode: k's ghost (orange) runs beside step 0's (blue), using replay's PlayHead, tables_at and update_ghosts. The Stats and Ledger windows show the two, and libcvc's sim transport drives the episode.
  • The deployed metric: the Metric combo chooses reached, time, path, ticks penetrating, clearance min or mean, or what is left to the goal. It is charted against the checkpoint step, with step 0's value as a dashed line and the pick marked, and shown as a table. On hosts without chart: the table and text carry the same numbers.
  • The training curve: a held-out curve from the history, drawn with the learn port's loss_chart and its marks. Both charts carry a cursor at checkpoint k.

Headless it deploys, prints a line per checkpoint and, with --report, writes every checkpoint's metrics (grl_snam.scrub/v1).

Exit code: 0, or 2 when the history names no saved policy that exists, or when the plant is torch.

On real data

I ran it on the learning check's retrain: seed 0, 41 .pt checkpoints, on Austin with the kinematic plant, 60 s each. The first deploy took 72 s; with the cache, the view opens in about 20 s. No checkpoint reaches the goal, and there are two outcomes:

  • 25 checkpoints, step 0 among them: stop 516–558 m short, after 255–266 ticks penetrating.
  • 16 checkpoints: take another turn and end 865–883 m away, after 323–334 ticks penetrating. They are scattered from step 400 to 4000, and include the history's pick (step 2100) and the last checkpoint.

Nothing orders the two outcomes by training step: it is docs/learning-validation.md's null, seen checkpoint by checkpoint. The screenshot is phase4b-scrub-retrain-seed0.png in the session's shared notes, taken with --offscreen on the chart build, at the pick against step 0.

Tests: tests/test_ariadne_scrub.py

  • No host needed:
    • the checkpoints a history names, and how blobs are resolved;
    • the cache key;
    • the table and the metric chart;
    • two runs side by side.
  • Deployed: a copy of the coef-train fixture history with four blobs written for it, on the flat square, on the kinematic plant. It checks:
    • every checkpoint is deployed, cached, and read back without running again;
    • one checkpoint deployed twice gives the same run (every array but the wall time);
    • checkpoint 0 is the untrained arm of live --arms (pose, telemetry, books and Stats arrays equal);
    • the view's controls (Next, a chart click, the slider);
    • the refusals.
  • Charts (needs chart:).
  • Offscreen (GRL_SNAM_ARIADNE_GL=1).

Locally:

  • On the catalog 3.7.13 closure, the Ariadne and learning tests give 152 passed and 7 skipped (chart, GL, Austin).
  • On the chart build with GL=1, the scrub and arms tests give 36 passed.
  • black 26.5.1 and ruff 0.16 are clean.

…g run deployed (Phase 4b)

`grl-snam ariadne scrub HIST [--seed --ticks --plant kinematic]` deploys each checkpoint blob a
learning history names (.cvcnav or .pt) on one scenario, headless, as live --arms drives an arm
tick for tick, and caches each run log at <hist>.scrub/<blob sha>-<scenario hash>.npz.

- live.py: make_fleet, begin_stats and tick_arms factored out of run_arms; live and scrub share
  them, so checkpoint 0 deployed is the untrained arm deployed (tested).
- The scenario hash covers the world (run.* keys, a generated world's world.*), start, goal,
  seed, ticks, plant, the policies' frame, command-line settings and libcvc's version.
- docs/scrub.ari: checkpoint k picked by a combo, a slider, Previous/Next or a click on a chart;
  its ghost beside step 0's over the episode (replay's play head, Stats and Ledger); a deployed
  metric against the checkpoint step with step 0's dashed, as a chart and a table; a held-out
  curve from the history (learn's loss_chart); both charts carry a cursor at k.
- --report writes every checkpoint's metrics (grl_snam.scrub/v1).
@transfix
transfix merged commit d579ce2 into main Nov 14, 2026
5 checks passed
transfix added a commit to transfix/libcvc that referenced this pull request Nov 16, 2026
…ployed, k beside step 0 (#1259)

* cvc::nav's checkpoint scrubber: every checkpoint of a training run deployed, k beside step 0

Watch a policy learn. read_training_history() reads a training history (cvc::nav's own
coef_trainer history, cvc.nav.coef_train_history/v1, or GRL-SNAM's: JSON lines whose checkpoint
records name a .cvcnav blob), and scrub() deploys every checkpoint on one scenario, headless, as a
one-arm arms_run: the built-in blocks (a walled square of city blocks) or a recorded input trace's
world. Each run is a run log cached at <history>.scrub/<blob sha16>-<scenario hash>.cvcrun, the
hash covering the world, agents, settings, ticks and the versions. scrub_view shows checkpoint k
beside step 0: the deployed metric against the step with step 0 dashed, the table, a curve from
the history, and both runs' Stats and Ledger at the play head (three more units in
nav_lab_panels.ari).

cvc nav scrub HIST prints every checkpoint's metrics and writes a cvc.nav.scrub/v1 report;
pycvc binds the scrubber, and pycvc_gl.nav_lab scrub draws it. One blob deployed twice is the same
run, and checkpoint 0 deployed is the untrained policy's arm (nav_scrub_test). The behaviour is
GRL-SNAM's ariadne scrub (CVC-Lab/GRL-SNAM#181).

* nav_scrub_test: each test trains in a directory of its own (ctest runs them in parallel processes)

* nav_scrub: the checkpoint scrubber in libcvc's demo gallery, training and deploying in the page (#1260)

* nav_scrub: the checkpoint scrubber in libcvc's demo gallery, training and deploying in the page

examples/ariadne/nav_scrub is a C++ Ariadne host for cvc::nav's scrubber. With no --history it
trains cvc::nav's own coef_trainer for 60 steps on the built-in blocks' own map (in its frame,
occupancy_scene), a checkpoint every 6, deploys every checkpoint there and shows nav_scrub.ari
(the nav_lab_panels component's windows, written by cvc::nav::scrub_view), drawing the walls and
the two runs' ghosts. It joins the gallery's _wasm_demos with its document and the component
library preloaded, so in the browser the training, the deploys and the view run in the page: the
same numbers as natively (under 3 s there). demos.json and deploy-pages.yml's live check list it.

* nav_scrub: import the split nav lab components
transfix added a commit to transfix/libcvc that referenced this pull request Nov 16, 2026
…point scrubber, and a Pages demo (#1258)

* cvc::nav arms: policies side by side, the Stats and Ledger, the run log and its replay

Several navigation policies run side by side in cvc::nav, one sim_world each, on the same world
from the same starts to the same goals, stepped in lockstep (arms_run). A retarget moves every
arm's goals on the same tick and starts a leg. Each tick records, per arm and agent, the pose,
size, drive telemetry, the books against U_nav (dU, drive, projection, context, dKE, residual)
and the plant ledger, and per arm the wall time and the Stats row, into cvc::nav's run log
(cvc.nav.run_log/v1, JSON lines, read back value for value).

The Stats and Ledger windows are a shipped component (nav_lab_panels.ari), written from a run log
at a tick by nav_panels (the live run at its last tick, a replay at its play head, so the cells
are the same). pycvc binds the arms, the run log, the replay view and the plant ledger's items;
pycvc_gl.nav_lab runs arms live and replays a run log; cvc nav log prints one. The behaviour is
GRL-SNAM's live --arms and replay (CVC-Lab/GRL-SNAM#175, #176). docs/NAV_LAB.md.

* run_log: a JSON-quoting helper named quoted() is ambiguous with std::quoted under libc++

(cherry picked from commit 74856dffb86aa26653eef739f6077dd60352bc31)

* nav lab: a component file per unit named after it; finish() closes the streamed run log

The shipped-component check (AriadneComponents.ShippedComponentsLoadClean) wants each file in
src/cvc/ariadne/components to hold a unit named after it: nav_lab_panels.ari is now
nav_lab_stats.ari (the Stats window) and nav_lab_ledger.ari (the Ledger), each in INDEX.ari, and the
documents import both. arms_run::finish() now closes the file it streams the log to, so the log is
whole and free to read, move or remove at once: Windows refused to remove it while the run still
held it (NavArms.TheLogReadsBackValueForValue).

* nav_arms_test: a fused multiply-add leaves dKE a last bit off zero on arm64; compare near

* cvc::nav's checkpoint scrubber: every checkpoint of a training run deployed, k beside step 0 (#1259)

* cvc::nav's checkpoint scrubber: every checkpoint of a training run deployed, k beside step 0

Watch a policy learn. read_training_history() reads a training history (cvc::nav's own
coef_trainer history, cvc.nav.coef_train_history/v1, or GRL-SNAM's: JSON lines whose checkpoint
records name a .cvcnav blob), and scrub() deploys every checkpoint on one scenario, headless, as a
one-arm arms_run: the built-in blocks (a walled square of city blocks) or a recorded input trace's
world. Each run is a run log cached at <history>.scrub/<blob sha16>-<scenario hash>.cvcrun, the
hash covering the world, agents, settings, ticks and the versions. scrub_view shows checkpoint k
beside step 0: the deployed metric against the step with step 0 dashed, the table, a curve from
the history, and both runs' Stats and Ledger at the play head (three more units in
nav_lab_panels.ari).

cvc nav scrub HIST prints every checkpoint's metrics and writes a cvc.nav.scrub/v1 report;
pycvc binds the scrubber, and pycvc_gl.nav_lab scrub draws it. One blob deployed twice is the same
run, and checkpoint 0 deployed is the untrained policy's arm (nav_scrub_test). The behaviour is
GRL-SNAM's ariadne scrub (CVC-Lab/GRL-SNAM#181).

* nav_scrub_test: each test trains in a directory of its own (ctest runs them in parallel processes)

* nav_scrub: the checkpoint scrubber in libcvc's demo gallery, training and deploying in the page (#1260)

* nav_scrub: the checkpoint scrubber in libcvc's demo gallery, training and deploying in the page

examples/ariadne/nav_scrub is a C++ Ariadne host for cvc::nav's scrubber. With no --history it
trains cvc::nav's own coef_trainer for 60 steps on the built-in blocks' own map (in its frame,
occupancy_scene), a checkpoint every 6, deploys every checkpoint there and shows nav_scrub.ari
(the nav_lab_panels component's windows, written by cvc::nav::scrub_view), drawing the walls and
the two runs' ghosts. It joins the gallery's _wasm_demos with its document and the component
library preloaded, so in the browser the training, the deploys and the view run in the page: the
same numbers as natively (under 3 s there). demos.json and deploy-pages.yml's live check list it.

* nav_scrub: import the split nav lab components
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