Repository navigation
Brings Newton assets integration tests - #4818
kellyguo11 merged 23 commits into
Conversation
Greptile SummaryThis PR introduces Newton physics backend integration tests for Key source fixes bundled with the tests:
Remaining items worth attention:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Integration Test
participant SimCtx as build_simulation_context
participant NM as NewtonManager
participant Art as Articulation / RigidObject
participant ArtData as ArticulationData / RigidObjectData
Test->>SimCtx: enter context (NewtonCfg)
SimCtx->>NM: instantiate_builder_from_stage()
NM->>NM: scan /World for Env_N Xforms
alt env Xforms found
NM->>NM: build prototype from Env_0
NM->>NM: begin_world() / add_builder(proto) / end_world() per env
NM-->>NM: _num_envs = len(env_paths)
else flat load
NM->>NM: add_usd(stage)
NM-->>NM: _num_envs = 1
end
NM->>NM: build model + state
Test->>Art: Articulation(cfg)
Art->>ArtData: ArticulationData(root_view, device)
Art->>NM: register_callback(PHYSICS_READY, _create_simulation_bindings)
Note over Art: _physics_ready_handle stored
Test->>SimCtx: sim.reset()
SimCtx->>NM: PhysicsEvent.PHYSICS_READY fired
NM->>ArtData: _create_simulation_bindings()
loop simulation steps
Test->>Art: write_data_to_sim()
Art->>ArtData: .assign() to sim bindings
Test->>SimCtx: sim.step()
Test->>Art: update(dt)
end
Test->>SimCtx: exit context (teardown)
SimCtx->>Art: _clear_callbacks()
Art->>NM: _physics_ready_handle.deregister()
Last reviewed commit: 530457e |
Additional Comments (3)
Consider setting
A blank line with 4 spaces of trailing whitespace was inserted before the docstring. This will fail |
|
could use a formatter run :) |
3b72c89 to
a47c91b
Compare
# Description Adds rigid object collections for Newton. Builds ontop of #4818 ## Type of change - New feature (non-breaking change which adds functionality) ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
# Description Update Newton to commit `5ea82eef6f7911388025a8df6ccdb172e2fed286` and MuJoCo/MuJoCo Warp to 3.14. Adapt checkpoint loading, actuator selection, cable indexing, deformable registration, and visualization to the changed interfaces. Workspace requirements and wheel metadata use the same Newton revision. ## Runtime changes and their upstream causes - **Actuator checkpoints — [Newton #4347](newton-physics/newton#4347 Newton removed TorchScript/dict loading. Export existing TorchScript MLP/LSTM checkpoints to dynamic-batch `.pt2` during USD authoring, preserving metadata and device placement. Users keep their existing paths and actuator configurations. - **Actuator parameters — [Newton #4430](newton-physics/newton#4430 Selection caches now belong to each view. Initialize the DOF mapping cache in Isaac Lab's lightweight PhysX/OVPhysX view and borrow the updated mapping methods. Remove its duplicate world-mask implementation. - **Cable indexing — [Newton #4124](newton-physics/newton#4124 Standalone cables now include the free root joint. Its child is the root segment, so the link array already contains every segment. Remove the separate root binding and `link_count + 1`; use one child-body ID array for writes. Masked writes and CUDA capture remain covered. - **Deformable registration — [Newton #4363](newton-physics/newton#4363 Mesh builders now record their own surface/volume ranges. Remove Isaac Lab's duplicate calls to the deleted private recording methods and read the new records directly. - **Live plots — [Newton #4186](newton-physics/newton#4186 Read histories from `PlotLogger`, their new owner. The old viewer-level lookups left GL plots empty. - **Contact visualization — [Newton #4340](newton-physics/newton#4340 Replace the removed `sensing_obj_transforms` alias with `sensing_transforms`. - **Rendering references — [Newton #4177](newton-physics/newton#4177 Refresh four ANYmal images for authored mesh normals and USD sharp shading. Pixel and SSIM tolerances are unchanged. Disabling the upstream normal-loading change made both affected Newton cases pass against the old references, confirming the cause. All seven upstream changes are included in the pinned revision. ## Why the reset code can be removed The rebind callback was introduced in [Isaac Lab #4818](#4818), when hard resets restarted simulation without first dispatching `STOP`. [Isaac Lab #8027](#8027) subsequently added `STOP` before model recreation. Assets are now invalidated and their existing `PHYSICS_READY` initialization constructs new views, data, and actuators. Rebinding the discarded data is redundant. The extra callbacks run before asset initialization and access the previous data's weak view reference. Newton #4430 removed global caches that accidentally retained those views, exposing `ReferenceError` in rigid objects and collections. Articulations avoided that error only because the shared view registry retained their old views; a joint-wrench sensor initialized first could then select a view of the old model. Remove these extra callbacks across rigid objects, collections, articulations, cables, deformables, and MPM. Clear Newton's old registry entries and per-model actuator/step hooks before rebuilding. Each data instance binds once during construction. Remove the rebind-only proxy branches, timestamp invalidation, actuator-executor rebinding, and cleanup overrides. Keep articulation's model-init/post-step cleanup and its separate joint/body ordering setup, which still have callers. This preserves the existing hard-reset lifetime: reacquire `asset.data` and its arrays after `sim.reset(soft=False)`. Soft resets retain the current model and data. The direct `ArticulationData` test now retains its `ArticulationView` explicitly, matching production ownership instead of relying on Newton's former global cache. Existing asset tests now exercise two real hard resets, state writes, physics steps, fresh data containers, and stable callback counts. Replace the synthetic array-swap/rebind test and its helper with this lifecycle check; remove the actuator test whose only caller was the deleted private rebind method. Extend the existing nested-root sensor test to initialize the sensor first. This follow-up removes 200 production lines and 449 lines overall, without adding production files, classes, or helpers. PhysX and OVPhysX retain their existing reset lifecycle. Inline five one-use proxy-initialization helpers into buffer creation, and remove the unused OVPhysX articulation-data invalidation method and its test-only assertions. Keep PhysX articulation's helper because ordering changes call it again. This cleanup removes 64 production lines and 14 test lines (76 net lines including two changelog fragments), with no new helpers or public API changes. ## Validation Additional PhysX/OVPhysX validation for `6d4202844`: 565 shared rigid-object, collection, and articulation contract tests passed on CPU and GPU0, with four existing expected failures. Each file ran in its own process. The retained OVPhysX ordering-cache test also passed. An AST comparison confirmed that inlining preserved every initialization statement and its order; formatting, lint, and changelog checks passed. Validated `f677d2532` on GPU0. The collection, articulation, deformable, MPM, and sensor-order regressions failed on `9f5d1c3bd` for the expected stale-view or accumulating-callback errors and passed with the fix. 148 focused tests passed. Each test file ran in its own process: ```bash export CUDA_VISIBLE_DEVICES=0 DISPLAY= export OMNI_KIT_ACCEPT_EULA=YES ACCEPT_EULA=Y export WARP_CACHE_PATH=/tmp/pr6aii-warp-cache for test_file in \ source/isaaclab_newton/test/assets/test_rigid_object.py \ source/isaaclab_newton/test/assets/test_articulation.py \ source/isaaclab_newton/test/assets/test_mpm_object.py \ source/isaaclab_newton/test/assets/test_deformable_object.py \ source/isaaclab/test/actuators/test_actuator_collection.py \ source/isaaclab_newton/test/assets/test_newton_actuators_newton.py \ source/isaaclab_newton/test/sensors/test_joint_wrench_sensor.py; do uv run --no-sync python -m pytest "$test_file" -q done uv run --no-sync python -m pytest \ source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py \ -k 'hard_reset_then_step_runs or graph_capture_preserves_first_step_and_recapture or reset_lands' -q ISAACLAB_CHANGELOG_BASE_REF=abe7db4f3 uv run --no-sync isaaclab -f ``` The environment included the `test`, `isaacsim`, and `tetrahedralization` extras. Local disk pressure required moving compilation temporary files to shared memory; incompatible global Warp cache entries required using the branch's dedicated cache. No production workaround, test tolerance, or timeout was added for either environment issue. Earlier checks on the same dependency revision covered checkpoint numerical agreement and variable batches, viewer teardown and markers, cable masked writes/capture, camera/raycast hard resets, deformable cloning, wheel metadata, and all four updated image references. The exact Newton VCS pin still requires Git for installation. [PyPI does not accept direct-URL dependencies](https://setuptools.pypa.io/en/stable/userguide/dependency_management.html#direct-url-dependencies), so a published Newton version containing the required changes is needed before publishing that dependency metadata to PyPI. Related viewer work: #8303. ## Type of change - Bug fix ## Release backport - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] Read the contribution guidelines - [x] Ran `uv run isaaclab -f` - [x] Validated changed behavior with focused tests - [x] Added changelog fragments for each changed package - [x] Contributor already listed
Description
Brings tests to Newton
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there