Repository navigation
Route clone backends through ClonePlan - #7462
Conversation
|
Too many files changed for review (295 files, 100 file limit). Bypass the limit by tagging |
There was a problem hiding this comment.
Isaac Lab Review Bot
The flattened ClonePlan/ReplicateSession lifecycle is coherent overall, but cfg discovery can incorrectly turn sensor visualizer configs into conflicting plan rows, camera spawning removes established redirect/existence behavior, the RayCasterCfg.spawn default change lacks migration guidance, and startup profiling still targets the removed dispatch name.
- Design and architecture: Publishing one immutable plan before construction and dispatching it to registered backends provides a single description of clone ownership. However,
_plan_cfgsalso classifies visualizer marker configs as prim authors; sensors sharing a default marker path can therefore fail planning with duplicate ownership. Visualizer-only configs should be excluded from clone-plan rows. - API: The major changelog covers the removed cloner entry points and most cfg/spawner field removals. It does not cover the
RayCasterCfg.spawndefault changing fromSensorFrameCfg()toNone. Camera construction also drops the previous physics-body-to-child redirect and existing-prim guard, changing behavior for publicCameraCfgusages that target bodies or pre-authored cameras. - Implementation: Plan construction, source-path resolution, and backend dispatch were traced. The remaining implementation integration issue is the startup profiler whitelist still matching
cloner.*:replicateafter dispatch was renamed to_replicate, causing clone-dispatch measurements to be reported as zero placeholders.
Significant concerns. Posted 4 actionable findings inline.
The full PR diff was reviewed; some supplemental surrounding file context was omitted.
Automated review; human maintainers own approval decisions.
5c3ba34 to
5f7619e
Compare
|
PR 3 has now been split at the execution/lifecycle boundary. This PR contains only the existing Accordingly, the earlier automated inline findings on |
|
run-ci |
bc71259 to
987f764
Compare
|
run-ci |
987f764 to
91288ba
Compare
|
run-ci |
# Description Revives #6308 on current `develop` and supersedes #3728 with a single backend-neutral contract for kinematic rigid-object rendering. ## Architecture `source/isaaclab/test/renderers/rigid_object_rendering_contract.py` is the composition root. It owns the cloned scene, kinematic pose sequence, depth measurements, and assertions. Package-local adapters own only availability checks, simulation/renderer selection, and backend cleanup: - Isaac RTX + PhysX on CPU and CUDA, with and without a coexisting articulation; - Newton Warp + PhysX on CUDA; - OVRTX + OVPhysX on CUDA through both legacy and OVStage scene ownership (OVStage runs when installed). The dependency direction is adapter -> shared test contract -> public Isaac Lab APIs. An AST architecture gate rejects backend imports in the shared contract and rejects scene, asset, sensor, or class ownership in adapters. The contract creates two cloned instanceable DexCubes with root-level nonuniform scale, verifies their depth silhouettes, moves both kinematic bodies through the public rigid-object tensor API, verifies the physics poses, and requires opposite rendered centroid displacement. ## Current-develop audit Most production changes in the old PR have since landed through newer ownership boundaries: Isaac RTX render-product lifetime in #6729, Newton shadow-state copying in #6773, OVRTX scale-aware transform writes in #7010, and Newton Fabric scale preservation in #7481. This revival removes those stale patches rather than carrying duplicate implementations. The revived contract exposed one remaining OVRTX bug: composed scale was captured only for clone-plan source paths, while OVRTX creates non-source destinations after exporting the host USD stage. Those destinations therefore defaulted to unit scale. As a deliberately temporary bridge, this PR projects only captured non-unit scales through the existing `isaaclab.cloner.query.path_env_ids` and `path_to_clone` boundary using the already-validated `ClonePlan`; real destination scales take precedence. It adds no plan fields, query APIs, renderer configuration, or per-body fallback, and the bridge can be deleted as one unit when SDP supplies composed scale aligned with canonical rigid-body paths. Historical context: [Isaac Sim forum report](https://forums.developer.nvidia.com/t/rigidbody-prim-is-not-updated-in-rendering-pipeline-if-set-to-kinematic/346608). ## Type of change - Bug fix - Shared regression coverage ## Testing - Isaac RTX contract: 4 passed (CUDA/CPU x articulation absent/present). - Newton Warp contract: 1 passed. - OVRTX contract: 2 passed (legacy and OVStage). - OVRTX renderer unit surface: 167 passed. - Core architecture and Newton visualization suites: 25 passed. - OVRTX clone-plan suite: 17 passed. - Cloner query and rendering-contract architecture suites: 87 passed. - Controlled OVRTX regression: failed before the production fix with clone silhouettes of 264 vs. 36 pixels; passed after the fix. - Incoming #7462 NumPy-backed `ClonePlan` query-boundary smoke check: passed unchanged, including non-dense environment ids. - `uv run isaaclab -f`: all hooks passed against the exact upstream `develop` base, including changelog validation. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [x] Documentation changes are not applicable - [x] I have added unit and integration regression coverage - [x] I have added changelog fragments for every touched package - [x] My name is already present in `CONTRIBUTORS.md`
# Description Restores the missing `torch` import in `test_ovrtx_clone_plan.py`. #7462 converted the existing clone-plan test inputs from Torch tensors to NumPy arrays and removed the then-unused import. #6308 subsequently added a new object-scale test using `torch.ones` and `torch.arange` without restoring the import, causing the repository-wide Ruff pre-commit check to fail with `F821 Undefined name torch`. This PR contains only the import repair and an `isaaclab_ov` `.skip` changelog fragment. It unblocks #7579 and other changes based on the current `develop` branch. ## Type of change - Bug fix (non-breaking test fix) ## Release backport - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` No release backport is required: `release/3.0.0` already imports `torch` in this test. ## Screenshots Not applicable. ## Testing - `uv run --no-project --with pre-commit python -m pre_commit run --all-files` - `uv run --no-project python tools/changelog/cli.py check --include-worktree` - `git diff --check upstream/develop...HEAD` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the full pre-commit checks - [x] Documentation changes are not required because no public API changed - [x] My changes generate no new warnings - [x] The fix directly covers the Ruff `F821` failure - [x] I have added an `isaaclab_ov` changelog fragment - [x] My name already exists in `CONTRIBUTORS.md`
# Description This follows #7462 by making the simulation's `ClonePlan` available before cfg-owned scene construction. `ReplicateSession` now builds and publishes the plan on entry, constructs every participant at its planned source path, and dispatches that same object on exit. `SimulationContext` remains the canonical owner of the plan pointer; no secondary lifecycle state, constructor ownership heuristic, stage discovery, fallback context, or second clone mapping is introduced. `InteractiveScene` owns this lifecycle for cfg-declared scenes. An empty `InteractiveScene` authors only the env-0 prototype and leaves replication to direct task setup. That removes redundant environment-root authoring while preserving direct workflows with custom clone positions. Plan positions remain NumPy during scene construction and become a cached device tensor only when the public `env_origins` property is read. Kitless shadow visualization now takes its environment count and world positions from the same plan instead of rediscovering destination env transforms on USD. This lets OVPhysX feed Newton Renderer or OVRTX without requiring redundant destination prims. ## Migration Custom cfg-owned composition roots should use the session around cfg construction: ```python with cloner.ReplicateSession(asset_cfgs, num_clones=num_envs, env_spacing=env_spacing): for cfg in asset_cfgs: cfg.class_type(cfg) ``` Homogeneous direct workflows construct env 0 first, then finish their one clone lifecycle explicitly: ```python plan = cloner.clone_plan_from_env_0(src, dest, num_envs, positions, global_paths=global_paths) cloner.replicate(plan) ``` ## Size | Scope | Added | Deleted | Net | | --- | ---: | ---: | ---: | | This PR | 180 | 143 | +37 | | Production | 79 | 79 | 0 | | #7462 + this PR | 1,413 | 1,813 | -400 | ## Performance The earlier functional 3B head was performance-neutral in one matched warm sample on physical GPU 0 using `Isaac-Lift-KukaAllegro`, 4,096 environments, Newton MJWarp physics, and no visualizer: | Metric | This PR | merged develop | | --- | ---: | ---: | | Total startup | 42.58 s | 43.11 s | | Environment creation | 39.76 s | 39.24 s | | First step | 0.658 s | 0.637 s | The cleanup commits remove redundant empty-scene root authoring and eager environment-origin tensor creation. A current-head Kuka sample will replace this table when the shared physical GPU 0 is idle. ## Type of change - Breaking change - Bug fix - Documentation update ## Release backport - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Screenshots Not applicable. ## Validation - 92 clone-plan and `ReplicateSession` tests passed - 3 focused `InteractiveScene` origin/lifecycle tests passed on CPU and CUDA - 16 Newton clone/visualization-builder tests passed - 22 Newton shadow-model lifecycle tests passed - The missing-destination regression test fails with `KeyError` before the fix and passes after it - OVPhysX → Newton Renderer completed creation, reset, and first rendered step with only the env-0 USD prototype - Former CI failures passed: visual-material scene (1), multi-mesh ray-caster camera (21), ray-caster integration (7), and Newton duplicate-body frame transforms (4) - PhysX and Newton visual-color-randomization demos reached setup and continued through repeated resets - Warning-free current documentation build passed - Repository formatting, lint, changelog, and LFS checks passed - `git diff --check` passed The prior `isaaclab_rl` failure is the independent LEAPP 0.7 regression fixed by #7592; this PR does not duplicate that dependency pin. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [x] I have made corresponding documentation changes - [x] My changes generate no new warnings - [x] I have added focused lifecycle and regression tests - [x] I have added the required changelog fragments - [x] My name already exists in `CONTRIBUTORS.md`
…7622) # Description Backports #7298 to `release/3.0.0`. This preserves MuJoCo-authored joint friction and damping when USD stages are imported for Newton managers that register MuJoCo solvers. Both vectorized clone replication and standalone stage import now use the active manager's schema-resolver policy, with MuJoCo values remaining lower-priority fallbacks behind Newton and PhysX values. Coupled managers inherit the same solver-capability policy. The merged source commit `f948fa596c1c61a155d55778976b7547799e6200` cherry-picked without conflicts. The release branch intentionally retains its Torch-based clone mapping contract; the backported clone-path regression test is adapted from the source PR's NumPy inputs to the release API's Torch tensors. Backporting #7462 is out of scope because it is a broad, breaking `ClonePlan` and NumPy API migration that explicitly did not request a release backport. A separate follow-up adds the `isaaclab_contrib` changelog fragment required for the second changed source package and omitted from the source PR. No dependency or public API is added. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [ ] <!-- backport-active-release --> This PR already targets the active release branch; do not backport it again. ## Screenshots Not applicable; this fixes a non-visual USD import path. ## Validation - `uvx --from pre-commit==4.6.2 pre-commit run --all-files` — passed after the release-specific test adaptation. - `tools/changelog/cli.py check release/3.0.0` — passed for both changed packages against the current release base. - Python bytecode compilation passed for all changed Python files. - `git diff --check upstream/release/3.0.0..HEAD` — passed. - Source PR validation: the focused production-path regression matrix passed all five cases; the broader Newton manager, cloner, custom coupling, generic coupler, and MJCF converter suites also passed on the source branch. - The first release CI run exposed that the source test passed NumPy arrays introduced by develop-only #7462 into the release helper's Torch API. The test now uses the same Torch input convention as the neighboring release cloner coverage. The runtime Newton tests cannot run on this macOS host because the current lockfile supports Linux x86_64/aarch64 and Windows AMD64 only. Release CI provides the supported-platform verification. ## Checklist - [x] I have read and understood the contribution guidelines. - [x] I have run the available pre-commit checks. - [x] Documentation changes are not required because no public API or user workflow changed. - [x] My changes generate no new warnings in the available checks. - [x] The source PR includes focused regression coverage for both production import paths. - [x] I have included changelog fragments for `isaaclab_newton` and `isaaclab_contrib`. - [x] The original contributor already appears in `CONTRIBUTORS.md`. --------- Co-authored-by: Zeng Qingcheng <[email protected]> Co-authored-by: NeoZng <[email protected]>
This is a narrow follow-up to merged isaac-sim#7453. It keeps that Newton fast path and makes the existing `ClonePlan` the single mapping consumed by USD, Newton, PhysX, and OvPhysX replication. Planning records `context_rows`, mapping each simulation-owned clone-context type to the plan rows it consumes. `cloner.replicate(plan)` retrieves those already-registered contexts from `SimulationContext`, orders them by replication priority, and passes each the same plan. Backends no longer rebuild the mapping through local `queue(...)` or `queue_mapping(...)` state. Clone planning is a NumPy host-side control plane. `ClonePlan`, its constructors, strategies, queries, and raw clone APIs use NumPy arrays; backend code no longer performs Torch device synchronization or `detach().cpu().tolist()` round trips. Runtime owners convert once when they need a device tensor. `InteractiveScene` derives its environment roots and device-side origins from the same plan instead of calculating a second grid. The public structure stays small: - `ClonePlan.global_paths` remains the explicit declaration for shared scene prims. - `ClonePlan.env_ids` and `positions` remain optional for query-only plans; execution validates what it needs. - Per-asset `cloning_contexts`, `cfg_rows`, `ReplicateSession`, and the existing scene-construction lifecycle remain. - Standalone tooling keeps the raw USD, Newton, PhysX, and OvPhysX replication functions. - OVRTX camera/export/SDP architecture remains deferred to the renderer cutover; this PR only removes Torch round trips from its mechanical plan-array consumption. - No stage discovery, fallback context construction, registry-wide duck routing, or second clone mapping is introduced. Custom clone contexts now implement `replicate(plan)` and must be registered with `SimulationContext.get_or_create_backend(...)` before dispatch. Remove context-local `queue(...)` / `queue_mapping(...)` calls and the former backend `PHYSICS_CONTEXT` aliases; raw standalone replication functions remain available. The high-level `stage=` argument is removed from `cloner.replicate(...)` and `ReplicateSession`; each simulation-owned context already owns its stage. Clone arrays and raw clone API arrays are now NumPy. The unused public `device` arguments are removed from `CloneCfg`, plan constructors, `grid_transforms`, `ReplicateSession`, clone strategies, and raw backend replication functions. Custom clone strategies now implement `(combinations: np.ndarray, num_clones: int) -> np.ndarray`. | Added | Deleted | Net | | ---: | ---: | ---: | | 1,267 | 1,700 | **-433** | These counts are for this PR alone against current `develop`; merged The targeted benchmark warms with 128 worlds, then times replication and required label publication for one 48-body/48-shape Newton prototype at 4,096 worlds. Measurements taken while isaac-sim#7453 was under review used physical GPU 0 and the same Newton revision: | Revision | Targeted median | Versus pre-isaac-sim#7453 develop | | --- | ---: | ---: | | develop before isaac-sim#7453 | 1.428 s | — | | isaac-sim#7453 | 1.171 s | -18.0% | | this follow-up before restacking | 1.181 s | **-17.3%** | The restack removed the duplicated isaac-sim#7453 implementation rather than reimplementing it. A file-by-file audit confirms this PR no longer changes isaac-sim#7453's label-prefix fast-path files, and the one-source/all-true Newton route still delegates to `ModelBuilder.replicate(...)`. - Breaking clone-context and NumPy API simplification - Documentation update - `84 passed` — clone-plan algebra - `7 passed` — replicate-session lifecycle - `15 passed` — focused Newton label-prefix/root-name coverage from - Repository formatting, lint, RST, spelling, license, changelog, LFS, and hygiene hooks passed against current `upstream/develop` - `git diff --check` passed - Static audit found no Torch import or CPU/list materialization in the core, Newton, PhysX, or OvPhysX clone paths - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` - [x] I have read and understood the contribution guidelines - [x] I have run the relevant pre-commit checks - [x] I have made corresponding documentation changes - [x] I have added focused contract, routing, and lifecycle tests - [x] I have added a changelog fragment for every touched source package - [x] My name already exists in `CONTRIBUTORS.md` (cherry picked from commit 644acf5)
Description
This is a narrow follow-up to merged #7453. It keeps that Newton fast path and makes the existing
ClonePlanthe single mapping consumed by USD, Newton, PhysX, and OvPhysX replication.Planning records
context_rows, mapping each simulation-owned clone-context type to the plan rows it consumes.cloner.replicate(plan)retrieves those already-registered contexts fromSimulationContext, orders them by replication priority, and passes each the same plan. Backends no longer rebuild the mapping through localqueue(...)orqueue_mapping(...)state.Clone planning is a NumPy host-side control plane.
ClonePlan, its constructors, strategies, queries, and raw clone APIs use NumPy arrays; backend code no longer performs Torch device synchronization ordetach().cpu().tolist()round trips. Runtime owners convert once when they need a device tensor.InteractiveScenederives its environment roots and device-side origins from the same plan instead of calculating a second grid.The public structure stays small:
ClonePlan.global_pathsremains the explicit declaration for shared scene prims.ClonePlan.env_idsandpositionsremain optional for query-only plans; execution validates what it needs.cloning_contexts,cfg_rows,ReplicateSession, and the existing scene-construction lifecycle remain.Migration
Custom clone contexts now implement
replicate(plan)and must be registered withSimulationContext.get_or_create_backend(...)before dispatch. Remove context-localqueue(...)/queue_mapping(...)calls and the former backendPHYSICS_CONTEXTaliases; raw standalone replication functions remain available.The high-level
stage=argument is removed fromcloner.replicate(...)andReplicateSession; each simulation-owned context already owns its stage.Clone arrays and raw clone API arrays are now NumPy. The unused public
devicearguments are removed fromCloneCfg, plan constructors,grid_transforms,ReplicateSession, clone strategies, and raw backend replication functions. Custom clone strategies now implement(combinations: np.ndarray, num_clones: int) -> np.ndarray.Size
These counts are for this PR alone against current
develop; merged #7453 code and dependency changes are no longer duplicated in the diff.Performance
The targeted benchmark warms with 128 worlds, then times replication and required label publication for one 48-body/48-shape Newton prototype at 4,096 worlds. Measurements taken while #7453 was under review used physical GPU 0 and the same Newton revision:
The restack removed the duplicated #7453 implementation rather than reimplementing it. A file-by-file audit confirms this PR no longer changes #7453's label-prefix fast-path files, and the one-source/all-true Newton route still delegates to
ModelBuilder.replicate(...).Type of change
Validation
84 passed— clone-plan algebra7 passed— replicate-session lifecycle15 passed— focused Newton label-prefix/root-name coverage from [Newton] Delegate homogeneous world prefix generation toModelBuilder.replicate()#7453upstream/developgit diff --checkpassedRelease backport
developChecklist
CONTRIBUTORS.md