Skip to content

Nav: the material trainer and pycvc train on the Jolt Humvee (P4) - #941

Merged
transfix merged 3 commits into
masterfrom
feat/jolt-rollout-p4
Oct 31, 2026
Merged

transfix merged 3 commits into
masterfrom
feat/jolt-rollout-p4

Conversation

@transfix

@transfix transfix commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Follows #940 (merged as 65c6bd0; this branch is rebased onto master). This is P4 of the Jolt training rollout. The material trainer and pycvc can now train on the Jolt Humvee, the gradient coming from the calibrated four-wheel pH model at Jolt's states.

The material trainer on Jolt

  • material_integrator::jolt: integrate_plant_material / _vjp in material.h. It runs integrate_dynamic_material's controller, with its commands driving a rollout_plant. The reverse replays the controller's step_bwd and dyn4_plant_vjp along the plant's tape.
  • Each call resets Jolt to the batch:
    • each agent's discs become 16-sided prisms, and with hard_walls the patch's hard cells become boxes;
    • every agent is launched at its start speed;
    • each agent gets vmax dt max(H) of room.
      So the loss is a function of the weights and the batch, and its finite differences are well defined.
  • New material_loss_config fields: plant, dyn4, ground_mu, hard_walls. L_multi runs on the kinematic bicycle. An external force (ext) is refused, as it isn't implemented yet.

The seam and the Jolt plant

  • rollout_batch gains three fields:
    • obstacles: each agent's own discs and boxes;
    • speed: start speeds;
    • reach: room around obstacles when there is no scene.
  • jolt_rollout now:
    • builds those walls;
    • lays out copies around each agent's own extent, so a batch can have no scene;
    • turns starts so the body fits around discs and boxes as well as scene walls;
    • launches at the start speed by setting the chassis velocity after settling. The wheels spin up in the first step, which costs 5–8% of the speed.
  • use_jolt_rollout(cfg, scene, desc, agents, steps): one call that sets up a train_config for Jolt (plant, calibrated model, price).

pycvc

  • nav_train_coef_mlp_jolt(...): trains the coefficient policy on Jolt and returns the calibration as a dict.
  • nav_material_trainer_set_jolt(handle, 1, vehicle, L, dt, ...): calibrates, then turns the material loss onto Jolt. nav_material_trainer_integrator now reads "jolt".
  • Both are new symbols, so GRL-SNAM can key a --rollout jolt on hasattr. The GRL-SNAM change itself belongs in CVC-Lab/GRL-SNAM.
  • New test_pycvc_nav_train.py::test_jolt_integrator.

Measured

Windows MSVC Release; the Humvee at 0.106 units per metre; 24 material-fixture agents under way at 2.8 m/s, 40 steps of 0.06 s.

Model Jolt FD rel
Along the gradient 3.07 2.57 0.089
gamma_head.2.weight 1.239 1.245 0.002
gamma_head.0.weight 1.150 1.148 0.001
goal_enc.0.weight 0.947 0.980 0.017

Tests

  • physics_jolt_rollout_test: 11 tests, including the new launch, material-walls, material gradcheck, material training and use_jolt_rollout tests.
  • nav_material_train_test: FullChainGradcheckOnAPlant.
  • pycvc: pycvc_nav_train passes locally, run through ctest against a pycvc built here with CVC_BUILD_PYCVC=ON; it includes the new test_jolt_integrator. At that test's limits (22 m/s² asked of a Humvee) the fitted drive gain sits at its 0.25 floor, so realistic limits matter for the calibration.

Docs

NAV_TRAINING.md, "Training on Jolt": the material trainer, and the pycvc entry points.

Base automatically changed from feat/jolt-rollout to master October 31, 2026 10:46
material_integrator::jolt takes the material loss through a vehicle
simulation: integrate_plant_material runs the material controller with its
commands driving a rollout_plant, and its VJP replays the controller's reverse
and dyn4_plant_vjp along the plant's tape. Each call resets Jolt to the batch:
each agent's discs and the patch's hard cells as walls, every agent launched at
its start speed.

- rollout_batch gains per-agent obstacles, start speeds and a reach;
  jolt_rollout builds them, lays copies out without a scene, turns starts to fit
  around them, and launches at speed.
- use_jolt_rollout sets a train_config up for Jolt in one call (plant,
  calibrated model, price).
- pycvc: nav_train_coef_mlp_jolt and nav_material_trainer_set_jolt, new symbols
  for GRL-SNAM's --rollout jolt; the integrator reads "jolt".

Measured on the Humvee: the material gradient matches Jolt's central
differences (rel 0.089 along it, 0.001-0.017 on its largest tensors), and 20
Adam steps lower the material loss on Jolt 23.97 -> 21.65.
…, scored on Jolt

NavPlantConvergence.JoltTrainedHumveeOnJoltReach (an experiment, run with
CVC_JOLT_TRAIN_EXPERIMENT=1): the Humvee at demo3's metric with its own envelope,
arms trained on the Jolt rollout (calibrated first) and on the dynamic vehicle,
checkpoints selected on Jolt reach, the selected policies scored on the held-out
seeds against the untrained seed with paired CIs and saved as .cvcnav (JOLT_EXP_OUT).
…periment scores each arm as it ends

An overnight arm (horizon 120) stopped on 'drive: the command must be finite':
a non-finite gradient (the four-wheel model's reverse at a state far outside
its domain, such as a rolled vehicle) made every parameter NaN. The Jolt window
now sums each agent's gradient on its own and leaves it out when it is not
finite (coef_trainer::dropped_agents counts them), and a non-finite command
throws with the agent, step, coefficients and state. The experiment scores and
saves each arm as it is trained, takes per-arm horizon and w_coll
(kind:seed:lr[:horizon[:w_coll]]), and reports a failing arm and goes on.
@transfix
transfix force-pushed the feat/jolt-rollout-p4 branch from 23b4eaf to 2da4276 Compare October 31, 2026 12:11
@transfix transfix changed the title Nav: the material trainer and pycvc train on the Jolt Humvee (P4, stacked on #940) Nav: the material trainer and pycvc train on the Jolt Humvee (P4) Oct 31, 2026
@transfix
transfix enabled auto-merge (squash) October 31, 2026 12:11
@transfix
transfix merged commit 0580f96 into master Oct 31, 2026
21 of 28 checks passed
@transfix
transfix deleted the feat/jolt-rollout-p4 branch October 31, 2026 13:05
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