|
23 | 23 |
|
24 | 24 | import isaaclab_tasks # noqa: F401 |
25 | 25 | from isaaclab_tasks.utils.hydra import resolve_presets |
26 | | -from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry, parse_env_cfg |
| 26 | +from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry |
| 27 | + |
| 28 | +# Bit-wise determinism is a physics-backend property, so keep these checks on |
| 29 | +# Isaac Sim PhysX rather than following a task's evolving default. Newton |
| 30 | +# MJWarp is not yet run-to-run deterministic on CUDA for the locomotion tasks. |
| 31 | +_PINNED_PHYSICS_PRESET = "isaacsim_physx" |
27 | 32 |
|
28 | 33 |
|
29 | 34 | @pytest.fixture(scope="module", autouse=True) |
@@ -100,7 +105,7 @@ def _test_environment_determinism( |
100 | 105 | device: str, |
101 | 106 | *, |
102 | 107 | num_steps: int = 100, |
103 | | - physics_preset_name: str | None = None, |
| 108 | + physics_preset_name: str = _PINNED_PHYSICS_PRESET, |
104 | 109 | deterministic_mode: str | None = None, |
105 | 110 | ): |
106 | 111 | """Check deterministic environment creation.""" |
@@ -138,21 +143,18 @@ def _obtain_transition_tuples( |
138 | 143 | device: str, |
139 | 144 | num_steps: int, |
140 | 145 | *, |
141 | | - physics_preset_name: str | None = None, |
| 146 | + physics_preset_name: str, |
142 | 147 | deterministic_mode: str | None = None, |
143 | 148 | ) -> tuple[dict, torch.Tensor]: |
144 | 149 | """Run random actions and obtain transition tuples after fixed number of steps.""" |
145 | 150 | # create a new stage |
146 | 151 | sim_utils.create_new_stage() |
147 | 152 | try: |
148 | | - # parse configuration |
149 | | - if physics_preset_name is None: |
150 | | - env_cfg = parse_env_cfg(task_name, device=device, num_envs=num_envs) |
151 | | - else: |
152 | | - env_cfg = load_cfg_from_registry(task_name, "env_cfg_entry_point") |
153 | | - env_cfg = resolve_presets(env_cfg, selected=(physics_preset_name,)) |
154 | | - env_cfg.sim.device = device |
155 | | - env_cfg.scene.num_envs = num_envs |
| 153 | + # Parse configuration with an explicit physics backend. |
| 154 | + env_cfg = load_cfg_from_registry(task_name, "env_cfg_entry_point") |
| 155 | + env_cfg = resolve_presets(env_cfg, selected=(physics_preset_name,)) |
| 156 | + env_cfg.sim.device = device |
| 157 | + env_cfg.scene.num_envs = num_envs |
156 | 158 | if deterministic_mode is not None: |
157 | 159 | assert isinstance(env_cfg.sim.physics, NewtonCfg) |
158 | 160 | env_cfg.sim.physics.deterministic_mode = deterministic_mode |
|
0 commit comments