Repository navigation
Accelerate and strengthen asset tests [8/13] - #8147
AntoineRichard wants to merge 10 commits into
Conversation
RigidObjectCollection.set_coms_index passed wp.transformf data to the PhysX tensor API, which raises a KeyError. It also marked the lazily filled body_com_pose_b cache as fresh after a partial write, so the unselected entries read back as zeros when the cache had not been read before. set_inertias_index flattened the (num_instances, num_bodies, 9) inertias with the 2D reshape, which the backend rejects. Pass the COM poses as float32, let the next read refresh the COM cache from the view as RigidObject does, and reshape the inertias with the 3D helper. A new test writes both properties to a non-sorted subset of (env, body) cells and checks the PhysX view and the data buffers.
Share one module-scoped scene of locally authored cubes instead of a Nucleus scene per test. Partial state, inertial, and wrench writes select environment 1 and read the PhysX view back; a center-of-mass offset checks every root-frame writer and the spin kinematics. Failure modes, the gravity vector, and physics warmup keep their own scenes. The articulation-root rejection is kept as a strict xfail: the check was removed from the PhysX rigid object, and the previous Nucleus fixture only failed because it resolved no rigid body.
Share one module-scoped scene of locally authored cubes instead of a Nucleus scene per test. Partial state, mass, and wrench writes select non-sorted body-major subsets and read the PhysX view back; a center-of-mass offset checks every body-frame writer and the spin kinematics. Failure modes, the gravity vector, and the subset-write regressions keep their own scenes.
|
| cube_object.update(sim.cfg.dt) | ||
|
|
||
| env_ids = None if i % 2 == 0 else env_idx | ||
| def test_rigid_object_initialization(rigid_object_scene: _RigidObjectScene): |
There was a problem hiding this comment.
Composite tests skipped in short CI When
ISAACSIM_CI_SHORT=true, the test runner selects this file because earlier tests are marked, then runs pytest with -m isaacsim_ci. This test and the other three new composite tests lack that marker, so all four are deselected. Short CI consequently misses the replacement coverage for initialization, inertial properties, root state, and wrenches.
| cube_object.update(sim.cfg.dt) | ||
|
|
||
| env_ids = None if i % 2 == 0 else env_idx | ||
| def test_rigid_object_initialization(rigid_object_scene: _RigidObjectScene): |
There was a problem hiding this comment.
PhysX contact coverage removed The rewrite removes the three tests that set rigid-object material properties and check friction or restitution during contact. The replacement tests use airborne cubes, and the similarly named tests in
isaaclab_ov exercise a different view. A regression in the PhysX material or contact path can now pass this package’s asset tests; please retain a focused contact case or replace that coverage elsewhere.
Knowledge Base Used: PhysX 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!
|
|
||
| @pytest.mark.parametrize("num_cubes", [2]) | ||
| @pytest.mark.parametrize("device", test_devices()) | ||
| @pytest.mark.parametrize("device", test_devices(DeviceScope.CUDA)) |
There was a problem hiding this comment.
CPU gravity checks removed Restricting this test to CUDA removes the CPU checks of the gravity vector and body acceleration with gravity both enabled and disabled. The remaining CPU warmup test only checks that a cube falls, so it cannot catch an incorrect CPU gravity vector or acceleration when gravity is disabled. Please keep the CPU case unless an equivalent PhysX test covers it.
Import the mock and PhysX interfaces at module level, allocate repeated rows directly, state the articulation-root xfail as the current contract, and annotate the tests and the scene fixture.
Drop step-narrating comments from the gravity test and annotate the tests and fixtures.
The strict xfail now authors an enabled articulation root on the rigid body itself and only accepts the missing-rejection failure, so it turns red once the check is restored. Every test carries the Isaac Sim CI marker, the invalid-body and gravity tests run on every device, the writer passes step in between, the wrench node sets its own masses, and the partial velocity write is read back from PhysX.
A second step must double the velocity from a permanent force, which the deleted single-body force test covered. The writer passes step in between, the link velocity write is read back from PhysX, and the invalid-body and gravity tests run on every device again.
Description
Part 8/13 of the asset-test series (tracker: #7282). Scope: PhysX rigid object and rigid object collection. Depends on #8131; this branch contains its commits until it merges.
What changed
test_rigid_object.pyandtest_rigid_object_collection.pyeach run on one module-scoped scene of locally authored 1 kg cubes instead of a Nucleus DexCube scene per test. Both scenes run on cpu and cuda:0 and use two environments, so partial writes target one environment and prove the other is preserved in the real PhysX state.Rigid object (two environments of gravity-free dynamic cubes, two of kinematic cubes), four nodes:
The invalid-body failure, the gravity vector (with and without gravity) and physics warmup keep their own scenes and run before the composite scene, which a new simulation context would otherwise replace.
Rigid object collection (two environments of three gravity-free cubes, plus a single-cube kinematic collection). PhysX stores collection bodies body-major, so writes select non-sorted environment and body subsets and read the view back. Four nodes:
Both collection regressions,
test_subset_write_reaches_selected_view_entry(develop) and #8131'stest_inertial_property_subset_writes_reach_selected_view_entries, are kept verbatim in their own scenes. The inertial one runs on a buffer that has never been read; reverting any of the three #8131 changes turns it red (the COM float view, the COM cache freshness, and the inertia 3-D reshape).Disposition
"Mutation" means a one-line production change that turns the keeper red; each was checked red on the keeper and reverted.
test_rigid_object.py::test_initialization(1 and 2 cubes)test_warmup_loads_physics_oncetest_rigid_object.py::test_initialization_with_kinematic_enabledtest_rigid_object.py::test_initialization_with_no_rigid_bodytest_initialization_rejects_invalid_rigid_body[none]test_initialization_with_articulation_roottest_initialization_rejects_invalid_rigid_body[articulation_root]raises=pytest.fail.Exception); see "Product bugs"test_set_rigid_object_stateitest_reset_rigid_objecttest_rigid_body_no_friction,test_rigid_body_with_static_friction,test_rigid_body_with_restitutionisaaclab/test/utils/test_wrench_composer_integration.pyondevelop, red whenwrite_data_to_simresets the permanent composer)test_rigid_body_set_massset_massesskippedtest_body_root_state_propertiestest_write_root_statetest_rigid_object_collection.py::test_initialization(1×1, 2×3)test_rigid_object_collection.py::test_initialization_with_kinematic_enabledtest_external_force_on_single_body,test_external_force_on_single_body_at_positionis_globalnegated; torques zeroed;write_data_to_simresets the permanent composer instead of the instantaneous onetest_set_object_state(i, j)test_object_state_propertiestest_write_object_statetest_reset_object_collectiontest_gravity_vec_w(both files),test_rigid_object_collection.py::test_initialization_with_no_rigid_bodytest_warmup_loads_physics_onceBoth files' root and link velocity writers are also read back through raw
get_velocities(): makingset_velocitiesa no-op in the link-velocity writer turns each state node red.Devices and CI selection
@pytest.mark.isaacsim_ci, as ondevelop. The collection file carried no mark ondevelopand carries none now.Timing
Warm Warp cache, repository orchestrator (
pytest tools), one process per file, second of two runs, RTX 5090.developis 09b1d54; this branch is 516c378.Times are the per-file process wall times the orchestrator reports, including interpreter and Kit startup.
developtest_rigid_object.pytest_rigid_object_collection.pyWith #8131 (a8300a3), the
developcollection file takes 13.1 s (40 tests).Product bugs
RigidObjectno longer rejects an enabled articulation root. The check (Adds check that no articulation root API is applied on rigid bodies #1358) was dropped in skip usd cloning in pure newton path #5743. Thedeveloptest still passes only because its Nucleus fixture resolves no rigid body at all ("Expected 1 prims … found 0"). The local case authors an enabled articulation root (physxArticulation:articulationEnabled = True) on the rigid body itself. Re-inserting the removed check turns it intoXPASS(strict)on both devices.RigidObjectCollection.reset()still leaves the wrench composers active.reset()passes_ALL_ENV_INDICEStoWrenchComposer.reset, which takes the partial-reset path. [Tests] Prune PhysX tests with the test-audit skill #8009 reported this. The reset assertions are kept fromdevelopand do not checkactive.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