Skip to content

Accelerate and strengthen asset tests [7/13] - #8146

Closed
AntoineRichard wants to merge 8 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/asset-tests-p13-physx-newton-actuators
Closed

AntoineRichard wants to merge 8 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/asset-tests-p13-physx-newton-actuators

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Part 7/13 of the asset-test series (tracker: #7282). Scope: PhysX actuators. No dependencies.

What changed

source/isaaclab_physx/test/assets/test_newton_actuators_physx.py now focuses on the PhysX-specific seams: PhysxActuatorWrapper efforts next to implicit PhysX drives, stateful actuators with ping-pong CUDA graphs, non-identity joint ordering, per-articulation adapters, per-environment resets, gain randomization, and network actuators. Every test kept is unchanged, including test_native_graph_count and both test_network_drives_haa_joints. The translation of each Lab actuator model to Newton actuator schemas is backend independent: the mixed implicit/explicit rollout keeps exercising PD and DC-motor authoring on PhysX, and the Newton suite owns the other models.

The checks that no longer need a full rollout move to units:

  • New source/isaaclab/test/actuators/test_physx_actuator_runtime.py covers the CUDA-graph handling of the host-side runtime (isaaclab.actuators.newton.physx_runtime.PhysxActuatorRuntime), which the PhysX and OVPhysX backends share:
    • a failed second graph capture discards the graphs, restores the adapter state swapped by the first capture, and logs a warning;
    • a graphable adapter whose capture fails computes eagerly on every step and does not retry the capture (the test counts the capture attempts);
    • stateful actuators reject an outer CUDA graph capture with an explicit error.
  • test_newton_adapter.py gains test_is_stateful_only_with_delay_state: an adapter built from delayed actuators reports is_stateful, and one built from DC motors alone does not. The runtime unit stubs the adapter, so this test covers the real property.
  • New unit/test_physx_actuator_control.py holds the two actuator-preparation checks verbatim; they do not need Kit.

Disposition

"Mutation" means a one-line production change that turns the keeper red; each was checked red on the keeper and reverted.

Removed or moved Keeper Proof
TestIdealPDEquivalence TestMixedWithImplicitEquivalence mutation: authored kp halved
TestDCMotorEquivalence TestMixedWithImplicitEquivalence mutation: authored saturation_effort halved
TestRemotizedPDEquivalence Newton TestRemotizedPDEquivalence (develop); PD and delay path via Mixed and TestDelayedPDEquivalence halving the lookup efforts or shortening the delay goes undetected by the removed test and the Newton suite alike, because the clamp does not bind within the 10-step rollout
test_newton_actuator_graph_capture_failure_falls_back_to_eager test_physx_actuator_runtime.py (first two tests) mutations: capture fallback catches only ValueError; capture retried after a failure (if not self.native_actuator_graphs:)
test_stateful_newton_actuators_reject_outer_cuda_capture test_physx_actuator_runtime.py (guard); test_newton_adapter.py::test_is_stateful_only_with_delay_state (the real NewtonActuatorAdapter.is_stateful) mutations: outer-capture guard disabled; is_stateful returning False, or True
test_prepare_native_actuators_does_not_zero_solver_gains, test_prepare_native_actuators_leaves_implicit_only_articulation_on_standard_path unit/test_physx_actuator_control.py verbatim

Devices and CI selection

  • test_newton_actuators_physx.py keeps its develop device scope (cuda:0).
  • The runtime unit uses a CUDA device stand-in and mocked captures, so it needs no GPU; the adapter and actuator-control units run on CPU.
  • None of these files carried @pytest.mark.isaacsim_ci on develop, and none does now.

Timing

Warm Warp cache, repository orchestrator (pytest tools), one process per file, second of two runs, RTX 5090. develop is 09b1d54; this branch is 5ad5e84.

Times are the per-file process wall times the orchestrator reports, including interpreter and Kit startup.

File develop This branch
test_newton_actuators_physx.py 17.1 s (35 tests) 12.8 s (19 tests)
unit/test_physx_actuator_control.py (new) — 2.6 s (2 tests)
source/isaaclab/test/actuators/test_physx_actuator_runtime.py (new) — 2.4 s (3 tests)
source/isaaclab/test/actuators/test_newton_adapter.py 2.5 s (11 tests) 2.6 s (12 tests)
Total 19.6 s 20.4 s

The PhysX rollout file is 4.3 s faster; the two new unit files add about 5 s of process startup for well under 0.1 s of test time.

With a cold Warp cache, the removed outer-capture rollout alone took about 21 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

Cover the host-side Newton actuator runtime shared by the PhysX and
OVPhysX backends at its own boundary: a failed graph capture restores the
adapter state swapped by an earlier capture and falls back to eager
kernels on every step, and stateful actuators reject an outer CUDA graph
capture. These units replace full ANYmal rollouts in the PhysX
Newton-actuator suite.
Drop the ideal-PD, DC-motor, and remotized-PD equivalence runs, whose
actuator translation is backend independent: the mixed implicit/explicit
run still exercises the PD and DC-motor authoring on PhysX, and the
Newton suite owns the remaining models. Move the native-path preparation
checks to a kitless unit file, and rely on the shared PhysX actuator
runtime units for graph-capture failure and outer-capture rejection
instead of full ANYmal rollouts.
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Low risk] Adds unit tests for actuator runtime and control.

The PR appears safe to merge, with a non-blocking gap in capture-failure integration coverage.

Findings

  1. P2 Fallback effort goes unchecked ▶

Summary

The PR moves two PhysX preparation checks into a kitless unit file, adds focused host-runtime graph tests, and removes several PhysX actuator equivalence rollouts. The new capture-failure tests no longer check actual effort application after fallback.

Reviews (1) · Last reviewed commit: "Focus PhysX Newton-actuator tests on bac..."

eager_compute = Mock()
monkeypatch.setattr(wp, "get_device", lambda device: _cuda_device(is_capturing=False))
monkeypatch.setattr(wp, "ScopedCapture", _FailingCapture)
monkeypatch.setattr(runtime, "_run_native_actuator_kernels", eager_compute)

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 Fallback effort goes unchecked

This test replaces _run_native_actuator_kernels with a mock, so it checks that failed capture selects eager execution but not that the real adapter applies effort. The removed PhysX rollout checked for nonzero applied and adapter effort after capture failed. Without a check through the real kernels, a fallback that runs but produces zero or stale effort could pass.

@AntoineRichard
AntoineRichard marked this pull request as draft September 29, 2026 12:54
Build the device description where it is used and annotate the test functions consistently.
The suite runs through pytest and the repository test runner.
…ntoiner/asset-tests-p13-physx-newton-actuators
The PhysX CUDA-capture rejection tests stub the adapter, so they no
longer reach the real is_stateful property.
@AntoineRichard AntoineRichard changed the title Accelerate and strengthen asset tests [13/24] Accelerate and strengthen asset tests [7/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