Repository navigation
Accelerate and strengthen asset tests [2/13] - #8135
AntoineRichard wants to merge 3 commits into
Conversation
Replace the randomized and device-parametrized composer matrix with literal two-environment, two-body cases that pin frames, fast paths, live CoM and rotation reads, selection, set, reset, merge, lazy composition, and the deprecated API. Keep one real PhysX test: a world force at a world offset must match raw PhysX delivery, and a world wrench at the CoM of a rotated body far from the origin must follow the world axes. The composer-versus-PhysX matrix is removed; its only non-trivial parity case is the retained offset force, and its other cases issued the same PhysX call on both sides.
|
| """Create a two-environment, two-body CPU composer with literal body poses.""" | ||
| asset = SimpleNamespace(num_instances=2, num_bodies=2, device="cpu", data=_AssetData(*_poses(com, quat))) | ||
| return WrenchComposer(asset, supports_world_at_com=supports_world_at_com) |
There was a problem hiding this comment.
CUDA coverage is lost The new composer fixture runs only on CPU, and the remaining CUDA integration test uses single-body index writes. Mask selection and buffer merging are therefore no longer tested on CUDA, so a GPU-specific regression in either path could pass the suite. A targeted CUDA case covering those paths, including a multi-cell mask, would restore that protection.
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!
Type the literal cell tables, allocate uniform vectors directly instead of scaling a ones tensor, drop redundant contiguous() calls, and build the raw PhysX wrench arrays once before the step loop.
Run the PhysX delivery test on every test device, as before, and spawn its cubes from the rigid-body, mass, and collision schema fragments instead of the deprecated property configs. Assert that the deprecated composed properties return the output proxies themselves.
Description
Part 2/13 of the asset-test series (tracker: #7282). Scope: WrenchComposer tests. No dependencies.
This PR reduces the WrenchComposer tests to literal unit cases plus one real PhysX delivery test.
test_wrench_composer.py: 38 literal cases on small hand-written inputs replace the randomized matrix. They cover:test_wrench_composer_integration.py: one real PhysX test,test_composed_wrenches_reach_physx_in_the_frame_they_are_delivered, runs on every test device (CPU and CUDA, as before). It covers both ways a rigid object hands a composed wrench to PhysX:test_wrench_composer_vs_physx.pyis removed. Two of its eight tests are genuine parity checks: the local force at a local offset, and the long-run world force at an offset. Their contracts are covered by the literal units and the delivery test, each proven by a mutation (table below). Four others make the identical PhysX call on both sides: local force, local torque, global torque and payload. The reset case re-applies the force to every environment, so it cannot detect a reset bug. The remaining case, the world force at an offset, is kept as the body-frame half of the delivery test.Disposition of deleted and rewritten tests
Every mutation below is a one-line change to
wrench_composer.py, its Warp kernels, or the PhysXRigidObject.write_data_to_sim. Each turned the named keeper red and was then reverted."Delivery test" means
test_composed_wrenches_reach_physx_in_the_frame_they_are_delivered.develop)test_wrench_composer_uses_asset_frame_conventionstest_index_dtype_combinations_preserve_selected_wrench_cellstest_composed_wrench_emits_deprecation_warningcomposed_forcereturnsout_torque_btest_output_property_triggers_lazy_compositionout_force_bstops calling_ensure_composedtest_lazy_composition_reflects_later_addsadd_forces_and_torques_indexstops marking the composer dirtytest_add_forces_and_torques_at_positiontest_local_wrench_at_position_composes_without_pose_reads,test_add_accumulates_local_wrenchescross(p, F)torquetest_local_forces_at_local_positiontest_local_wrench_at_position_composes_without_pose_reads(all four entry points)cross(p, F)torquetest_global_forces_with_rotationtest_global_wrench_at_com_uses_world_fast_path_or_rotatesquat_rotateinstead ofquat_rotate_invtest_global_torques_with_rotationtest_global_wrench_at_com_uses_world_fast_path_or_rotatestest_global_forces_at_global_positiontest_global_force_at_position_uses_live_com_and_rotationtest_global_force_with_com_offsettest_global_force_at_position_uses_live_com_and_rotationtest_com_offset_with_rotationtest_global_force_at_position_uses_live_com_and_rotationtest_90_degree_rotation_global_forcetest_global_force_at_position_uses_live_com_and_rotation(second read after a pose change)_ensure_composed)test_composition_mixed_local_and_globaltest_mixed_local_and_global_wrenches_compose_in_body_frametest_add_raw_buffers_fromtest_raw_buffer_merge_accumulates_all_five_buffers_and_ignores_inactive_sourcestest_add_raw_buffers_from_inactive_is_nooptest_raw_buffer_merge_accumulates_all_five_buffers_and_ignores_inactive_sourcestest_add_forces_masktest_index_and_mask_selection_change_only_selected_cells, plus sentinel-filled masked-out cells in every four-entry-point casetest_set_forces_overwrites_previous_addtest_set_clears_every_buffer_of_targeted_environments_onlytest_set_forces_clears_targeted_envs_onlytest_set_clears_every_buffer_of_targeted_environments_only[index]test_set_forces_mask_clears_targeted_envs_onlytest_set_clears_every_buffer_of_targeted_environments_only[mask]test_partial_reset_zeros_only_specified_envstest_partial_reset_zeros_only_selected_environmentstest_full_reset_clears_active_flagtest_full_reset_clears_every_buffer_and_frame_flagslice(None)treated as a partial resettest_compose_is_idempotenttest_lazy_composition_reflects_later_addstest_deprecated_add_forces_and_torques_emits_warningtest_deprecated_writers_warn_and_keep_add_and_set_behaviortest_deprecated_set_forces_and_torques_clears_previoustest_deprecated_writers_warn_and_keep_add_and_set_behaviortest_global_force_invariant_under_rotationtest_global_force_at_position_uses_live_com_and_rotation; delivery test (body frame)test_local_force_follows_rotationtest_local_wrench_at_position_composes_without_pose_reads; delivery test (body frame); contracttest_external_wrench_frameswrite_data_to_simpassesis_global=Truetest_global_torque_invariant_under_rotationwrite_data_to_simpassesis_global=Falsetest_global_force_torque_after_translationtest_global_force_at_position_uses_live_com_and_rotation(CoM moved between reads)test_global_force_no_position_no_torquetest_global_wrench_at_com_uses_world_fast_path_or_rotateswrite_data_to_simpassesis_global=Falsetest_global_force_no_position_no_rotation_large_offsetwrite_data_to_simpassesis_global=Falsetest_multi_cube_different_torques_from_same_forcetest_global_force_at_position_uses_live_com_and_rotation(two environments with distinct CoMs)test_global_force_torque_far_from_origintest_global_force_at_position_uses_live_com_and_rotation(cell at x = 2000 m); delivery testtest_composer_vs_physx_local_forcetest_external_wrench_frames; delivery test (body frame)is_global=Truetest_composer_vs_physx_local_torquetest_external_wrench_frames; delivery test (body frame)is_global=Truetest_composer_vs_physx_global_torqueis_global=Falsetest_composer_vs_physx_payload_scenariois_global=Falsetest_composer_vs_physx_global_force_with_resettest_partial_reset_zeros_only_selected_environmentstest_composer_vs_physx_local_force_at_position(parity)test_local_wrench_at_position_composes_without_pose_reads; delivery test (body frame)cross(p, F)torque; PhysXis_global=Truetest_composer_vs_physx_global_force_at_position(parity)is_global=Falsetest_composer_vs_physx_permanent_global_force_at_position_long_run(parity)test_global_force_at_position_uses_live_com_and_rotation; delivery testTiming
Warm Warp cache, repository orchestrator, one process per file, RTX 5090.
developType 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