Skip to content

grl-snam train: the robot at its real size on Austin, and an objective that is the task - #182

Merged
transfix merged 6 commits into
mainfrom
feat/sdf-objective-in-metres
Nov 15, 2026
Merged

transfix merged 6 commits into
mainfrom
feat/sdf-objective-in-metres

Conversation

@transfix

@transfix transfix commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #179. The change is measured at a6c3199; the branch merges main (with #179's squash) on top. The record is docs/learning-validation.md §9.

Why

#179 fixed the divergence, but the retrain reached fewer held-out Austin goals than the untrained net. The cause is deeper than the collision margin.

  • The physics constants are numbers in sim units, tuned where one unit is 20 m: rr 0.15, d_hat 0.35, vmax 0.9, the carrot 1.8. libcvc's carrot machine hard-codes its own the same way.
  • grl-snam sdf frames a map at ~10 units across its region, so Austin's nav_sdf.npz is 300 m per unit.
  • There the trainer simulated a 270 m/s robot with a 105 m barrier band, a 540 m carrot and a 6 m collision margin.
  • Austin's geometry stays as it is, in metres. The sim now runs in a 20 m unit.

What

  • --metres-per-unit 20 (default). The field is read in a 20 m sim frame (sdf_eval.in_frame): the same geometry in metres, with a 3 m, 18 m/s robot and a 7 m barrier band.
    • Pairs are drawn in the npz's frame as before and converted: the same places, bit for bit.
    • meta["scale"] is the sim frame's and meta["sdf_scale"] the npz's.
  • --objective task (default):
    • the seek drive's carrot rule each step;
    • a goal term that is the share of possible progress toward arrival not made (O(1), 0 at arrival);
    • the collision margin and temperature in metres (0.4 m);
    • --leg-ticks 1000: each batch row drives a whole 300-600 m leg across optimizer steps.
  • --pick clean-reach (default): held-out reach with no penetration tick. --val-ticks now defaults to 1000.
  • The old trainer stays reachable. --metres-per-unit 0 --objective end-distance is the trainer before; with --bptt-window 0 --no-col-grad it reproduces the published coef_sdf.pt bit for bit (checked).
  • The scorers drive every arm in the runs' frame: sdf_arms.py, objective_arms.py, and arms-eval --meta-from ARM. On §8's runs the new path takes the same settings and the same test pairs, bit for bit (checked). The demos and capture read a prebuilt npz in the checkpoint's frame.
  • Test: tests/test_sdf_train_frame.py fails on grl-snam train: why the SDF retrain diverged, the fix, and the learning measure again #179's code (its robot drives at 270 m/s). It also covers frame invariance of the task objective, the arrival term, the pick and the persistent legs.

