Skip to content

Commit 853b971

Browse files
committed
revert: Keep scene partitioning opt-in
Retain the alpha.50 pin and explicit partition coverage, but postpone the default-on behavior while global goal markers remain in the background partition under NVBug 6601572. Restore the existing visualizer golden.
1 parent cc1c0e1 commit 853b971

11 files changed

Lines changed: 43 additions & 48 deletions

File tree

source/isaaclab/changelog.d/esekkin-enable-scene-partition-default.rst

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

source/isaaclab/isaaclab/utils/renderers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
def isaac_rtx_per_env_scene_partition_enabled() -> bool:
1212
"""Return whether per-environment RTX scene partitioning is enabled.
1313
14-
Partitioning is enabled by default. Set
15-
``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=0`` to disable authoring of
16-
``primvars:omni:scenePartition`` and ``omni:scenePartition`` on the USD stage.
14+
Partitioning is opt-in: set ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1``
15+
to enable authoring of ``primvars:omni:scenePartition`` and ``omni:scenePartition``
16+
on the USD stage.
1717
"""
18-
return os.environ.get("ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION", "1") == "1"
18+
return os.environ.get("ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION", "0") == "1"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Test-only: re-enabled default-on Isaac RTX scene-partition isolation tests with Isaac Sim alpha.50.
1+
Test-only: re-enabled Isaac RTX scene-partition isolation tests with Isaac Sim alpha.50.

source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ def supported_output_types(self) -> dict[RenderBufferKind, RenderBufferSpec]:
196196
def prepare_stage(self, stage: Usd.Stage, num_envs: int) -> None:
197197
"""Author per-env ``omni:scenePartition`` attributes for RTX cull-by-env rendering.
198198
199-
Authoring is enabled by default. Set
200-
``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=0`` to make this method
201-
a no-op so no ``primvars:omni:scenePartition`` or ``omni:scenePartition``
202-
attributes are written to the stage.
199+
Authoring is only performed when
200+
``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` is set.
201+
When the variable is absent the method is a no-op and no ``primvars:omni:scenePartition``
202+
or ``omni:scenePartition`` attributes are written to the stage.
203203
204204
When enabled, for each ``/World/envs/env_{i}`` root, writes the inheriting primvar
205205
``primvars:omni:scenePartition`` (token ``env_{i}``) on the root and the matching
@@ -212,7 +212,9 @@ def prepare_stage(self, stage: Usd.Stage, num_envs: int) -> None:
212212
return
213213

214214
logger.debug(
215-
"Per-environment RTX scene partitioning is enabled. Authoring primvars:omni:scenePartition on %d env(s).",
215+
"Per-environment RTX scene partitioning is enabled"
216+
" (ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1)."
217+
" Authoring primvars:omni:scenePartition on %d env(s).",
216218
num_envs,
217219
)
218220

source/isaaclab_physx/test/renderers/test_isaac_rtx_renderer_scene_partitioning.py

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
``isaacsim_ci`` test file in its own app, so keeping these tests isolated here gives them
1818
a clean renderer and exercises the real single-scene use case.
1919
20-
Per-env scene partitioning is enabled by default. Set
21-
``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=0`` to disable it.
20+
Per-env scene partitioning is gated behind the
21+
``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION`` environment variable and is off
22+
by default. Tests that verify partitioning is *active* use the ``enable_scene_partition``
23+
fixture, which sets the variable for the duration of the test and restores the previous
24+
state afterwards.
2225
2326
Launch Isaac Sim Simulator first.
2427
"""
@@ -49,33 +52,22 @@
4952
_ENV_VAR = "ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION"
5053

5154

52-
@pytest.mark.isaacsim_ci
53-
def test_partitioning_enabled_by_default(monkeypatch):
54-
"""``primvars:omni:scenePartition`` must be authored when the environment variable is absent."""
55-
from pxr import Usd
56-
57-
monkeypatch.delenv(_ENV_VAR, raising=False)
58-
59-
stage = Usd.Stage.CreateInMemory()
60-
world = stage.DefinePrim("/World", "Xform") # noqa: F841
61-
env0 = stage.DefinePrim("/World/envs/env_0", "Xform") # noqa: F841
62-
63-
renderer = object.__new__(IsaacRtxRenderer)
64-
renderer.cfg = IsaacRtxRendererCfg()
65-
renderer.prepare_stage(stage, num_envs=1)
66-
67-
prim = stage.GetPrimAtPath("/World/envs/env_0")
68-
assert prim.HasAttribute("primvars:omni:scenePartition"), (
69-
"primvars:omni:scenePartition must be authored when partitioning uses its default."
70-
)
55+
@pytest.fixture()
56+
def enable_scene_partition(monkeypatch):
57+
"""Set ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` for the duration of one test."""
58+
monkeypatch.setenv(_ENV_VAR, "1")
7159

