Repository navigation
[5C] Move Newton deformable ownership out of contrib - #8021
Conversation
|
run-ci |
|
There was a problem hiding this comment.
Isaac Lab Review Bot
The Newton deformable implementation is moved from contrib into isaaclab_newton.assets.deformable_object, with VBD now registering its builder callback directly. The relocated asset and data paths preserve the existing implementation, while documented class imports remain available through deprecated contrib re-exports.
- Design and architecture: Ownership now aligns the deformable asset, buffers, kernels, and VBD lifecycle integration within the Newton package, removing Newton’s optional contrib dependency. The direct callback registration remains idempotent and teardown is delegated to the existing
NewtonManager.clear()lifecycle. - API: The documented
DeformableObjectandDeformableObjectDatacompatibility imports are preserved and migration guidance points users toisaaclab_newton.assets; the backend-independent asset API remains unchanged. The removed registry and hook-management functions were lower-level implementation constructs rather than documented public exports, and all repository consumers shown in the patch migrate with the ownership change. - Implementation: The moved asset and data implementations retain the existing nodal-state, cache-invalidation, registration, and simulation-binding behavior, with imports adjusted to the Newton-local manager and kernels. The VBD manager now owns registry initialization and callback registration without the previous optional-import path.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
|
run-ci |
|
run-ci |
|
run-ci |
|
run-ci |
|
run-ci |
|
run-ci |
|
run-ci |
|
Backported to |
## Summary Move Newton deformable assets into `isaaclab_newton`, alongside articulations and rigid objects: 1. Import declared geometry and materials into source builders. 2. Compose and replicate those builders through the common native cloning path. 3. Initialize assets by selecting particle ranges from the completed backend; publish visual geometry through SDP. Render-only deformables follow the same flow: their meshes are built once per prototype, not rebuilt after cloning for every destination. - Remove the contrib geometry registry, per-world deformable construction hooks, and unused runtime interpolation wrappers. - Record MPM particle ranges and cable shape indices during native copying. - Bind PhysX/OVPhysX bodies through native views instead of completed-stage discovery. Fabric rendering prepares its own body bindings. - Preserve cloth rest angles, rotated tetrahedral rest frames, authored visuals/materials, and sensor-selected bodies. Source builders are not temporarily renamed. - Consolidate site injection and initialize stable deformable data wrappers once, while retaining timestamp-based lazy data updates. Against develop: **1,293 fewer production lines and 536 fewer test lines**. ## Migration **Breaking:** `isaaclab_contrib.deformable` is removed. For Newton-specific imports, use: ```python from isaaclab_newton.assets import DeformableObject, DeformableObjectData ``` The backend-neutral `isaaclab.assets.DeformableObject` and `DeformableObjectCfg` APIs are unchanged. The local `add_deformable_from_usd` importer remains until the pinned Newton provides material-import and selection-metadata parity. Removal conditions are documented beside it; related issue: #6208. ## Validation - 64 clone/import, SDP geometry, and site tests passed, including four subtests. - Four Newton deformable integration tests, three frame-transformer tests, and PhysX → Newton Franka cloth rendering passed. - Explicit native-builder initialization with `MODEL_INIT` site requests passed. - The prototype-first regression test failed before the fix and passed afterward. It covers repeated instances, shared geometry, distinct visual topology, native world ownership, and translated/rotated placement. - Formatting/lint checks and changelog validation passed. ## Startup benchmark Matched comparison of the latest cleanup: `fd302b37d` before → `8e2b841a7` after, **not a develop baseline**. PhysX physics → Newton renderer, 128×128 RGB cameras, no interactive visualizer, seed 42, RTX 5090 (GPU 0). Both checkouts used the same dependency environment. Mean of two fresh-process runs with warm asset/kernel caches, after an excluded warmup launch for each revision and workload. Measured order: before/after, then after/before. | Environment | Envs | Startup before → after [s] | Environment creation before → after [s] | |---|---:|---:|---:| | Franka Cloth Camera | 128 | 10.28 → 10.00 | 7.21 → 7.01 | | Franka Soft Camera | 128 | 11.08 → 9.90 | 8.28 → 7.01 | | Franka Cloth Camera | 512 | 19.62 → 15.59 | 16.66 → 12.60 | Startup is the sum of the benchmark's Python imports, configuration resolution, Kit launch, and `gym.make()` timings. Environment creation is the `gym.make()` subset; the subsequent `env.reset()`, rollout, and shutdown are excluded. Each launch also completed two warmup steps and ten measured steps to exercise the camera path; this is not a runtime-throughput comparison. At 512 cloth environments, scene creation fell **7.76 → 3.78 s**, while simulation initialization stayed **8.28 → 8.23 s**. This accounts for almost all of the **4.03 s (20.5%)** startup saving. The soft-body task saved **1.17 s (10.6%)**. The smaller 128-cloth startup difference is within the observed sample variation; no robust total-startup gain is claimed for that case. These are small-sample measurements on a shared workstation; unrelated jobs remained on GPU 1. <details> <summary>Reproduce and individual startup samples</summary> Run from each checkout with its imports and the same pinned dependencies: ```bash CUDA_VISIBLE_DEVICES=0 OMP_NUM_THREADS=8 MKL_NUM_THREADS=8 \ uv run --no-sync isaaclab -p -m isaaclab.benchmark.entrypoints.runtime \ --task Isaac-Lift-Cloth-Franka-Camera --num_envs 128 \ physics=isaacsim_physx renderer=newton_renderer --visualizer none \ --device cuda:0 --seed 42 --warmup_steps 2 --num_steps 10 \ --kit_args=--/renderer/multiGpu/enabled=false --output_path /tmp/cloth-startup ``` Also run `Isaac-Lift-Soft-Franka-Camera` at 128 environments and the cloth task at 512 environments. Warm each case first and keep each launch's JSON output. Startup samples [s], before → after: - Franka Cloth Camera (128): 10.507, 10.056 → 10.149, 9.859 - Franka Soft Camera (128): 11.034, 11.119 → 9.891, 9.917 - Franka Cloth Camera (512): 19.500, 19.747 → 15.428, 15.758 </details> ## Checklist - [x] Followed contribution guidelines and ran formatting checks - [x] Updated documentation and package changelog fragments - [x] Validated import, replication, runtime selection, and rendering - [x] <!-- backport-active-release --> Backport this pull request to the active release branch (cherry picked from commit 8577dbf)
## Summary Newton cameras, raycasters, and viewers acquire their shared native model and state from the simulation registry. They request transforms and deformable geometry through SDP instead of using the physics manager as a rendering gateway. - Cloning populates one native `ModelBuilder`: mutable construction data retained for hard resets. Consumer initialization acquires `NewtonBackend`: the finalized model and native buffers, including with PhysX/OVPhysX physics. - `NewtonBuilderCfg` declares Python-owned construction data; `NewtonBackendCfg` declares a runtime resource with `close()`. Both use the selected physics cfg and the same registry. Configs have no teardown methods. - Stateless `NewtonQueries` functions live beside `NewtonManager`, take an explicit backend, and own no state. Cameras and raycasters own their query graphs. The shared backend uses `TimestampedBuffer` to refit BVHs once per publication change. Raycasters configure the existing builder before finalization, regardless of which consumer acquired it first. - Hard resets replace the model and rebind consumers; closing a consumer does not close the shared resource. - Streaming cameras take `streaming_cam_renderer_cfg=OVRTXRendererCfg()` (or another renderer cfg), not a nickname. Visualizers register that dependency before cloning. Defaults remain Kit → Isaac RTX and other viewers → Newton Warp; explicit construction errors propagate without renderer substitution. ```python # During scene construction: acquire and populate the shared builder. builder = sim.get_or_create_backend(NewtonBuilderCfg(physics_cfg=sim.cfg.physics)) # After cloning: each consumer keeps this cfg and acquires the same native model. self.newton_cfg = NewtonBackendCfg(physics_cfg=sim.cfg.physics, device=sim.device) self.backend = sim.get_or_create_backend(self.newton_cfg) ``` This PR retains the supported single Newton representation for the selected physics configuration. It does not add independently configured consumer models. `NewtonManager.set_builder()` is removed; direct-builder callers use the first line above before `sim.reset()`. `NewtonManager.get_state()` and `update_visualization_state()` are removed; render consumers acquire the backend and call SDP directly. `sync_transforms_to_fabric()` and its `sync_transforms_to_usd()` alias are also removed: rendering-owned `FabricBackend.update_transforms(provider)` already requests poses through SDP. The registry calls `resource.close()` for `BackendCfg` resources and drops its reference to plain construction data. A missing backend `close()` is an error. SDP validates unique named source/destination paths when binding a layout; subsets and repeated `None` destination slots remain supported. Built on merged #8021. Relative to the develop base: **380 fewer production lines and 230 fewer test lines**. ## Validation - 136 visualizer/config/lifecycle tests passed. One existing Kit-only test was excluded from the kitless run. - 108 Newton manager tests passed on GPU 1, including first-step graph capture, recapture, solver initialization, and hard reset. - Both GPU camera/raycaster sharing tests passed with independent query graphs in captured and eager execution. - Extended existing tests for custom renderer cfg forwarding, registration before cloning, and propagation of unavailable-renderer errors. The cfg/error regressions failed before their fixes. - Formatting, lint, and changelog checks passed. Documentation builds and full Kit/rendering correctness remain for CI. - Query functions were relocated without changing capture behavior. No new startup/FPS claim is made by this revision.
…resources (#8099) ## Summary Backports #8027 (`b05a35a0eedda86662f82e663993c2b7046bf94f`) to `release/3.0.0`. Newton cameras, raycasters, and visualizers acquire shared native resources through the simulation registry and consume transforms and geometry through SDP. The original API migration notes and changelog fragments are included unchanged. This is an exact, conflict-free cherry-pick. The prerequisite #8021 is already present on the release branch. No additional refactoring or fixes are included. ## Validation - Exact-patch backport validation passed. - Formatting, lint, and changelog checks passed. - 14 focused registry/lifecycle tests passed. - A broader local test invocation encountered Rerun/package-import collection errors. Further local testing was stopped at the user's request; full package, GPU, rendering, and documentation validation is delegated to CI.
# Description Skip the PhysX scene-data rigid-body tensor view when the stage has no rigid bodies. Since #8021, `PhysxManager` requests a global `create_rigid_body_view("/**")` at warmup to back the scene-data transforms. `omni.physics.tensors` logs an error whenever a pattern matches no rigid bodies, so every static scene, for example `scripts/tutorials/00_sim/launch_app.py`, starts with: ```text [Error] [omni.physx.tensors.plugin] Pattern '/**' did not match any rigid bodies [Error] [omni.physx.tensors.plugin] Provided pattern list did not match any rigid bodies ``` The manager now checks the loaded USD stage, including instance proxies, for `UsdPhysics.RigidBodyAPI` before requesting the view. Rigid-body scenes keep the existing tensor-view and articulation-alias behavior. - **No false skips.** With Kit, every PhysX body comes from a USD prim: environments are always authored through `UsdReplicateContext`, and PhysX replication copies from USD sources. - **Cost.** `any()` stops at the first rigid body, so only static scenes walk the whole stage. - **Why not ask PhysX.** `omni.physics.tensors.SimulationView` cannot list bodies or silence the no-match error from Python. The tensors C++ layer has a per-view `setNoMatchLoggingQuiet`, which the OVPhysX tensor binding uses for wildcard bindings. Once it is exposed in Python, this stage walk can be replaced. `test_reset_without_rigid_bodies_skips_rigid_body_view` resets a scene whose only physics prim is a static collider and checks that no rigid-body view is requested or published. It fails on the pre-fix code with the `/**` request. `test_timeline_play_stop` covers the rigid-body branch; no existing test had a static scene. No additional dependencies or public API changes are required. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` `release/3.0.0` has the same `/**` request. ## Screenshots Not applicable; this removes startup log errors. ## Validation - `PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONEXE=.venv/bin/python <isaac-sim-source>/python.sh --no-ros-env -m pytest -q source/isaaclab_physx/test/sim/test_simulation_context_kit.py` — TODO: rerun after the test change (was 5 passed with source-built Isaac Sim 6.2). - The reported `launch_app.py --visualizer kit,viser,rerun,newton_gl` command reached `[INFO]: Setup complete...`; neither PhysX tensor error appeared before the bounded smoke run was stopped. - `ISAACLAB_CHANGELOG_BASE_REF=upstream/develop uv run --no-sync isaaclab -f` — passed. - `uv run --no-sync python tools/changelog/cli.py check upstream/develop --include-worktree` — passed. - `performance-smoke-benchmarks` fails on the `g1-newton` leg (Warp LTO build directory `Permission denied`). This is unrelated; the same workflow fails on `develop`. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `uv run isaaclab --format` - [x] No public documentation change is required; the user-visible fix is recorded in the package changelog - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the test-audit criteria to the test change - [x] I have added a changelog fragment under `source/isaaclab_physx/changelog.d/` - [x] My name already exists in `CONTRIBUTORS.md` --------- Co-authored-by: Antoine RICHARD <antoiner@nvidia.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Move Newton deformable assets into
isaaclab_newton, alongside articulations and rigid objects:Render-only deformable meshes are built once per prototype, not rebuilt for every destination after cloning.
Against develop: 1,295 fewer production lines and 549 fewer test lines.
Migration
Breaking:
isaaclab_contrib.deformableis removed. For Newton-specific imports, use:The backend-neutral
isaaclab.assets.DeformableObjectandDeformableObjectCfgAPIs are unchanged.The local
add_deformable_from_usdimporter remains until the pinned Newton provides material-import and selection-metadata parity. Removal conditions are documented beside it; related issue: #6208.Benchmarks
Matched develop → this PR, on an RTX 5090 (reserved GPU 1). One fresh-process sample per revision and workload, with warm caches; 50 excluded warmup steps followed by 200 measured steps, seed 42, no interactive visualizer. Every run completed.
Cloth and soft-body startup improved substantially. Cable showed a smaller startup saving; MPM was effectively neutral. Shared-Newton camera throughput changed by −0.2% to −1.8%, and MPM by +2.6%; these small single-pair differences do not establish a runtime change. PhysX → Newton camera throughput improved by 15.8% for cloth and 29.1% for soft bodies in this sample.
The main startup saving comes from importing deformable meshes once and using native replication, replacing repeated per-destination mesh construction. PhysX → Newton scene construction alone fell from 275.25 → 11.42 s for cloth and 864.77 → 11.45 s for soft bodies. The PR also removes the second native GPU PhysX load. For PhysX → Newton, deformable render geometry now receives destination-world IDs instead of being appended to the shared world, allowing Newton's triangle-mesh partitioning to use those IDs.
All camera cases use 128×128 RGB images. PhysX uses 4,095 environments to stay below the tested native deformable limit; MPM uses its maintained 64-environment task configuration, not a 4,096-environment comparison. Startup is
python_imports + task_config + app_launch + env_creation; it excludes the subsequent reset, first step, rollout, and shutdown. Throughput counts environment transitions, not GPU render calls.Exact revisions, dependencies, and reproduction
0d607262c14de6a4baea30b72631a2ecc192b3aa.baa2764b20f660589b5055cb2778683f4870bdac, combining that same develop commit with PR headf528106c842c8275598474930675d4ffcb05cccd.host_returnenvironment-step timing.("newton", "newton")after the MJWarp entry inbenchmark/capture.py, and"newton"toPhysicsBackendinbenchmark/schema.py. No task or solver setting was changed by this adjustment, and it is not part of this PR.Run from each checkout using its source imports and the same dependencies:
Validation
Checklist