Skip to content

Accelerate and strengthen asset tests [4/13] - #8139

Closed
AntoineRichard wants to merge 26 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/asset-tests-p06-ov-articulation-core
Closed

AntoineRichard wants to merge 26 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/asset-tests-p06-ov-articulation-core

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Part 4/13 of the asset-test series (tracker: #7282). Scope: OVPhysX articulation. Depends on #8138, #8134; this branch contains their commits until they merge.

#8138 lets CPU and CUDA OVPhysX scenes run in one process. #8134 (the shared asset contract, which includes #8131)
owns the partial joint-state and deprecated joint-state-writer contracts that replace one removed test.

What changed

  • test_articulation.py builds one module-scoped composite scene per device from locally authored islands of the
    branching fixture, resets it once, and keeps it alive for every node that uses it. Each island serves one node
    unless noted, so the nodes do not depend on each other's order. Partial writes select a subset of environments,
    joints, or bodies and prove the unselected entries keep their real backend state. No Nucleus robot is loaded, and
    the file no longer needs device_split.
  • Core nodes, referred to below by their short names:
    • partial-state node, test_articulation_initialization_and_partial_state (CPU and CUDA): indexed joint-state
      writes under MJWarp ordering, including a position-only partial write checked bit-exact against the raw binding;
    • properties node, test_articulation_joint_and_body_properties_round_trip (CPU and CUDA): joint friction, mass,
      COM, and inertia through raw bindings and public getters;
    • drive node, test_implicit_drive_targets_submit_feedforward_effort_and_track: implicit drive targets with
      feedforward-only effort submission, PD telemetry, partial targets, and tracking in the solver;
    • dynamics node, test_computed_dynamics_follow_public_order_and_model_writes: gathered Jacobian, mass matrix, and
      gravity forces with their refresh after joint-state and model-property writes;
    • floating node, test_floating_articulation_root_state_dynamics_wrench_and_reset: floating-root state,
      generalized dynamics columns, wrench-composer reset, root link/COM composition, and environment-selective wrench
      delivery.
  • Regression nodes: material randomization, joint velocity and effort limits, implicit-effort submission on the host
    (CPU scene) and native (CUDA scene) actuator paths, COM writes under non-identity body order, reversed-joint
    dynamics, spatial and fixed tendons, native actuator effort, native reset and gain selectivity, FK refresh shared
    between asset and render reads, pinned-host staging of CPU-only property writes, USD-authored gains, an explicit
    root path to a floating base body, and default joint position clamping by new limits.
  • Own-scene tests cover initialization failures: out-of-range default joint positions and velocities, and an explicit
    root path that matches no prim. 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.
  • Pure unit tests move to unit/: test_articulation_helpers.py and test_articulation_kernels.py (with a unit
    marker), and new unit/test_ovphysx_articulation.py and unit/test_ovphysx_actuator_control.py with tests moved
    verbatim from test_articulation.py.

Test disposition

Mutations are one-line production changes, reverted afterwards, that turn the keeper red. "Same name" keepers carry
the develop assertions verbatim on a local fixture.

Removed or moved develop test Keeper Proof
test_reversed_joint_ordering_joint_state_index_writes_backend_order partial-state node (partial and position-only writes); floating node (floating-base columns); full reordered writes: develop test_articulation_ordering_iface.py assertions verbatim on the branching fixture
test_write_joint_frictions_to_sim properties node dynamic-friction getter aliased to static → red
test_live_anymal_c_manual_joint_ordering_reorders_joint_targets drive node host path submitting applied effort → red
test_apply_joint_command drive node (tracking) position targets blocked at set and submit → red
test_articulation_dynamics_fixed_base_match_raw_ovphysx_bindings dynamics node mass write not invalidating the mass matrix → red
test_articulation_dynamics_reorder_body_rows_and_joint_axes dynamics node assertions verbatim
test_reset floating node reset clearing every environment's composer → red
test_write_root_state floating node root COM write ignoring the COM offset → red
test_external_force_on_single_body, test_external_force_on_single_body_at_position, test_external_force_on_multiple_bodies, test_external_force_on_multiple_bodies_at_position floating node (delivery); develop test_wrench_composer.py (composition, positions, frames) skipping the LINK_WRENCH write → red
test_initialization_floating_base, test_initialization_fixed_base, test_initialization_fixed_base_single_joint composite islands' initialization and shape checks; develop test_articulation_iface.py —
test_initialization_floating_base_made_fixed_base, test_initialization_fixed_base_made_floating_base, test_fragment_fix_root_reenables_existing_joint develop test_articulation_fragments.py (fix-root authoring) and the fixed and floating islands —
test_body_root_state dynamics node (J·q̇ equals COM and link velocities with a COM offset); develop iface frame contracts —
test_write_joint_state_data_consistency partial-state node; develop iface cache-invalidation and data contracts —
test_branching_fixture_physx_ordering_is_identity_on_ovphysx develop test_articulation_ordering.py (same-backend preset identity) —
test_ovphysx_effort_binding_excludes_implicit_pd test_effort_binding_excludes_implicit_pd (CPU host path, CUDA native path) host path submitting telemetry → CPU red; native path submitting telemetry → CUDA red
test_newton_native_explicit_actuator_submits_ovphysx_effort test_native_actuator_submits_real_effort native controller reading stale state → red
test_newton_native_actuator_reset_and_gain_event_are_environment_selective same name (delay pushes checked per joint) native reset resetting every environment → red
test_reversed_joint_dynamics_use_public_joint_basis same name (reads right after the write, no step) legacy joint-sign correction applied on top of the runtime's → red
test_root_link_vel_w_refreshes_fk_before_body_com_vel_w_read same name removing the FK refresh from root_link_vel_w → red
test_set_material_properties same name (two authored collision shapes) skipping the event's write → red
test_setting_velocity_and_effort_limits_write_to_solver same name (branching fixture, same drive props) configured velocity limit not written → red
test_com_orientation_write_invalidates_static_inertia_cache_with_body_ordering same name (CPU and CUDA) partial COM write skipping the cache refresh → red; COM write keeping the static inertia → red
test_cpu_only_property_writes_wait_for_pinned_host_staging same name, same fixture reverting the #7486 stream syncs → red
test_fixed_tendon_position_target_writes_offset test_tendon_properties_and_position_targets (locally authored fixed and spatial tendons) mask-form target sign flipped → red
test_write_joint_state_to_sim_index_partial #8134 contract cases for partial int64 joint-state writes and the deprecated writer; partial-state node #8134 record
test_prepare_native_actuators_leaves_implicit_only_articulation_on_standard_path, test_host_actuator_control_import_does_not_probe_optional_newton_runtime unit/test_ovphysx_actuator_control.py moved verbatim
test_cached_read_launches_reset_on_ordering_and_invalidation, test_static_property_reads_are_not_invalidated_by_simulation_steps, test_joint_dof_sign_resolution_traverses_instance_proxies unit/test_ovphysx_articulation.py moved verbatim
test_out_of_range_default_joint_pos, test_out_of_range_default_joint_vel test_out_of_range_default_joint_state[position, velocity] (own scene; matches the specific message) removing the position raise in _validate_cfg → position red; removing the velocity raise → velocity red
test_loading_gains_from_usd same name (unset actuator gains adopt the authored drive gains, per radian) default stiffness read as zero in get_default_joint_properties → red
test_setting_invalid_articulation_root_prim_path same name (own scene; matches Failed to find articulation root prim) removing the missing-root check → red
test_setting_articulation_root_prim_path, test_initialization_floating_base_non_root test_explicit_articulation_root_on_a_floating_base_body (root API moved to the floating base body, explicit /base path) explicit root path ignored → red
test_joint_pos_limits test_joint_position_limits_clamp_default_joint_positions (partial limits round trip, clamping of the selected defaults only); limit-writer contract in #8134 clamp kernel skipped → red

test_articulation_helpers.py and test_articulation_kernels.py move to unit/ without test changes.

Device coverage: the drive, dynamics, floating-root, reversed-joint dynamics, FK-refresh, USD-gain, tendon, native
actuator, position-limit clamping, and pinned-host staging nodes run on CUDA only; the own-scene validation tests run
on CPU only. Develop ran most of their predecessors on both devices. Their Lab code paths do not depend on the device,
except pinned-host staging, which only exists on CUDA. The CPU-specific path is the direct read and write of CPU-only
property bindings without staging, which the CPU scene covers through the partial-state, properties, limits,
COM-ordering, material, and effort-binding nodes.

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 ran device_split files in two processes.

Test file develop wall (s) this PR wall (s) Tests
assets/test_articulation.py 94.97 7.55 85/86 → 30/30
assets/unit/test_ovphysx_articulation.py — 3.07 3 (moved)
assets/unit/test_articulation_helpers.py 2.71 2.98 1
assets/unit/test_ovphysx_actuator_control.py — 2.68 3 (moved)
assets/unit/test_articulation_kernels.py 1.65 1.68 4
Total 99.33 17.96

Product bugs pinned

None.

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

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.
Move the mocked cross-backend asset interface tests into a contract package
with api, data, and write entry modules. An explicit capability table gives
every backend a visible row: unavailable backends and unsupported branches
collect as skips with their reason instead of silently dropping out. A
kitless usdrt/carb stub and an availability guard keep PhysX articulations
in the matrix, where they previously were skipped without notice.

Factory manager patches are scoped to one test and restored afterwards.
PhysX views apply TensorAPI writes so partial writers are checked against
unselected backend rows, Newton joins the fixed-tendon contract, the
deprecated command aliases are checked against the actuator collection, and
one enforced inventory classifies the public base-class surface.
Take over what the removed OVPhysX real-backend joint-state test checked, on
every backend: unsorted int64 environment and joint selectors on the fused
writer, the finite-difference baseline it restarts for the written joints,
skip_forward leaving body caches to the caller, and the deprecated combined
writer producing the same state as the public writers.
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.
Add a module-scoped composite scene per device, built from locally authored
islands of the branching fixture and reset once. Its nodes cover indexed
joint-state writes, raw joint and body properties with the public getters,
implicit drive targets with feedforward effort and tracking, gathered
computed dynamics with model-property refresh, and floating-root state,
reset, and wrench delivery. The CPU scene covers the host-resident property
path.

Remove the per-test Nucleus-robot tests these nodes or the backend
interface and ordering tests already cover. The remaining per-test cases
run before the module-scoped scene is created.
Move the remaining OVPhysX articulation regressions onto islands of the
composite scenes: material randomization, joint velocity and effort limits,
implicit-effort submission on the host and native actuator paths, COM
writes under body ordering, reversed-joint dynamics, spatial and fixed
tendons, native actuator effort, reset and gain selectivity, FK refresh
sharing, and pinned-host staging of CPU-only property writes. Move the
articulation data and actuator-control unit tests verbatim to unit
modules, and remove the remaining per-test Nucleus-robot cases. The file no
longer needs one process per device.
…oots

Keep a real check for every removed per-test case. Own-scene tests pin that
out-of-range default joint positions and velocities and an explicit root
path matching no prim fail initialization with their specific errors.
Composite nodes pin that unset actuator gains adopt the authored drive
gains, that an explicit root path to a floating base body below the asset
resolves and simulates, and that partial joint position limits clamp only
the selected default joint positions.
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High risk] Removes process-wide CPU-only mode lock from physics runtime.

