Skip to content

Does base GRL-SNAM's policy learn? The coef_sdf learning check, and E1 (planted dissipation) - #172

Merged
transfix merged 2 commits into
mainfrom
feat/learning-proof-base
Nov 13, 2026
Merged

transfix merged 2 commits into
mainfrom
feat/learning-proof-base

Conversation

@transfix

Copy link
Copy Markdown
Contributor

The learning check (held-out per-term losses, the task metric with paired-seed CIs, a planted latent; each against untrained and constant arms) for base GRL-SNAM's public policy, grl-snam-weights' coef_sdf.pt. Results: docs/learning-validation.md, with every table's files and commands in docs/learning-validation/.

The answer: a null, and on held-out scenes a negative

  • The published coef_sdf.pt is an untrained net. grl-snam train at seed 0 for 200 steps on the CPU reproduces it bit for bit. On every scorer it ties its step-0 net and a constant net (Austin reach −0.2 points [−0.5, +0.2] vs untrained).
  • The retrain (5 seeds × 4000 steps, held-out blocks, the pick on held-out reach) does not descend its own loss.
    • Every optimizer step clips: the pre-clip gradient norm runs from 7 to 7·10¹³, likely the IPC barrier's 1/d at nsub 1.
    • Three seeds end higher than they started.
    • On held-out pairs the picks' training loss is above untrained: +0.75 [+0.25, +1.35].
  • The Austin reach gain is a mean shift.
    • The picks gain +0.8 points [+0.2, +1.6] on the policy's plant and +2.2 [+0.9, +3.8] on libcvc's sim_world navigator, paid in clearance (−1.8 m).
    • A constant at each pick's own mean coefficients matches them: −0.3 [−0.8, +0.2] and +0.0 [−0.9, +0.9].
  • On held-out city scenes the picks are worse: −2.7 points [−5.5, −0.2]. scorecard_eval and sim_world agree.
  • E1 stops at its ceiling. The best scalar damping per region, fitted straight to the generator's windows through the trainer's surrogate, is 93–97% off the planted γ/M_o. Pinning the truth costs 4.9–11× in loss: the surrogate's goal-spring drive cannot represent the generator's stage field.
  • coef-train's bicycle path does beat a constant at its own mean on safety: penetration −0.40 [−0.86, −0.03], on held-out draws of its own city. Its reach gain is again the mean's.

Recommendation: do not republish grl-snam-weights on these runs.