7260

7361
@pytest.mark.isaacsim_ci
74-
def test_partitioning_can_be_disabled(monkeypatch):
75-
"""``primvars:omni:scenePartition`` must not be authored when partitioning is explicitly disabled."""
62+
def test_partitioning_disabled_by_default(monkeypatch):
63+
"""``primvars:omni:scenePartition`` must NOT be authored when the env var is absent.
64+
65+
The feature is off by default; this test confirms that :meth:`IsaacRtxRenderer.prepare_stage`
66+
is a no-op without ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1``.
67+
"""
7668
from pxr import Usd
7769

78-
monkeypatch.setenv(_ENV_VAR, "0")
70+
monkeypatch.delenv(_ENV_VAR, raising=False)
7971

8072
stage = Usd.Stage.CreateInMemory()
8173
world = stage.DefinePrim("/World", "Xform") # noqa: F841
@@ -92,7 +84,7 @@ def test_partitioning_can_be_disabled(monkeypatch):
9284

9385

9486
@pytest.mark.isaacsim_ci
95-
def test_partitioning_isolates_rigid_object():
87+
def test_partitioning_isolates_rigid_object(enable_scene_partition):
9688
"""Per-env :class:`~isaaclab.assets.RigidObject` instances at unique world positions render
9789
as visibly different per-env tiles when RTX honors ``primvars:omni:scenePartition``."""
9890

@@ -159,7 +151,7 @@ class _Scene(InteractiveSceneCfg):
159151

160152

161153
@pytest.mark.isaacsim_ci
162-
def test_partitioning_isolates_articulation():
154+
def test_partitioning_isolates_articulation(enable_scene_partition):
163155
"""Per-env :class:`~isaaclab.assets.Articulation` instances driven to wildly different joint
164156
poses render as visibly different per-env tiles when RTX honors top-level scene partitions."""
165157

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Test-only: restored default-on scene-partition coverage for registered rendering tasks with Isaac Sim alpha.50.
1+
Test-only: restored scene-partition coverage for registered rendering tasks with Isaac Sim alpha.50.

source/isaaclab_tasks/test/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
1919

2020

21+
@pytest.fixture()
22+
def enable_scene_partition(monkeypatch):
23+
"""Set ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` for the duration of one test."""
24+
monkeypatch.setenv("ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION", "1")
25+
26+
2127
@pytest.fixture()
2228
def ovstage_variant(request, monkeypatch):
2329
"""Select the indirectly parametrized OVRTX stage path."""

source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _collect_camera_outputs(env: object) -> dict[str, dict[str, torch.Tensor]]:
8686

8787

8888
@pytest.mark.parametrize("task_id, presets, env_name", _RENDER_CORRECTNESS_TASK_IDS)
89-
def test_rendering_registered_tasks(task_id: str, presets: str | None, env_name: str):
89+
def test_rendering_registered_tasks(task_id: str, presets: str | None, env_name: str, enable_scene_partition):
9090
"""Test registered tasks rendering correctness."""
9191
env = None
9292

source/isaaclab_visualizers/changelog.d/esekkin-enable-scene-partition-default.skip

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,9 @@ def _apply_viewport_camera_scene_partition(self, usd_stage: Usd.Stage, num_envs:
899899
``/World/envs`` and are created by Kit, so they do not inherit the env-root
900900
primvar authored by :class:`~isaaclab.scene.InteractiveScene`.
901901
902-
This behavior is enabled by default. Set
903-
``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=0`` to disable it,
904-
matching :meth:`~isaaclab_physx.renderers.IsaacRtxRenderer.prepare_stage`.
902+
This method is a no-op unless ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1``,
903+
matching the opt-in behaviour of
904+
:meth:`~isaaclab_physx.renderers.IsaacRtxRenderer.prepare_stage`.
905905
"""
906906

907907
if not isaac_rtx_per_env_scene_partition_enabled():
@@ -911,7 +911,8 @@ def _apply_viewport_camera_scene_partition(self, usd_stage: Usd.Stage, num_envs:
911911
return
912912

913913
logger.debug(
914-
"[KitVisualizer] Per-environment Isaac RTX scene partitioning is enabled."
914+
"[KitVisualizer] Per-environment Isaac RTX scene partitioning is enabled"
915+
" (ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1)."
915916
" Authoring omni:scenePartition attribute onto viewport camera '%s'.",
916917
self._controlled_camera_path,
917918
)

0 commit comments

Comments
 (0)