Skip to content

Commit d22effd

Browse files
committed
Fix FPGS compatibility after rebase
Expose the new matrix-free warm-start constructor options with safe defaults. Preserve the current BVH configuration API and update newer MJWarp call sites to use Newton contacts.
1 parent c597205 commit d22effd

9 files changed

Lines changed: 16 additions & 69 deletions

File tree

source/isaaclab_contrib/test/coupling/test_coupler.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ def test_config_validation_requires_newton_solver_config():
177177
"post-step projection",
178178
),
179179
(MPMSolverCfg(), {}, ValueError, "must set in_place=True"),
180-
(MJWarpSolverCfg(use_mujoco_cpu=True), {}, NotImplementedError, "reset-mask lifecycle"),
180+
(
181+
MJWarpSolverCfg(use_mujoco_contacts=False, use_mujoco_cpu=True),
182+
{},
183+
NotImplementedError,
184+
"reset-mask lifecycle",
185+
),
181186
],
182187
)
183188
def test_config_validation_rejects_unsupported_nested_lifecycle(solver_cfg, entry_kwargs, error_type, match):
@@ -459,7 +464,7 @@ def _create_solver(cls, model, solver_cfg):
459464
@pytest.mark.parametrize(
460465
"solver_cfg",
461466
[
462-
MJWarpSolverCfg(),
467+
MJWarpSolverCfg(use_mujoco_contacts=False),
463468
XPBDSolverCfg(),
464469
FeatherstoneSolverCfg(),
465470
FeatherPGSSolverCfg(),
@@ -596,7 +601,7 @@ def test_proxy_selects_expected_outer_collision_pipeline(monkeypatch, case, expe
596601
resolved_entries[0].config.solver_cfg = MPMSolverCfg()
597602
resolved_entries[0].config.in_place = True
598603
else:
599-
resolved_entries[0].config.solver_cfg = MJWarpSolverCfg()
604+
resolved_entries[0].config.solver_cfg = MJWarpSolverCfg(use_mujoco_contacts=False)
600605

601606
for attribute in (
602607
"_solver",

source/isaaclab_newton/changelog.d/mesh-bvh-constructor.minor.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

source/isaaclab_newton/isaaclab_newton/physics/feather_pgs_manager_cfg.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ class FeatherPGSSolverCfg(NewtonSolverCfg):
115115
pgs_warmstart: bool = False
116116
"""Whether to warm-start impulses from the previous frame."""
117117

118+
mf_warmstart: bool = False
119+
"""Whether to reuse matched matrix-free contact impulses from the previous frame."""
120+
121+
mf_warmstart_decay: float = 1.0
122+
"""Scale applied to matched matrix-free contact impulses before reuse."""
123+
118124
pgs_mode: Literal["dense", "split", "matrix_free"] = "split"
119125
"""Constraint solve layout.
120126

source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,6 @@ def create_builder(cls, up_axis: str | None = None, **kwargs) -> ModelBuilder:
947947
cls._register_builder_attributes(builder)
948948
shape_cfg = cfg.default_shape_cfg if isinstance(cfg, NewtonCfg) else NewtonShapeCfg()
949949
checked_apply(shape_cfg, builder.default_shape_cfg)
950-
if isinstance(cfg, NewtonCfg) and cfg.mesh_bvh_constructor is not None:
951-
builder.default_bvh_cfg.mesh_constructor = cfg.mesh_bvh_constructor
952950
return builder
953951

954952
@classmethod

source/isaaclab_newton/isaaclab_newton/physics/newton_manager_cfg.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,6 @@ class NewtonCfg(PhysicsCfg):
170170
:class:`NewtonShapeCfg` for the declared fields.
171171
"""
172172

173-
mesh_bvh_constructor: Literal["lbvh", "sah", "median", "cubql"] | None = None
174-
"""BVH constructor used for triangle meshes.
175-
176-
Supported constructors are ``"lbvh"``, ``"sah"``, ``"median"``, and ``"cubql"``. Forwarded to Newton's
177-
:attr:`ModelBuilder.default_bvh_cfg` for every builder. When ``None``, Newton selects its default constructor.
178-
"""
179-
180173
simplify_meshes: bool = True
181174
"""Whether Newton replication simplifies mesh colliders to convex hulls.
182175

source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@
3131
from __future__ import annotations
3232

3333
import inspect
34-
import typing
3534
from types import SimpleNamespace
3635
from unittest import mock
3736

38-
import isaaclab_newton.physics.newton_manager as newton_manager_module
3937
import numpy as np
4038
import pytest
4139
import warp as wp
@@ -200,42 +198,6 @@ def test_newton_cfg_post_init_propagates_class_type(
200198
assert cfg.class_type.__name__ == expected_manager.__name__
201199

202200

203-
def test_newton_cfg_mesh_bvh_constructor_type_exposes_all_supported_values():
204-
"""The public type must expose every triangle-mesh BVH constructor supported by Newton."""
205-
module = inspect.getmodule(NewtonCfg)
206-
assert module is not None
207-
annotation = inspect.get_annotations(
208-
NewtonCfg,
209-
globals={**vars(module), "NewtonManager": NewtonManager, "PhysicsManager": PhysicsManager},
210-
eval_str=True,
211-
)["mesh_bvh_constructor"]
212-
literal = next(member for member in typing.get_args(annotation) if typing.get_origin(member) is typing.Literal)
213-
214-
assert set(typing.get_args(literal)) == {"lbvh", "sah", "median", "cubql"}
215-
assert type(None) in typing.get_args(annotation)
216-
217-
218-
@pytest.mark.parametrize("mesh_bvh_constructor", [None, "sah", "median"])
219-
def test_create_builder_applies_mesh_bvh_constructor_to_main_and_prototype_builders(monkeypatch, mesh_bvh_constructor):
220-
"""Main and prototype builders must share the manager-owned mesh BVH constructor."""
221-
upstream_mesh_bvh_constructor = newton_manager_module.ModelBuilder().default_bvh_cfg.mesh_constructor
222-
if mesh_bvh_constructor is None:
223-
cfg = NewtonCfg(solver_cfg=MJWarpSolverCfg(use_mujoco_contacts=False))
224-
else:
225-
cfg = NewtonCfg(
226-
solver_cfg=MJWarpSolverCfg(use_mujoco_contacts=False),
227-
mesh_bvh_constructor=mesh_bvh_constructor,
228-
)
229-
monkeypatch.setattr(PhysicsManager, "_cfg", cfg)
230-
231-
main_builder = NewtonManager.create_builder()
232-
prototype_builder = NewtonManager.create_builder()
233-
expected = upstream_mesh_bvh_constructor if mesh_bvh_constructor is None else mesh_bvh_constructor
234-
235-
assert main_builder.default_bvh_cfg.mesh_constructor == expected
236-
assert prototype_builder.default_bvh_cfg.mesh_constructor == expected
237-
238-
239201
@pytest.mark.parametrize(
240202
"num_substeps, collision_decimation, should_warn",
241203
[
@@ -526,7 +488,6 @@ def test_mpm_cuda_graph_capture_supports_only_fixed_grid(monkeypatch, grid_type,
526488

527489
def test_mpm_unsupported_cuda_graph_capture_uses_eager_execution(monkeypatch):
528490
"""Sparse/dense MPM should not enter a CUDA graph capture window."""
529-
from isaaclab.physics import PhysicsManager
530491

531492
monkeypatch.setattr(
532493
PhysicsManager,
@@ -547,7 +508,6 @@ def test_mpm_unsupported_cuda_graph_capture_uses_eager_execution(monkeypatch):
547508

548509
def test_cuda_graph_capture_uses_simulation_device(monkeypatch):
549510
"""CUDA graph capture should use the simulation device instead of Warp's default device."""
550-
from isaaclab.physics import PhysicsManager
551511

552512
captured_devices = []
553513
captured_graph = object()

source/isaaclab_newton/test/physics/test_newton_solver_reset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def test_env_reset_clears_selected_mjwarp_solver_internals(device):
6363
dt=1 / 120,
6464
physics=NewtonCfg(
6565
solver_cfg=MJWarpSolverCfg(
66+
use_mujoco_contacts=False,
6667
njmax=20,
6768
nconmax=20,
6869
integrator="implicitfast",

source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_cloth_env_cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ class PhysicsCfg(PresetCfg):
4848
newton_mjwarp_vbd: NewtonCfg = NewtonCfg(
4949
solver_cfg=CoupledMJWarpVBDSolverCfg(
5050
rigid_solver_cfg=MJWarpSolverCfg(
51+
use_mujoco_contacts=False,
5152
njmax=40,
5253
nconmax=20,
5354
ls_iterations=20,
5455
cone="pyramidal",
5556
impratio=1,
5657
integrator="implicitfast",
57-
ccd_iterations=100,
5858
),
5959
soft_solver_cfg=VBDSolverCfg(
6060
iterations=10,

source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ class PhysicsCfg(PresetCfg):
121121
cone="pyramidal",
122122
impratio=1,
123123
integrator="implicitfast",
124-
ccd_iterations=100,
125124
),
126125
soft_solver_cfg=VBDSolverCfg(
127126
iterations=10,

0 commit comments

Comments
 (0)