From 29ef6d003bd1bee263d26d7da14a44c99945afff Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Wed, 12 Aug 2026 21:01:27 -0700 Subject: [PATCH 01/14] Consolidate environment backend smoke tests --- .github/workflows/build.yaml | 3 +- .../test_cartpole_showcase_environments.py | 2 +- ...wcase_environments_with_stage_in_memory.py | 2 +- .../test_contrib_environments_smoke.py | 1 - .../test_pickplace_stack_environments.py | 1 - .../test/contrib/test_teleop_environments.py | 2 +- ...eleop_environments_with_stage_in_memory.py | 2 +- .../test/core/test_environments.py | 8 +-- .../test/core/test_environments_newton.py | 38 -------------- .../test_environments_with_stage_in_memory.py | 3 +- .../test/core/test_record_video.py | 2 +- source/isaaclab_tasks/test/env_test_utils.py | 50 ------------------- 12 files changed, 12 insertions(+), 102 deletions(-) delete mode 100644 source/isaaclab_tasks/test/core/test_environments_newton.py diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2b5cb7d41226..3b51125704ee 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -966,8 +966,7 @@ jobs: # (dexterous, many contacts). Deformable/MPM kernels are not covered; # widen if a test job reports large cache growth. include-files: >- - test_environments.py, - test_environments_newton.py + test_environments.py # No Soft/Cloth: the deformable envs depend on optional extras the CI # image does not install (Soft needs pytetwild), so they only ever fail. test-k-expr: "Cartpole or Drawer or AnymalD or Handover" diff --git a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments.py b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments.py index 38b2ce277a19..7eda602252c9 100644 --- a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments.py +++ b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments.py @@ -26,7 +26,7 @@ @pytest.mark.parametrize( "task_name", setup_environment( - include_play=False, factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True + factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True ), ) @pytest.mark.isaacsim_ci diff --git a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py index 536b209dbd47..185b24bec828 100644 --- a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py +++ b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py @@ -27,7 +27,7 @@ @pytest.mark.parametrize( "task_name", setup_environment( - include_play=False, factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True + factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True ), ) def test_cartpole_showcase_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): diff --git a/source/isaaclab_tasks/test/contrib/test_contrib_environments_smoke.py b/source/isaaclab_tasks/test/contrib/test_contrib_environments_smoke.py index ea1ae57d9fc3..4c16760fc529 100644 --- a/source/isaaclab_tasks/test/contrib/test_contrib_environments_smoke.py +++ b/source/isaaclab_tasks/test/contrib/test_contrib_environments_smoke.py @@ -42,7 +42,6 @@ @pytest.mark.parametrize( "task_name", setup_environment( - include_play=False, multi_agent=False, factory_envs=False, cartpole_showcase_envs=False, diff --git a/source/isaaclab_tasks/test/contrib/test_pickplace_stack_environments.py b/source/isaaclab_tasks/test/contrib/test_pickplace_stack_environments.py index cbc10c272b73..8801aea9f71a 100644 --- a/source/isaaclab_tasks/test/contrib/test_pickplace_stack_environments.py +++ b/source/isaaclab_tasks/test/contrib/test_pickplace_stack_environments.py @@ -36,7 +36,6 @@ @pytest.mark.parametrize( "task_name", setup_environment( - include_play=False, factory_envs=False, multi_agent=False, teleop_envs=False, diff --git a/source/isaaclab_tasks/test/contrib/test_teleop_environments.py b/source/isaaclab_tasks/test/contrib/test_teleop_environments.py index c30af100038a..980b2f3046de 100644 --- a/source/isaaclab_tasks/test/contrib/test_teleop_environments.py +++ b/source/isaaclab_tasks/test/contrib/test_teleop_environments.py @@ -37,7 +37,7 @@ @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) @pytest.mark.parametrize( - "task_name", setup_environment(include_play=False, factory_envs=False, multi_agent=False, teleop_envs=True) + "task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True) ) @pytest.mark.isaacsim_ci def test_teleop_environments(task_name, num_envs, device): diff --git a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py index 155543d0ed70..9379f0262962 100644 --- a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py +++ b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py @@ -38,7 +38,7 @@ @pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) @pytest.mark.parametrize( - "task_name", setup_environment(include_play=False, factory_envs=False, multi_agent=False, teleop_envs=True) + "task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True) ) def test_teleop_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): # skip test if stage in memory is not supported diff --git a/source/isaaclab_tasks/test/core/test_environments.py b/source/isaaclab_tasks/test/core/test_environments.py index 5e37814c2058..3947b9ec3e23 100644 --- a/source/isaaclab_tasks/test/core/test_environments.py +++ b/source/isaaclab_tasks/test/core/test_environments.py @@ -21,17 +21,19 @@ # Local imports should be imported last from env_test_utils import _run_environments, setup_environment # isort: skip +@pytest.mark.parametrize("physics_preset_name", ["newton_mjwarp", "physx", "isaacsim_physx"]) @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) @pytest.mark.parametrize( "task_name", setup_environment( - include_play=False, multi_agent=False, tier="core", ), ) @pytest.mark.isaacsim_ci -def test_environments(task_name, num_envs, device): +def test_environments(task_name, physics_preset_name, num_envs, device): # run environments without stage in memory - _run_environments(task_name, device, num_envs, create_stage_in_memory=False) + _run_environments( + task_name, device, num_envs, create_stage_in_memory=False, physics_preset_name=physics_preset_name + ) diff --git a/source/isaaclab_tasks/test/core/test_environments_newton.py b/source/isaaclab_tasks/test/core/test_environments_newton.py deleted file mode 100644 index 8618b04c6c34..000000000000 --- a/source/isaaclab_tasks/test/core/test_environments_newton.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Launch Isaac Sim Simulator first.""" - -from isaaclab.app import AppLauncher - -# launch the simulator -app_launcher = AppLauncher(headless=True, enable_cameras=True, limit_cpu_threads=1) -simulation_app = app_launcher.app - - -"""Rest everything follows.""" - -import pytest - -import isaaclab_tasks # noqa: F401 - -# Local imports should be imported last -from env_test_utils import _run_environments, setup_environment # isort: skip - - -@pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) -@pytest.mark.parametrize( - "task_name", - setup_environment( - include_play=False, - multi_agent=False, - newton_mjwarp_envs=True, - tier="core", - ), -) -@pytest.mark.newton_ci -def test_environments_newton(task_name, num_envs, device): - # run environments with MJWarp physics preset - _run_environments(task_name, device, num_envs, physics_preset_name="newton_mjwarp", create_stage_in_memory=False) diff --git a/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py index 1457b01f9c96..ad6185ed45a6 100644 --- a/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py +++ b/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py @@ -29,7 +29,7 @@ # TODO(mtrepte): re-enable with fabric cloning fix # @pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) -# @pytest.mark.parametrize("task_name", setup_environment(include_play=False,factory_envs=False, multi_agent=False)) +# @pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False)) # def test_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): # # skip test if stage in memory is not supported # if get_isaac_sim_version().major < 5: @@ -43,7 +43,6 @@ @pytest.mark.parametrize( "task_name", setup_environment( - include_play=False, multi_agent=False, tier="core", ), diff --git a/source/isaaclab_tasks/test/core/test_record_video.py b/source/isaaclab_tasks/test/core/test_record_video.py index 329d42b5249a..46748e97cc8f 100644 --- a/source/isaaclab_tasks/test/core/test_record_video.py +++ b/source/isaaclab_tasks/test/core/test_record_video.py @@ -41,7 +41,7 @@ def setup_video_params(): return num_envs, device, video_length -@pytest.mark.parametrize("task_name", setup_environment(include_play=True, tier="core")) +@pytest.mark.parametrize("task_name", setup_environment(tier="core")) def test_record_video(task_name, setup_video_params): """Run random actions agent with internal VideoRecorder capturing from the active visualizer.""" num_envs, device, video_length = setup_video_params diff --git a/source/isaaclab_tasks/test/env_test_utils.py b/source/isaaclab_tasks/test/env_test_utils.py index 3547c175fd66..da645a3234e5 100644 --- a/source/isaaclab_tasks/test/env_test_utils.py +++ b/source/isaaclab_tasks/test/env_test_utils.py @@ -76,49 +76,18 @@ def _task_tier(task_spec) -> str | None: return None -def _has_physics_preset(raw_cfg, preset_name: str) -> bool: - """Check if a raw (unresolved) env config has a named physics preset. - - Must be called with the result of :func:`load_cfg_from_registry`, not - :func:`parse_env_cfg`, because the latter resolves all PresetCfg wrappers - to their default before returning. - - Args: - raw_cfg: Raw env config from :func:`load_cfg_from_registry`. - preset_name: Name of the preset to check for (e.g., 'newton_mjwarp'). - - Returns: - True if ``raw_cfg.sim.physics`` is a PresetCfg with the given preset field. - """ - if isinstance(raw_cfg, dict): - return False - # If the top-level cfg is itself a PresetCfg wrapper, unwrap to its default. - env_cfg = raw_cfg - if ( - hasattr(env_cfg, "__dataclass_fields__") - and hasattr(env_cfg, "default") - and not hasattr(type(env_cfg), "class_type") - ): - env_cfg = env_cfg.default - physics = getattr(getattr(env_cfg, "sim", None), "physics", None) - return physics is not None and hasattr(physics, preset_name) - - def setup_environment( - include_play: bool = False, factory_envs: bool | None = None, multi_agent: bool | None = None, teleop_envs: bool | None = None, cartpole_showcase_envs: bool | None = None, pickplace_stack_envs: bool | None = None, - newton_mjwarp_envs: bool | None = None, tier: str | None = None, ) -> list[str]: """ Acquire all registered Isaac environment task IDs with optional filters. Args: - include_play: If True, include environments ending in 'Play-v0'. factory_envs: - True: include only Factory environments - False: exclude Factory environments @@ -139,10 +108,6 @@ def setup_environment( - True: include only PickPlace/Stack environments - False: exclude PickPlace/Stack environments - None: include all environments regardless of pick-place/stack type - newton_mjwarp_envs: - - True: include only environments that have an MJWarp physics preset. - - False: exclude environments that have an MJWarp physics preset. - - None: include all environments regardless of MJWarp preset availability. tier: - "core": include only core environments (registered under ``isaaclab_tasks.core``). - "contrib": include only contributed environments (registered under ``isaaclab_tasks.contrib``). @@ -161,10 +126,6 @@ def setup_environment( if "Isaac" not in task_spec.id: continue - # filter Play environments, if needed - if not include_play and task_spec.id.endswith("Play-v0"): - continue - # apply core/contrib tier filter if tier is not None and _task_tier(task_spec) != tier: continue @@ -211,17 +172,6 @@ def setup_environment( continue # if None: no filter - # apply MJWarp preset filter - if newton_mjwarp_envs is not None: - # Use load_cfg_from_registry (not parse_env_cfg) so that the PresetCfg - # wrapper on sim.physics is not yet resolved to its default. - raw_cfg = load_cfg_from_registry(task_spec.id, "env_cfg_entry_point") - has_newton_mjwarp = _has_physics_preset(raw_cfg, "newton_mjwarp") - if (newton_mjwarp_envs is True and not has_newton_mjwarp) or ( - newton_mjwarp_envs is False and has_newton_mjwarp - ): - continue - # if None: no filter registered_tasks.append(task_spec.id) From ccdd67a772277b6183dd1202c36dd714ea7b0638 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Wed, 12 Aug 2026 21:03:56 -0700 Subject: [PATCH 02/14] Default manipulation tasks to Newton --- .../isaaclab_tasks/core/cabinet/cabinet_env_cfg.py | 4 ++-- .../core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py | 3 ++- .../isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py index b58fcd4aec26..d09aeec2de50 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py @@ -102,7 +102,6 @@ class CabinetSimCfg(PresetCfg): physx: SimulationCfg = isaacsim_physx.replace( physics=PhysxAutoCfg(isaacsim_physx=isaacsim_physx.physics, ovphysx=ovphysx.physics) ) - default: SimulationCfg = isaacsim_physx newton_mjwarp: SimulationCfg = SimulationCfg( dt=1 / 600, render_interval=1, @@ -125,6 +124,7 @@ class CabinetSimCfg(PresetCfg): default_visualizer_cfg=VisualizerCfg(eye=(-2.0, 2.0, 2.0), lookat=(0.8, 0.0, 0.5)), physics=NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)), ) + default: SimulationCfg = newton_mjwarp @configclass @@ -138,9 +138,9 @@ class CabinetDecimationCfg(PresetCfg): isaacsim_physx: int = 1 ovphysx: int = isaacsim_physx physx: int = isaacsim_physx - default: int = isaacsim_physx newton_mjwarp: int = 10 newton_kamino: int = 10 + default: int = newton_mjwarp ## diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py index 3b751997e266..05d71e9839d6 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py @@ -43,7 +43,8 @@ class KukaAllegroPhysicsCfg(lift.PhysicsCfg): gpu_found_lost_pairs_capacity=2**26, ) physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - default = isaacsim_physx + newton_mjwarp = lift.PhysicsCfg().newton_mjwarp + default = newton_mjwarp @configclass diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py index 46efc8bcd5c0..551d027e3d1f 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py @@ -509,7 +509,7 @@ class PhysicsCfg(PresetCfg): debug_mode=False, ) physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx) - default = isaacsim_physx + default = newton_mjwarp @configclass From 8195d01c6e1a649f088499f0a1b937db7e4652d2 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Wed, 12 Aug 2026 21:05:06 -0700 Subject: [PATCH 03/14] Document manipulation Newton defaults --- .../changelog.d/default-newton-manipulation.minor.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 source/isaaclab_tasks/changelog.d/default-newton-manipulation.minor.rst diff --git a/source/isaaclab_tasks/changelog.d/default-newton-manipulation.minor.rst b/source/isaaclab_tasks/changelog.d/default-newton-manipulation.minor.rst new file mode 100644 index 000000000000..983870582102 --- /dev/null +++ b/source/isaaclab_tasks/changelog.d/default-newton-manipulation.minor.rst @@ -0,0 +1,5 @@ +Changed +^^^^^^^ + +* **Breaking:** Changed the Cabinet and Lift task families to use Newton MJWarp + by default. Pass an explicit physics preset to retain Isaac Sim PhysX. From 3ce7b3a7afc7303cc2cbc3672093e55fdcbe0dea Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 00:56:31 -0700 Subject: [PATCH 04/14] Collect environment objects before teardown --- source/isaaclab_tasks/test/env_test_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/isaaclab_tasks/test/env_test_utils.py b/source/isaaclab_tasks/test/env_test_utils.py index da645a3234e5..c28dd3e699d9 100644 --- a/source/isaaclab_tasks/test/env_test_utils.py +++ b/source/isaaclab_tasks/test/env_test_utils.py @@ -5,6 +5,7 @@ """Shared test utilities for Isaac Lab environments.""" +import gc import importlib import os import sys @@ -471,6 +472,11 @@ def _check_random_actions( if env is not None: env.close() + # Drop unreachable environment objects while the device is still alive. Warp arrays + # free device memory from a finalizer, so collect them before the simulation teardown + # destroys their streams. + gc.collect() + # Clear the simulation context singleton (also closes the USD context stage) SimulationContext.clear_instance() From 847ebce6eb702e8c22c827609a74f9860fa691a2 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 00:57:22 -0700 Subject: [PATCH 05/14] Update preset tests for Newton defaults --- .../test/core/test_preset_kit_decision.py | 42 ++++++++++--------- .../test/core/test_runtime_compatibility.py | 22 +++++----- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/source/isaaclab_tasks/test/core/test_preset_kit_decision.py b/source/isaaclab_tasks/test/core/test_preset_kit_decision.py index 73a119182f3c..5b14f3c7934e 100644 --- a/source/isaaclab_tasks/test/core/test_preset_kit_decision.py +++ b/source/isaaclab_tasks/test/core/test_preset_kit_decision.py @@ -15,6 +15,7 @@ import gymnasium as gym import pytest +from isaaclab_newton.physics import NewtonCfg from isaaclab_ov.physics import OvPhysxCfg from isaaclab_ov.renderers import OVRTXRendererCfg from isaaclab_physx.physics import PhysxCfg @@ -87,11 +88,12 @@ def test_isaacsim_physx_is_physics_selector(): assert "isaacsim_physx" in preset_map[PresetTarget.PHYSICS] -def test_registered_task_physx_presets_keep_auto_selection_explicit(): - """PhysX defaults are concrete while ``physx`` remains the automatic selector.""" +def test_core_task_physx_presets_keep_auto_selection_explicit(): + """Core tasks retain explicit PhysX variants alongside automatic ``physx``.""" for task_id, task_spec in gym.registry.items(): - if not task_id.startswith(("Isaac-", "IsaacContrib-")) or "env_cfg_entry_point" not in task_spec.kwargs: + entry_point = task_spec.kwargs.get("env_cfg_entry_point", "") + if not task_id.startswith("Isaac-") or "isaaclab_tasks.core" not in str(entry_point): continue env_cfg = load_cfg_from_registry(task_id, "env_cfg_entry_point") presets = collect_presets(env_cfg) @@ -137,24 +139,24 @@ def test_preset_mjwarp_ovrtx_does_not_need_kit(): assert needs_kit is False -def test_preset_rtx_with_default_physx_resolves_to_isaac_sim_backends(): - """Automatic RTX follows the default concrete Isaac Sim PhysX backend.""" +def test_preset_rtx_with_default_newton_resolves_to_isaac_sim_backends(): + """Explicit RTX retains the default Newton physics while requiring Isaac Sim.""" env_cfg = _resolve_with_presets("rtx") config_scan = _resolve_runtime_renderer(env_cfg) - assert isinstance(env_cfg.sim.physics, PhysxCfg) - assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg) - assert config_scan.needs_kit is True + assert isinstance(env_cfg.sim.physics, NewtonCfg) + assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg) + assert config_scan.needs_kit is False -def test_renderer_selector_rtx_with_default_physx_resolves_to_isaac_sim_backends(): - """The RTX selector follows the default concrete Isaac Sim PhysX backend.""" +def test_renderer_selector_rtx_with_default_newton_resolves_to_isaac_sim_backends(): + """The RTX selector retains the default Newton physics while requiring Isaac Sim.""" env_cfg = _resolve_with_args("renderer=rtx") config_scan = _resolve_runtime_renderer(env_cfg) - assert isinstance(env_cfg.sim.physics, PhysxCfg) - assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg) - assert config_scan.needs_kit is True + assert isinstance(env_cfg.sim.physics, NewtonCfg) + assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg) + assert config_scan.needs_kit is False def test_renderer_selector_physx_rtx_resolves_to_ovphysx_without_kit(): @@ -227,20 +229,20 @@ def test_preset_mjwarp_newton_renderer_does_not_need_kit(): assert needs_kit is False -def test_preset_physx_with_default_kit_camera_resolves_to_physx(): - """Automatic PhysX resolves to Isaac Sim PhysX when the default camera requires Kit.""" +def test_preset_physx_with_default_newton_camera_resolves_to_ovphysx(): + """Automatic PhysX resolves to OvPhysX when the default camera is kitless.""" env_cfg = _resolve_with_presets("physx") config_scan = scan(env_cfg) - assert isinstance(env_cfg.sim.physics, PhysxCfg) - assert config_scan.needs_kit is True + assert isinstance(env_cfg.sim.physics, OvPhysxCfg) + assert config_scan.needs_kit is False -def test_preset_default_needs_kit(): - """Default concrete Isaac Sim PhysX plus Isaac RTX requires Kit.""" +def test_preset_default_is_kitless(): + """Default Newton MJWarp plus Newton renderer does not require Kit.""" env_cfg = _resolve_with_presets("default") needs_kit = scan(env_cfg).needs_kit - assert needs_kit is True + assert needs_kit is False def test_preset_mjwarp_isaac_rtx_needs_kit(): diff --git a/source/isaaclab_tasks/test/core/test_runtime_compatibility.py b/source/isaaclab_tasks/test/core/test_runtime_compatibility.py index 6ca07657def5..30acafbf7622 100644 --- a/source/isaaclab_tasks/test/core/test_runtime_compatibility.py +++ b/source/isaaclab_tasks/test/core/test_runtime_compatibility.py @@ -18,6 +18,7 @@ import sys import pytest +from isaaclab_newton.physics import NewtonCfg from isaaclab_ov.physics import OvPhysxCfg from isaaclab_ov.renderers import OVRTXRendererCfg from isaaclab_physx.physics import PhysxCfg @@ -226,13 +227,14 @@ def test_newton_plus_ovrtx_is_valid(): validate_runtime_compatibility(env_cfg) -def test_default_isaacsim_physx_plus_ovrtx_raises(): - """The concrete default Isaac Sim PhysX backend is incompatible with OVRTX.""" +def test_default_newton_plus_ovrtx_is_valid(): + """The default Newton backend is compatible with OVRTX.""" env_cfg = _resolve_with_presets("ovrtx") - assert isinstance(env_cfg.sim.physics, PhysxCfg) - with pytest.raises(ValueError, match="PhysxCfg"): - validate_runtime_compatibility(env_cfg) + assert isinstance(env_cfg.sim.physics, NewtonCfg) + config_scan = validate_runtime_compatibility(env_cfg) + assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg) + assert config_scan.needs_kit is False def test_explicit_auto_physx_plus_ovrtx_resolves_to_ovphysx(): @@ -302,14 +304,14 @@ def test_default_preset_is_valid(): validate_runtime_compatibility(env_cfg) -def test_rtx_with_default_physx_is_valid_and_resolves_to_isaac_sim_backends(): - """The RTX selector follows the default concrete Isaac Sim PhysX backend.""" +def test_rtx_with_default_newton_is_valid_and_resolves_to_isaac_sim_backends(): + """The RTX selector retains default Newton physics and requires Isaac Sim.""" env_cfg = _resolve_with_presets("rtx") config_scan = validate_runtime_compatibility(env_cfg) - assert isinstance(env_cfg.sim.physics, PhysxCfg) - assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg) - assert config_scan.needs_kit is True + assert isinstance(env_cfg.sim.physics, NewtonCfg) + assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg) + assert config_scan.needs_kit is False def test_renderer_selector_physx_rtx_is_valid_and_resolves_to_ovphysx_and_ovrtx(): From 72292f48ebabe4ad27437eec02641341786744ab Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 00:59:26 -0700 Subject: [PATCH 06/14] Revert "Update preset tests for Newton defaults" This reverts commit 847ebce6eb702e8c22c827609a74f9860fa691a2. --- .../test/core/test_preset_kit_decision.py | 42 +++++++++---------- .../test/core/test_runtime_compatibility.py | 22 +++++----- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/source/isaaclab_tasks/test/core/test_preset_kit_decision.py b/source/isaaclab_tasks/test/core/test_preset_kit_decision.py index 5b14f3c7934e..73a119182f3c 100644 --- a/source/isaaclab_tasks/test/core/test_preset_kit_decision.py +++ b/source/isaaclab_tasks/test/core/test_preset_kit_decision.py @@ -15,7 +15,6 @@ import gymnasium as gym import pytest -from isaaclab_newton.physics import NewtonCfg from isaaclab_ov.physics import OvPhysxCfg from isaaclab_ov.renderers import OVRTXRendererCfg from isaaclab_physx.physics import PhysxCfg @@ -88,12 +87,11 @@ def test_isaacsim_physx_is_physics_selector(): assert "isaacsim_physx" in preset_map[PresetTarget.PHYSICS] -def test_core_task_physx_presets_keep_auto_selection_explicit(): - """Core tasks retain explicit PhysX variants alongside automatic ``physx``.""" +def test_registered_task_physx_presets_keep_auto_selection_explicit(): + """PhysX defaults are concrete while ``physx`` remains the automatic selector.""" for task_id, task_spec in gym.registry.items(): - entry_point = task_spec.kwargs.get("env_cfg_entry_point", "") - if not task_id.startswith("Isaac-") or "isaaclab_tasks.core" not in str(entry_point): + if not task_id.startswith(("Isaac-", "IsaacContrib-")) or "env_cfg_entry_point" not in task_spec.kwargs: continue env_cfg = load_cfg_from_registry(task_id, "env_cfg_entry_point") presets = collect_presets(env_cfg) @@ -139,24 +137,24 @@ def test_preset_mjwarp_ovrtx_does_not_need_kit(): assert needs_kit is False -def test_preset_rtx_with_default_newton_resolves_to_isaac_sim_backends(): - """Explicit RTX retains the default Newton physics while requiring Isaac Sim.""" +def test_preset_rtx_with_default_physx_resolves_to_isaac_sim_backends(): + """Automatic RTX follows the default concrete Isaac Sim PhysX backend.""" env_cfg = _resolve_with_presets("rtx") config_scan = _resolve_runtime_renderer(env_cfg) - assert isinstance(env_cfg.sim.physics, NewtonCfg) - assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg) - assert config_scan.needs_kit is False + assert isinstance(env_cfg.sim.physics, PhysxCfg) + assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg) + assert config_scan.needs_kit is True -def test_renderer_selector_rtx_with_default_newton_resolves_to_isaac_sim_backends(): - """The RTX selector retains the default Newton physics while requiring Isaac Sim.""" +def test_renderer_selector_rtx_with_default_physx_resolves_to_isaac_sim_backends(): + """The RTX selector follows the default concrete Isaac Sim PhysX backend.""" env_cfg = _resolve_with_args("renderer=rtx") config_scan = _resolve_runtime_renderer(env_cfg) - assert isinstance(env_cfg.sim.physics, NewtonCfg) - assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg) - assert config_scan.needs_kit is False + assert isinstance(env_cfg.sim.physics, PhysxCfg) + assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg) + assert config_scan.needs_kit is True def test_renderer_selector_physx_rtx_resolves_to_ovphysx_without_kit(): @@ -229,20 +227,20 @@ def test_preset_mjwarp_newton_renderer_does_not_need_kit(): assert needs_kit is False -def test_preset_physx_with_default_newton_camera_resolves_to_ovphysx(): - """Automatic PhysX resolves to OvPhysX when the default camera is kitless.""" +def test_preset_physx_with_default_kit_camera_resolves_to_physx(): + """Automatic PhysX resolves to Isaac Sim PhysX when the default camera requires Kit.""" env_cfg = _resolve_with_presets("physx") config_scan = scan(env_cfg) - assert isinstance(env_cfg.sim.physics, OvPhysxCfg) - assert config_scan.needs_kit is False + assert isinstance(env_cfg.sim.physics, PhysxCfg) + assert config_scan.needs_kit is True -def test_preset_default_is_kitless(): - """Default Newton MJWarp plus Newton renderer does not require Kit.""" +def test_preset_default_needs_kit(): + """Default concrete Isaac Sim PhysX plus Isaac RTX requires Kit.""" env_cfg = _resolve_with_presets("default") needs_kit = scan(env_cfg).needs_kit - assert needs_kit is False + assert needs_kit is True def test_preset_mjwarp_isaac_rtx_needs_kit(): diff --git a/source/isaaclab_tasks/test/core/test_runtime_compatibility.py b/source/isaaclab_tasks/test/core/test_runtime_compatibility.py index 30acafbf7622..6ca07657def5 100644 --- a/source/isaaclab_tasks/test/core/test_runtime_compatibility.py +++ b/source/isaaclab_tasks/test/core/test_runtime_compatibility.py @@ -18,7 +18,6 @@ import sys import pytest -from isaaclab_newton.physics import NewtonCfg from isaaclab_ov.physics import OvPhysxCfg from isaaclab_ov.renderers import OVRTXRendererCfg from isaaclab_physx.physics import PhysxCfg @@ -227,14 +226,13 @@ def test_newton_plus_ovrtx_is_valid(): validate_runtime_compatibility(env_cfg) -def test_default_newton_plus_ovrtx_is_valid(): - """The default Newton backend is compatible with OVRTX.""" +def test_default_isaacsim_physx_plus_ovrtx_raises(): + """The concrete default Isaac Sim PhysX backend is incompatible with OVRTX.""" env_cfg = _resolve_with_presets("ovrtx") - assert isinstance(env_cfg.sim.physics, NewtonCfg) - config_scan = validate_runtime_compatibility(env_cfg) - assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg) - assert config_scan.needs_kit is False + assert isinstance(env_cfg.sim.physics, PhysxCfg) + with pytest.raises(ValueError, match="PhysxCfg"): + validate_runtime_compatibility(env_cfg) def test_explicit_auto_physx_plus_ovrtx_resolves_to_ovphysx(): @@ -304,14 +302,14 @@ def test_default_preset_is_valid(): validate_runtime_compatibility(env_cfg) -def test_rtx_with_default_newton_is_valid_and_resolves_to_isaac_sim_backends(): - """The RTX selector retains default Newton physics and requires Isaac Sim.""" +def test_rtx_with_default_physx_is_valid_and_resolves_to_isaac_sim_backends(): + """The RTX selector follows the default concrete Isaac Sim PhysX backend.""" env_cfg = _resolve_with_presets("rtx") config_scan = validate_runtime_compatibility(env_cfg) - assert isinstance(env_cfg.sim.physics, NewtonCfg) - assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg) - assert config_scan.needs_kit is False + assert isinstance(env_cfg.sim.physics, PhysxCfg) + assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg) + assert config_scan.needs_kit is True def test_renderer_selector_physx_rtx_is_valid_and_resolves_to_ovphysx_and_ovrtx(): From ca111abccd6543314870ebb5c0a192a6dbf76ce3 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 01:08:55 -0700 Subject: [PATCH 07/14] Format environment test updates --- .../test/contrib/test_cartpole_showcase_environments.py | 4 +--- ...st_cartpole_showcase_environments_with_stage_in_memory.py | 4 +--- .../isaaclab_tasks/test/contrib/test_teleop_environments.py | 4 +--- .../contrib/test_teleop_environments_with_stage_in_memory.py | 4 +--- source/isaaclab_tasks/test/core/test_environments.py | 2 +- source/isaaclab_tasks/test/core/test_preset_kit_decision.py | 5 +++-- source/isaaclab_tasks/test/env_test_utils.py | 1 - 7 files changed, 8 insertions(+), 16 deletions(-) diff --git a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments.py b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments.py index 7eda602252c9..207f8ec10753 100644 --- a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments.py +++ b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments.py @@ -25,9 +25,7 @@ @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) @pytest.mark.parametrize( "task_name", - setup_environment( - factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True - ), + setup_environment(factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True), ) @pytest.mark.isaacsim_ci def test_cartpole_showcase_environments(task_name, num_envs, device): diff --git a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py index 185b24bec828..2ac712a34ba3 100644 --- a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py +++ b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py @@ -26,9 +26,7 @@ @pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) @pytest.mark.parametrize( "task_name", - setup_environment( - factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True - ), + setup_environment(factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True), ) def test_cartpole_showcase_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): # skip test if stage in memory is not supported diff --git a/source/isaaclab_tasks/test/contrib/test_teleop_environments.py b/source/isaaclab_tasks/test/contrib/test_teleop_environments.py index 980b2f3046de..11e0fab76008 100644 --- a/source/isaaclab_tasks/test/contrib/test_teleop_environments.py +++ b/source/isaaclab_tasks/test/contrib/test_teleop_environments.py @@ -36,9 +36,7 @@ @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) -@pytest.mark.parametrize( - "task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True) -) +@pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True)) @pytest.mark.isaacsim_ci def test_teleop_environments(task_name, num_envs, device): # run teleop environments without stage in memory diff --git a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py index 9379f0262962..f2cfbd83f2b2 100644 --- a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py +++ b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py @@ -37,9 +37,7 @@ @pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) -@pytest.mark.parametrize( - "task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True) -) +@pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True)) def test_teleop_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): # skip test if stage in memory is not supported if get_isaac_sim_version().major < 5: diff --git a/source/isaaclab_tasks/test/core/test_environments.py b/source/isaaclab_tasks/test/core/test_environments.py index 3947b9ec3e23..ec1093971e64 100644 --- a/source/isaaclab_tasks/test/core/test_environments.py +++ b/source/isaaclab_tasks/test/core/test_environments.py @@ -21,8 +21,8 @@ # Local imports should be imported last from env_test_utils import _run_environments, setup_environment # isort: skip -@pytest.mark.parametrize("physics_preset_name", ["newton_mjwarp", "physx", "isaacsim_physx"]) +@pytest.mark.parametrize("physics_preset_name", ["newton_mjwarp", "physx", "isaacsim_physx"]) @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) @pytest.mark.parametrize( "task_name", diff --git a/source/isaaclab_tasks/test/core/test_preset_kit_decision.py b/source/isaaclab_tasks/test/core/test_preset_kit_decision.py index 73a119182f3c..515ca8186f99 100644 --- a/source/isaaclab_tasks/test/core/test_preset_kit_decision.py +++ b/source/isaaclab_tasks/test/core/test_preset_kit_decision.py @@ -88,10 +88,11 @@ def test_isaacsim_physx_is_physics_selector(): def test_registered_task_physx_presets_keep_auto_selection_explicit(): - """PhysX defaults are concrete while ``physx`` remains the automatic selector.""" + """Core tasks retain explicit PhysX variants alongside automatic ``physx``.""" for task_id, task_spec in gym.registry.items(): - if not task_id.startswith(("Isaac-", "IsaacContrib-")) or "env_cfg_entry_point" not in task_spec.kwargs: + entry_point = task_spec.kwargs.get("env_cfg_entry_point", "") + if not task_id.startswith("Isaac-") or "isaaclab_tasks.core" not in str(entry_point): continue env_cfg = load_cfg_from_registry(task_id, "env_cfg_entry_point") presets = collect_presets(env_cfg) diff --git a/source/isaaclab_tasks/test/env_test_utils.py b/source/isaaclab_tasks/test/env_test_utils.py index c28dd3e699d9..880a8668bedc 100644 --- a/source/isaaclab_tasks/test/env_test_utils.py +++ b/source/isaaclab_tasks/test/env_test_utils.py @@ -173,7 +173,6 @@ def setup_environment( continue # if None: no filter - registered_tasks.append(task_spec.id) # sort environments alphabetically From 237d2f3ef2d355b74e6a5d60f9eb693e03eb29ee Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 12:15:09 -0700 Subject: [PATCH 08/14] Restrict core smoke tests to supported backends --- .../test/core/test_environments.py | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/source/isaaclab_tasks/test/core/test_environments.py b/source/isaaclab_tasks/test/core/test_environments.py index ec1093971e64..75a7de889daf 100644 --- a/source/isaaclab_tasks/test/core/test_environments.py +++ b/source/isaaclab_tasks/test/core/test_environments.py @@ -16,21 +16,45 @@ import pytest +from isaaclab.physics import PhysicsCfg + import isaaclab_tasks # noqa: F401 +from isaaclab_tasks.utils.hydra import collect_presets +from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry # Local imports should be imported last from env_test_utils import _run_environments, setup_environment # isort: skip -@pytest.mark.parametrize("physics_preset_name", ["newton_mjwarp", "physx", "isaacsim_physx"]) +_PHYSICS_PRESET_NAMES = ("newton_mjwarp", "physx", "isaacsim_physx") + + +def _core_physics_params() -> list: + """Return core task/backend pairs for explicitly supported physics presets.""" + params = [] + for task_param in setup_environment(multi_agent=False, tier="core"): + task_name = getattr(task_param, "values", (task_param,))[0] + marks = getattr(task_param, "marks", ()) + env_cfg = load_cfg_from_registry(task_name, "env_cfg_entry_point") + physics_preset_groups = collect_presets(env_cfg).values() + for physics_preset_name in _PHYSICS_PRESET_NAMES: + if any( + physics_preset_name in preset_group and isinstance(preset_group[physics_preset_name], PhysicsCfg) + for preset_group in physics_preset_groups + ): + params.append( + pytest.param( + task_name, + physics_preset_name, + id=f"{task_name}-{physics_preset_name}", + marks=marks, + ) + ) + return params + + +@pytest.mark.parametrize("task_name, physics_preset_name", _core_physics_params()) @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) -@pytest.mark.parametrize( - "task_name", - setup_environment( - multi_agent=False, - tier="core", - ), -) @pytest.mark.isaacsim_ci def test_environments(task_name, physics_preset_name, num_envs, device): # run environments without stage in memory From 5e5af54cc2f0809eecd50471f921f6522ab9ba62 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 17:08:20 -0700 Subject: [PATCH 09/14] Split environment smoke tests by backend --- ...wcase_environments_with_stage_in_memory.py | 37 ------------ ...eleop_environments_with_stage_in_memory.py | 47 ---------------- .../test/core/test_environments.py | 40 +------------ .../core/test_environments_isaacsim_physx.py | 31 ++++++++++ .../test/core/test_environments_newton.py | 31 ++++++++++ .../test_environments_with_stage_in_memory.py | 56 ------------------- source/isaaclab_tasks/test/env_test_utils.py | 36 +++++------- tools/test_settings.py | 8 +-- 8 files changed, 80 insertions(+), 206 deletions(-) delete mode 100644 source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py delete mode 100644 source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py create mode 100644 source/isaaclab_tasks/test/core/test_environments_isaacsim_physx.py create mode 100644 source/isaaclab_tasks/test/core/test_environments_newton.py delete mode 100644 source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py diff --git a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py deleted file mode 100644 index 2ac712a34ba3..000000000000 --- a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Launch Isaac Sim Simulator first.""" - -from isaaclab.app import AppLauncher - -# launch the simulator -app_launcher = AppLauncher(headless=True, enable_cameras=True) -simulation_app = app_launcher.app - -from isaaclab.utils.version import get_isaac_sim_version - -"""Rest everything follows.""" - -import pytest - -import isaaclab_tasks # noqa: F401 - -# Local imports should be imported last -from env_test_utils import _run_environments, setup_environment # isort: skip - - -@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) -@pytest.mark.parametrize( - "task_name", - setup_environment(factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True), -) -def test_cartpole_showcase_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): - # skip test if stage in memory is not supported - if get_isaac_sim_version().major < 5: - pytest.skip("Stage in memory is not supported in this version of Isaac Sim") - - # run cartpole showcase environments with stage in memory - _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py deleted file mode 100644 index f2cfbd83f2b2..000000000000 --- a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Launch Isaac Sim Simulator first.""" - -import sys - -# Import pinocchio in the main script to force the use of the dependencies -# installed by IsaacLab and not the one installed by Isaac Sim. -# pinocchio is required by the Pink IK controller used in some teleop environments -if sys.platform != "win32": - import pinocchio # noqa: F401 - -from isaaclab.app import AppLauncher - -# launch the simulator -app_launcher = AppLauncher(headless=True, enable_cameras=True) -simulation_app = app_launcher.app - -from isaaclab.utils.version import get_isaac_sim_version - -"""Rest everything follows.""" - -import pytest - -import isaaclab_tasks # noqa: F401 - -# Local imports should be imported last -from env_test_utils import _run_environments, setup_environment # isort: skip - - -# Teleop environments require isaacteleop / isaaclab_teleop and may interfere -# with other environment tests when run in the same process. They are collected -# separately here so they execute in their own test session. - - -@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) -@pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True)) -def test_teleop_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): - # skip test if stage in memory is not supported - if get_isaac_sim_version().major < 5: - pytest.skip("Stage in memory is not supported in this version of Isaac Sim") - - # run teleop environments with stage in memory - _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/core/test_environments.py b/source/isaaclab_tasks/test/core/test_environments.py index 75a7de889daf..5362b78a32b5 100644 --- a/source/isaaclab_tasks/test/core/test_environments.py +++ b/source/isaaclab_tasks/test/core/test_environments.py @@ -16,48 +16,14 @@ import pytest -from isaaclab.physics import PhysicsCfg - import isaaclab_tasks # noqa: F401 -from isaaclab_tasks.utils.hydra import collect_presets -from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry # Local imports should be imported last from env_test_utils import _run_environments, setup_environment # isort: skip -_PHYSICS_PRESET_NAMES = ("newton_mjwarp", "physx", "isaacsim_physx") - - -def _core_physics_params() -> list: - """Return core task/backend pairs for explicitly supported physics presets.""" - params = [] - for task_param in setup_environment(multi_agent=False, tier="core"): - task_name = getattr(task_param, "values", (task_param,))[0] - marks = getattr(task_param, "marks", ()) - env_cfg = load_cfg_from_registry(task_name, "env_cfg_entry_point") - physics_preset_groups = collect_presets(env_cfg).values() - for physics_preset_name in _PHYSICS_PRESET_NAMES: - if any( - physics_preset_name in preset_group and isinstance(preset_group[physics_preset_name], PhysicsCfg) - for preset_group in physics_preset_groups - ): - params.append( - pytest.param( - task_name, - physics_preset_name, - id=f"{task_name}-{physics_preset_name}", - marks=marks, - ) - ) - return params - - -@pytest.mark.parametrize("task_name, physics_preset_name", _core_physics_params()) +@pytest.mark.parametrize("task_name", setup_environment(multi_agent=False, physics_preset_name="physx", tier="core")) @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) @pytest.mark.isaacsim_ci -def test_environments(task_name, physics_preset_name, num_envs, device): - # run environments without stage in memory - _run_environments( - task_name, device, num_envs, create_stage_in_memory=False, physics_preset_name=physics_preset_name - ) +def test_environments(task_name, num_envs, device): + _run_environments(task_name, device, num_envs, physics_preset_name="physx") diff --git a/source/isaaclab_tasks/test/core/test_environments_isaacsim_physx.py b/source/isaaclab_tasks/test/core/test_environments_isaacsim_physx.py new file mode 100644 index 000000000000..56e76949d248 --- /dev/null +++ b/source/isaaclab_tasks/test/core/test_environments_isaacsim_physx.py @@ -0,0 +1,31 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Launch Isaac Sim Simulator first.""" + +from isaaclab.app import AppLauncher + +# launch the simulator +app_launcher = AppLauncher(headless=True, enable_cameras=True, limit_cpu_threads=1) +simulation_app = app_launcher.app + + +"""Rest everything follows.""" + +import pytest + +import isaaclab_tasks # noqa: F401 + +# Local imports should be imported last +from env_test_utils import _run_environments, setup_environment # isort: skip + + +@pytest.mark.parametrize( + "task_name", setup_environment(multi_agent=False, physics_preset_name="isaacsim_physx", tier="core") +) +@pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) +@pytest.mark.isaacsim_ci +def test_environments_isaacsim_physx(task_name, num_envs, device): + _run_environments(task_name, device, num_envs, physics_preset_name="isaacsim_physx") diff --git a/source/isaaclab_tasks/test/core/test_environments_newton.py b/source/isaaclab_tasks/test/core/test_environments_newton.py new file mode 100644 index 000000000000..3c2eac5c6f81 --- /dev/null +++ b/source/isaaclab_tasks/test/core/test_environments_newton.py @@ -0,0 +1,31 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Launch Isaac Sim Simulator first.""" + +from isaaclab.app import AppLauncher + +# launch the simulator +app_launcher = AppLauncher(headless=True, enable_cameras=True, limit_cpu_threads=1) +simulation_app = app_launcher.app + + +"""Rest everything follows.""" + +import pytest + +import isaaclab_tasks # noqa: F401 + +# Local imports should be imported last +from env_test_utils import _run_environments, setup_environment # isort: skip + + +@pytest.mark.parametrize( + "task_name", setup_environment(multi_agent=False, physics_preset_name="newton_mjwarp", tier="core") +) +@pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) +@pytest.mark.isaacsim_ci +def test_environments_newton(task_name, num_envs, device): + _run_environments(task_name, device, num_envs, physics_preset_name="newton_mjwarp") diff --git a/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py deleted file mode 100644 index ad6185ed45a6..000000000000 --- a/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Launch Isaac Sim Simulator first.""" - -from isaaclab.app import AppLauncher - -# launch the simulator -app_launcher = AppLauncher(headless=True, enable_cameras=True, limit_cpu_threads=1) -simulation_app = app_launcher.app - -from isaaclab.utils.version import get_isaac_sim_version - -"""Rest everything follows.""" - -import pytest - -import isaaclab_tasks # noqa: F401 - -# Local imports should be imported last -from env_test_utils import _run_environments, setup_environment # isort: skip - - -# note, running an env test without stage in memory then -# running an env test with stage in memory causes IsaacLab to hang. -# so, here we run all envs with stage in memory separately - -# TODO(mtrepte): re-enable with fabric cloning fix -# @pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) -# @pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False)) -# def test_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): -# # skip test if stage in memory is not supported -# if get_isaac_sim_version().major < 5: -# pytest.skip("Stage in memory is not supported in this version of Isaac Sim") - -# # run environments with stage in memory -# _run_environments(task_name, device, num_envs, create_stage_in_memory=True) - - -@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) -@pytest.mark.parametrize( - "task_name", - setup_environment( - multi_agent=False, - tier="core", - ), -) -def test_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): - # skip test if stage in memory is not supported - if get_isaac_sim_version().major < 5: - pytest.skip("Stage in memory is not supported in this version of Isaac Sim") - - # run environments with stage in memory - _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/env_test_utils.py b/source/isaaclab_tasks/test/env_test_utils.py index 880a8668bedc..5a301fd3a08b 100644 --- a/source/isaaclab_tasks/test/env_test_utils.py +++ b/source/isaaclab_tasks/test/env_test_utils.py @@ -18,8 +18,8 @@ from isaaclab.app.settings_manager import get_settings_manager from isaaclab.envs.mdp.actions.actions_cfg import OperationalSpaceControllerActionCfg from isaaclab.envs.utils.spaces import sample_space +from isaaclab.physics import PhysicsCfg from isaaclab.sim import SimulationContext -from isaaclab.utils.version import get_isaac_sim_version from isaaclab_tasks.utils.hydra import apply_overrides, collect_presets from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry, parse_env_cfg @@ -83,6 +83,7 @@ def setup_environment( teleop_envs: bool | None = None, cartpole_showcase_envs: bool | None = None, pickplace_stack_envs: bool | None = None, + physics_preset_name: str | None = None, tier: str | None = None, ) -> list[str]: """ @@ -109,6 +110,7 @@ def setup_environment( - True: include only PickPlace/Stack environments - False: exclude PickPlace/Stack environments - None: include all environments regardless of pick-place/stack type + physics_preset_name: Include only environments that support this physics preset. tier: - "core": include only core environments (registered under ``isaaclab_tasks.core``). - "contrib": include only contributed environments (registered under ``isaaclab_tasks.contrib``). @@ -173,6 +175,15 @@ def setup_environment( continue # if None: no filter + if physics_preset_name is not None: + env_cfg = load_cfg_from_registry(task_spec.id, "env_cfg_entry_point") + physics_preset_groups = collect_presets(env_cfg).values() + if not any( + physics_preset_name in preset_group and isinstance(preset_group[physics_preset_name], PhysicsCfg) + for preset_group in physics_preset_groups + ): + continue + registered_tasks.append(task_spec.id) # sort environments alphabetically @@ -295,8 +306,6 @@ def _run_environments( num_envs, num_steps=20, multi_agent=False, - create_stage_in_memory=False, - disable_clone_in_fabric=False, physics_preset_name: str | None = None, ): """Run all environments and check environments return valid signals. @@ -307,16 +316,10 @@ def _run_environments( num_envs: Number of environments. num_steps: Number of simulation steps. multi_agent: Whether the environment is multi-agent. - create_stage_in_memory: Whether to create stage in memory. - disable_clone_in_fabric: Whether to disable fabric cloning. physics_preset_name: Name of the physics preset to apply (e.g., 'newton_mjwarp'). If None, uses the environment's default physics. """ - # skip test if stage in memory is not supported - if get_isaac_sim_version().major < 5 and create_stage_in_memory: - pytest.skip("Stage in memory is not supported in this version of Isaac Sim") - # skip suction gripper environments as they require CPU simulation and cannot be run with GPU simulation if "Suction" in task_name and device != "cpu": return @@ -354,8 +357,6 @@ def _run_environments( num_envs, num_steps=num_steps, multi_agent=multi_agent, - create_stage_in_memory=create_stage_in_memory, - disable_clone_in_fabric=disable_clone_in_fabric, physics_preset_name=physics_preset_name, ) print(f""">>> Closing environment: {task_name}""") @@ -368,8 +369,6 @@ def _check_random_actions( num_envs: int, num_steps: int = 20, multi_agent: bool = False, - create_stage_in_memory: bool = False, - disable_clone_in_fabric: bool = False, physics_preset_name: str | None = None, ): """Run random actions and check environments return valid signals. @@ -380,14 +379,10 @@ def _check_random_actions( num_envs: Number of environments. num_steps: Number of simulation steps. multi_agent: Whether the environment is multi-agent. - create_stage_in_memory: Whether to create stage in memory. - disable_clone_in_fabric: Whether to disable fabric cloning. physics_preset_name: Name of the physics preset to apply (e.g., 'newton_mjwarp'). If None, uses the environment's default physics. """ - # create a new context stage, if stage in memory is not enabled - if not create_stage_in_memory: - sim_utils.create_new_stage() + sim_utils.create_new_stage() # reset the rtx sensors setting to False get_settings_manager().set_bool("/isaaclab/render/rtx_sensors", False) @@ -407,11 +402,6 @@ def _check_random_actions( # the scene config with the preset's default num_envs. if num_envs is not None: env_cfg.scene.num_envs = num_envs - # set config args - env_cfg.sim.create_stage_in_memory = create_stage_in_memory - if disable_clone_in_fabric: - env_cfg.scene.clone_in_fabric = False - # filter based off multi agents mode and create env if multi_agent: if not hasattr(env_cfg, "possible_agents"): diff --git a/tools/test_settings.py b/tools/test_settings.py index 540a76ad3b39..ace16447350e 100644 --- a/tools/test_settings.py +++ b/tools/test_settings.py @@ -21,10 +21,8 @@ "test_stage_in_memory.py": 1000, "test_imu.py": 1000, "test_environments.py": 10000, # This test runs through all the environments for 100 steps each + "test_environments_isaacsim_physx.py": 10000, "test_contrib_environments_smoke.py": 10000, # Smoke test running through contributed environments - "test_environments_with_stage_in_memory.py": ( - 10000 - ), # Like the above, with stage in memory and with and without fabric cloning "test_environment_determinism.py": 1000, # This test runs through many the environments for 100 steps each "test_pickplace_stack_environments.py": 10000, # This test runs through PickPlace and Stack environments "test_factory_environments.py": 1000, # This test runs through Factory environments for 100 steps each @@ -41,9 +39,7 @@ "test_environments_skillgen.py": 1000, "test_environments_automate.py": 2500, "test_teleop_environments.py": 5000, - "test_teleop_environments_with_stage_in_memory.py": 5000, "test_cartpole_showcase_environments.py": 5000, - "test_cartpole_showcase_environments_with_stage_in_memory.py": 5000, "test_simulation_render_config.py": 1000, "test_operational_space.py": 1000, "test_non_headless_launch.py": 1000, # This test launches the app in non-headless mode and starts simulation @@ -65,7 +61,7 @@ "test_multi_tiled_camera.py": 1000, "test_multirotor.py": 1000, "test_shadow_hand_camera_presets.py": 5000, - "test_environments_newton.py": 5000, + "test_environments_newton.py": 10000, "test_surface_gripper.py": 3000, # The first test in the kitless rendering test job will take longer to run due to RTX shader compilation. "test_rendering_cartpole_kitless.py": 2000, From 775d18a2a4992d626ab4865ef43a8ea14fc31300 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 17:10:26 -0700 Subject: [PATCH 10/14] Retain stage-in-memory test utilities --- ...wcase_environments_with_stage_in_memory.py | 37 +++++++++++++++ ...eleop_environments_with_stage_in_memory.py | 47 +++++++++++++++++++ source/isaaclab_tasks/test/env_test_utils.py | 24 +++++++++- tools/test_settings.py | 2 + 4 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py create mode 100644 source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py diff --git a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py new file mode 100644 index 000000000000..2ac712a34ba3 --- /dev/null +++ b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py @@ -0,0 +1,37 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Launch Isaac Sim Simulator first.""" + +from isaaclab.app import AppLauncher + +# launch the simulator +app_launcher = AppLauncher(headless=True, enable_cameras=True) +simulation_app = app_launcher.app + +from isaaclab.utils.version import get_isaac_sim_version + +"""Rest everything follows.""" + +import pytest + +import isaaclab_tasks # noqa: F401 + +# Local imports should be imported last +from env_test_utils import _run_environments, setup_environment # isort: skip + + +@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) +@pytest.mark.parametrize( + "task_name", + setup_environment(factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True), +) +def test_cartpole_showcase_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): + # skip test if stage in memory is not supported + if get_isaac_sim_version().major < 5: + pytest.skip("Stage in memory is not supported in this version of Isaac Sim") + + # run cartpole showcase environments with stage in memory + _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py new file mode 100644 index 000000000000..f2cfbd83f2b2 --- /dev/null +++ b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py @@ -0,0 +1,47 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Launch Isaac Sim Simulator first.""" + +import sys + +# Import pinocchio in the main script to force the use of the dependencies +# installed by IsaacLab and not the one installed by Isaac Sim. +# pinocchio is required by the Pink IK controller used in some teleop environments +if sys.platform != "win32": + import pinocchio # noqa: F401 + +from isaaclab.app import AppLauncher + +# launch the simulator +app_launcher = AppLauncher(headless=True, enable_cameras=True) +simulation_app = app_launcher.app + +from isaaclab.utils.version import get_isaac_sim_version + +"""Rest everything follows.""" + +import pytest + +import isaaclab_tasks # noqa: F401 + +# Local imports should be imported last +from env_test_utils import _run_environments, setup_environment # isort: skip + + +# Teleop environments require isaacteleop / isaaclab_teleop and may interfere +# with other environment tests when run in the same process. They are collected +# separately here so they execute in their own test session. + + +@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) +@pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True)) +def test_teleop_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): + # skip test if stage in memory is not supported + if get_isaac_sim_version().major < 5: + pytest.skip("Stage in memory is not supported in this version of Isaac Sim") + + # run teleop environments with stage in memory + _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/env_test_utils.py b/source/isaaclab_tasks/test/env_test_utils.py index 5a301fd3a08b..17ddf2cd4f59 100644 --- a/source/isaaclab_tasks/test/env_test_utils.py +++ b/source/isaaclab_tasks/test/env_test_utils.py @@ -20,6 +20,7 @@ from isaaclab.envs.utils.spaces import sample_space from isaaclab.physics import PhysicsCfg from isaaclab.sim import SimulationContext +from isaaclab.utils.version import get_isaac_sim_version from isaaclab_tasks.utils.hydra import apply_overrides, collect_presets from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry, parse_env_cfg @@ -306,6 +307,8 @@ def _run_environments( num_envs, num_steps=20, multi_agent=False, + create_stage_in_memory=False, + disable_clone_in_fabric=False, physics_preset_name: str | None = None, ): """Run all environments and check environments return valid signals. @@ -316,10 +319,16 @@ def _run_environments( num_envs: Number of environments. num_steps: Number of simulation steps. multi_agent: Whether the environment is multi-agent. + create_stage_in_memory: Whether to create stage in memory. + disable_clone_in_fabric: Whether to disable fabric cloning. physics_preset_name: Name of the physics preset to apply (e.g., 'newton_mjwarp'). If None, uses the environment's default physics. """ + # skip test if stage in memory is not supported + if get_isaac_sim_version().major < 5 and create_stage_in_memory: + pytest.skip("Stage in memory is not supported in this version of Isaac Sim") + # skip suction gripper environments as they require CPU simulation and cannot be run with GPU simulation if "Suction" in task_name and device != "cpu": return @@ -357,6 +366,8 @@ def _run_environments( num_envs, num_steps=num_steps, multi_agent=multi_agent, + create_stage_in_memory=create_stage_in_memory, + disable_clone_in_fabric=disable_clone_in_fabric, physics_preset_name=physics_preset_name, ) print(f""">>> Closing environment: {task_name}""") @@ -369,6 +380,8 @@ def _check_random_actions( num_envs: int, num_steps: int = 20, multi_agent: bool = False, + create_stage_in_memory: bool = False, + disable_clone_in_fabric: bool = False, physics_preset_name: str | None = None, ): """Run random actions and check environments return valid signals. @@ -379,10 +392,14 @@ def _check_random_actions( num_envs: Number of environments. num_steps: Number of simulation steps. multi_agent: Whether the environment is multi-agent. + create_stage_in_memory: Whether to create stage in memory. + disable_clone_in_fabric: Whether to disable fabric cloning. physics_preset_name: Name of the physics preset to apply (e.g., 'newton_mjwarp'). If None, uses the environment's default physics. """ - sim_utils.create_new_stage() + # create a new context stage, if stage in memory is not enabled + if not create_stage_in_memory: + sim_utils.create_new_stage() # reset the rtx sensors setting to False get_settings_manager().set_bool("/isaaclab/render/rtx_sensors", False) @@ -402,6 +419,11 @@ def _check_random_actions( # the scene config with the preset's default num_envs. if num_envs is not None: env_cfg.scene.num_envs = num_envs + # set config args + env_cfg.sim.create_stage_in_memory = create_stage_in_memory + if disable_clone_in_fabric: + env_cfg.scene.clone_in_fabric = False + # filter based off multi agents mode and create env if multi_agent: if not hasattr(env_cfg, "possible_agents"): diff --git a/tools/test_settings.py b/tools/test_settings.py index ace16447350e..43714a540a3d 100644 --- a/tools/test_settings.py +++ b/tools/test_settings.py @@ -39,7 +39,9 @@ "test_environments_skillgen.py": 1000, "test_environments_automate.py": 2500, "test_teleop_environments.py": 5000, + "test_teleop_environments_with_stage_in_memory.py": 5000, "test_cartpole_showcase_environments.py": 5000, + "test_cartpole_showcase_environments_with_stage_in_memory.py": 5000, "test_simulation_render_config.py": 1000, "test_operational_space.py": 1000, "test_non_headless_launch.py": 1000, # This test launches the app in non-headless mode and starts simulation From 4cfcc663fd9d494db12e2ccc54938d6c1c1b2164 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 17:18:59 -0700 Subject: [PATCH 11/14] Test OV PhysX environment presets --- source/isaaclab_tasks/test/core/test_environments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/isaaclab_tasks/test/core/test_environments.py b/source/isaaclab_tasks/test/core/test_environments.py index 5362b78a32b5..694f77e08650 100644 --- a/source/isaaclab_tasks/test/core/test_environments.py +++ b/source/isaaclab_tasks/test/core/test_environments.py @@ -22,8 +22,8 @@ from env_test_utils import _run_environments, setup_environment # isort: skip -@pytest.mark.parametrize("task_name", setup_environment(multi_agent=False, physics_preset_name="physx", tier="core")) +@pytest.mark.parametrize("task_name", setup_environment(multi_agent=False, physics_preset_name="ovphysx", tier="core")) @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) @pytest.mark.isaacsim_ci def test_environments(task_name, num_envs, device): - _run_environments(task_name, device, num_envs, physics_preset_name="physx") + _run_environments(task_name, device, num_envs, physics_preset_name="ovphysx") From 7861a11d38e9003aff259c3e356c4efcd53e4cf0 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 18:48:41 -0700 Subject: [PATCH 12/14] Revert "Test OV PhysX environment presets" This reverts commit 16f22274800c915cec6c451c81360d2bfeb1eebb. --- source/isaaclab_tasks/test/core/test_environments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/isaaclab_tasks/test/core/test_environments.py b/source/isaaclab_tasks/test/core/test_environments.py index 694f77e08650..5362b78a32b5 100644 --- a/source/isaaclab_tasks/test/core/test_environments.py +++ b/source/isaaclab_tasks/test/core/test_environments.py @@ -22,8 +22,8 @@ from env_test_utils import _run_environments, setup_environment # isort: skip -@pytest.mark.parametrize("task_name", setup_environment(multi_agent=False, physics_preset_name="ovphysx", tier="core")) +@pytest.mark.parametrize("task_name", setup_environment(multi_agent=False, physics_preset_name="physx", tier="core")) @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) @pytest.mark.isaacsim_ci def test_environments(task_name, num_envs, device): - _run_environments(task_name, device, num_envs, physics_preset_name="ovphysx") + _run_environments(task_name, device, num_envs, physics_preset_name="physx") From 9c56c08d66be7e48e578d71b19a01bb687ccea18 Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 18:48:41 -0700 Subject: [PATCH 13/14] Revert "Retain stage-in-memory test utilities" This reverts commit 389f780cfdeaa80dd09d26577b4812633125fa39. --- ...wcase_environments_with_stage_in_memory.py | 37 --------------- ...eleop_environments_with_stage_in_memory.py | 47 ------------------- source/isaaclab_tasks/test/env_test_utils.py | 24 +--------- tools/test_settings.py | 2 - 4 files changed, 1 insertion(+), 109 deletions(-) delete mode 100644 source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py delete mode 100644 source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py diff --git a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py deleted file mode 100644 index 2ac712a34ba3..000000000000 --- a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Launch Isaac Sim Simulator first.""" - -from isaaclab.app import AppLauncher - -# launch the simulator -app_launcher = AppLauncher(headless=True, enable_cameras=True) -simulation_app = app_launcher.app - -from isaaclab.utils.version import get_isaac_sim_version - -"""Rest everything follows.""" - -import pytest - -import isaaclab_tasks # noqa: F401 - -# Local imports should be imported last -from env_test_utils import _run_environments, setup_environment # isort: skip - - -@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) -@pytest.mark.parametrize( - "task_name", - setup_environment(factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True), -) -def test_cartpole_showcase_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): - # skip test if stage in memory is not supported - if get_isaac_sim_version().major < 5: - pytest.skip("Stage in memory is not supported in this version of Isaac Sim") - - # run cartpole showcase environments with stage in memory - _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py deleted file mode 100644 index f2cfbd83f2b2..000000000000 --- a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Launch Isaac Sim Simulator first.""" - -import sys - -# Import pinocchio in the main script to force the use of the dependencies -# installed by IsaacLab and not the one installed by Isaac Sim. -# pinocchio is required by the Pink IK controller used in some teleop environments -if sys.platform != "win32": - import pinocchio # noqa: F401 - -from isaaclab.app import AppLauncher - -# launch the simulator -app_launcher = AppLauncher(headless=True, enable_cameras=True) -simulation_app = app_launcher.app - -from isaaclab.utils.version import get_isaac_sim_version - -"""Rest everything follows.""" - -import pytest - -import isaaclab_tasks # noqa: F401 - -# Local imports should be imported last -from env_test_utils import _run_environments, setup_environment # isort: skip - - -# Teleop environments require isaacteleop / isaaclab_teleop and may interfere -# with other environment tests when run in the same process. They are collected -# separately here so they execute in their own test session. - - -@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) -@pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True)) -def test_teleop_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): - # skip test if stage in memory is not supported - if get_isaac_sim_version().major < 5: - pytest.skip("Stage in memory is not supported in this version of Isaac Sim") - - # run teleop environments with stage in memory - _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/env_test_utils.py b/source/isaaclab_tasks/test/env_test_utils.py index 17ddf2cd4f59..5a301fd3a08b 100644 --- a/source/isaaclab_tasks/test/env_test_utils.py +++ b/source/isaaclab_tasks/test/env_test_utils.py @@ -20,7 +20,6 @@ from isaaclab.envs.utils.spaces import sample_space from isaaclab.physics import PhysicsCfg from isaaclab.sim import SimulationContext -from isaaclab.utils.version import get_isaac_sim_version from isaaclab_tasks.utils.hydra import apply_overrides, collect_presets from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry, parse_env_cfg @@ -307,8 +306,6 @@ def _run_environments( num_envs, num_steps=20, multi_agent=False, - create_stage_in_memory=False, - disable_clone_in_fabric=False, physics_preset_name: str | None = None, ): """Run all environments and check environments return valid signals. @@ -319,16 +316,10 @@ def _run_environments( num_envs: Number of environments. num_steps: Number of simulation steps. multi_agent: Whether the environment is multi-agent. - create_stage_in_memory: Whether to create stage in memory. - disable_clone_in_fabric: Whether to disable fabric cloning. physics_preset_name: Name of the physics preset to apply (e.g., 'newton_mjwarp'). If None, uses the environment's default physics. """ - # skip test if stage in memory is not supported - if get_isaac_sim_version().major < 5 and create_stage_in_memory: - pytest.skip("Stage in memory is not supported in this version of Isaac Sim") - # skip suction gripper environments as they require CPU simulation and cannot be run with GPU simulation if "Suction" in task_name and device != "cpu": return @@ -366,8 +357,6 @@ def _run_environments( num_envs, num_steps=num_steps, multi_agent=multi_agent, - create_stage_in_memory=create_stage_in_memory, - disable_clone_in_fabric=disable_clone_in_fabric, physics_preset_name=physics_preset_name, ) print(f""">>> Closing environment: {task_name}""") @@ -380,8 +369,6 @@ def _check_random_actions( num_envs: int, num_steps: int = 20, multi_agent: bool = False, - create_stage_in_memory: bool = False, - disable_clone_in_fabric: bool = False, physics_preset_name: str | None = None, ): """Run random actions and check environments return valid signals. @@ -392,14 +379,10 @@ def _check_random_actions( num_envs: Number of environments. num_steps: Number of simulation steps. multi_agent: Whether the environment is multi-agent. - create_stage_in_memory: Whether to create stage in memory. - disable_clone_in_fabric: Whether to disable fabric cloning. physics_preset_name: Name of the physics preset to apply (e.g., 'newton_mjwarp'). If None, uses the environment's default physics. """ - # create a new context stage, if stage in memory is not enabled - if not create_stage_in_memory: - sim_utils.create_new_stage() + sim_utils.create_new_stage() # reset the rtx sensors setting to False get_settings_manager().set_bool("/isaaclab/render/rtx_sensors", False) @@ -419,11 +402,6 @@ def _check_random_actions( # the scene config with the preset's default num_envs. if num_envs is not None: env_cfg.scene.num_envs = num_envs - # set config args - env_cfg.sim.create_stage_in_memory = create_stage_in_memory - if disable_clone_in_fabric: - env_cfg.scene.clone_in_fabric = False - # filter based off multi agents mode and create env if multi_agent: if not hasattr(env_cfg, "possible_agents"): diff --git a/tools/test_settings.py b/tools/test_settings.py index 43714a540a3d..ace16447350e 100644 --- a/tools/test_settings.py +++ b/tools/test_settings.py @@ -39,9 +39,7 @@ "test_environments_skillgen.py": 1000, "test_environments_automate.py": 2500, "test_teleop_environments.py": 5000, - "test_teleop_environments_with_stage_in_memory.py": 5000, "test_cartpole_showcase_environments.py": 5000, - "test_cartpole_showcase_environments_with_stage_in_memory.py": 5000, "test_simulation_render_config.py": 1000, "test_operational_space.py": 1000, "test_non_headless_launch.py": 1000, # This test launches the app in non-headless mode and starts simulation From fd0ed042ae7e025c97c4ae2102c4622dd3f8253d Mon Sep 17 00:00:00 2001 From: Mustafa Haiderbhai Date: Thu, 13 Aug 2026 18:48:41 -0700 Subject: [PATCH 14/14] Revert "Split environment smoke tests by backend" This reverts commit ed946fa3450ab7b519eb6840af26565174aa4a14. --- ...wcase_environments_with_stage_in_memory.py | 37 ++++++++++++ ...eleop_environments_with_stage_in_memory.py | 47 ++++++++++++++++ .../test/core/test_environments.py | 40 ++++++++++++- .../core/test_environments_isaacsim_physx.py | 31 ---------- .../test/core/test_environments_newton.py | 31 ---------- .../test_environments_with_stage_in_memory.py | 56 +++++++++++++++++++ source/isaaclab_tasks/test/env_test_utils.py | 36 +++++++----- tools/test_settings.py | 8 ++- 8 files changed, 206 insertions(+), 80 deletions(-) create mode 100644 source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py create mode 100644 source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py delete mode 100644 source/isaaclab_tasks/test/core/test_environments_isaacsim_physx.py delete mode 100644 source/isaaclab_tasks/test/core/test_environments_newton.py create mode 100644 source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py diff --git a/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py new file mode 100644 index 000000000000..2ac712a34ba3 --- /dev/null +++ b/source/isaaclab_tasks/test/contrib/test_cartpole_showcase_environments_with_stage_in_memory.py @@ -0,0 +1,37 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Launch Isaac Sim Simulator first.""" + +from isaaclab.app import AppLauncher + +# launch the simulator +app_launcher = AppLauncher(headless=True, enable_cameras=True) +simulation_app = app_launcher.app + +from isaaclab.utils.version import get_isaac_sim_version + +"""Rest everything follows.""" + +import pytest + +import isaaclab_tasks # noqa: F401 + +# Local imports should be imported last +from env_test_utils import _run_environments, setup_environment # isort: skip + + +@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) +@pytest.mark.parametrize( + "task_name", + setup_environment(factory_envs=False, multi_agent=False, teleop_envs=False, cartpole_showcase_envs=True), +) +def test_cartpole_showcase_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): + # skip test if stage in memory is not supported + if get_isaac_sim_version().major < 5: + pytest.skip("Stage in memory is not supported in this version of Isaac Sim") + + # run cartpole showcase environments with stage in memory + _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py new file mode 100644 index 000000000000..f2cfbd83f2b2 --- /dev/null +++ b/source/isaaclab_tasks/test/contrib/test_teleop_environments_with_stage_in_memory.py @@ -0,0 +1,47 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Launch Isaac Sim Simulator first.""" + +import sys + +# Import pinocchio in the main script to force the use of the dependencies +# installed by IsaacLab and not the one installed by Isaac Sim. +# pinocchio is required by the Pink IK controller used in some teleop environments +if sys.platform != "win32": + import pinocchio # noqa: F401 + +from isaaclab.app import AppLauncher + +# launch the simulator +app_launcher = AppLauncher(headless=True, enable_cameras=True) +simulation_app = app_launcher.app + +from isaaclab.utils.version import get_isaac_sim_version + +"""Rest everything follows.""" + +import pytest + +import isaaclab_tasks # noqa: F401 + +# Local imports should be imported last +from env_test_utils import _run_environments, setup_environment # isort: skip + + +# Teleop environments require isaacteleop / isaaclab_teleop and may interfere +# with other environment tests when run in the same process. They are collected +# separately here so they execute in their own test session. + + +@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) +@pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False, teleop_envs=True)) +def test_teleop_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): + # skip test if stage in memory is not supported + if get_isaac_sim_version().major < 5: + pytest.skip("Stage in memory is not supported in this version of Isaac Sim") + + # run teleop environments with stage in memory + _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/core/test_environments.py b/source/isaaclab_tasks/test/core/test_environments.py index 5362b78a32b5..75a7de889daf 100644 --- a/source/isaaclab_tasks/test/core/test_environments.py +++ b/source/isaaclab_tasks/test/core/test_environments.py @@ -16,14 +16,48 @@ import pytest +from isaaclab.physics import PhysicsCfg + import isaaclab_tasks # noqa: F401 +from isaaclab_tasks.utils.hydra import collect_presets +from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry # Local imports should be imported last from env_test_utils import _run_environments, setup_environment # isort: skip -@pytest.mark.parametrize("task_name", setup_environment(multi_agent=False, physics_preset_name="physx", tier="core")) +_PHYSICS_PRESET_NAMES = ("newton_mjwarp", "physx", "isaacsim_physx") + + +def _core_physics_params() -> list: + """Return core task/backend pairs for explicitly supported physics presets.""" + params = [] + for task_param in setup_environment(multi_agent=False, tier="core"): + task_name = getattr(task_param, "values", (task_param,))[0] + marks = getattr(task_param, "marks", ()) + env_cfg = load_cfg_from_registry(task_name, "env_cfg_entry_point") + physics_preset_groups = collect_presets(env_cfg).values() + for physics_preset_name in _PHYSICS_PRESET_NAMES: + if any( + physics_preset_name in preset_group and isinstance(preset_group[physics_preset_name], PhysicsCfg) + for preset_group in physics_preset_groups + ): + params.append( + pytest.param( + task_name, + physics_preset_name, + id=f"{task_name}-{physics_preset_name}", + marks=marks, + ) + ) + return params + + +@pytest.mark.parametrize("task_name, physics_preset_name", _core_physics_params()) @pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) @pytest.mark.isaacsim_ci -def test_environments(task_name, num_envs, device): - _run_environments(task_name, device, num_envs, physics_preset_name="physx") +def test_environments(task_name, physics_preset_name, num_envs, device): + # run environments without stage in memory + _run_environments( + task_name, device, num_envs, create_stage_in_memory=False, physics_preset_name=physics_preset_name + ) diff --git a/source/isaaclab_tasks/test/core/test_environments_isaacsim_physx.py b/source/isaaclab_tasks/test/core/test_environments_isaacsim_physx.py deleted file mode 100644 index 56e76949d248..000000000000 --- a/source/isaaclab_tasks/test/core/test_environments_isaacsim_physx.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Launch Isaac Sim Simulator first.""" - -from isaaclab.app import AppLauncher - -# launch the simulator -app_launcher = AppLauncher(headless=True, enable_cameras=True, limit_cpu_threads=1) -simulation_app = app_launcher.app - - -"""Rest everything follows.""" - -import pytest - -import isaaclab_tasks # noqa: F401 - -# Local imports should be imported last -from env_test_utils import _run_environments, setup_environment # isort: skip - - -@pytest.mark.parametrize( - "task_name", setup_environment(multi_agent=False, physics_preset_name="isaacsim_physx", tier="core") -) -@pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) -@pytest.mark.isaacsim_ci -def test_environments_isaacsim_physx(task_name, num_envs, device): - _run_environments(task_name, device, num_envs, physics_preset_name="isaacsim_physx") diff --git a/source/isaaclab_tasks/test/core/test_environments_newton.py b/source/isaaclab_tasks/test/core/test_environments_newton.py deleted file mode 100644 index 3c2eac5c6f81..000000000000 --- a/source/isaaclab_tasks/test/core/test_environments_newton.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Launch Isaac Sim Simulator first.""" - -from isaaclab.app import AppLauncher - -# launch the simulator -app_launcher = AppLauncher(headless=True, enable_cameras=True, limit_cpu_threads=1) -simulation_app = app_launcher.app - - -"""Rest everything follows.""" - -import pytest - -import isaaclab_tasks # noqa: F401 - -# Local imports should be imported last -from env_test_utils import _run_environments, setup_environment # isort: skip - - -@pytest.mark.parametrize( - "task_name", setup_environment(multi_agent=False, physics_preset_name="newton_mjwarp", tier="core") -) -@pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")]) -@pytest.mark.isaacsim_ci -def test_environments_newton(task_name, num_envs, device): - _run_environments(task_name, device, num_envs, physics_preset_name="newton_mjwarp") diff --git a/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py b/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py new file mode 100644 index 000000000000..ad6185ed45a6 --- /dev/null +++ b/source/isaaclab_tasks/test/core/test_environments_with_stage_in_memory.py @@ -0,0 +1,56 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Launch Isaac Sim Simulator first.""" + +from isaaclab.app import AppLauncher + +# launch the simulator +app_launcher = AppLauncher(headless=True, enable_cameras=True, limit_cpu_threads=1) +simulation_app = app_launcher.app + +from isaaclab.utils.version import get_isaac_sim_version + +"""Rest everything follows.""" + +import pytest + +import isaaclab_tasks # noqa: F401 + +# Local imports should be imported last +from env_test_utils import _run_environments, setup_environment # isort: skip + + +# note, running an env test without stage in memory then +# running an env test with stage in memory causes IsaacLab to hang. +# so, here we run all envs with stage in memory separately + +# TODO(mtrepte): re-enable with fabric cloning fix +# @pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) +# @pytest.mark.parametrize("task_name", setup_environment(factory_envs=False, multi_agent=False)) +# def test_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): +# # skip test if stage in memory is not supported +# if get_isaac_sim_version().major < 5: +# pytest.skip("Stage in memory is not supported in this version of Isaac Sim") + +# # run environments with stage in memory +# _run_environments(task_name, device, num_envs, create_stage_in_memory=True) + + +@pytest.mark.parametrize("num_envs, device", [(2, "cuda")]) +@pytest.mark.parametrize( + "task_name", + setup_environment( + multi_agent=False, + tier="core", + ), +) +def test_environments_with_stage_in_memory_and_clone_in_fabric_disabled(task_name, num_envs, device): + # skip test if stage in memory is not supported + if get_isaac_sim_version().major < 5: + pytest.skip("Stage in memory is not supported in this version of Isaac Sim") + + # run environments with stage in memory + _run_environments(task_name, device, num_envs, create_stage_in_memory=True, disable_clone_in_fabric=True) diff --git a/source/isaaclab_tasks/test/env_test_utils.py b/source/isaaclab_tasks/test/env_test_utils.py index 5a301fd3a08b..880a8668bedc 100644 --- a/source/isaaclab_tasks/test/env_test_utils.py +++ b/source/isaaclab_tasks/test/env_test_utils.py @@ -18,8 +18,8 @@ from isaaclab.app.settings_manager import get_settings_manager from isaaclab.envs.mdp.actions.actions_cfg import OperationalSpaceControllerActionCfg from isaaclab.envs.utils.spaces import sample_space -from isaaclab.physics import PhysicsCfg from isaaclab.sim import SimulationContext +from isaaclab.utils.version import get_isaac_sim_version from isaaclab_tasks.utils.hydra import apply_overrides, collect_presets from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry, parse_env_cfg @@ -83,7 +83,6 @@ def setup_environment( teleop_envs: bool | None = None, cartpole_showcase_envs: bool | None = None, pickplace_stack_envs: bool | None = None, - physics_preset_name: str | None = None, tier: str | None = None, ) -> list[str]: """ @@ -110,7 +109,6 @@ def setup_environment( - True: include only PickPlace/Stack environments - False: exclude PickPlace/Stack environments - None: include all environments regardless of pick-place/stack type - physics_preset_name: Include only environments that support this physics preset. tier: - "core": include only core environments (registered under ``isaaclab_tasks.core``). - "contrib": include only contributed environments (registered under ``isaaclab_tasks.contrib``). @@ -175,15 +173,6 @@ def setup_environment( continue # if None: no filter - if physics_preset_name is not None: - env_cfg = load_cfg_from_registry(task_spec.id, "env_cfg_entry_point") - physics_preset_groups = collect_presets(env_cfg).values() - if not any( - physics_preset_name in preset_group and isinstance(preset_group[physics_preset_name], PhysicsCfg) - for preset_group in physics_preset_groups - ): - continue - registered_tasks.append(task_spec.id) # sort environments alphabetically @@ -306,6 +295,8 @@ def _run_environments( num_envs, num_steps=20, multi_agent=False, + create_stage_in_memory=False, + disable_clone_in_fabric=False, physics_preset_name: str | None = None, ): """Run all environments and check environments return valid signals. @@ -316,10 +307,16 @@ def _run_environments( num_envs: Number of environments. num_steps: Number of simulation steps. multi_agent: Whether the environment is multi-agent. + create_stage_in_memory: Whether to create stage in memory. + disable_clone_in_fabric: Whether to disable fabric cloning. physics_preset_name: Name of the physics preset to apply (e.g., 'newton_mjwarp'). If None, uses the environment's default physics. """ + # skip test if stage in memory is not supported + if get_isaac_sim_version().major < 5 and create_stage_in_memory: + pytest.skip("Stage in memory is not supported in this version of Isaac Sim") + # skip suction gripper environments as they require CPU simulation and cannot be run with GPU simulation if "Suction" in task_name and device != "cpu": return @@ -357,6 +354,8 @@ def _run_environments( num_envs, num_steps=num_steps, multi_agent=multi_agent, + create_stage_in_memory=create_stage_in_memory, + disable_clone_in_fabric=disable_clone_in_fabric, physics_preset_name=physics_preset_name, ) print(f""">>> Closing environment: {task_name}""") @@ -369,6 +368,8 @@ def _check_random_actions( num_envs: int, num_steps: int = 20, multi_agent: bool = False, + create_stage_in_memory: bool = False, + disable_clone_in_fabric: bool = False, physics_preset_name: str | None = None, ): """Run random actions and check environments return valid signals. @@ -379,10 +380,14 @@ def _check_random_actions( num_envs: Number of environments. num_steps: Number of simulation steps. multi_agent: Whether the environment is multi-agent. + create_stage_in_memory: Whether to create stage in memory. + disable_clone_in_fabric: Whether to disable fabric cloning. physics_preset_name: Name of the physics preset to apply (e.g., 'newton_mjwarp'). If None, uses the environment's default physics. """ - sim_utils.create_new_stage() + # create a new context stage, if stage in memory is not enabled + if not create_stage_in_memory: + sim_utils.create_new_stage() # reset the rtx sensors setting to False get_settings_manager().set_bool("/isaaclab/render/rtx_sensors", False) @@ -402,6 +407,11 @@ def _check_random_actions( # the scene config with the preset's default num_envs. if num_envs is not None: env_cfg.scene.num_envs = num_envs + # set config args + env_cfg.sim.create_stage_in_memory = create_stage_in_memory + if disable_clone_in_fabric: + env_cfg.scene.clone_in_fabric = False + # filter based off multi agents mode and create env if multi_agent: if not hasattr(env_cfg, "possible_agents"): diff --git a/tools/test_settings.py b/tools/test_settings.py index ace16447350e..540a76ad3b39 100644 --- a/tools/test_settings.py +++ b/tools/test_settings.py @@ -21,8 +21,10 @@ "test_stage_in_memory.py": 1000, "test_imu.py": 1000, "test_environments.py": 10000, # This test runs through all the environments for 100 steps each - "test_environments_isaacsim_physx.py": 10000, "test_contrib_environments_smoke.py": 10000, # Smoke test running through contributed environments + "test_environments_with_stage_in_memory.py": ( + 10000 + ), # Like the above, with stage in memory and with and without fabric cloning "test_environment_determinism.py": 1000, # This test runs through many the environments for 100 steps each "test_pickplace_stack_environments.py": 10000, # This test runs through PickPlace and Stack environments "test_factory_environments.py": 1000, # This test runs through Factory environments for 100 steps each @@ -39,7 +41,9 @@ "test_environments_skillgen.py": 1000, "test_environments_automate.py": 2500, "test_teleop_environments.py": 5000, + "test_teleop_environments_with_stage_in_memory.py": 5000, "test_cartpole_showcase_environments.py": 5000, + "test_cartpole_showcase_environments_with_stage_in_memory.py": 5000, "test_simulation_render_config.py": 1000, "test_operational_space.py": 1000, "test_non_headless_launch.py": 1000, # This test launches the app in non-headless mode and starts simulation @@ -61,7 +65,7 @@ "test_multi_tiled_camera.py": 1000, "test_multirotor.py": 1000, "test_shadow_hand_camera_presets.py": 5000, - "test_environments_newton.py": 10000, + "test_environments_newton.py": 5000, "test_surface_gripper.py": 3000, # The first test in the kitless rendering test job will take longer to run due to RTX shader compilation. "test_rendering_cartpole_kitless.py": 2000,