[Newton] Declare physics presets for warp-only experimental envs#5974
[Newton] Declare physics presets for warp-only experimental envs#5974hujc7 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
This PR migrates 18 warp-only experimental environment configs from directly assigning a bare NewtonCfg to sim.physics to using the PresetCfg mechanism. Each file now declares a module-level PhysicsCfg(PresetCfg) class with a newton_mjwarp variant and default aliasing it, matching the convention already used in core/velocity envs. For direct envs, stray solver_cfg/newton_cfg class attributes are lifted into the preset class.
Findings
No issues found.
Details of review:
-
Consistent pattern — All 18 files follow the identical refactoring pattern: extract physics config into a
PhysicsCfg(PresetCfg)class → exposenewton_mjwarp→ aliasdefault = newton_mjwarp→ passPhysicsCfg()toSimulationCfg(physics=...). -
Parameter preservation — Solver parameters (
njmax,nconmax,cone,impratio,integrator,num_substeps,debug_mode, etc.) are preserved byte-for-byte in all files. No accidental parameter changes detected. -
Special cases handled correctly:
allegro_hand_warp_env_cfg.py:physics_material(static/dynamic friction) preserved inSimulationCfg.franka/joint_pos_env_cfg.py: Customdt=1/60preserved.humanoid_env_cfg.py(manager-based classic):__post_init__assignment withdt=1/120.0preserved.anymal_d: Note that this config does not specifyintegrator(unlike most others that use"implicitfast"), which matches the pre-existing behavior.
-
No behavioral change —
PhysicsCfg()instantiation resolvesdefault→newton_mjwarp→ identicalNewtonCfgas before. Bothpresets=newton_mjwarpand no-preset paths resolve to the same config. -
Import consistency —
from isaaclab_tasks.utils import PresetCfgadded cleanly in all 18 files.
Verdict
No issues found — Clean mechanical refactoring with no behavioral change. The PR correctly brings all 18 warp-only experimental envs into the PresetCfg mechanism.
Update (106a544): Large batch of changes merged into this PR branch (version bumps, changelog consolidation, lazy-export refactoring in isaaclab_experimental, ls_parallel deprecation in MJWarpSolverCfg, new NewtonSDFCollisionPropertiesCfg, task path renames, sim_launcher addition, etc.). None of these changes conflict with or alter the original physics preset refactoring for the 18 warp-only envs. The ls_parallel deprecation is consistent — configs that previously set ls_parallel=False will now simply have the field ignored via the new __post_init__ guard. No new issues introduced.
Greptile SummaryThis PR migrates 18 warp-only experimental environment configs from bare
Confidence Score: 5/5Safe to merge — purely structural refactoring with no solver parameter changes and no new runtime paths. Every changed file applies the same well-established PhysicsCfg(PresetCfg) pattern already validated in core envs. Solver parameters are faithfully transcribed, removed class attributes were confirmed unreferenced, and the physics_material / dt values are preserved where they existed. The default = newton_mjwarp alias is explicitly documented in PresetCfg's own docstring, so no novel mechanism is introduced. No files require special attention; the 4 direct env files had the largest structural change (attribute removal) but these attributes were unused. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[EnvCfg class] -->|sim=| B["SimulationCfg(physics=PhysicsCfg())"]
B -->|physics| C["PhysicsCfg(PresetCfg)"]
C -->|newton_mjwarp| D["NewtonCfg(solver_cfg=MJWarpSolverCfg(...))"]
C -->|default| D
E["No preset CLI arg"] -->|resolves via 'default'| D
F["presets=newton_mjwarp"] -->|resolves via name| D
style C fill:#d4edda,stroke:#28a745
style D fill:#cce5ff,stroke:#004085
Reviews (1): Last reviewed commit: "Declare physics presets for warp-only ex..." | Re-trigger Greptile |
The warp env configs under isaaclab_tasks_experimental assigned a bare NewtonCfg directly to sim.physics, bypassing the PresetCfg mechanism. As a result they declared no default and did not participate in `presets=` resolution the way the migrated core envs do. Wrap each env's physics in a module-level PhysicsCfg(PresetCfg) exposing a newton_mjwarp variant with default aliasing it, matching the core/velocity convention. For the direct envs, lift the stray solver_cfg and newton_cfg class attributes into the preset class.
57fb835 to
106a544
Compare
|
are presets necessary if they only support one backend? |
So there are two ways I think
|
1. Summary
isaaclab_tasks_experimentalassigned a bareNewtonCfgstraight tosim.physics, bypassing thePresetCfgmechanism — so they declared nodefaultand did not participate inpresets=resolution like the migratedcoreenvs.PhysicsCfg(PresetCfg)with anewton_mjwarpvariant anddefaultaliasing it (warp-only, so no PhysX default is invented), matching thecore/velocityconvention.solver_cfg/newton_cfgclass attributes (confirmed unreferenced) lifted into the preset class.presets=newton_mjwarp, resolution returns the sameNewtonCfgthese envs used before.2. Scope
a1, anymal_b, anymal_c, anymal_d, cassie, g1, go1, go2, h1franka, ur_10(SimulationCfgdtpreserved)ant, cartpole, humanoid(humanoid builds physics in__post_init__)allegro_hand_warp_env_cfg, and the split cfg filesant/ant_env_warp_cfg,cartpole/cartpole_warp_env_cfg,humanoid/humanoid_warp_env_cfg(allegro'sphysics_materialpreserved)3. Pattern
4. Test plan
develop(picks up the direct-env cfg split from Warp-first experimental envs implements lazy export + cfg implementation split #5916 and thels_paralleldeprecation from Deprecate MJWarp parallel linesearch #5956)./isaaclab.sh -f— clean passpy_compileon all 18 filesPhysicsCfg: bothdefault(no preset) andpresets=newton_mjwarpresolve to aNewtonCfg