Skip to content

[Tests] Prune PhysX tests with the test-audit skill - #8009

Merged
ooctipus merged 7 commits into
isaac-sim:developfrom
StafaH:test/audit-physx-tests
Sep 25, 2026
Merged

ooctipus merged 7 commits into
isaac-sim:developfrom
StafaH:test/audit-physx-tests

Conversation

@StafaH

@StafaH StafaH commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

PhysX test suite: 12:54 → 7:09 (−45%)

The isaaclab_physx suite runs through pytest tools on the same machine with a warm Warp cache. 26/27 files pass. test_spawn_meshes.py needs the tetrahedralization extra, which is missing locally and fails identically on develop; it passes with the extra.

develop this PR
Suite wall time 12:54 7:09
Test functions 272 186
Test lines 15,744 12,350

What changed

The whole test surface was pruned with the isaaclab-auditing-tests skill (#8007).

Method. Every test was marked keep, fix, merge or delete. Whenever a deletion's keeper does not carry the assertions verbatim, a deliberate production mutation proves the keeper fails. An independent review then restored every gap it found. Only test files changed.

  • Merged:
    • frame transformer: one scene
    • IMU/PVA: one driven loop each (the analytic checks are kept)
    • Jacobian and mass-matrix tests into the link-origin contract
    • init smoke tests into their siblings
    • consistency tests into the write tests, which now use random states
  • Deleted:
    • joint-wrench tests that compared the sensor to the raw tensor it copies; the shared analytic test is the keeper
    • Fabric tests that restated the shared FrameView contract
    • WrenchComposer replays
    • OSC tests covered by the controller suite
    • cloner tests that are always-xfail or always-skipped
  • Un-shadowed: the Fabric view defined local tests with the same names as the shared contract tests, which hid them. The shared tests now run and catch a per-row scale bug the local copies missed.
  • Fixed tests that could not fail:
  • Kept: the RTX writer and visual-material tests, and IK tracking. Their would-be keepers (the Kuka golden-image test and test_differential_ik.py) never run in CI.

Product defects found (not fixed here)

  • RigidObjectCollection.set_coms_index raises KeyError.
  • A full collection reset() leaves the wrench composers active.
  • FrameTransformer.__str__ swaps the frame count and the frame names.
  • The Kuka visual-material golden-image test is excluded from CI.

Release backport

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

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • My changes generate no new warnings
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

- Remove the Fabric view's local scale tests that shadowed the shared
  FrameView contract tests of the same name; the contract versions write
  a different scale per row on both devices and catch a broadcast bug
  the overrides passed.
- Enforce the physx_replicate vs. USD-parsing trajectory match, which
  passes on both devices but sat behind a non-strict xfail.
- Make the IMU stale-data regression settle on the ground and check a
  non-zero reading first; the freefall version passed with the
  timestamp guard removed.
- Give the IMU and PVA env_ids propagation tests assertions for the
  partially reset environments.
- Assert the contact-report API and threshold unconditionally, fold the
  assertion-free sensor print test into it, and remove the duplicate
  rigid-body material round trip.
- Run device-independent ordering and writer-lock tests on CUDA only.
@StafaH
StafaH requested a review from a team September 24, 2026 19:04
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 24, 2026
@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Test file consolidation and cleanup.

The PR appears mergeable, though the identified regression-test coverage should be restored where practical.

Findings

  1. P2 PhysX controller coverage removed ▶
  2. P2 Deformable simulation coverage removed ▶
  3. P2 CPU test coverage removed ▶

Summary

The PR consolidates and prunes PhysX asset, sensor, rendering, and simulation tests, while strengthening several assertions. It also removes distinct coverage for disabled contact processing, PhysX operational-space control under gravity, and live deformable-cone simulation.

Reviews (2) · Last reviewed commit: "Restore renderer writer and visual-mater..."



@pytest.mark.parametrize("device", ["cuda:0", "cpu"])
@pytest.mark.parametrize("device", test_devices(DeviceScope.CUDA))

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 CPU test coverage removed

DeviceScope.CUDA drops the CPU case that this test previously ran. On a CPU-only run, the contact-reporter and threshold assertions now skip entirely, so a CPU-specific regression can go unnoticed. The same change removes CPU coverage from two articulation-ordering tests and two Fabric writer-scope tests. Please retain CPU in the test scope while respecting the runtime device mask.

Knowledge Base Used: PhysX backend

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

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.

Isaac Lab Review Bot

The test audit consolidates duplicate and shadowed PhysX coverage, strengthens IMU/PVA reset assertions, makes the contact-threshold contract unconditional, and enforces the cloner trajectory comparison. The changed test-selection and launch-order paths do not establish a concrete defect requiring action before merge.

  • Design and architecture: The consolidation preserves focused contract coverage: shared FrameView scale tests replace local overrides, the contact sensor summary check joins the existing threshold fixture, and redundant material-property coverage is removed in favor of the existing view round-trip test.
  • API: No production or public API is changed. The added uses of test_devices and DeviceScope rely on existing test utilities and replace hard-coded device matrices without altering user-facing behavior.
  • Implementation: The reset tests now establish non-vacuous preconditions and verify selective per-environment zeroing. The contact threshold and cloner checks are directly asserted rather than guarded or non-strictly xfailed. The inherited CI marker and pre-launch test-utility imports were checked, but the supplied evidence does not demonstrate a material failure or unsupported dependency initialization.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@StafaH
StafaH marked this pull request as draft September 24, 2026 19:26
Retire redundant layers in source/isaaclab_physx/test/assets and repair
vacuous assertions, keeping one owner per contract:

- Delete wrench-composer self-readback, PhysX view round-trip, private
  ordering-map, tautological implicit-feedforward, and OSC tracking tests
  whose keepers were proven red by production mutations.
- Merge init, shape, mass-matrix refresh, int64-selector, and state
  consistency checks into the tests that already build the same fixture.
- Repair tests that passed without the behavior: external-force tests on
  a free-falling robot, reset tests that never set a wrench, the inverted
  joint-command check, spatial-tendon setters with no readback, neural
  actuator tests that only checked finiteness, and the private-ID
  collection test.
- Trim parametrize axes that select no distinct branch, keeping N=1
  initialization coverage per asset type and CPU coverage for writers.
…tion review

The shape-only iface alias tests did not cover the reordered values of body_com_pos_b/quat_b and body_pos_w/quat_w. Also replace the neural-actuator effort clamp, which could not fail, with a check that the network output follows the joint state.
- Merge frame-transformer, IMU, and PVA property tests that rebuilt the same
  scene into one driven-loop keeper per sensor, and drop the duplicate
  pendulum fixture.
- Delete joint-wrench tests that compared the sensor to the raw PhysX tensor
  it copies; the shared analytic frame contract keeps the physics proof.
- Fold view-caching counters into the fallback tests, sensor print checks
  into their keepers, and the isaac-sim#3498 threshold checks into the lazy contact
  test.
- Assert the signed friction direction and the exact ValueError messages for
  invalid contact data configs.
- Trim parametrize axes that select no distinct branch (dead contact
  processing flag, aged-clock and num_envs rows, device on bookkeeping).
- Remove the always-xfail and always-skipped cloner tests, assert the
  replicated body count, and fold env consistency into replicate-vs-USD.
- Remove Fabric view tests that re-assert shared contract tests through
  private matrices and selections.
- Remove renderer tests that restate a class property, a private table, a
  source grep, or mock pass-through, and cover the Isaac Sim 5.x output
  gate.
…ion review

The Kuka golden-image keeper is excluded from every CI shard, so restore the Fabric visual-material writer, tensor layout, and runtime-only tests it was meant to replace, and check that the frame transformer reuses its recorded launch.
@StafaH StafaH changed the title Audit PhysX tests with the test-audit skill Prune PhysX tests with the test-audit skill Sep 25, 2026
@StafaH StafaH changed the title Prune PhysX tests with the test-audit skill [Tests] Prune PhysX tests with the test-audit skill Sep 25, 2026
@StafaH
StafaH marked this pull request as ready for review September 25, 2026 01:36
@StafaH

StafaH commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 25, 2026
OperationalSpaceController,
OperationalSpaceControllerCfg,
)
from isaaclab.controllers import DifferentialIKController, DifferentialIKControllerCfg

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 PhysX controller coverage removed