The PR is not ready to merge because the articulation suite still silently skips per-test coverage on the second device.

Findings

  1. P1 Second-device tests remain skipped ▶
  2. P2 Identity ordering loses coverage ▶

Summary

The PR replaces many per-test OVPhysX articulation scenes with reusable CPU/CUDA composite scenes, moves two isolated test modules under unit/, and changes OVPhysX device selection to scene attributes.

  • Mixed-device lifecycle coverage accompanies the runtime change.
  • The articulation test file retains an obsolete device-skip policy and loses a same-backend identity assertion.

Reviews (1) · Last reviewed commit: "Move OVPhysX articulation helper and ker..."

Comment on lines +1575 to +1579
device = request.param
device_scope = DeviceScope.CUDA if device.startswith("cuda") else DeviceScope.CPU
# The native Newton actuator runtime requires CUDA; the CPU scene keeps explicit actuators on the host.
native_actuators = device.startswith("cuda")
sim_cfg = SimulationCfg(physics=OvPhysxCfg(), device=device, use_newton_actuators=native_actuators)

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.

P1 Second-device tests remain skipped. When this suite runs CPU and CUDA cases in one process, the existing _ovphysx_skip_other_device fixture still records the first device parameter and skips later per-test cases on the other device. The manager now supports switching devices, but a normal run silently misses those cases—often the CPU cases if CUDA runs first. Remove the obsolete skip policy so both devices receive the intended coverage.