Code

  • grl-snam train: --history, --checkpoint-every and --val-frac (whole blocks held out; each checkpoint scores the objective's terms and the seek drive; keeps <out>.best_heldout.pt), plus --device. With the instruments on, the weights are bit-identical. grl_snam/tools/sdf_eval.py holds the split, pairs, terms and the batched seek drive.
  • learning_history: a fitness may return its held-out terms. checkpoint_ext serves trainers that save .pt.
  • spline_stagewise6: gamma_o_regions, and fric_mu (default 0.1, the old hard-coded value). make_checkpoint logs gamma_o_true.
    • Behaviour change: stagewise_dataset's Case-2 robot perturbation already set and logged fric_mu (0.05–0.30), but the step ignored it. It now takes effect.
  • train_coef_energy: --planted (per-region truth / mean / rel_err and the ratio on held-out windows), an init record and init.pt. The held-out scoring now forks the CUDA RNG too.
  • experiments/learning_proof/: arms, objective, curves, paired bootstrap, coef_eval with CIs, E1's data and ceiling.
  • Overlap with grl_snam.learning: learning histories, held-out curve marks, arms and learn-report (Phase 1a, 1b) #171: grl_snam.learning: learning histories, held-out curve marks, arms and learn-report (Phase 1a, 1b) #171 adds coef_export --constant, so this branch does not touch coef_export; the scripts build the constant arm themselves.

Tests

  • New: tests/test_sdf_train_instruments.py, tests/test_stagewise_planted.py, plus additions to test_learning_history.py and test_coef_energy_heldout.py.
  • Local run in the grl-snam-cp312 cvcpkg closure: 1046 passed, 19 skipped. black 26.5.1 and ruff are clean.

Found, not fixed here

  • stagewise_dataset.py's main() writes every episode's checkpoints to one shared file, so its manifest's records all read the last episode.
  • The stagewise generator does not repeat bit for bit run to run: it drifts by ~3·10⁻³ in 25 steps, on one thread too.
  • pycvc-cp312 3.7.13+cvc.2's cvcpkg closure lacks yaml-cpp, ftxui, json-schema-validator and joltphysics. import pycvc fails without them.

Merge on Joe's OK.

… planted dissipation

- grl-snam train: --history, --checkpoint-every (<out>.stepNNNNNN.pt, step 0 included) and
  --val-frac (whole blocks of the region held out; every checkpoint scores fixed held-out pairs,
  the objective's terms and the seek drive; <out>.best_heldout.pt on held-out reach), plus
  --device. With the history and checkpoints on, the weights are bit-identical; seed 0 at 200
  steps on the CPU reproduces grl-snam-weights' coef_sdf.pt.
- grl_snam/tools/sdf_eval.py: the block split, held-out pairs, the objective's terms and a
  batched seek drive (reach, time to goal, path, clearance, penetration, end gap).
- learning_history: a fitness may return its held-out terms (recorded as "heldout");
  checkpoint_ext for trainers that save .pt.
- spline_stagewise6: gamma_o_regions (damping by the centre's x) and fric_mu (the hard-coded 0.1,
  still the default); make_checkpoint logs gamma_o_true.
- train_coef_energy: --planted (per-region truth / mean / rel_err and the ratio on held-out
  windows), an init record and init.pt for the untrained net, and the held-out scoring forks the
  CUDA RNG too.
- experiments/learning_proof/: the arms, the paired bootstrap, the curves, E1's data and ceiling.
…sdf, and E1

A null, and on held-out scenes a negative: the published coef_sdf is its untrained net; the
retrain clips every step and its held-out picks are worse than untrained on their own held-out
objective; their Austin reach gain is a mean shift a constant reproduces, and on the city they
reach less. E1 stops at its ceiling: the surrogate's best scalar damping is 93-97% off the
planted gamma. Every table's files and commands are in docs/learning-validation/.
transfix added a commit that referenced this pull request Nov 13, 2026
…rms, metrics, init)

Found running learn-report on the five real retrain histories of the base-measure work (its PR
#172):

- A held-out <prefix>_<term> (grl-snam train's obj_goal) with no exact twin pairs with the
  training <term>; without it no objective term had a twin.
- A held-out value with a training twin is a loss term; the loss claims are made on those (and
  on fitness) only. Held-out metrics with no twin (reach, path_m, min_clear_m, ...) get marks and
  are listed under untested, instead of a claim with a guessed direction: reach and min_clear_m
  read as lower-is-better before. HIGHER_IS_BETTER and a header `maximize` list give a metric's
  direction for its marks.
- An `init` record (train_coef_energy's untrained evaluation before epoch 0) joins the first
  evaluated kind's series one before its first x, so the untrained net is the first point.
- `planted` values are not loss terms (the planted claims read them).
- One run needs 5 evaluations for a loss claim to pass (the noise floor needs them); its margin
  is now max(delta * IQR, z * noise).

Fixtures: sdf_train_history.jsonl (a subset of retrain seed 0) and
coef_energy_history_planted.jsonl (the E1 pipeline history), both from #172.
transfix added a commit that referenced this pull request Nov 13, 2026
… learn-report (Phase 1a, 1b) (#171)

* grl_snam.learning: read learning histories, mark held-out curves, compare arms, report claims

Phase 1a and 1b of the learning proof: is a learner learning, or fitting noise? Held-out data,
against an untrained arm and a constant arm.

- grl_snam/learning/history.py: load(paths, follow=False) reads any trainer's JSON-lines history
  by the shared conventions (kind, step/epoch, train/terms beside heldout, heads.<g>.*,
  grad_norm, best*, blob/checkpoint), no per-schema adapter: series <kind>.<path>, the header as
  meta, a checkpoint table with the pick, train/held-out term pairs, band() across seeds, and an
  mtime/size re-read that tolerates a half-written last line.
- grl_snam/learning/curves.py: best, Kneedle elbow, plateau (windowed Theil-Sen change against
  the curve's IQR) and divergence after best, on a 5-point running median, each threshold with a
  noise floor (robust sd of the second differences) so a flat noisy curve gets no elbow and no
  divergence.
- grl_snam/learning/stats.py: the downstream A/B harness's percentile bootstrap, draw for draw
  (5000 resamples, one seeded generator), and paired differences that keep pairs together.
- grl_snam/learning/arms.py + tools/arms_eval.py: arms NAME=PATH|const:..., scored on paired
  held-out seeds through coef_eval and scorecard_eval, written as grl_snam.arms/v1 (the
  harness's JSON shape plus per-seed values, direction and primary metrics).
- grl_snam/learning/report.py + `grl-snam learn-report`: loss, selection, task and planted
  claims, each pass or fail, plus the curves' marks and the checkpoint tables.
- tools/coef_export.py: --constant (a CoefMLP with zero weights whose output bias is the inverse
  activation of each constant, to .cvcnav or .pt) and read_coef_mlp (.cvcnav back to torch).
- tools/scorecard_eval.py: episodes(model, seeds) gives the per-scene stats evaluate() reduces.
- tests/learning/*, tests/fixtures/learning_history/* (five writers' layouts, downstream ones
  with neutral names), tests/fixtures/learning_marks_golden.json (tools/learning_marks_golden.py
  regenerates and checks it).

* learning: read grl-snam train's and E1's histories right (prefixed terms, metrics, init)

Found running learn-report on the five real retrain histories of the base-measure work (its PR
#172):

- A held-out <prefix>_<term> (grl-snam train's obj_goal) with no exact twin pairs with the
  training <term>; without it no objective term had a twin.
- A held-out value with a training twin is a loss term; the loss claims are made on those (and
  on fitness) only. Held-out metrics with no twin (reach, path_m, min_clear_m, ...) get marks and
  are listed under untested, instead of a claim with a guessed direction: reach and min_clear_m
  read as lower-is-better before. HIGHER_IS_BETTER and a header `maximize` list give a metric's
  direction for its marks.
- An `init` record (train_coef_energy's untrained evaluation before epoch 0) joins the first
  evaluated kind's series one before its first x, so the untrained net is the first point.
- `planted` values are not loss terms (the planted claims read them).
- One run needs 5 evaluations for a loss claim to pass (the noise floor needs them); its margin
  is now max(delta * IQR, z * noise).

Fixtures: sdf_train_history.jsonl (a subset of retrain seed 0) and
coef_energy_history_planted.jsonl (the E1 pipeline history), both from #172.
@transfix
transfix merged commit ead2f60 into main Nov 13, 2026
4 checks passed
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