Skip to content

Accelerate and strengthen asset tests [5/13] - #8141

Closed
AntoineRichard wants to merge 23 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/asset-tests-p08-ov-rigid-object
Closed

AntoineRichard wants to merge 23 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/asset-tests-p08-ov-rigid-object

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Part 5/13 of the asset-test series (tracker: #7282). Scope: OVPhysX rigid object, rigid object collection, and deformable. Depends on #8138; this branch contains their commits until they merge.

#8138 lets CPU and CUDA OVPhysX scenes run in one process.

What changed

  • test_rigid_object.py and test_rigid_object_collection.py each build one module-scoped scene of locally authored
    cuboids per device instead of rebuilding a Nucleus prop per test. Each pair or collection serves one test, so the
    tests do not depend on each other's order, and neither file needs device_split any more.
  • Rigid object: partial root-state writes checked against the public data and the raw RIGID_BODY_POSE binding; raw
    mass, COM, and inertia bindings; real wrench delivery; kinematic bodies with scene-data-provider readiness; resets
    that clear active wrench composers; and a cube pair spinning about an offset center of mass, whose link and COM
    poses and velocities are checked against each other.
  • Rigid object collection (N=2, B=3): nonidentity environment and body selectors through partial pose, mass, COM,
    and inertia writes, each checked against the public data and the raw body-major binding; fused material mapping;
    wrench delivery through the fused body-major binding to one body only (a cell whose flat index differs between
    body-major and environment-major layouts); and resets that clear active wrench composers.
  • Initialization failures (no rigid body in either file; the strict xfail for the missing ArticulationRootAPI guard)
    keep their own scenes. A second simulation context cannot start while a shared scene is alive, so these tests are
    defined first and run before the module-scoped scenes are created. The no-rigid-body cases keep the asset alive
    through reset; otherwise they could pass without initializing it.
  • Deformable: test_initialization_on_device_cpu runs in process instead of a spawned child, with unchanged
    assertions. test_deformable_object_helpers.py moves to unit/test_ovphysx_deformable_object.py and
    test_deformable_views.py to unit/, both with a unit marker.
  • docs/source/concepts/ovphysx.rst pointed its smoke test at test_rigid_object.py::test_initialization, which no
    longer exists; it now runs test_rigid_object_real_ovphysx_seams -k cpu. The docs were not built.

Test disposition

Mutations are one-line production changes, reverted afterwards, that turn the keeper red.

Removed or changed develop test Keeper Proof
rigid test_external_force_on_single_body, test_external_force_on_single_body_at_position test_rigid_object_real_ovphysx_seams (delivery); develop test_wrench_composer.py (composition, positions, frames) skipping the RIGID_BODY_WRENCH write → red
rigid test_set_rigid_object_state, test_write_root_state rigid seams node (partial root pose write against the public data and the raw RIGID_BODY_POSE binding); develop test_rigid_object_iface.py root pose/velocity writers root pose write skipping the binding → red
rigid test_reset_rigid_object test_reset_clears_active_wrench_composers reset keeping the permanent composer → red
rigid test_rigid_body_set_mass rigid seams node (raw mass binding) assertions verbatim
rigid test_initialization_with_kinematic_enabled same name (scene-data-provider paths and kinematic hold) scene data provider skipping rigid bodies → red
rigid test_body_root_state_properties same name (dedicated spinning pair, 10 steps instead of 100, fixed spin rate) root_link_vel_w returning the COM velocity (offset ignored) → red
rigid test_gravity_vec_w initialization shapes: rigid seams node; gravity direction: none needed see below
rigid test_rigid_body_no_friction, test_rigid_body_with_static_friction, test_rigid_body_with_restitution none needed see below
collection test_id_conversion test_rigid_object_collection_real_ovphysx_seams (nonidentity selectors against raw body-major bindings, CPU and CUDA) view ids computed environment-major → red
collection test_set_object_state, test_object_state_properties, test_write_object_state collection seams node (partial pose write against the raw body-major pose binding); develop test_rigid_object_collection_iface.py body pose/velocity writers pose write skipping the binding → red
collection test_reset_object_collection test_reset_clears_active_wrench_composers reset keeping the instantaneous composer → red
collection test_set_material_properties collection seams node (raw fused material mapping) assertions on the raw binding
collection test_external_force_on_single_body, test_external_force_on_single_body_at_position test_wrench_reaches_only_the_selected_collection_body (delivery through the fused binding); develop test_wrench_composer.py (composition, positions, frames) skipping the fused LINK_WRENCH write → red; writing the wrench buffer environment-major → red
collection test_gravity_vec_w initialization shapes: collection seams node; gravity direction: none needed see below
collection test_initialization_with_kinematic_enabled none needed see below
deformable test_initialization_on_device_cpu same name, in process assertions unchanged
test_deformable_object_helpers.py, test_deformable_views.py unit/test_ovphysx_deformable_object.py, unit/test_deformable_views.py moved without test changes (marker added)

Not restored, with reasons:

  • GRAVITY_VEC_W with gravity disabled is a constant of the simulation config. The zero-gravity guard in the data
    classes does not change the result, because normalize clamps the norm and returns zeros anyway: removing the guard
    leaves a gravity-disabled check green. There is no distinct Lab branch to protect.
  • The rigid friction and restitution tests wrote the material through the raw root_view binding, with no Lab API in
    between, and checked only the solver's response. The Lab material paths are covered by the articulation material
    event in Accelerate and strengthen asset tests [4/13] #8139 and the fused collection material mapping here.
  • Kinematic collection bodies: the OVPhysX collection has no kinematic branch. Kinematic is a USD rigid-body flag the
    solver handles; Lab reads kinematic poses through the same fused path the collection seams node covers, and the
    rigid kinematic test keeps the kinematic read check.

Device coverage: the spinning-cube, reset, and collection wrench-delivery tests run on CUDA only, and the
initialization failures on CPU only; their Lab code paths do not depend on the device. The CPU-specific path is the
direct read and write of CPU-only property bindings, which both seams nodes cover on CPU, along with CUDA pinned-host
staging.

Timing

Warm Warp cache, repository orchestrator (./isaaclab.sh -p -m pytest tools, one process per file), second of two runs on one RTX 5090 shared with other jobs, so treat the numbers as indicative. Wall includes process startup. Develop numbers are from the same machine; develop ran device_split files in two processes.

Test file develop wall (s) this PR wall (s) Tests
assets/test_rigid_object.py 19.17 3.36 32/34 → 7/8 (+1 strict xfail)
assets/test_rigid_object_collection.py 15.17 3.14 28/28 → 5/6 (+1 strict xfail)
assets/test_deformable_object.py 8.08 6.18 8
assets/unit/test_ovphysx_deformable_object.py 1.90 1.94 12 (was test_deformable_object_helpers.py)
assets/unit/test_deformable_views.py 1.60 1.55 1
Total 45.92 16.17

Product bugs pinned

test_partial_body_pose_write_preserves_unselected_bodies_after_steps (strict xfail on AssertionError, CUDA):
RigidObjectCollection partial body pose writes push whole environment rows from a pose buffer that is not refreshed
first. After a few steps, the unselected bodies of the written environment are rewound to stale poses (about 1.3 cm in
the test). Reproduced in the real backend on CPU and CUDA; with a cold buffer, CUDA writes an all-zero pose to those
bodies and CPU PhysX rejects it (pose is not valid). The velocity variant did not reproduce in the real backend.
#8134 pins the same bug in the mocked contract.

The existing strict xfail for the missing ArticulationRootAPI guard on RigidObject is kept.

Type of change

  • Test-suite redesign (no production change)

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

OvPhysxManager pinned the first simulation device for the whole process
because the backend entered the OVPhysX process-wide CPU-only mode, which
OVPhysX 0.6.3 still documents as irreversible. CPU scenes now leave that
mode off and select CPU dynamics per scene through enableGPUDynamics=false
and the MBP broadphase, as the OVPhysX developer guide recommends for mixed
CPU/GPU processes, so the device lock is removed.

A child-process test runs CPU, CUDA, CPU and CUDA, CPU scene sequences and
checks device placement, state I/O, and that each CPU scene reproduces the
same trajectory. A unit test pins the per-device scene attributes.
Rigid-object tests share one module-scoped scene of locally authored
cuboids per device instead of rebuilding a Nucleus prop per test. The scene
covers partial root-state writes, raw mass, COM, and inertia bindings, real
wrench delivery, kinematic bodies with scene-data-provider readiness, and
resets that clear active wrench composers. The initialization failures and
the ArticulationRootAPI strict xfail keep their own scenes, and the file no
longer needs one process per device.
Collection tests share one module-scoped scene of locally authored N=2, B=3
collections per device. The scene covers nonidentity environment and body
selectors through partial pose, mass, COM, and inertia writes checked
against the raw body-major bindings, fused material mapping, and resets
that clear active wrench composers.

A strict xfail pins a collection bug: a partial body pose write pushes whole
environment rows from a pose buffer that is not refreshed first, so the
unselected bodies of that environment are rewound to stale poses.
CPU and CUDA OVPhysX simulations can follow each other in one process, so
the CPU rejection contract no longer needs a spawned child process. Move
the deformable helper and view unit tests under unit.
Spin a cube pair with an offset center of mass on the persistent scene and
check the root and body link and COM poses and velocities against each
other, as the removed spinning-cube test did.
Push one body of a collection through the fused body-major wrench binding
and check that only that body accelerates. The selected cell has different
flat indices in body-major and environment-major layouts.
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High risk] Removes process-wide device lock from physics manager initialization.

The PR appears safe to merge, with two non-blocking test-coverage and maintenance gaps.

Findings

  1. P2 Cross-frame coverage is lost ▶
  2. P2 Articulation tests still skip devices ▶

Summary

The PR enables sequential CPU and CUDA OVPhysX scenes by selecting dynamics on each physics scene, and replaces per-test rigid-object scenes with shared local cuboid scenes. The new tests exercise device switching, property bindings, wrench delivery, kinematic state, reset, and COM motion.

Reviews (1) · Last reviewed commit: "Restore the OVPhysX rigid-object COM kin..."

Comment on lines +146 to +151
initial_pose = rigid_object.data.root_link_pose_w.torch.clone()
target_pose = initial_pose[1:2].clone()
target_pose[0, :3] += torch.tensor([0.25, -0.1, 0.2], device=device)
rigid_object.write_root_link_pose_to_sim_index(root_pose=target_pose, env_ids=[1])
torch.testing.assert_close(rigid_object.data.root_link_pose_w.torch[1:2], target_pose)
torch.testing.assert_close(rigid_object.data.root_link_pose_w.torch[0:1], initial_pose[0:1])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Cross-frame coverage is lost

The replacement test writes a partial link pose and checks only that it reads back. The removed root-state test also checked that writes in the link, COM, and root frames updated the other frame correctly when the center of mass was offset. The interface tests check writer inputs and matching getters, but do not restore that real-backend check. Please retain a focused offset-COM assertion so a broken frame conversion cannot pass this suite.