Knowledge Base Used: Omniverse backend

_ISLANDS: dict[str, _IslandCfg] = {
# Nonidentity MJWarp order through cross-backend discovery; shared by the state and property
# tests, which each check deltas against their own starting state.
"ordered": _IslandCfg(_implicit(), joint_ordering="mjwarp", body_ordering="mjwarp"),

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 Identity ordering loses coverage. The replacement islands test mjwarp and explicit joint orders, but none requests joint_ordering="physx" and body_ordering="physx". The removed branching-fixture test checked that this same-backend path preserves the native order without creating reorder maps. Without an equivalent assertion, a regression in that path could pass the OVPhysX suite unnoticed.

Knowledge Base Used: Omniverse backend

@AntoineRichard
AntoineRichard marked this pull request as draft September 29, 2026 12:54
Replace the static-method fixture helper with a module function, read
backend storage through bound getters instead of getattr on known names,
share one context for suppressing Newton model-change notifications, reuse
the timestamped-cache helpers in the joint-state case, complete return
annotations, and word comments by their current constraint.
# Conflicts:
#	source/isaaclab_ov/test/assets/test_articulation.py
Run the index-resolution cases on OVPhysX, which implements the joint and
body helpers, and drop the capability every backend now shares. Make the
PhysX recording setters reject compact data instead of accepting it. Move
the tendon shape negatives into their own case so the Newton mask xfail
covers exactly the torch or warp oversized input it pins.
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.
@AntoineRichard AntoineRichard changed the title Accelerate and strengthen asset tests [6/24] Accelerate and strengthen asset tests [4/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

infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants