Repository navigation
keep environment roots for asset-level cloning - #8686
Merged
r-schmitt merged 2 commits intoOct 16, 2026
Merged
Conversation
r-schmitt
requested review from
AntoineRichard,
huidongc,
marcodiiga,
pbarejko and
rilei-nvidia
as code owners
October 16, 2026 19:17
Collaborator
Author
|
run-ci |
Contributor
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Test quality (1). Other reviewed categories look good.
- PR description: The body repeats the opening fix sentence and leaves
Fixes # (issue)unresolved; remove both, and cite validation for the duo-camera and heterogeneous-variant claims or narrow them. - Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Implementation looks good.
- Style consistency: Style consistency looks good.
- Test quality: The transform and partition assertions cover the regression, but
use_ovstagenow selects no production branch and duplicates the same scene build; remove that parameter and assignment.
Minor fixes needed. Posted 1 inline finding.
Automated review; human maintainers own approval decisions.
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryKeeps destination environment roots when
Review was based on source inspection; tests were not run. Reviews (1) · Last reviewed commit: "keep environment roots when cloning with..." · Reviewed by Greptile |
kellyguo11
approved these changes
Oct 16, 2026
Collaborator
Author
|
run-ci |
pbarejko
approved these changes
Oct 16, 2026
6 of 7 tasks
ooctipus
added a commit
that referenced
this pull request
Oct 16, 2026
# Description Clone preparation now resolves native representations before initialization, and the simulation registry owns OVStage resources. This PR contains the cloning foundation and its simplification. Shared OVPhysX/OVRTX stages remain isolated in #8279. Without flags, OVPhysX keeps native physics cloning and OVRTX uses an **independent rendering OVStage**; Newton uses native OVRTX cloning. `ISAAC_LAB_OVRTX_USE_OVSTAGE=0` or `1` overrides the rendering path without changing physics ownership. This policy is resolved in `OvrtxReplicateContext.prepare`, in `isaaclab_ov/cloner/replicate.py`, before backend initialization. The renderer-side switch helper was removed. #8279 adds separate opt-in flags for sharing. - `ReplicateContext` gives USD, PhysX, Newton, OVPhysX, OVRTX and OVStage one explicit preparation/dispatch contract. Removed optional method discovery and duplicate constructors. Preparation is inline before context construction, standalone reset and late renderer initialization. Custom contexts must inherit the base and implement `replicate`; no compatibility shim was added. - `OvstageBackend` owns population, prepared copies, queries/path lists and write ordinals. Contexts use `SimulationContext.get_backends()`; renderers own bindings and borrow resources. OVRTX constructors declare requirements without allocating native engines. - `InteractiveScene` authors prototypes only. SDP reads the environment count from `ClonePlan`, including native copies absent from USD. Backends apply planned placement and create required frames in private exports. Removed recursive deactivation and environment-frame capture/restore. Routed prototypes are still selected correctly after USD replication. Deformable discovery and Newton import use authored source frames rather than infer them from planned destination poses. - Consolidated camera registration, binding setup, pose conversion, submission and segmentation decoding. Shared unscaled SDP conversions and retained asynchronous buffers replace duplicate work. Native partition writes create missing attributes so sensor cameras exclude neighboring environments. - Removed OVStage 0.1 / OVRTX 0.4 compatibility modules and fallbacks. The pinned OVStage 0.2 and OVRTX 0.5 APIs are used directly, with concrete stage, binding, frame and buffer types. Preserved current upstream CUDA stream encoding and stream-ordered mapped-buffer release. Based on `develop` at `c1e69cc45`, including #8585 and #8686. Scene-owned cameras and the RTX viewer use the same rendering stage; the reusable `OvstageBackend` owns its resources. The rebase preserves renderer-owned markers and runtime geometry, explicit simulation ownership, scene lighting, and authored environment-root transforms and metadata. Physics/rendering stage sharing remains in #8279, which needs to be restacked on this revision. ## Size Against `develop`: **491 fewer production lines**, 117 additional test lines and 103 documentation/metadata lines: **271 fewer lines overall**, across 61 files (+1,932/-2,203). The OVPhysX physics manager, camera implementation and Newton visualizer match `develop`; shared-stage coordination stays in #8279. The benchmark results below are historical measurements at the named revisions, not new measurements of this rebase. ## Rendering defaults and Kuka measurements Matched Kuka Allegro Lift camera runs (`single_camera,rgb64`), 1,024 environments, median full environment-step time: | Physics / measured revision | Native OVRTX cloning | Independent OVStage rendering | |---|---:|---:| | OVPhysX / develop `c9a40a1de` | 113.5 ms | 80.4 ms | | Newton MJWarp / foundation `0018ae99d` | 18.0–18.3 ms | 30.7–30.8 ms | OVPhysX used one diagnostic process per path. Newton used two per path in reversed order. Each measured 60 synchronized steps after 15 warmup steps. At 128 environments, Newton measured 12.2 ms with OVRTX cloning versus 14.1 ms with OVStage rendering. Newton was 1.6.1rc1 (`dff296359`), MuJoCo/MuJoCo Warp 3.12.0, using the same OV library versions and GPU below; both Newton paths used an isolated kernel cache with fresh LTO artifacts after resolving a pre-existing compiler-cache mismatch. With independent OVStage rendering, OVPhysX Kuka startup and stepping were essentially unchanged by the foundation: develop 70.1 s / 80.4 ms versus #8232 70.8 s / 81.3 ms at 1,024 environments. These measurements justify backend-specific rendering defaults; they do not justify enabling physics/rendering sharing. Shared-stage measurements are in #8279. ## Native-cloning startup | Environments | Base median [range], s | PR median [range], s | Change | |---:|---:|---:|---:| | 128 | 4.000 [3.984–4.038] | 4.067 [3.986–4.121] | +1.7% | | 1,024 | 7.593 [7.492–7.646] | 7.000 [6.985–7.054] | -7.8% | | 4,096 | 31.715 [31.347–31.799] | 28.851 [28.734–29.019] | -9.0% | Compared `develop` at `c9a40a1de` with this foundation at `0018ae99d`. Three measured fresh processes per revision and environment count, alternating revision order, after one excluded warmup pair per count. Both use native cloning (`ISAAC_LAB_OVRTX_USE_OVSTAGE=0`). The 128-environment timings overlap; the larger counts show improvement. These are startup measurements, not shared-stage or steady-state throughput claims. Eight rigid cubes per environment, dome lighting, and a tiled 64×64 diffuse/depth camera. Timing covers simulation/scene construction, reset and the first synchronized image; imports are excluded. **All 24 runs**, including warmups, checked 4.5 m center depth in every environment. Threadripper PRO 7965WX; RTX 5090 GPU 1; driver 580.173.02; Python 3.12.12; OVPhysX 0.6.3, OVRTX 0.5.0.377615, OVStage 0.2.0.377349, Warp 1.17.0, Torch 2.12.0+cu130. Both revisions used the same environment and GPU. No tests or other work used that GPU during timing. The SDK reports existing CPU powersave/device-masking warnings. <details> <summary>Startup reproduction harness</summary> Save as `benchmark_startup.py`. Use one environment with the dependency versions above for both checkouts: ```bash CUDA_VISIBLE_DEVICES=1 /path/to/shared-venv/bin/python benchmark_startup.py --root /path/to/checkout --num-envs 1024 --ovstage 0 ``` Repeat at 128, 1024 and 4096 environments: one warmup pair, then three measured pairs; alternate the order of base and PR runs. Compare `scene_to_image_s`. ```python import argparse import json import os import time from pathlib import Path started = time.perf_counter() parser = argparse.ArgumentParser() parser.add_argument('--root', required=True) parser.add_argument('--num-envs', type=int, default=128) parser.add_argument('--ovstage', type=int, choices=(0, 1), default=0) args = parser.parse_args() os.environ['ISAAC_LAB_OVRTX_USE_OVSTAGE'] = str(args.ovstage) # Dependencies are identical; only the selected checkout changes. import sys root = Path(args.root) sys.path[:0] = [str(path) for path in (root / 'source').iterdir() if path.is_dir()] import numpy as np import torch import warp as wp from isaaclab.app import launch_simulation from isaaclab.assets import AssetBaseCfg, RigidObjectCfg from isaaclab.envs import ManagerBasedEnv, ManagerBasedEnvCfg from isaaclab.scene import InteractiveScene, InteractiveSceneCfg from isaaclab.sensors import CameraCfg from isaaclab.sim import CuboidCfg, DomeLightCfg, MassCfg, PinholeCameraCfg, PreviewSurfaceCfg, SimulationCfg, UsdPhysicsCollisionCfg, UsdPhysicsRigidBodyCfg from isaaclab.utils import configclass from isaaclab_ov.physics import OvPhysxCfg from isaaclab_ov.renderers import OVRTXRendererCfg @configclass class SceneCfg(InteractiveSceneCfg): light = AssetBaseCfg(prim_path='/World/Light', spawn=DomeLightCfg(intensity=1000)) camera = CameraCfg( prim_path='{ENV_REGEX_NS}/Camera', height=64, width=64, data_types=['simple_shading_constant_diffuse', 'distance_to_image_plane'], spawn=PinholeCameraCfg(focal_length=24.0, horizontal_aperture=20.955, clipping_range=(0.1, 100.0)), offset=CameraCfg.OffsetCfg(pos=(0, 0, 5), rot=(0, 0, 0, 1), convention='opengl'), renderer_cfg=OVRTXRendererCfg(log_level='error'), ) scene_cfg = SceneCfg(num_envs=args.num_envs, env_spacing=10) for i in range(8): setattr(scene_cfg, f'object_{i}', RigidObjectCfg( prim_path=f'{{ENV_REGEX_NS}}/Object_{i}', spawn=CuboidCfg(size=(1, 1, 1), rigid_props=UsdPhysicsRigidBodyCfg(), mass_props=MassCfg(mass=1), collision_props=UsdPhysicsCollisionCfg(), visual_material=PreviewSurfaceCfg(diffuse_color=(0.8, 0.2, 0.1))), init_state=RigidObjectCfg.InitialStateCfg(pos=(float(i % 4) * 1.5, float(i // 4) * 1.5, 0)), )) cfg = ManagerBasedEnvCfg(scene=scene_cfg, sim=SimulationCfg(physics=OvPhysxCfg(), device='cuda:0', gravity=(0.0, 0.0, 0.0)), decimation=1, observations={}, actions={}, events={}, seed=42) imports_done = time.perf_counter() with launch_simulation(cfg, {'visualizer': [], 'device': 'cuda:0'}) as _: launched = time.perf_counter() from isaaclab.sim import SimulationContext sim = SimulationContext(cfg.sim) try: scene = InteractiveScene(cfg.scene) constructed = time.perf_counter() sim.reset() reset_done = time.perf_counter() scene.reset() scene.update(sim.get_physics_dt()) data = scene['camera'].data.output depth = data['distance_to_image_plane'].torch wp.synchronize_device('cuda:0') image_ready = time.perf_counter() assert tuple(depth.shape) == (args.num_envs, 64, 64, 1), depth.shape centers = depth[:, 32, 32, 0].cpu().numpy() np.testing.assert_allclose(centers, 4.5, atol=0.02) result = dict(ovstage=args.ovstage, num_envs=args.num_envs, imports_s=imports_done-started, launch_s=launched-imports_done, scene_create_s=constructed-launched, sim_reset_s=reset_done-constructed, reset_first_image_s=image_ready-constructed, scene_to_image_s=image_ready-launched, script_to_image_s=image_ready-started, depth_min=float(centers.min()), depth_max=float(centers.max())) print('STARTUP_RESULT ' + json.dumps(result), flush=True) finally: sim.clear_instance() ``` </details> ## Validation The three previously failing Franka soft/cloth/cable native-OVRTX golden-image cases passed on GPU0, along with 152 focused clone, renderer, USD-export and scene-data tests. The environment-count regression failed before the fix and passed afterward. Existing coverage was extended; no test files or image tolerances were added. The stale `OvstageBackend.reset` autodoc reference was removed; the full docs build runs in CI. Earlier checks passed 110 profiling-target checks, 71 clone/renderer/binding checks, 10 Newton cloning tests (plus four subtests), and all seven RTX viewer integration cases. The Newton placement regression failed before the fix and passed afterward. Existing tests were extended; no new test files were added. On GPU0, Shadow Hand passed with OVRTX and Newton rendering. Cartpole passed 15 cases; its OVStage constant-diffuse comparison failed identically on `develop`. Kuka's remaining image-comparison failures also reproduced on `develop`; no image tolerances were changed. Earlier rebase validation passed 217 focused cases, including both RTX scene paths, native physics/rendering ownership, camera calibration, lighting, material synchronization and lifecycle checks. The Coffee GPU capture reproduction also passed: moving particles changed recorded pixels without drawing a window. Native validation used GPU0, OVPhysX 0.6.4, OVRTX 0.5.1 and OVStage 0.2.1. Formatting, changelog validation and `git diff --check` passed. Documentation builds are left to CI. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `uv run isaaclab --format` - [x] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings (native runs include existing SDK and Torch warnings) - [x] I have validated the changed behavior with focused coverage - [x] I have added changelog fragments for the changed packages - [x] My name already exists in `CONTRIBUTORS.md`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix geometry leaking between environment camera views and misplaced static geometry when using OVStage with asset-level cloning.
The OVStage export previously removed destination environment roots regardless of what was being cloned. Asset-level cloning recreated the children without preserving the roots’ authored USD type, transforms, and scene partition metadata.
Environment roots are now retained for asset-level cloning and removed only when the roots themselves are clone targets. This also preserves the shared scene used by the duo-camera preset’s scene and robot-mounted cameras.
The issue affects repeated asset clones, including heterogeneous environments with repeated variants; it is not limited to homogeneous environments.
Fixes # (issue)
Fix geometry leaking between environment camera views and misplaced static geometry when using OVStage with asset-level cloning.
Type of change
Release backport
developScreenshots
Checklist
Docker and GPU tests run on demand. Push the commits you want tested, then
comment
run-cion the pull request.pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there