Repository navigation
Accelerate and strengthen asset tests [5/13] - #8141
AntoineRichard wants to merge 23 commits into
Conversation
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.
|
| 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]) |
There was a problem hiding this comment.
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!
| 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 |
There was a problem hiding this comment.
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
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.
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.pyandtest_rigid_object_collection.pyeach build one module-scoped scene of locally authoredcuboids 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_splitany more.RIGID_BODY_POSEbinding; rawmass, 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.
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.
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.
test_initialization_on_device_cpuruns in process instead of a spawned child, with unchangedassertions.
test_deformable_object_helpers.pymoves tounit/test_ovphysx_deformable_object.pyandtest_deformable_views.pytounit/, both with aunitmarker.docs/source/concepts/ovphysx.rstpointed its smoke test attest_rigid_object.py::test_initialization, which nolonger 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.
test_external_force_on_single_body,test_external_force_on_single_body_at_positiontest_rigid_object_real_ovphysx_seams(delivery); developtest_wrench_composer.py(composition, positions, frames)RIGID_BODY_WRENCHwrite → redtest_set_rigid_object_state,test_write_root_stateRIGID_BODY_POSEbinding); developtest_rigid_object_iface.pyroot pose/velocity writerstest_reset_rigid_objecttest_reset_clears_active_wrench_composerstest_rigid_body_set_masstest_initialization_with_kinematic_enabledtest_body_root_state_propertiesroot_link_vel_wreturning the COM velocity (offset ignored) → redtest_gravity_vec_wtest_rigid_body_no_friction,test_rigid_body_with_static_friction,test_rigid_body_with_restitutiontest_id_conversiontest_rigid_object_collection_real_ovphysx_seams(nonidentity selectors against raw body-major bindings, CPU and CUDA)test_set_object_state,test_object_state_properties,test_write_object_statetest_rigid_object_collection_iface.pybody pose/velocity writerstest_reset_object_collectiontest_reset_clears_active_wrench_composerstest_set_material_propertiestest_external_force_on_single_body,test_external_force_on_single_body_at_positiontest_wrench_reaches_only_the_selected_collection_body(delivery through the fused binding); developtest_wrench_composer.py(composition, positions, frames)LINK_WRENCHwrite → red; writing the wrench buffer environment-major → redtest_gravity_vec_wtest_initialization_with_kinematic_enabledtest_initialization_on_device_cputest_deformable_object_helpers.py,test_deformable_views.pyunit/test_ovphysx_deformable_object.py,unit/test_deformable_views.pyNot restored, with reasons:
GRAVITY_VEC_Wwith gravity disabled is a constant of the simulation config. The zero-gravity guard in the dataclasses does not change the result, because
normalizeclamps the norm and returns zeros anyway: removing the guardleaves a gravity-disabled check green. There is no distinct Lab branch to protect.
root_viewbinding, with no Lab API inbetween, 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.
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 randevice_splitfiles in two processes.assets/test_rigid_object.pyassets/test_rigid_object_collection.pyassets/test_deformable_object.pyassets/unit/test_ovphysx_deformable_object.pytest_deformable_object_helpers.py)assets/unit/test_deformable_views.pyProduct bugs pinned
test_partial_body_pose_write_preserves_unselected_bodies_after_steps(strict xfail onAssertionError, CUDA):RigidObjectCollectionpartial body pose writes push whole environment rows from a pose buffer that is not refreshedfirst. 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
RigidObjectis kept.Type of change
Release backport
developChecklist
Docker and GPU tests run on demand. Push the commits you want tested, then
comment
run-cion the pull request.pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there