Repository navigation
nav: semi-implicit Euler by default in the geometry rollout, with the integrator A/B - #981
Merged
Merged
Conversation
…or A/B harness integrate_surrogate_v2 / multi_start_penalty (L_multi) defaulted to explicit Euler, following the material fork's surrogate_robust.py. Every other point-mass rollout here was already semi-implicit: GRL-SNAM's own surrogate_robust.py (since f5a015f) and sdf_rollout, integrate_surrogate_material (CPU and CUDA), and the coefficient trainer's surr_step. Explicit Euler gains energy at every step of a conservative orbit (NavPotential.ExplicitEulerRaisesTheAlarm). - geom_rollout_params::semi_implicit and multi_start_params::semi_implicit default to true; explicit Euler stays an option (false). - pycvc's nav_material_trainer_create(ms_semi_implicit) defaults to 1. - Tests that meant the explicit order now say so (legacy(false)); new NavGeomRolloutGrad.SemiImplicitIsTheDefault and NavMaterialTrain.FullChainGradcheckExplicitMultiStart. - docs/NAV_MATERIAL.md: the new default. The A/B: train_config::point_mass (CPU only; the CUDA trainer refuses all but the default) selects the coefficient trainer's point-mass integrator: semi_implicit (the default, unchanged), explicit_euler, or strang (velocity Verlet with the damping and the speed clamp split out). Each has its own backward and gradcheck. NavPlantConvergence.PointMassIntegratorAB (CVC_NAV_INTEGRATOR_AB=1) trains on the city under each arm and drives the policies on Jolt RoboRacers over 20 paired seeds, and books each arm's point-mass steps under its trained policies.
…ING.md The A/B (10 training seeds per arm on the city; Jolt RoboRacers over 20 paired seeds; 95% CIs over both): against semi-implicit, a policy trained on explicit Euler loses 7.3 [4.7, 10.1] points of reach at lr 1e-4 and 4.7 [1.6, 8.4] at 2e-4. At the gate's lr 5e-5 it drives 5% further and hits buildings 4% more, for +1.0 [+0.1, +1.9] points. On its booked steps the sharp check alarms 14-19% of the time, and 78-94% of those steps gained energy. Semi-implicit never alarms (worst ratio 1.2e-3). The Strang split never differs from semi-implicit in reach outside the CI. At lr 2e-4 it hits buildings more (+0.14 [+0.06, +0.21]) and comes closer to them. It costs two force evaluations a step, and its books need a cross term of their own. It does not earn its place: point_mass_integrator keeps semi_implicit (the default) and explicit_euler (the A/B's control). The previous commit has the Strang arm, its gradcheck and its books.
transfix
added a commit
to CVC-Lab/GRL-SNAM
that referenced
this pull request
Nov 2, 2026
…#981) (#144) The guide's integrator note said cvc::nav's integrate_surrogate_v2 runs explicit Euler by default. transfix/libcvc#981 makes semi-implicit Euler the default there, in multi_start_params and in pycvc's nav_material_trainer_create(ms_semi_implicit=1); explicit stays an option. The note now says so, and says what changes for MaterialTrainer here: its legacy start leaves the integrator argument out, so with such a pycvc it runs semi-implicit natively while the torch twin keeps its explicit default. Only this note changes; the guide's PDF is not re-rendered (it was last rendered on Oct 2, before #115 and #140 edited the Markdown).
transfix
enabled auto-merge (squash)
November 6, 2026 21:03
transfix
added a commit
that referenced
this pull request
Nov 7, 2026
Bumps the project version and every recipe's upstream_version from 3.7.11 to 3.7.12. The v3.7.12 tag on this commit is the first release with the multi-car controller template (pycvc_gl.cars, #1031 #1035 #1040), the hidden-subtree fix in cvcGL (#1037), the discrete-gradient dyn_bike step (#978), semi-implicit Euler by default in the nav rollout (#981), the implicit contact damper (#1004, #1038), and generated_world's roads and water (#1032, #1034).
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.
What
Semi-implicit (symplectic) Euler is now the default in the navigator's geometry rollout. Explicit Euler stays an option.
integrate_surrogate_v2/multi_start_penalty(L_multi).geom_rollout_params::semi_implicitandmulti_start_params::semi_implicitdefault totrue. The velocity updates first, then the position steps with the new velocity.falseis explicit Euler, as before.nav_material_trainer_create(..., ms_semi_implicit=1)is the new default;0is explicit.surr_step(rollout_kind::surrogate, CPU and CUDA);integrate_surrogate_material(CPU and CUDA);sdf_rolloutandsurrogate_robust.py.gen_nav_geom_multistart_golden.py's cases name their integrator, so they hold. The material-trainer goldens that GRL-SNAM commits recordsemi_implicitin their config, and its torch twin reads it from there. Regenerated with this branch, they would say1. GRL-SNAM's committed copies (0) stay valid.Explicit Euler gains energy at every step of a conservative orbit, by
w^2 dt^2on a harmonic mode. The energy books' sharp check alarms on it (NavPotential.ExplicitEulerRaisesTheAlarm). This is the integrator a reviewer of the GRL-SNAM vehicle pH whitepaper objected to.The A/B
What it answers. The A/B answers the reviewer's question with evidence: which integrator should the navigator use? It is not about protecting deployed coefficients, because none were ever trained under explicit Euler.
What was trained before. No trained policy depended on explicit Euler:
grl-snam-weights'coef_sdf.cvcnav, a CoefMLP) was trained throughsdf_rollout, which is semi-implicit.L_multi, which has no production caller and no trained weights in either repo.What the A/B tests instead. The integrator inside the coefficient policy's own training.
train_config::point_mass(CPU only) selects it:semi_implicit, the default and unchanged;explicit_euler;NavPlantConvergence.PointMassIntegratorAB(CVC_NAV_INTEGRATOR_AB=1) runs it:city_scene(96)(n 128, horizon 28, window 7), the city GRL-SNAM'scoef_train.pytrains on.The books' sharp check on each arm's point-mass steps, driven by its trained policies:
(r_E − r_hat_E) / bound, withbook_step's semi-implicitr_hat_E. Strang keeps its own books: exact damping and clamps, a cross term for the clamp before the drift, andr_hat_E = 0.L_multi itself, on
nav_geom_rollout_grad_test's penetrating batch: semi-implicit's penalty is 8% lower than explicit's on the legacy start (2.050 against 2.230) and 15% lower on sampled starts (2.453 against 2.898).Reading it:
dt^2 g.(g + gamma v)vanishes.b2349e10keeps the arm, its gradcheck and its books (AB_ARMS=semi,explicit,strang).hdt/2 g.(v_b − v_k), the counterpart of semi-implicit'sW_cross.Nowhere did fully implicit Euler look like what was needed, so it isn't here.
GRL-SNAM
grl_snam/material_train_native.pyleaves the integrator out onMaterialTrainer's legacy start (semi_implicit=Falsewith the defaultfrac_range), so with a pycvc carrying this change that start runs semi-implicit natively.tests/test_material_train_native.py::test_sampled_multi_start_argsassertsloss(semi_implicit=True) != loss()(itssemi_one != legacy). That will fail once GRL-SNAM's CI picks up a pycvc release with this change.Local
MSVC 14.44 Release, deps from the local cvcpkg prefix. Rerun 2026-11-06 with master (
8f468c18) merged in (1ca5b97d), after master's required recipe checks moved toubuntu-22.04; the C++ suites pass as below, withNavPlant.*at 20/20 (#1011 added one):nav_geom_rollout_grad_testnav_potential_testnav_material_train_testnav_material_bike_rollout_testnav_material_testnav_material_ext_testnav_coef_train_test(NavCoefTrain.*,NavCoefMlp.*)nav_plant_test(NavPlant.*)NavPlantConvergence.PointMassIntegratorAB)test_pycvc_nav_train.pyNew tests:
NavGeomRolloutGrad.SemiImplicitIsTheDefaultNavMaterialTrain.FullChainGradcheckExplicitMultiStartNavCoefTrain.ExplicitEulerGradcheckMatchesFiniteDifference: dir_rel 6.5e-4NavCoefTrain.PointMassIntegratorsDifferThe CUDA trainer refuses
point_massvalues other than the default. It isn't built locally; CI covers it.