Knowledge Base Used: Omniverse backend

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!

Comment on lines +832 to +834
When no runtime is active, constructs a new :class:`ovphysx.PhysX`
instance. The first construction also records IsaacLab's process device
choice and registers process-exit cleanup. On a forced re-warm before
instance for the simulation device and registers process-exit cleanup.
CPU and CUDA simulations may follow each other in one process. On a forced re-warm before

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Articulation tests still skip devices

The manager now permits sequential CPU and CUDA scenes, but the OVPhysX articulation suite still describes the removed _locked_device guard and skips the second device in a normal single-process run. Update that suite’s device gating and instructions alongside this change; otherwise a direct run continues to omit one device’s articulation coverage.

Knowledge Base Used: Omniverse backend

@AntoineRichard
AntoineRichard marked this pull request as draft September 29, 2026 12:54
The OVPhysX manager no longer pins the first simulation device, so the
lock-skip fixtures in these test files skipped the other device's cases
for a reason that no longer holds. Remove them and the device_split
marker; each file passes its CPU and CUDA cases in one process. Describe
the device_split marker by what it does rather than by the removed lock.
OVPhysX simulates every UsdPhysics.Scene in the stage, and the PhysX schema
default enables GPU dynamics. The manager configured only the simulation's
physics scene, so an extra scene, such as one authored by an asset, kept
GPU dynamics during a CPU simulation. Author the device's dynamics and
broadphase on every physics scene, and describe the change in the changelog.
@github-actions github-actions Bot added documentation Improvements or additions to documentation infrastructure labels Sep 29, 2026
@AntoineRichard AntoineRichard changed the title Accelerate and strengthen asset tests [8/24] Accelerate and strengthen asset tests [5/13] Sep 29, 2026
@StafaH

StafaH commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Closing because the combined PR #7282 has merged. This split PR is superseded by #7282 and is no longer needed.

@StafaH StafaH closed this Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants