Skip to content

Accelerate and strengthen asset tests [12/13] - #8154

Closed
AntoineRichard wants to merge 14 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/asset-tests-p21-newton-rigid-object
Closed

AntoineRichard wants to merge 14 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/asset-tests-p21-newton-rigid-object

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

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

What changed

source/isaaclab_newton/test/assets/test_rigid_object.py and test_rigid_object_collection.py run kitless on locally spawned cubes from #8151's scene helpers, not the Nucleus DexCube and ground plane.

  • One persistent scene per device (CPU and CUDA) in each file. It holds two environments with gravity off and is reset once. A function fixture puts the bodies back at rest and restores the configured mass, centre of mass and inertia before every test. Tests that need gravity apply it per world for their own duration.
  • Rigid object: two cubes. The state-write rows (COM, link, root) run in one scene instead of one scene per row. test_write_root_state now also snapshots body_link_vel_w before any root-frame cache is read. [Tests] Prune Newton tests with the test-audit skill #8008 reported body_link_vel_w stale after a COM-velocity write; that does not reproduce on current develop, and the snapshot guards the fix.
  • Rigid object collection: each environment holds three cubes in the collection and an unrelated rigid body next to them, so the collection view must select exactly its configured bodies. The fixture rests that sibling too. The only assertion change is .view becoming .reshape in test_write_object_state: with the sibling interleaved, the collection's pose view is strided.
  • Own scenes for configurations that must fail initialization and for the single-instance cases. Only one simulation context can be alive, so they run first in each file; selected after a shared-scene test, they fail.
  • Every develop test keeps its name and assertions. On develop, the rigid-object articulation_root initialization row loaded a Nucleus asset that is only an over "object" layer with no defined prims, so it repeated the none case; the local row is a real articulation rooted on a rigid body.

Disposition

Test on develop Keeper Proof
test_rigid_object.py::test_initialization_rejects_non_rigid_body_prims[none, articulation_root] Same name, [none, articulation] Same match string; setting expected_num_matches=None turns the articulation row red
test_rigid_object.py::test_write_root_state[(2,com),(2,link),(2,root),(1,root)] test_write_root_state loops over the three locations; test_single_instance_initialization_and_root_state_write covers the single-instance row Assertions verbatim plus the snapshot above; a stale body_link_vel_w view turns it red
test_rigid_object.py: test_external_force_on_single_body, test_rigid_body_set_material_properties, test_rigid_body_set_mass, test_gravity_vec_w_tracks_model_gravity, test_body_root_state_properties, test_body_link_pose_w_fresh_after_root_pose_write Same names on the local cubes Verbatim; the flaky marker is dropped because the scene is deterministic
test_rigid_object_collection.py::test_initialization[(1,1,False),(2,3,True)] test_initialization (two envs, three cubes, sibling, pose check) and test_single_instance_initialization (1×1) Assertions verbatim
test_rigid_object_collection.py: test_set_body_inertial_properties_updates_inverses, test_initialization_with_no_rigid_body, test_external_force_on_single_body, test_gravity_vec_w_tracks_model_gravity, test_object_state_properties, test_write_object_state[com/link/root], test_body_pose_write_marks_fk_reset_mask Same names Verbatim; the state-write rows run in one scene

Device scope and CI routing

  • Both shared scenes and the single-instance tests run on test_devices() (CPU and CUDA by default), as on develop. The scenes disable CUDA-graph capture, which develop's default NewtonCfg enabled on CUDA; the captured-graph path is covered for articulations in Accelerate and strengthen asset tests [13/13] #8156.
  • The keepers of every test develop marked keep @pytest.mark.isaacsim_ci (eight in the rigid-object file; test_gravity_vec_w_tracks_model_gravity and test_body_pose_write_marks_fk_reset_mask in the collection file), so both files stay selected by Isaac Sim's short CI (ISAACSIM_CI_SHORT).

Product observations (not fixed here)

  • Newton's RigidObject accepts a single rigid body that carries ArticulationRootAPI. It only rejects a prim path when it finds more than one rigid body. This may differ from PhysX.
  • [Tests] Prune Newton tests with the test-audit skill #8008 reported that Newton's ArticulationView misaddresses per-environment shapes for collections. It does not reproduce with the local single-shape cubes on CPU or CUDA: a masked set_attribute("shape_material_mu") changes only the selected environment and body in the flat model. randomize_rigid_body_material rejects RigidObjectCollection outright, so no Isaac Lab path exercises this, and this PR adds no test for it.

Timing

Warm Warp cache, repository orchestrator, one process per file, RTX 5090. The second of two runs is reported.

File develop This PR
assets/test_rigid_object.py 21 pass, 13.5 s 18 pass, 6.9 s
assets/test_rigid_object_collection.py 20 pass, 12.1 s 17 pass, 6.6 s

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

@AntoineRichard
AntoineRichard requested a review from a team September 29, 2026 12:48
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 29, 2026
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Low risk] Adds test utilities and changelog entries for asset tests.

The PR appears safe to merge, though restoring shape materials would keep the shared tests isolated.

Findings

  1. P2 Material changes persist between tests ▶

Summary

The PR moves Newton rigid-object tests to locally spawned cubes, shares a scene per device, and adds a pre-root-read snapshot for stale body-link velocity coverage.

  • Separate scenes retain invalid-initialization and single-instance checks.
  • One test leaves changed material properties in the shared scene.

Reviews (1) · Last reviewed commit: "Run Newton rigid-object tests on a persi..."

term = randomize_rigid_body_material(
EventTermCfg(func=randomize_rigid_body_material, mode="startup", params=params), env
)
term(env, torch.tensor([num_cubes - 1], device=device), **params)

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 Material changes persist between tests

This test changes the second cube’s friction and restitution, but the shared-scene fixture does not restore them. Later tests therefore use a different material than the configured cube. Restoring the original values would keep the tests independent.

@AntoineRichard
AntoineRichard marked this pull request as draft September 29, 2026 12:55
@AntoineRichard AntoineRichard changed the title Accelerate and strengthen asset tests [21/24] Accelerate and strengthen asset tests [12/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

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants