Repository navigation
Fix Newton particle BVH synchronization - #6687
Conversation
Greptile SummaryThis PR fixes Newton Warp camera rendering of moving particles by keeping the particle BVH synchronized with the simulation state through the existing sensor task pipeline. It mirrors the shape BVH handling already in place, adding particle BVH build during sensor registration and particle BVH refit during each update cycle.
Confidence Score: 5/5Safe to merge — the change is a narrow, well-tested extension of an existing pattern with no behavioral regressions for shape-only scenes. The particle BVH path is a direct parallel of the shape BVH path that was already in place and working. Both No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[_register_sensor_task] --> B{model.shape_count > 0\nand bvh_shapes is None?}
B -- Yes --> C[bvh_build_shapes]
B -- No --> D{model.particle_count > 0\nand bvh_particles is None?}
C --> D
D -- Yes --> E[bvh_build_particles]
D -- No --> F[Register task / set state dirty]
E --> F
G[_update_sensor_tasks] --> H{sensor_state_dirty?}
H -- Yes --> I[_refit_sensor_bvh]
H -- No --> L[Run sensor tasks]
I --> J{refit_shapes?}
J -- Yes --> K1[bvh_refit_shapes]
J -- No --> K2{refit_particles?}
K1 --> K2
K2 -- Yes --> K3[bvh_refit_particles]
K2 -- No --> L
K3 --> L[Run sensor tasks]
Reviews (2): Last reviewed commit: "Monkeypatch NewtonManager._sensor_state ..." | Re-trigger Greptile |
maxkra15
left a comment
There was a problem hiding this comment.
thanks! lgtm, just some minor suggestions for test and comments
# Description Restore the CPU PhysX stage-initialization path from #4675 while preserving the Isaac Sim core-extension removal from #6499. #6499 removed `isaacsim.core.simulation_manager`, which also removed the registration bridge between the unified physics API and PhysX. The replacement CPU path explicitly attached the stage and skipped `force_load_physics_from_usd()`. This reintroduced non-deterministic CPU broadphase collision failures, observed by the SkillGen test in #6687. This change: - adds `omni.physics.physx` to the GUI and headless app experiences so PhysX is registered without restoring the Isaac Sim core extension or its Warp dependency; - restores the pre-#6499 warmup behavior: only GPU explicitly attaches the stage, while CPU uses `force_load_physics_from_usd()`; - updates the regression test to verify the bridge is enabled, CPU does not call `attach_stage()`, and CPU force-loads exactly once. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Screenshots Not applicable. ## Validation - `uv run python -m pytest source/isaaclab_physx/test/assets/test_rigid_object.py::test_warmup_attach_stage_not_called_for_cpu source/isaaclab_physx/test/assets/test_rigid_object.py::test_initialization -q` - 5 passed across CPU and GPU initialization. - CPU SkillGen environment creation and 20 random-action steps passed for `IsaacContrib-Stack-Cube-Franka-IK-Rel-Skillgen`. - `uv run python tools/changelog/cli.py check develop` - `uv run isaaclab -f` ## 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 `uv run isaaclab -f` - [x] Documentation changes are not required for this internal lifecycle fix - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective - [x] I have added a changelog fragment under `source/isaaclab_physx/changelog.d/` - [x] My name already exists in `CONTRIBUTORS.md`
Build and refit particle BVHs through the sensor task pipeline so moving particles remain visible to Newton Warp cameras. Raise a runtime error when BVH refitting lacks an initialized sensor state.
sensor-task test does not leak class attributes after teardown.
Patch sensor graph flag arrays so pytest teardown restores consistent NewtonManager state. Clarify that sensor tasks refit both shape and particle BVHs.
c55661f to
80313fb
Compare
# Description Restore the CPU PhysX stage-initialization path from isaac-sim#4675 while preserving the Isaac Sim core-extension removal from isaac-sim#6499. isaac-sim#6499 removed `isaacsim.core.simulation_manager`, which also removed the registration bridge between the unified physics API and PhysX. The replacement CPU path explicitly attached the stage and skipped `force_load_physics_from_usd()`. This reintroduced non-deterministic CPU broadphase collision failures, observed by the SkillGen test in isaac-sim#6687. This change: - adds `omni.physics.physx` to the GUI and headless app experiences so PhysX is registered without restoring the Isaac Sim core extension or its Warp dependency; - restores the pre-isaac-sim#6499 warmup behavior: only GPU explicitly attaches the stage, while CPU uses `force_load_physics_from_usd()`; - updates the regression test to verify the bridge is enabled, CPU does not call `attach_stage()`, and CPU force-loads exactly once. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Screenshots Not applicable. ## Validation - `uv run python -m pytest source/isaaclab_physx/test/assets/test_rigid_object.py::test_warmup_attach_stage_not_called_for_cpu source/isaaclab_physx/test/assets/test_rigid_object.py::test_initialization -q` - 5 passed across CPU and GPU initialization. - CPU SkillGen environment creation and 20 random-action steps passed for `IsaacContrib-Stack-Cube-Franka-IK-Rel-Skillgen`. - `uv run python tools/changelog/cli.py check develop` - `uv run isaaclab -f` ## 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 `uv run isaaclab -f` - [x] Documentation changes are not required for this internal lifecycle fix - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective - [x] I have added a changelog fragment under `source/isaaclab_physx/changelog.d/` - [x] My name already exists in `CONTRIBUTORS.md`
# Description Build and refit particle BVHs through the sensor task pipeline so moving particles remain visible to Newton Warp cameras. Raise a runtime error when BVH refitting lacks an initialized sensor state. ## Type of change - New feature (non-breaking change which adds functionality) ## Screenshots Please attach before and after screenshots of the change if applicable. | Before | After | | ------ | ----- | | <img width="262" height="262" alt="franka_pour-newton-newton_renderer-rgb" src="https://github.com/user-attachments/assets/d034705d-54da-48ba-903c-2979b9537c49" /> | <img width="262" height="262" alt="franka_pour-newton-newton_renderer-rgb" src="https://github.com/user-attachments/assets/b05d71b3-0a31-4b53-afc2-fbe4d381c842" /> | ## 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
Description
Build and refit particle BVHs through the sensor task pipeline so moving particles remain visible to Newton Warp cameras. Raise a runtime error when BVH refitting lacks an initialized sensor state.
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there