The measure (§8.9 rerun: 5 seeds x 4000, the same split, all arms incl. constant_final)

  • The run: no step clips. The held-out objective falls 0.71-0.80 -> 0.33-0.34 on every seed. Held-out clean reach rises on every seed (learn-report +0.70 points [+0.59, +0.86]), and every pick is after step 0 (steps 700-2300; grl-snam train: why the SDF retrain diverged, the fix, and the learning measure again #179's were all step 0).
  • Held-out objective: below every arm, including a constant at the net's own mean: -0.16 [-0.18, -0.15].
  • Austin task, 1024 test pairs, against untrained:
    • seek drive +0.6 [-0.2, +1.4], matched by a constant at the net's own mean (+0.0);
    • sim_world +1.5 [-0.2, +3.2];
    • every seed positive on both, neither interval excluding zero. A null.
    • No penetration on either plant. +0.4 m clearance, +0.4 s to arrive.
  • In world units the untrained net reaches 28.6% of the test pairs (6.4% in the 300 m frame). The best constant in a 36-point sweep reaches 32.5%, so the coefficient room is ~4 points.
  • Elsewhere: the city ties (-0.8 [-3.1, +1.4]; grl-snam train: why the SDF retrain diverged, the fix, and the learning measure again #179 lost there). On coef's ice-band city the final nets reach more (+1.3 [+0.8, +1.9]) and penetrate less (-1.16) than every arm, constant_final included.
  • learn-report: 19/47 pass on the picks (11/47 in grl-snam train: why the SDF retrain diverged, the fix, and the learning measure again #179), 27/47 with --trained final (19/47).

Do not republish grl-snam-weights on these runs without an explicit go-ahead. No Austin gain is significant, and a checkpoint in the 20 m frame changes the demos' robot to its real size, which deserves its own check.

… term that has one

Truncate the backward every 7 rollout steps (--bptt-window) and let the collision term carry
gradient (--col-grad). Neither changes a forward value; --bptt-window 0 --no-col-grad is the
trainer before the fix and still reproduces the published coef_sdf.pt. --grad-terms-every records
each loss term's gradient norm in the history (grad_norm.terms.<term>).
…nd the measure again

The source (gradient_source.py), the pilot of each half of the fix, the five-seed retrain, every
arm on held-out Austin pairs, the procedural city and arms-eval's cases, and learn-report.
sdf_arms.py and objective_arms.py gain the constant_final arm (a constant at the final net's own
mean coefficients).
…ve that is the task

The physics constants are sim-unit numbers tuned at 20 m per unit; Austin's nav_sdf.npz is 300 m per
unit, so the trainer simulated a 270 m/s robot with a 105 m barrier band and a 6 m collision margin.

- train_sdf(metres_per_unit=20): the field is read in a 20 m sim frame (sdf_eval.in_frame, the same
  geometry in metres); pairs are drawn in the npz's frame as before and converted, so a held-out pair
  is the same place. meta records scale (the sim frame's) and sdf_scale (the npz's).
- objective='task': the seek drive's carrot each step, the goal term the share of the possible
  progress toward arrival not made, the collision margin and temperature in metres (0.4 m), and
  leg_ticks=1000: each batch row drives one leg across steps until it arrives or times out.
- pick='clean-reach': the held-out pick is reach with no penetration tick.
- --metres-per-unit 0 --objective end-distance is the trainer before; with --bptt-window 0
  --no-col-grad it still reproduces the published coef_sdf.pt bit for bit.
- The scorers (sdf_arms.py, objective_arms.py, arms-eval objective-sdf --meta-from) drive every arm
  in the runs' frame; the demos read a prebuilt npz in the checkpoint's frame.
- tests/test_sdf_train_frame.py fails on the trainer before (its robot drives at 270 m/s).
@transfix
transfix changed the base branch from fix/sdf-trainer-divergence to main November 14, 2026 23:14
# Conflicts:
#	experiments/learning_proof/objective_arms.py
#	experiments/learning_proof/sdf_arms.py
#	grl_snam/cli.py
#	grl_snam/tools/sdf_eval.py
#	grl_snam/tools/train.py
#	tests/test_sdf_train_divergence.py
…t is the task, and the measure again

Austin's nav_sdf.npz is 300 m per unit and the physics constants mean 20 m, so §§2-8 trained and
scored a 270 m/s robot. In the 20 m frame the untrained net reaches 28.6% of the held-out test pairs
(6.4% before). With the task objective the held-out objective beats every arm, held-out clean reach
rises on every seed (+0.70 [+0.59, +0.86] points along the run) and every pick is after step 0; on
the 1024 test pairs the gain against untrained is +0.6 [-0.2, +1.4] (seek drive) and +1.5
[-0.2, +3.2] (sim_world), the seek drive's matched by a constant at the net's own mean. The city
ties; on coef's ice-band city the final nets reach more and penetrate less than every arm.

§7's and §8's commands name the flags that give their trainer. Files in
docs/learning-validation/world-units/ (local paths scrubbed).
@transfix
transfix marked this pull request as ready for review November 15, 2026 00:56
…the geometry doc and the Ariadne README

- README: what build-sdf's frame is and that train reads it at 20 m per unit; arms-eval
  objective-sdf scores in the run's frame and objective, --meta-from for arms from another frame.
- docs/cvc-nav-and-grl-snam-guide.md: a gotcha on sim units vs the npz's frame and meta["scale"].
- docs/training-navigation-on-geometry.md: the SDF commands are grl-snam build-sdf / grl-snam train
  (scripts/build_sdf.py and train_sdf.py are gone), the file table points at grl_snam/, and a units
  note.
- grl_snam/ariadne/README.md: --grl-policy drives in the frame its checkpoint records.
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