Repository navigation
Fix kitless OVPhysX scene cloning - #6072
AntoineRichard merged 1 commit into
Conversation
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot — PR #6072
Verdict: ✅ Looks Good
Summary
Well-scoped fix that removes redundant USD replication queuing from OVPhysX asset constructors. Since OVPhysX runs kitless (cannot coexist with Kit/OVRTX), these assets only need OvPhysxReplicateContext — the UsdReplicateContext calls were dead weight that could trigger unnecessary Fabric notice paths.
Analysis
| Perspective | Assessment |
|---|---|
| Architecture/Design | ✅ Correct approach. OVPhysX assets inherit from base classes that handle USD concerns; the OVPhysX layer should only enqueue its own backend-specific replication. |
| Consistency | ✅ All three asset types (Articulation, RigidObject, RigidObjectCollection) are updated uniformly — import removal + call removal. |
| Test Coverage | ✅ New test_replication_queue.py comprehensively verifies that each OVPhysX asset type enqueues only OvPhysxReplicateContext and not UsdReplicateContext. Tests use pytest.importorskip to gracefully skip when ovphysx wheel is unavailable. |
| Changelog | ✅ Fragment added under isaaclab_ovphysx/changelog.d/ with clear description. |
Code Review
Changes are minimal and surgical:
- 3 asset files: removed
queue_usd_replicationimport + call - 1 test file: 77 lines of new tests with proper fixtures
🔵 Minor observation — test_replication_queue.py line 44: The helper _assert_only_ovphysx_replication_queued asserts both that the queue contains exactly [(cfg, OvPhysxReplicateContext)] AND that no UsdReplicateContext is present. The second assertion is redundant given the first, but harmless — defensive coding.
🔵 Suggestion — The test file monkeypatches AssetBase.__del__ to a no-op (line 37). A brief comment explaining why (e.g., "prevent finalizer from modifying queue during test teardown") would help future readers.
Overall: Clean removal of unnecessary code path, good test coverage, proper changelog. Ready to merge. 🚀
Update (e773554): New commits add graceful handling for missing usdrt in disabled_fabric_change_notifies(). Changes look good:
- ✅
_fabric_notices.py:import usdrtnow wrapped intry/except ModuleNotFoundError— context manager yields cleanly when usdrt is unavailable in kitless runtimes. Name check (exc.name != "usdrt") ensures unrelated import errors still propagate. - ✅ New test
test_disabled_fabric_change_notifies_noops_when_usdrt_unavailable: properly monkeypatchesbuiltins.__import__to simulate missing usdrt and verifies the context manager no-ops without error. - ✅ Changelog fragment
fix-kitless-fabric-notices.rstadded.
🔵 Previous inline suggestion (adding logger.debug when usdrt is unavailable) not adopted — acceptable, the function is already a silent no-op by design.
No new concerns. Still ✅ ready to merge.
| if exc.name != "usdrt": | ||
| raise | ||
| yield | ||
| return |
There was a problem hiding this comment.
🔵 Suggestion: Consider adding a logger.debug("usdrt unavailable — Fabric notice suspension skipped") here for observability in verbose/debug runs. Matches the logger.info(...) pattern used in initialize() above when libcarb.so is missing.
Greptile SummaryFixes
Confidence Score: 4/5Safe to merge; the production fix is correct and the test gap is in the test harness only. The core logic in source/isaaclab/test/sim/test_cloner.py — the new test would benefit from a sys.modules cleanup to be robust in Kit environments. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["disabled_fabric_change_notifies(stage)"] --> B{"get_bindings()\nreturns None?"}
B -- "Yes (no libcarb.so)" --> Z[yield / no-op]
B -- "No" --> C{"import usdrt"}
C -- "ModuleNotFoundError\nexc.name == 'usdrt'" --> Z
C -- "ModuleNotFoundError\nexc.name != 'usdrt'\n(broken dependency)" --> E[re-raise exception]
C -- "Success" --> F["Attach stage → get fabric_id"]
F --> G{"bindings.validate_with\n(fabric_id)?"}
G -- "Fails round-trip" --> Z
G -- "OK" --> H["Disable Fabric notices\nyield\nRestore on exit"]
|
| raise ModuleNotFoundError("No module named 'usdrt'", name="usdrt") | ||
| return real_import(name, *args, **kwargs) | ||
|
|
||
| monkeypatch.setattr(builtins, "__import__", _import_without_usdrt) |
There was a problem hiding this comment.
Adding
monkeypatch.delitem(sys.modules, "usdrt", raising=False) ensures the __import__ patch is always effective, even in Kit environments where usdrt may already be cached in sys.modules.
| monkeypatch.setattr(builtins, "__import__", _import_without_usdrt) | |
| monkeypatch.delitem(sys.modules, "usdrt", raising=False) | |
| monkeypatch.setattr(builtins, "__import__", _import_without_usdrt) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
458acee to
31d12c0
Compare
Handle the kitless state where Fabric notice bindings are available but the Python usdrt module is not importable, so disabled_fabric_change_notifies falls back to a no-op instead of failing. Also stop OVPhysX assets from enqueueing redundant USD replication; they still enqueue OvPhysxReplicateContext for backend runtime cloning.
31d12c0 to
e773554
Compare
# Description Implements `Pva` and `PvaData` for the OVPhysX backend, satisfying the `BasePva` / `BasePvaData` contracts. The sensor reports world-frame pose, body-frame linear and angular velocities, body-frame coordinate linear and angular accelerations (zero at rest, `-g` in freefall - not the IMU's proper acceleration), and projected gravity as a unit direction vector. - The kernel is byte-for-byte aligned with `isaaclab_physx`'s PVA kernel. - The sensor class mirrors the OVPhysX IMU's structure verbatim wherever applicable (binding setup, buffer naming, error wording, `__str__`), diverging only for PVA-specific outputs and gravity-direction vs gravity-bias semantics. - `PvaData` uses the same `ProxyArray` pattern as the IMU / Newton data classes; `pose_w` is rebuilt on read via the shared `concat_pos_and_quat_to_pose_1d_kernel` (matches PhysX's lazy access). - `OvPhysxManager.get_gravity()` is added so backend-agnostic sensor code can read scene gravity through one classmethod; identical to the same addition in #5421, so the two PRs merge cleanly in either order. - The branch is merged on top of latest `develop` after #6072 and #6085. The kitless `usdrt` guard, OVPhysX USD-clone removal, and OVPhysX `isaacsim_ci` cleanup are now in the base branch, so this PR carries only the PVA sensor changes. Validated end-to-end against the real OVPhysX backend on both CPU and CUDA. The procedural and Nucleus-backed cases are run in separate pytest processes because mixing them in one process can hit the known process-global `omni.client` symbol issue. Validation run: ```bash ./isaaclab.sh -p -m pytest --collect-only -q -m device_split source/isaaclab_ovphysx/test/sensors/test_pva.py # 28 tests collected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'cpu and not offset and not env_ids' # 11 passed, 17 deselected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'cpu and (offset or env_ids)' # 2 passed, 26 deselected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'cuda and not offset and not env_ids' # 11 passed, 17 deselected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'cuda and (offset or env_ids)' # 2 passed, 26 deselected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'single_dof_pendulum or indirect_attachment' # 1 passed, 3 skipped, 24 deselected PATH=/tmp/git-lfs-v3.7.1:$PATH ./isaaclab.sh -f # Passed rg -n "isaacsim_ci" source/isaaclab_ovphysx/test # no matches ``` The skipped pendulum cases are pending a USD-converted pendulum asset; the PhysX equivalents use the Kit URDF importer, which is not loaded under the kitless launcher. Fixes #5319 ## 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 added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump `extension.toml` - CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
# Description Implements `Pva` and `PvaData` for the OVPhysX backend, satisfying the `BasePva` / `BasePvaData` contracts. The sensor reports world-frame pose, body-frame linear and angular velocities, body-frame coordinate linear and angular accelerations (zero at rest, `-g` in freefall - not the IMU's proper acceleration), and projected gravity as a unit direction vector. - The kernel is byte-for-byte aligned with `isaaclab_physx`'s PVA kernel. - The sensor class mirrors the OVPhysX IMU's structure verbatim wherever applicable (binding setup, buffer naming, error wording, `__str__`), diverging only for PVA-specific outputs and gravity-direction vs gravity-bias semantics. - `PvaData` uses the same `ProxyArray` pattern as the IMU / Newton data classes; `pose_w` is rebuilt on read via the shared `concat_pos_and_quat_to_pose_1d_kernel` (matches PhysX's lazy access). - `OvPhysxManager.get_gravity()` is added so backend-agnostic sensor code can read scene gravity through one classmethod; identical to the same addition in isaac-sim#5421, so the two PRs merge cleanly in either order. - The branch is merged on top of latest `develop` after isaac-sim#6072 and isaac-sim#6085. The kitless `usdrt` guard, OVPhysX USD-clone removal, and OVPhysX `isaacsim_ci` cleanup are now in the base branch, so this PR carries only the PVA sensor changes. Validated end-to-end against the real OVPhysX backend on both CPU and CUDA. The procedural and Nucleus-backed cases are run in separate pytest processes because mixing them in one process can hit the known process-global `omni.client` symbol issue. Validation run: ```bash ./isaaclab.sh -p -m pytest --collect-only -q -m device_split source/isaaclab_ovphysx/test/sensors/test_pva.py # 28 tests collected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'cpu and not offset and not env_ids' # 11 passed, 17 deselected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'cpu and (offset or env_ids)' # 2 passed, 26 deselected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'cuda and not offset and not env_ids' # 11 passed, 17 deselected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'cuda and (offset or env_ids)' # 2 passed, 26 deselected ./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sensors/test_pva.py -k 'single_dof_pendulum or indirect_attachment' # 1 passed, 3 skipped, 24 deselected PATH=/tmp/git-lfs-v3.7.1:$PATH ./isaaclab.sh -f # Passed rg -n "isaacsim_ci" source/isaaclab_ovphysx/test # no matches ``` The skipped pendulum cases are pending a USD-converted pendulum asset; the PhysX equivalents use the Kit URDF importer, which is not loaded under the kitless launcher. Fixes isaac-sim#5319 ## 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 added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump `extension.toml` - CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
Description
OVPhysX can run kitless in a state where Carbonite exposes the Fabric USD notice interface but the Python
usdrtmodule is not importable. In that state,disabled_fabric_change_notifies()should fall back to its intended no-op behavior instead of failing during scene cloning.This PR keeps Fabric notice suspension active when
usdrtis available, but treats only a missing top-levelusdrtmodule as unavailable Fabric notice suspension. It also removes redundantqueue_usd_replication(...)calls from the OVPhysXRigidObject,Articulation, andRigidObjectCollectionconstructors. OVPhysX assets continue to enqueuequeue_ovphysx_replication(...)for backend runtime cloning.Fixes #
Type of change
Screenshots
Not applicable.
Checklist
pre-commitchecks with./isaaclab.sh -fsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists thereTesting
./isaaclab.sh -p -m pytest -q source/isaaclab/test/sim/test_cloner.py::test_disabled_fabric_change_notifies_noops_when_usdrt_unavailable(1 passed)./isaaclab.sh -p -m pytest -q source/isaaclab_physx/test/sim/test_cloner.py::test_disabled_fabric_change_notifies_toggles_ifabricusd_flag(2 passed)./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sim/test_views_xform_prim_ovphysx.py::test_world_pose_equals_parent_plus_offset -k cpu(1 passed, 1 deselected)./isaaclab.sh -p -m pytest -q source/isaaclab_ovphysx/test/sim/test_views_xform_prim_ovphysx.py::test_world_pose_equals_parent_plus_offset -k cuda(1 passed, 1 deselected)PATH=/tmp/git-lfs-v3.7.1:$PATH ./isaaclab.sh -f