Repository navigation
Accelerate and strengthen asset tests [4/13] - #8139
AntoineRichard wants to merge 26 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.
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.
|
| 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) |
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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
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
…r/asset-tests-p01-contract
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.
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.pybuilds one module-scoped composite scene per device from locally authored islands of thebranching 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.test_articulation_initialization_and_partial_state(CPU and CUDA): indexed joint-statewrites under MJWarp ordering, including a position-only partial write checked bit-exact against the raw binding;
test_articulation_joint_and_body_properties_round_trip(CPU and CUDA): joint friction, mass,COM, and inertia through raw bindings and public getters;
test_implicit_drive_targets_submit_feedforward_effort_and_track: implicit drive targets withfeedforward-only effort submission, PD telemetry, partial targets, and tracking in the solver;
test_computed_dynamics_follow_public_order_and_model_writes: gathered Jacobian, mass matrix, andgravity forces with their refresh after joint-state and model-property writes;
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.
(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.
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.
unit/:test_articulation_helpers.pyandtest_articulation_kernels.py(with aunitmarker), and new
unit/test_ovphysx_articulation.pyandunit/test_ovphysx_actuator_control.pywith tests movedverbatim 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.
test_reversed_joint_ordering_joint_state_index_writes_backend_ordertest_articulation_ordering_iface.pytest_write_joint_frictions_to_simtest_live_anymal_c_manual_joint_ordering_reorders_joint_targetstest_apply_joint_commandtest_articulation_dynamics_fixed_base_match_raw_ovphysx_bindingstest_articulation_dynamics_reorder_body_rows_and_joint_axestest_resettest_write_root_statetest_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_positiontest_wrench_composer.py(composition, positions, frames)LINK_WRENCHwrite → redtest_initialization_floating_base,test_initialization_fixed_base,test_initialization_fixed_base_single_jointtest_articulation_iface.pytest_initialization_floating_base_made_fixed_base,test_initialization_fixed_base_made_floating_base,test_fragment_fix_root_reenables_existing_jointtest_articulation_fragments.py(fix-root authoring) and the fixed and floating islandstest_body_root_statetest_write_joint_state_data_consistencytest_branching_fixture_physx_ordering_is_identity_on_ovphysxtest_articulation_ordering.py(same-backend preset identity)test_ovphysx_effort_binding_excludes_implicit_pdtest_effort_binding_excludes_implicit_pd(CPU host path, CUDA native path)test_newton_native_explicit_actuator_submits_ovphysx_efforttest_native_actuator_submits_real_efforttest_newton_native_actuator_reset_and_gain_event_are_environment_selectivetest_reversed_joint_dynamics_use_public_joint_basistest_root_link_vel_w_refreshes_fk_before_body_com_vel_w_readroot_link_vel_w→ redtest_set_material_propertiestest_setting_velocity_and_effort_limits_write_to_solvertest_com_orientation_write_invalidates_static_inertia_cache_with_body_orderingtest_cpu_only_property_writes_wait_for_pinned_host_stagingtest_fixed_tendon_position_target_writes_offsettest_tendon_properties_and_position_targets(locally authored fixed and spatial tendons)test_write_joint_state_to_sim_index_partialtest_prepare_native_actuators_leaves_implicit_only_articulation_on_standard_path,test_host_actuator_control_import_does_not_probe_optional_newton_runtimeunit/test_ovphysx_actuator_control.pytest_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_proxiesunit/test_ovphysx_articulation.pytest_out_of_range_default_joint_pos,test_out_of_range_default_joint_veltest_out_of_range_default_joint_state[position, velocity](own scene; matches the specific message)_validate_cfg→ position red; removing the velocity raise → velocity redtest_loading_gains_from_usdget_default_joint_properties→ redtest_setting_invalid_articulation_root_prim_pathFailed to find articulation root prim)test_setting_articulation_root_prim_path,test_initialization_floating_base_non_roottest_explicit_articulation_root_on_a_floating_base_body(root API moved to the floating base body, explicit/basepath)test_joint_pos_limitstest_joint_position_limits_clamp_default_joint_positions(partial limits round trip, clamping of the selected defaults only); limit-writer contract in #8134test_articulation_helpers.pyandtest_articulation_kernels.pymove tounit/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 randevice_splitfiles in two processes.assets/test_articulation.pyassets/unit/test_ovphysx_articulation.pyassets/unit/test_articulation_helpers.pyassets/unit/test_ovphysx_actuator_control.pyassets/unit/test_articulation_kernels.pyProduct bugs pinned
None.
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