Removing the operational-space-controller tests leaves no PhysX test that checks whether gravity compensation holds the Franka arm steady while an uncompensated controller lets it sag. The Newton tests cannot catch a PhysX-specific regression in that behavior.

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!

sim.play()
for _ in range(10):
sim.step()
# Spawn cone with density instead of mass

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 Deformable simulation coverage removed

The combined cone test checks the authored mass and density attributes but no longer starts or steps the simulation. It can therefore pass even if PhysX fails to initialize or simulate either deformable cone, which the removed tests exercised.

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!

@greptile-apps

greptile-apps Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.

  • P2 Disabled-contact coverage removed source/isaaclab_physx/test/sensors/test_contact_sensor.py:636 ▶

    The removed CPU test checked that overlapping cubes report zero contact forces when /physics/disableContactProcessing is true. The remaining tests that set this flag check other behavior, so contact reporting could regress despite the setting without this suite catching it.

    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!

@greptile-apps

greptile-apps Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

StafaH and others added 2 commits September 24, 2026 21:30
These files boot Kit on the default GPU, so scope their device rows to the default GPU instead of every CUDA device, which the multi-GPU discovery would pick up.
@ooctipus

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 25, 2026
@ooctipus
ooctipus merged commit 0173b04 into isaac-sim:develop Sep 25, 2026
53 checks passed
@ooctipus
ooctipus deleted the test/audit-physx-tests branch September 25, 2026 05:40
ooctipus added a commit that referenced this pull request Sep 25, 2026
…ts (#8018)

## Description

Completes the missing `develop` backports to `release/3.0.0` from the
48-hour audit window ending September 25, 2026 at 05:55 UTC. Of 30
merged source PRs, 25 were already present on release, three had no
backport, and two had inferred draft backports.

- #7978: report Newton reaction wrenches for fixed connections while
preserving articulation control-joint ownership.
- #7997: correct OVPhysX joint-wrench frames and move the shared
analytic sensor contract into the test tree.
- #7989: correct body-offset Jacobians in task-space actions without
mutating backend buffers.
- #8010 and #8009: backport the OVPhysX and PhysX test audits after
their wrench prerequisite.

All five source patches apply without conflicts in this order. This
supersedes the now-closed inferred draft backports #8016 and #8017,
which were generated without #7997 and adapted their sensor tests around
the old release implementation. Source commit hashes are recorded in the
commit message.

## Validation

- Audited all 778 paths touched by the 30 source PRs. Remaining
differences in those paths are existing release metadata, cloning
documentation, a CLI test version example, and release-only renderer
tests.
- **55 focused checks passed:** 6 Jacobian/shared-contract unit tests,
14 Newton sensor tests, 9 OVPhysX sensor tests across CPU/GPU, 9 PhysX
sensor tests, 14 changed shared-ordering cases, and 3 live PhysX OSC
tracking/gravity cases. Seven PhysX ordering variants skipped in the
direct invocation; the live PhysX checks ran separately with Kit.
- Backend validation used Newton 1.6.0, Warp 1.17.0, OVPhysX 0.6.3, and
the pinned Isaac Sim 6.1.0 installation. Package imports were verified
to resolve to this backport checkout.
- `uv run --no-sync isaaclab -f`, `git diff --check`, and the full `make
-C docs current-docs` build with warnings as errors passed.
- Additional renderer contract coverage: 53 passed; two live-render
cases could not initialize the local native CRenderApi library despite
installing the pinned `ov` extra. Full Docker/GPU CI is running on the
PR head.
- The broader shared ordering file has 14 OVPhysX failures on both this
branch and unchanged release, with identical failing node IDs and no
added failures. The changed cases listed above passed.

## Controller coverage review

The live PhysX OSC tests remain in
`source/isaaclab/test/controllers/test_operational_space.py`; its
fixture uses `SimulationCfg`'s default `PhysxCfg`, and the file is
included in CI. The existing absolute-pose tracking,
gravity-compensation, and nullspace-centering cases passed against Isaac
Sim 6.1.0. The test audit removes the duplicate asset-suite cases while
retaining this controller-suite coverage.

## Existing release CI failures

The latest [release
run](https://github.com/isaac-sim/IsaacLab/actions/runs/36097576980) and
[develop
run](https://github.com/isaac-sim/IsaacLab/actions/runs/36099567240)
fail the same five OvStage image comparisons in
`rendering-correctness-kitless (ovstage)` and `ovrtx-cache-warm`:
Cartpole on Newton and OVPhysX, plus Newton Franka cable, cloth, and
soft. Cartpole is 2.03–2.04% different against a 1.50% threshold on both
branches; cloth is 32.48% on both. These shared rendering failures
predate this catch-up; this PR does not change rendering output or image
thresholds.

## Checklist

- [x] Contribution guidance followed and formatting checks passed
- [x] Original package changelog fragments and documentation included
- [x] File-by-file backport audit completed
- [x] Warning-free documentation build completed
- [ ] Full CI completed

Targets `release/3.0.0`; no further backport is needed.
@ooctipus ooctipus self-assigned this Sep 25, 2026
@ooctipus ooctipus added this to the Isaac Lab 3.0 GA milestone Sep 25, 2026
StafaH added a commit that referenced this pull request Sep 25, 2026
…8031)

Backports the two test-prune PRs whose automatic backports failed to
`release/3.0.0`:

- #8022 — prune core `isaaclab` tests with the test-audit skill (core
job 32:18 → ~22:40 locally). The bot could not replay it because the PR
contained a merge commit.
- #8008 — prune Newton tests with the test-audit skill. The bot's
cherry-pick applied, but its validation rejected the result.

Each is a `git cherry-pick -x` of the squash commit on `develop`:
- **#8008** applies identically.
- **#8022** applies identically except for three asset-interface test
fixtures, which `release/3.0.0` already has in #8022's final form.

Test-only changes plus `.skip` changelog fragments. Tests are validated
by this PR's CI.

The rest of this test-audit series is already on `release/3.0.0`:
- #8003 via #8002
- #8009 and #8010 via #8018
- #8006, #8007, #8019 and #8020 by the backport bot

---------

Signed-off-by: Octi Zhang <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>
StafaH added a commit that referenced this pull request Oct 3, 2026
# Description

`isaaclab_physx.assets.RigidObjectCollection` has three bugs in its
inertial-property setters. #8009 and #8022 found the first one during
the test audit (`set_coms_index` raises `KeyError`) and left it unfixed.

1. **`set_coms_index` raises `KeyError: <class
'warp._src.types.transformf'>`.** The COM poses were reshaped into view
order but passed to the PhysX tensor API as `wp.transformf`. Every other
view write in this class already calls `.view(wp.float32)`; this path
now does too.
2. **A partial COM write zeroes the cached `body_com_pose_b`.**
`body_com_pose_b` is filled lazily from the view. `set_coms_index` wrote
the selected cells into the buffer and then marked it fresh, so cells
that had never been read back returned all-zero poses (including a zero
quaternion) whenever the setter ran before the first read. An example is
a COM randomization event applied to a subset of bodies at startup. The
setter no longer marks the cache fresh, so the next read refreshes from
the view, which is what `RigidObject` does.
3. **`set_inertias_index` fails with `Failed to set rigid body inertias
in backend`.** The `(num_instances, num_bodies, 9)` inertias were
flattened with the 2D reshape helper. They now use
`reshape_data_to_view_3d(..., 9)`.

Only the PhysX collection is affected. `RigidObject` and `Articulation`
handle these paths correctly, and the mocked interface tests accept
either layout, which is why this was missed.

## Testing

A new test,
`test_inertial_property_subset_writes_reach_selected_view_entries`,
writes COM and inertia to a non-sorted subset of (env, body) cells. It
then checks both the PhysX view readback and the data buffers, on CPU
and CUDA. Each bug turns it red on its own:

| Code state | Result |
|---|---|
| `develop` | `KeyError: transformf` in `set_coms_index` |
| + float32 COM view | `body_com_pose_b` mismatch: 4/42 elements (zero
quaternion `w` in unselected cells) |
| + cache freshness fix | `Exception: Failed to set rigid body inertias
in backend` |
| + inertia 3D reshape (this PR) | passes |

- `source/isaaclab_physx/test/assets/test_rigid_object_collection.py`:
40 passed
- `source/isaaclab/test/assets/test_rigid_object_collection_iface.py`:
107 passed
- `./isaaclab.sh -f`: all hooks pass

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Release backport

- [ ] <!-- backport-active-release --> 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.

- [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
`uv run isaaclab --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] 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)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Mustafa Haiderbhai <[email protected]>
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

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants