Optimize test suite runtime (~18% faster)#1689
Conversation
The monolithic TestImportMjcf class had ~110 test methods that ran sequentially in one worker. Split into TestImportMjcfBasic, TestImportMjcfGeometry, TestImportMjcfSolverParams, TestImportMjcfActuatorsFrames, and TestImportMjcfComposition so the test runner can distribute them across parallel workers.
TestImportUsd (44 methods) split into TestImportUsdArticulation, TestImportUsdJoints, and TestImportUsdPhysics. TestImportSampleAssets (52 methods) split into TestImportSampleAssetsBasic, TestImportSampleAssetsParsing, and TestImportSampleAssetsComposition. The verify_usdphysics_parser helper is now a module-level function shared by all sample asset classes.
TestModel (44 methods) split into TestModelMesh, TestModelJoints, TestModelWorld, and TestModelValidation.
TestImportUrdf (32 methods) split into TestImportUrdfBasic, TestImportUrdfBaseJoints, and TestImportUrdfComposition. The parse_urdf helper is now a module-level function.
- test_equality_constraints: 10,000 → 2,000 solver steps - test_rigid_contact: 250 → 120 frames in shapes_on_plane - test_softbody: 100 → 30 random tet energy iterations - test_collision_pipeline: 200 → 100 frames (both loops) - test_collision_pipeline: hoist .numpy() out of contact pair loop - test_rigid_contact: move .numpy() from substep to frame loop
Four SDF test classes were recreating the same box mesh before every test method. Moving to setUpClass creates the mesh once per class.
- test_hydroelastic: replace per-substep NumPy force allocation with pre-computed wp.array and add graph capture (1,800 steps) - test_heightfield: add graph capture to collision test (500 steps) - test_sensor_contact: add graph capture to both scenarios (480 steps) - test_fixed_tendon: add graph capture to tendon length test (200 steps)
📝 WalkthroughWalkthroughShortens test runtimes, introduces conditional CUDA-graph capture/replay in several tests, moves some per-test setup to class-level, precomputes forces in a hydroelastic test, and significantly expands/restructures MJCF/URDF/USD import test suites while promoting several helpers to module scope. Changes
Sequence Diagram(s)(Skipped — changes are test-focused and do not introduce a cross-component runtime feature requiring sequence visualization.) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
newton/tests/test_import_mjcf.py (3)
128-135:⚠️ Potential issue | 🟡 MinorAvoid silently passing when maxhullvert parsing fails.
The conditional guard allows the test to pass even if parsing fails. Assert the expected mesh count so a regression is caught.
Suggested fix
- meshes = [model.shape_source[i] for i in range(3) if hasattr(model.shape_source[i], "maxhullvert")] - - if len(meshes) >= 3: - self.assertEqual(meshes[0].maxhullvert, 32) - self.assertEqual(meshes[1].maxhullvert, 128) - self.assertEqual(meshes[2].maxhullvert, 64) # Default value + meshes = [model.shape_source[i] for i in range(3) if hasattr(model.shape_source[i], "maxhullvert")] + self.assertEqual(len(meshes), 3, "Expected 3 meshes with maxhullvert parsed") + self.assertEqual(meshes[0].maxhullvert, 32) + self.assertEqual(meshes[1].maxhullvert, 128) + self.assertEqual(meshes[2].maxhullvert, 64) # Default value🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_mjcf.py` around lines 128 - 135, The test currently skips failures if mesh parsing didn't produce three meshes; before checking values add an assertion on the parsed mesh count (e.g., assertGreaterEqual(len(meshes), 3) or assertEqual(len(meshes), 3)) so a regression is caught; place this assertion immediately after constructing meshes (variable meshes from model.shape_source) and before the self.assertEqual checks of meshes[0].maxhullvert, meshes[1].maxhullvert and meshes[2].maxhullvert.
2297-2331:⚠️ Potential issue | 🟡 MinorDocstring format/units missing for stiffness & damping.
Please convert this docstring to Google-style and include SI units for physical quantities (stiffness/damping, actuator gains) using inline [unit] notation.
As per coding guidelines: Use Google-style docstrings with clear, concise explanations of function behavior, parameters, and return values; State SI units for all physical quantities in docstrings using inline [unit] notation (e.g., [m], [N], [N·m], or [m or rad, depending on joint type]); skip non-physical fields.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_mjcf.py` around lines 2297 - 2331, Add a Google-style docstring to the test_joint_stiffness_damping() function explaining the test purpose and summarizing the physical quantities used; explicitly document stiffness and damping for joints and actuator gains (kp, kv) using SI inline [unit] notation (for hinge joints use rotational units, e.g., stiffness [N·m/rad], damping [N·m·s/rad], kp [N·m/rad], kv [N·m·s/rad]); include brief Args (none) and Returns (None) sections per Google-style docstrings and skip non-physical fields like names/positions.
3629-3691:⚠️ Potential issue | 🟡 MinorTest intent vs setup mismatch (rotation not exercised).
The child body has no relative rotation, so the anchor rotation path described in the docstring isn’t exercised. Either rotate the child (so the bug is actually caught) or rename the test to match the current scenario.
Suggested fix
- <body name="child" pos="1 0 0"> + <body name="child" pos="1 0 0" quat="0.7071068 0 0 0.7071068"> <joint name="child_joint" type="hinge" axis="0 0 1" pos="0.5 0 0"/> <geom type="box" size="0.1 0.1 0.1"/> </body> @@ - # But wait - the joint_X_p is the parent_xform which includes the body transform. - # In the parent >= 0 case: - # relative_xform = inverse(parent_world) * child_world - # body_pos_for_joints = relative_xform.p = (1, 0, 0) - # body_ori_for_joints = relative_xform.q = identity (child has no local rotation) - # - # So joint anchor = (1, 0, 0) + rotate(identity, (0.5, 0, 0)) = (1.5, 0, 0) - # - # Actually, this test case doesn't trigger the bug because child has no - # rotation relative to parent! - - # Let me verify the position - with identity rotation, the anchor should be (1.5, 0, 0) - np.testing.assert_allclose(joint_X_p[:3], [1.5, 0.0, 0.0], atol=1e-5) + # Expected anchor: (1, 0, 0) + rotate_90z(0.5, 0, 0) = (1, 0.5, 0) + np.testing.assert_allclose(joint_X_p[:3], [1.0, 0.5, 0.0], atol=1e-5)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_mjcf.py` around lines 3629 - 3691, The test documents a rotated parent but the child has no local rotation so the rotation path isn’t exercised; update the MJCF so the child has the 90° Z rotation (or move the quat from parent to child) so the relative orientation is non‑identity and the bug is triggered: modify the MJCF in test_joint_anchor_with_rotated_body so parent has identity quat and the child body has quat="0.7071068 0 0 0.7071068" (or otherwise give the child a non‑identity rotation), then keep the assertions that inspect model.joint_key, joint_X_p (from model.joint_X_p.numpy()[joint_idx]) to validate the rotated anchor.newton/tests/test_import_usd.py (1)
1133-1134:⚠️ Potential issue | 🟡 MinorMissing
@unittest.skipUnless(USD_AVAILABLE, ...)on USD-dependent tests
test_mesh_approximation(line 1133) andtest_limit_margin_parsing(line 1518) both import frompxrinside the method body but lack the@unittest.skipUnless(USD_AVAILABLE, "Requires usd-core")decorator. Without USD installed, these will raiseImportErrorinstead of being cleanly skipped, which is inconsistent with every other test in this file that usespxr.🛡️ Proposed fix (same pattern for test_limit_margin_parsing)
+ `@unittest.skipUnless`(USD_AVAILABLE, "Requires usd-core") def test_mesh_approximation(self): from pxr import Gf, Usd, UsdGeom, UsdPhysics🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_usd.py` around lines 1133 - 1134, Add the missing test skip decorators: annotate both test_mesh_approximation and test_limit_margin_parsing with `@unittest.skipUnless`(USD_AVAILABLE, "Requires usd-core") so they are skipped when pxr/USD is not available; keep the existing inline imports from pxr but add the `@unittest.skipUnless` decorator referencing the USD_AVAILABLE symbol used elsewhere in the file to match the pattern of other USD-dependent tests.
🧹 Nitpick comments (7)
newton/tests/test_sensor_contact.py (1)
211-231: Consider extracting the CUDA graph stepping pattern into a helper.The warmup → capture → replay → odd-remainder logic is duplicated verbatim between
test_stacking_scenarioandtest_parallel_scenario(and acrosstest_fixed_tendon.py,test_heightfield.py). A small helper likerun_with_cuda_graph(solver, state_in, state_out, control, contacts, dt, num_steps)would reduce duplication and make the step accounting fix a single-point change.Also applies to: 277-297
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_sensor_contact.py` around lines 211 - 231, The CUDA-graph warmup/capture/replay/odd-remainder stepping pattern is duplicated across tests (e.g., in test_stacking_scenario and test_parallel_scenario) — extract that logic into a single helper like run_with_cuda_graph(solver, state_in, state_out, control, sim_dt, num_steps) that performs the two-step warmup via solver.step, captures with wp.ScopedCapture to produce graph, replays graph with wp.capture_launch for the paired steps, and handles an odd remaining step by calling solver.step once and swapping state_in/state_out; update tests to call this helper to centralize step accounting and eliminate the duplicated block that references solver.step, wp.ScopedCapture, graph, and wp.capture_launch.newton/tests/test_import_urdf.py (2)
207-232: Redundantres_dir = res_dir or {}assignment (dead code)
if not res_dir: ... returnon Line 216 already guards againstNoneand empty-dict, so by the time execution reaches Line 222res_diris guaranteed to be a non-empty dict; theor {}fallback is a no-op and can be removed.🧹 Proposed fix
urdf_filename = "robot.urdf" # Create a temporary directory to store files - res_dir = res_dir or {} with tempfile.TemporaryDirectory() as temp_dir:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_urdf.py` around lines 207 - 232, The assignment "res_dir = res_dir or {}" in parse_urdf is redundant because the earlier guard "if not res_dir: ... return" ensures res_dir is non-empty when reached; remove that line and leave the rest (keep urdf_filename and the loop that writes files and the builder.add_urdf call) so the function relies on the existing guard and the dict unpacking {urdf_filename: urdf, **res_dir} works as intended.
208-210: Docstring is not Google-style✏️ Suggested rewrite
- """Parse the specified URDF file from a directory of files. - urdf: URDF file to parse - res_dir: dict[str, str]: (filename, content): extra resources files to include in the directory""" + """Parse a URDF string, optionally with auxiliary resource files. + + Args: + urdf: URDF XML content to parse. + builder: ModelBuilder to populate. + res_dir: Optional mapping of filename to text content for auxiliary files + (e.g. referenced meshes). Files are written to a temporary directory. + **kwargs: Forwarded to ``builder.add_urdf()``. Defaults to ``up_axis="Y"`` + when not provided. + """As per coding guidelines: "Use Google-style docstrings with clear, concise explanations of function behavior, parameters, and return values."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_urdf.py` around lines 208 - 210, The docstring for the URDF parsing helper in newton/tests/test_import_urdf.py is not Google-style; replace it with a Google-style docstring: start with a one-line summary, a short description if needed, then an Args section documenting urdf (type and meaning) and res_dir (dict[str, str] and meaning), a Returns section describing the returned value and its type, and an optional Raises section for any exceptions; ensure you reference the parameters by name (urdf, res_dir) so the docstring clearly documents the function that parses the URDF.newton/tests/test_import_mjcf.py (1)
3126-3134: Confirm this regression test fails without the fix.Please confirm you reverted the fix to see this test fail, then re‑applied it to verify it passes, and note that in the test plan. I can help craft a minimal repro note if needed.
As per coding guidelines: **/test.py: Always verify regression tests fail without the fix by temporarily reverting it, confirming test failure, then reapplying the fix and verifying test passes.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_mjcf.py` around lines 3126 - 3134, Temporarily revert the change that fixed double application of incoming_xform in parse_shapes, run the test test_static_geom_xform_not_applied_twice to confirm it fails (showing the double-application symptom for static geoms where link == -1), then reapply the fix and run the test again to verify it passes; include a short note in the test plan documenting the revert-run-restore steps and the outcomes (failing before fix, passing after) referencing parse_shapes, incoming_xform, and the test_static_geom_xform_not_applied_twice regression test.newton/tests/test_import_usd.py (3)
1059-1062:arrays_matchhelper is duplicated in four test methodsThe same local
arrays_matchfunction is defined identically at lines 1060, 1501, 1680, and 1797. Extracting it as a module-level helper (alongsideverify_usdphysics_parser) removes the repetition.♻️ Proposed fix — module-level helper
+def _arrays_match(arr, expected, tol=1e-4): + return all(abs(arr[i] - expected[i]) < tol for i in range(len(expected))) + + def verify_usdphysics_parser(test, file, model, ...): ...Then in each test method:
- def arrays_match(arr, expected, tol=1e-4): - return all(abs(arr[i] - expected[i]) < tol for i in range(len(expected)))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_usd.py` around lines 1059 - 1062, The local helper function arrays_match is duplicated across multiple test methods; extract it to a single module-level helper (next to verify_usdphysics_parser) and remove the four local definitions, then have the tests call the module-level arrays_match instead; ensure the signature (arr, expected, tol=1e-4) and behavior remain identical so tests using arrays_match continue to work unchanged.
2759-2767: Magic numbers[3, 5]should useGeoTypeenum valuesThe axis-rotation branch identifies capsule and cylinder by raw integers rather than named enum constants. Immediately below (lines 2779–2791) the same shape types are compared using
newton.GeoType.CAPSULE/newton.GeoType.CYLINDER, so the inconsistency is visible in the same function.♻️ Proposed fix
- if newton_type in [3, 5]: + if newton_type in [newton.GeoType.CAPSULE, newton.GeoType.CYLINDER]:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_usd.py` around lines 2759 - 2767, The code uses magic integers [3, 5] to detect capsule/cylinder; replace that check to use the enum constants newton.GeoType.CAPSULE and newton.GeoType.CYLINDER (i.e., if newton_type in [newton.GeoType.CAPSULE, newton.GeoType.CYLINDER]) so it matches the later comparisons and improves readability; update the conditional that sets usd_axis/axis_quat (referencing newton_type, shape_spec.axis, quat_between_axes, newton.Axis.Z, newton.Axis.X, newton.Axis.Y, and wp.quat_identity) accordingly without changing the existing axis_quat logic.
2675-2675: Inconsistent quaternion multiplication: use*operator consistently forwp.quatoperandsLine 2675 uses
*for quaternion composition while line 2768 useswp.mul()for equivalent operations withwp.quatoperands. The codebase standard (seen inexample_ik_cube_stacking.py,example_cloth_h1.py, andarticulation.py) is to use the*operator forwp.quattypes. Line 2768 should be changed to match this pattern, while line 2773 correctly useswp.mul()becausenewton_quatis a numpy slice that requires the explicit function.♻️ Suggested fix
- expected_quat = wp.mul(usd_quat, axis_quat) + expected_quat = usd_quat * axis_quat🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_usd.py` at line 2675, Change the quaternion multiplication at the location that currently calls wp.mul(...) (the one corresponding to the wp.quat operands referenced in the review) to use the `*` operator instead, matching the codebase convention used by expressions like `q_diff = lhs_q * wp.quat_inverse(rhs_q)` and examples `example_ik_cube_stacking.py`/`example_cloth_h1.py`/`articulation.py`; leave the call to `wp.mul()` that operates on `newton_quat` (a numpy slice) unchanged since that one requires the explicit function for non-wp.quat types.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@newton/tests/test_fixed_tendon.py`:
- Around line 104-124: The CUDA-graph path double-counts two steps performed
inside the ScopedCapture: when use_cuda_graph is true the warmup runs 2
solver.step calls and the ScopedCapture block also executes 2 real steps, but
remaining is computed as 200 - 2 (only subtracting warmup), causing 2 extra
steps overall; fix by decrementing remaining by the total number of executed
steps during setup (subtract 4 when both warmup and capture run) or adjust the
logic to compute executed_setup_steps = (2 if warmup else 0) + (2 if capture
runs else 0) and then set remaining = 200 - executed_setup_steps so that the
for-loop and final odd-step branch produce exactly 200 solver.step invocations
(update code around device/use_cuda_graph, the warmup solver.step calls, the
wp.ScopedCapture block, capture.graph usage and the remaining
calculation/loops).
In `@newton/tests/test_heightfield.py`:
- Around line 273-293: The CUDA path double-counts warmup: you run two
pre-capture solver.step calls and then two more inside wp.ScopedCapture(), so
remaining should subtract 4 when use_cuda_graph is true; update the remaining
calculation (and any comment) to use remaining = 500 - (4 if use_cuda_graph else
0) so that total solver.step invocations (solver.step and wp.capture_launch)
equal 500, keeping the existing loop and state_in/state_out swap logic intact;
references: device, use_cuda_graph, solver.step, wp.ScopedCapture, graph,
wp.capture_launch, remaining.
In `@newton/tests/test_import_urdf.py`:
- Around line 254-256: Rename the unused parameter in the mock function
signature from url to _url to satisfy the call signature while silencing Ruff
ARG001: update def mock_mesh_download(dst, url: str): to def
mock_mesh_download(dst, _url: str): in the test, leaving the body unchanged
(dst.write(MESH_OBJ.encode("utf-8"))) so the mock remains compatible with
callers.
In `@newton/tests/test_import_usd.py`:
- Line 2464: Replace the direct dict access
parsed[UsdPhysics.ObjectType.RigidBody] with a safe lookup using
parsed.get(UsdPhysics.ObjectType.RigidBody, ()) so that parsed_bodies =
list(zip(*parsed.get(UsdPhysics.ObjectType.RigidBody, ()), strict=False)) (i.e.,
use the same safe .get pattern as the joint loop) to avoid a KeyError when there
are no rigid bodies; locate the occurrence referencing
UsdPhysics.ObjectType.RigidBody and change it to use .get with an empty tuple
default.
- Around line 2532-2550: The loop is repeatedly calling
model.joint_type.numpy()[j], causing extra GPU→CPU syncs; use the pre-cached
array model_joint_type (computed earlier) instead. In the loop that iterates
over model.joint_count and reads jt, replace jt =
int(model.joint_type.numpy()[j]) with jt = int(model_joint_type[j]) (keeping the
same JointType comparisons and assertions against joint_dof_dim_array,
total_dofs, and final shape check against model.joint_axis). Ensure type
conversion and indexing remain identical so behavior is unchanged.
In `@newton/tests/test_sensor_contact.py`:
- Around line 208-231: The remaining steps calculation underestimates executed
steps when CUDA graph capture is used: warmup runs 2 solver.step calls and the
ScopedCapture block records (and executes) 2 more, so subtract 4 not 2. Update
the assignment of remaining (the variable named remaining) to subtract 4 when
use_cuda_graph is true (e.g., remaining = num_steps - (4 if use_cuda_graph else
0)) and apply the same fix in the other test method using the same pattern (the
blocks using use_cuda_graph, wp.ScopedCapture, capture.graph, and
wp.capture_launch(graph)).
---
Outside diff comments:
In `@newton/tests/test_import_mjcf.py`:
- Around line 128-135: The test currently skips failures if mesh parsing didn't
produce three meshes; before checking values add an assertion on the parsed mesh
count (e.g., assertGreaterEqual(len(meshes), 3) or assertEqual(len(meshes), 3))
so a regression is caught; place this assertion immediately after constructing
meshes (variable meshes from model.shape_source) and before the self.assertEqual
checks of meshes[0].maxhullvert, meshes[1].maxhullvert and
meshes[2].maxhullvert.
- Around line 2297-2331: Add a Google-style docstring to the
test_joint_stiffness_damping() function explaining the test purpose and
summarizing the physical quantities used; explicitly document stiffness and
damping for joints and actuator gains (kp, kv) using SI inline [unit] notation
(for hinge joints use rotational units, e.g., stiffness [N·m/rad], damping
[N·m·s/rad], kp [N·m/rad], kv [N·m·s/rad]); include brief Args (none) and
Returns (None) sections per Google-style docstrings and skip non-physical fields
like names/positions.
- Around line 3629-3691: The test documents a rotated parent but the child has
no local rotation so the rotation path isn’t exercised; update the MJCF so the
child has the 90° Z rotation (or move the quat from parent to child) so the
relative orientation is non‑identity and the bug is triggered: modify the MJCF
in test_joint_anchor_with_rotated_body so parent has identity quat and the child
body has quat="0.7071068 0 0 0.7071068" (or otherwise give the child a
non‑identity rotation), then keep the assertions that inspect model.joint_key,
joint_X_p (from model.joint_X_p.numpy()[joint_idx]) to validate the rotated
anchor.
In `@newton/tests/test_import_usd.py`:
- Around line 1133-1134: Add the missing test skip decorators: annotate both
test_mesh_approximation and test_limit_margin_parsing with
`@unittest.skipUnless`(USD_AVAILABLE, "Requires usd-core") so they are skipped
when pxr/USD is not available; keep the existing inline imports from pxr but add
the `@unittest.skipUnless` decorator referencing the USD_AVAILABLE symbol used
elsewhere in the file to match the pattern of other USD-dependent tests.
---
Nitpick comments:
In `@newton/tests/test_import_mjcf.py`:
- Around line 3126-3134: Temporarily revert the change that fixed double
application of incoming_xform in parse_shapes, run the test
test_static_geom_xform_not_applied_twice to confirm it fails (showing the
double-application symptom for static geoms where link == -1), then reapply the
fix and run the test again to verify it passes; include a short note in the test
plan documenting the revert-run-restore steps and the outcomes (failing before
fix, passing after) referencing parse_shapes, incoming_xform, and the
test_static_geom_xform_not_applied_twice regression test.
In `@newton/tests/test_import_urdf.py`:
- Around line 207-232: The assignment "res_dir = res_dir or {}" in parse_urdf is
redundant because the earlier guard "if not res_dir: ... return" ensures res_dir
is non-empty when reached; remove that line and leave the rest (keep
urdf_filename and the loop that writes files and the builder.add_urdf call) so
the function relies on the existing guard and the dict unpacking {urdf_filename:
urdf, **res_dir} works as intended.
- Around line 208-210: The docstring for the URDF parsing helper in
newton/tests/test_import_urdf.py is not Google-style; replace it with a
Google-style docstring: start with a one-line summary, a short description if
needed, then an Args section documenting urdf (type and meaning) and res_dir
(dict[str, str] and meaning), a Returns section describing the returned value
and its type, and an optional Raises section for any exceptions; ensure you
reference the parameters by name (urdf, res_dir) so the docstring clearly
documents the function that parses the URDF.
In `@newton/tests/test_import_usd.py`:
- Around line 1059-1062: The local helper function arrays_match is duplicated
across multiple test methods; extract it to a single module-level helper (next
to verify_usdphysics_parser) and remove the four local definitions, then have
the tests call the module-level arrays_match instead; ensure the signature (arr,
expected, tol=1e-4) and behavior remain identical so tests using arrays_match
continue to work unchanged.
- Around line 2759-2767: The code uses magic integers [3, 5] to detect
capsule/cylinder; replace that check to use the enum constants
newton.GeoType.CAPSULE and newton.GeoType.CYLINDER (i.e., if newton_type in
[newton.GeoType.CAPSULE, newton.GeoType.CYLINDER]) so it matches the later
comparisons and improves readability; update the conditional that sets
usd_axis/axis_quat (referencing newton_type, shape_spec.axis, quat_between_axes,
newton.Axis.Z, newton.Axis.X, newton.Axis.Y, and wp.quat_identity) accordingly
without changing the existing axis_quat logic.
- Line 2675: Change the quaternion multiplication at the location that currently
calls wp.mul(...) (the one corresponding to the wp.quat operands referenced in
the review) to use the `*` operator instead, matching the codebase convention
used by expressions like `q_diff = lhs_q * wp.quat_inverse(rhs_q)` and examples
`example_ik_cube_stacking.py`/`example_cloth_h1.py`/`articulation.py`; leave the
call to `wp.mul()` that operates on `newton_quat` (a numpy slice) unchanged
since that one requires the explicit function for non-wp.quat types.
In `@newton/tests/test_sensor_contact.py`:
- Around line 211-231: The CUDA-graph warmup/capture/replay/odd-remainder
stepping pattern is duplicated across tests (e.g., in test_stacking_scenario and
test_parallel_scenario) — extract that logic into a single helper like
run_with_cuda_graph(solver, state_in, state_out, control, sim_dt, num_steps)
that performs the two-step warmup via solver.step, captures with
wp.ScopedCapture to produce graph, replays graph with wp.capture_launch for the
paired steps, and handles an odd remaining step by calling solver.step once and
swapping state_in/state_out; update tests to call this helper to centralize step
accounting and eliminate the duplicated block that references solver.step,
wp.ScopedCapture, graph, and wp.capture_launch.
…me-optimization # Conflicts: # newton/tests/test_sdf_compute.py
Fix off-by-2 CUDA graph step accounting in test_fixed_tendon, test_heightfield, and test_sensor_contact. ScopedCapture executes 2 steps during capture in addition to the 2 warmup steps, so subtract 4 (not 2) from the total to get correct step counts. Rename unused url parameter to _url in test_import_urdf mock. Use .get() for safe dict access in test_import_usd's verify_usdphysics_parser, consistent with the joint loop pattern. Replace redundant model.joint_type.numpy()[j] with pre-cached model_joint_type[j] in test_import_usd to avoid extra GPU-CPU sync.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
newton/tests/test_sdf_compute.py (1)
1075-1080:⚠️ Potential issue | 🟠 Major
test_mesh_build_sdf_works_on_gpumutates the sharedcls.mesh, breakingtest_sdf_disabled_works_on_cpu.Due to alphabetical test ordering,
test_mesh_build_sdf_works_on_gpu(line 1118) runs beforetest_sdf_disabled_works_on_cpu(line 1102). Line 1123 callsself.mesh.build_sdf(max_resolution=64)on the class-level mesh, settingcls.mesh.sdfto non-None. Whentest_sdf_disabled_works_on_cpuruns afterward using the sameself.mesh, its expectation "Mesh withoutmesh.sdf" is violated. During finalize (lines 8601-8608), the builder detects the pre-builtmesh.sdfviagetattr(shape_src, "sdf", None)and adds it to the compact SDF table, causingshape_sdf_index[0]to be a valid index instead of the expected-1. The assertion at line 1115 fails.Fix
test_mesh_build_sdf_works_on_gputo use a local mesh:Suggested fix
`@unittest.skipUnless`(_cuda_available, "Requires CUDA device") def test_mesh_build_sdf_works_on_gpu(self): """Mesh SDF built via mesh.build_sdf() should be used by builder.""" builder = newton.ModelBuilder() cfg = newton.ModelBuilder.ShapeConfig() - self.mesh.build_sdf(max_resolution=64) + mesh = create_box_mesh(self.half_extents) + mesh.build_sdf(max_resolution=64) # Add a mesh shape builder.add_body() - builder.add_shape_mesh(body=-1, mesh=self.mesh, cfg=cfg) + builder.add_shape_mesh(body=-1, mesh=mesh, cfg=cfg)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_sdf_compute.py` around lines 1075 - 1080, The class-level mesh (cls.mesh) is being mutated by test_mesh_build_sdf_works_on_gpu causing later tests to fail; change test_mesh_build_sdf_works_on_gpu to create and use a local mesh instance (e.g., mesh = create_box_mesh(self.half_extents)) and call mesh.build_sdf(max_resolution=64) on that local variable instead of self.mesh/cls.mesh so the shared cls.mesh remains unchanged for test_sdf_disabled_works_on_cpu and other tests.newton/tests/test_import_usd.py (1)
1133-1135:⚠️ Potential issue | 🟡 MinorMissing
@unittest.skipUnless(USD_AVAILABLE, "Requires usd-core")ontest_mesh_approximation.The test imports from
pxrunconditionally inside the method body. Without the skip decorator, running on a machine withoutusd-coreraisesModuleNotFoundError(hard error) instead of a graceful skip.test_limit_margin_parsing(line 1518) has the same omission — both should be decorated.🛡️ Proposed fix
+ `@unittest.skipUnless`(USD_AVAILABLE, "Requires usd-core") def test_mesh_approximation(self):+ `@unittest.skipUnless`(USD_AVAILABLE, "Requires usd-core") def test_limit_margin_parsing(self):🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_usd.py` around lines 1133 - 1135, Add the unittest skip decorator to avoid hard errors when usd-core isn't installed: annotate both test_mesh_approximation and test_limit_margin_parsing with `@unittest.skipUnless`(USD_AVAILABLE, "Requires usd-core") so the pxr imports inside those test functions are only attempted when USD_AVAILABLE is true; update the function definitions for test_mesh_approximation and test_limit_margin_parsing accordingly.
🧹 Nitpick comments (5)
newton/tests/test_sensor_contact.py (1)
274-297: Consider extracting the duplicated CUDA-graph stepping boilerplate.Lines 208-231 and 274-297 are nearly identical. A small helper (e.g.,
_simulate(solver, state_in, state_out, control, sim_dt, num_steps, device)) would eliminate the duplication and make future changes (e.g., adjusting warmup strategy) single-site.Sketch
def _simulate(solver, state_in, state_out, control, sim_dt, num_steps, device): """Run num_steps solver steps, using CUDA-graph replay when available.""" use_cuda_graph = device.is_cuda and wp.is_mempool_enabled(device) if use_cuda_graph: solver.step(state_in, state_out, control, None, sim_dt) solver.step(state_out, state_in, control, None, sim_dt) with wp.ScopedCapture(device) as capture: solver.step(state_in, state_out, control, None, sim_dt) solver.step(state_out, state_in, control, None, sim_dt) graph = capture.graph remaining = num_steps - (4 if use_cuda_graph else 0) for _ in range(remaining // 2 if use_cuda_graph else remaining): if use_cuda_graph: wp.capture_launch(graph) else: solver.step(state_in, state_out, control, None, sim_dt) state_in, state_out = state_out, state_in if use_cuda_graph and remaining % 2 == 1: solver.step(state_in, state_out, control, None, sim_dt) state_in, state_out = state_out, state_in return state_in, state_out🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_sensor_contact.py` around lines 274 - 297, Duplicate CUDA-graph stepping boilerplate appears in two places; extract it into a helper (e.g., _simulate) that accepts solver, state_in, state_out, control, sim_dt, num_steps, device and implements the warmup (two manual steps), ScopedCapture to build graph, replay via wp.capture_launch, and final odd-step handling; replace both duplicated blocks with calls to _simulate and return/assign the updated (state_in, state_out) as needed. Ensure the helper references wp.ScopedCapture, wp.capture_launch, and the solver.step signature exactly so behavior is unchanged.newton/tests/test_import_urdf.py (1)
207-232:parse_urdf: dead-code assignment + non-Google-style docstringTwo nits in the new helper:
Dead assignment (line 222):
res_dir = res_dir or {}is unreachable in effect. The guard at line 216 (if not res_dir: … return) already exits whenres_dirisNoneor{}, so at line 222res_diris always a non-empty dict. The assignment can be removed.Docstring (lines 208-210): The parameter descriptions are written inline rather than in a Google-style
Args:block.builderand**kwargsare also not documented.♻️ Suggested fix
def parse_urdf(urdf: str, builder: newton.ModelBuilder, res_dir: dict[str, str] | None = None, **kwargs): - """Parse the specified URDF file from a directory of files. - urdf: URDF file to parse - res_dir: dict[str, str]: (filename, content): extra resources files to include in the directory""" + """Parse a URDF string, optionally alongside auxiliary resource files. + + Args: + urdf: URDF XML string (or file path when ``res_dir`` is ``None``). + builder: ModelBuilder to populate. + res_dir: Optional mapping of filename → text content for auxiliary + files (e.g. mesh .obj). Written alongside the URDF in a temp + directory before parsing. + **kwargs: Forwarded verbatim to ``builder.add_urdf()``. + """ # Default to up_axis="Y" if not specified in kwargs if "up_axis" not in kwargs: kwargs["up_axis"] = "Y" if not res_dir: builder.add_urdf(urdf, **kwargs) return urdf_filename = "robot.urdf" - # Create a temporary directory to store files - res_dir = res_dir or {} with tempfile.TemporaryDirectory() as temp_dir:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_urdf.py` around lines 207 - 232, The parse_urdf helper has a dead assignment and a non-Google-style docstring: remove the unreachable "res_dir = res_dir or {}" assignment in parse_urdf, and replace the current inline docstring with a Google-style one that documents args (urdf: str, builder: newton.ModelBuilder, res_dir: dict[str,str] | None) and kwargs (e.g. up_axis), describing their types and behavior; keep the existing defaulting of "up_axis" in kwargs and the early-return behavior when res_dir is falsy, and ensure parse_urdf, builder, and kwargs are clearly referenced in the new docstring.newton/tests/test_import_usd.py (3)
3234-3236:import mathinsidetest_joint_stiffness_dampingis redundant.
mathis already imported at module level (line 16). The in-function import is a no-op but adds noise.♻️ Proposed fix
- import math # noqa: PLC0415 - angular_gain_unit_scale = math.degrees(1.0)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_usd.py` around lines 3234 - 3236, Remove the redundant local import of math inside test_joint_stiffness_damping: delete the line "import math # noqa: PLC0415" and rely on the module-level math import already present (used by angular_gain_unit_scale = math.degrees(1.0)); also remove the trailing noqa comment since it will no longer be needed.
2567-2681: Multiple.numpy()calls inside the joint loop — inconsistent with this PR's sync-reduction goal.Several warp arrays are converted via
.numpy()on every loop iteration instead of being hoisted out once:
Lines Expression 2583–2584 model.joint_parent.numpy()[j],model.joint_child.numpy()[j]2606, 2609, 2614, 2616 model.joint_limit_lower/upper.numpy()[dof_index]2632, 2640 model.joint_target_ke/kd.numpy()[dof_index]2652–2653 model.joint_parent/child.numpy()[j](second loop)The PR already caches
body_q_array,joint_dof_dim_array,model_joint_type, etc. before their loops; the same pattern should be applied here.♻️ Proposed fix — hoist arrays before the joint loop
+ joint_parent_array = model.joint_parent.numpy() + joint_child_array = model.joint_child.numpy() + joint_limit_lower_array = model.joint_limit_lower.numpy() + joint_limit_upper_array = model.joint_limit_upper.numpy() + joint_target_ke_array = model.joint_target_ke.numpy() + joint_target_kd_array = model.joint_target_kd.numpy() for j, key in enumerate(model.joint_key): ... - test.assertEqual(int(model.joint_parent.numpy()[j]), body_key_to_idx[p_path]) - test.assertEqual(int(model.joint_child.numpy()[j]), body_key_to_idx[c_path]) + test.assertEqual(int(joint_parent_array[j]), body_key_to_idx[p_path]) + test.assertEqual(int(joint_child_array[j]), body_key_to_idx[c_path]) ... - test.assertAlmostEqual(float(model.joint_limit_lower.numpy()[dof_index]), ...) - test.assertAlmostEqual(float(model.joint_limit_upper.numpy()[dof_index]), ...) + test.assertAlmostEqual(float(joint_limit_lower_array[dof_index]), ...) + test.assertAlmostEqual(float(joint_limit_upper_array[dof_index]), ...) ... - test.assertAlmostEqual(float(model.joint_target_ke.numpy()[dof_index]), ...) - test.assertAlmostEqual(float(model.joint_target_kd.numpy()[dof_index]), ...) + test.assertAlmostEqual(float(joint_target_ke_array[dof_index]), ...) + test.assertAlmostEqual(float(joint_target_kd_array[dof_index]), ...) # second loop (compare_min_max_coords branch) for j in range(model.joint_count): - p = int(model.joint_parent.numpy()[j]) - c = int(model.joint_child.numpy()[j]) + p = int(joint_parent_array[j]) + c = int(joint_child_array[j])🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_usd.py` around lines 2567 - 2681, The test is repeatedly calling .numpy() inside the joint loops causing extra syncs; hoist these into local numpy arrays before the first joint loop and reuse them in both loops. Specifically, before the for j, key in enumerate(model.joint_key) loop cache model.joint_parent.numpy(), model.joint_child.numpy(), model.joint_axis.numpy(), model.joint_limit_lower.numpy(), model.joint_limit_upper.numpy(), model.joint_target_ke.numpy(), model.joint_target_kd.numpy(), model.joint_X_p.numpy(), and model.joint_X_c.numpy() (and any other model.*.numpy() used later) into local variables, then replace all in-loop .numpy() calls (e.g., uses in assertions and dof_index lookups) to reference those cached arrays; ensure dof_index indexing and list conversions (tolist()/float()/int()) are preserved when using the cached arrays.
2759-2768: Magic integers[3, 5]should useGeoTypeenum members.
newton_typeis an integer taken fromshape_type_array(a.numpy()result), but the intent is to matchCAPSULEandCYLINDER. Comparing against bare integers makes the condition opaque.♻️ Proposed fix
- if newton_type in [3, 5]: + if newton_type in [int(newton.GeoType.CAPSULE), int(newton.GeoType.CYLINDER)]:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_import_usd.py` around lines 2759 - 2768, Replace the magic integer check "if newton_type in [3, 5]:" with an enum-based check using GeoType so the intent (CAPSULE/CYLINDER) is clear; for example, convert the integer to the enum and test membership: use GeoType(newton_type) (or GeoType(newton_type).value if your enum requires) and check against GeoType.CAPSULE and GeoType.CYLINDER. Update the conditional around newton_type (and ensure GeoType is imported) so the block that computes usd_axis, axis_quat (quat_between_axes) and expected_quat remains the same but is guarded by the enum-based condition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@newton/tests/test_import_usd.py`:
- Around line 1133-1135: Add the unittest skip decorator to avoid hard errors
when usd-core isn't installed: annotate both test_mesh_approximation and
test_limit_margin_parsing with `@unittest.skipUnless`(USD_AVAILABLE, "Requires
usd-core") so the pxr imports inside those test functions are only attempted
when USD_AVAILABLE is true; update the function definitions for
test_mesh_approximation and test_limit_margin_parsing accordingly.
In `@newton/tests/test_sdf_compute.py`:
- Around line 1075-1080: The class-level mesh (cls.mesh) is being mutated by
test_mesh_build_sdf_works_on_gpu causing later tests to fail; change
test_mesh_build_sdf_works_on_gpu to create and use a local mesh instance (e.g.,
mesh = create_box_mesh(self.half_extents)) and call
mesh.build_sdf(max_resolution=64) on that local variable instead of
self.mesh/cls.mesh so the shared cls.mesh remains unchanged for
test_sdf_disabled_works_on_cpu and other tests.
---
Duplicate comments:
In `@newton/tests/test_fixed_tendon.py`:
- Around line 104-115: The off-by-two error in the test's solver call count is
fixed by adjusting remaining to account for the two warmup steps and the two
captured steps; keep the logic using device, use_cuda_graph, the two warmup
solver.step calls, the ScopedCapture block, and the remaining = 200 - (4 if
use_cuda_graph else 0) line as-is, and add a short inline comment near remaining
explaining it accounts for 2 warmup + 2 captured steps so total solver.step
calls equal 200 across both paths.
- Around line 104-124: The review note is a duplicate comment; remove the
duplicated review text or redundant comment block so only one confirmation about
the off-by-2 fix remains. Locate the test logic around use_cuda_graph, the
warmup solver.step calls, the wp.ScopedCapture block that produces
capture.graph, and the calculation remaining = 200 - (4 if use_cuda_graph else
0), then delete the extra duplicated comment/annotation that repeats the same
message.
In `@newton/tests/test_heightfield.py`:
- Around line 273-293: Check that SolverMuJoCo.__init__ sets
update_data_interval default to 0 and that SolverMuJoCo.step()’s behavior during
wp.capture_launch does not cause unintended update_mjc_data calls; either (A)
confirm update_data_interval == 0 by default (so branch is unreachable), or (B)
change logic so step-count used for deciding update_mjc_data is a logical
counter that increments even during capture replay (e.g., maintain a separate
logical_step used by update_mjc_data), or prevent update_mjc_data from running
during capture replays by detecting replay mode (use capture.graph/replay
context) inside SolverMuJoCo.step() before calling update_mjc_data; inspect
SolverMuJoCo.step(), self._step, update_data_interval, update_mjc_data, and
wp.capture_launch/capture.graph to implement the chosen fix.
In `@newton/tests/test_import_urdf.py`:
- Around line 254-256: The rename of the unused parameter to _url in the mock
function mock_mesh_download is correct; keep the signature def
mock_mesh_download(dst, _url: str): and the body
dst.write(MESH_OBJ.encode("utf-8")) as-is to silence unused-argument warnings
and maintain the intended mock behavior.
In `@newton/tests/test_import_usd.py`:
- Around line 2532-2550: The loop currently uses the cached model_joint_type and
joint_dof_dim_array to compute per-joint (lin, ang) and validate DOF shapes,
which avoids repeated .numpy() calls; ensure any remaining per-iteration
accesses do not call model.joint_type.numpy() or other .numpy() repeatedly—use
model_joint_type[j], joint_dof_dim_array[j], model.joint_count and
model.joint_key[j] instead, compute total_dofs by summing lin+ang and finally
assert total_dofs equals model.joint_axis.numpy().shape[0] (convert to int as
shown) to validate overall DOF count.
- Line 2464: Replace the unsafe dict access of
parsed[UsdPhysics.ObjectType.RigidBody] with the safe lookup used for joints by
using parsed.get(UsdPhysics.ObjectType.RigidBody, ()), as already done in the
parsed_bodies assignment; ensure the code uses
parsed.get(UsdPhysics.ObjectType.RigidBody, ()) in the list(zip(...,
strict=False)) call (variable parsed_bodies) to avoid KeyError and match the
existing safe idiom for joint types.
---
Nitpick comments:
In `@newton/tests/test_import_urdf.py`:
- Around line 207-232: The parse_urdf helper has a dead assignment and a
non-Google-style docstring: remove the unreachable "res_dir = res_dir or {}"
assignment in parse_urdf, and replace the current inline docstring with a
Google-style one that documents args (urdf: str, builder: newton.ModelBuilder,
res_dir: dict[str,str] | None) and kwargs (e.g. up_axis), describing their types
and behavior; keep the existing defaulting of "up_axis" in kwargs and the
early-return behavior when res_dir is falsy, and ensure parse_urdf, builder, and
kwargs are clearly referenced in the new docstring.
In `@newton/tests/test_import_usd.py`:
- Around line 3234-3236: Remove the redundant local import of math inside
test_joint_stiffness_damping: delete the line "import math # noqa: PLC0415" and
rely on the module-level math import already present (used by
angular_gain_unit_scale = math.degrees(1.0)); also remove the trailing noqa
comment since it will no longer be needed.
- Around line 2567-2681: The test is repeatedly calling .numpy() inside the
joint loops causing extra syncs; hoist these into local numpy arrays before the
first joint loop and reuse them in both loops. Specifically, before the for j,
key in enumerate(model.joint_key) loop cache model.joint_parent.numpy(),
model.joint_child.numpy(), model.joint_axis.numpy(),
model.joint_limit_lower.numpy(), model.joint_limit_upper.numpy(),
model.joint_target_ke.numpy(), model.joint_target_kd.numpy(),
model.joint_X_p.numpy(), and model.joint_X_c.numpy() (and any other
model.*.numpy() used later) into local variables, then replace all in-loop
.numpy() calls (e.g., uses in assertions and dof_index lookups) to reference
those cached arrays; ensure dof_index indexing and list conversions
(tolist()/float()/int()) are preserved when using the cached arrays.
- Around line 2759-2768: Replace the magic integer check "if newton_type in [3,
5]:" with an enum-based check using GeoType so the intent (CAPSULE/CYLINDER) is
clear; for example, convert the integer to the enum and test membership: use
GeoType(newton_type) (or GeoType(newton_type).value if your enum requires) and
check against GeoType.CAPSULE and GeoType.CYLINDER. Update the conditional
around newton_type (and ensure GeoType is imported) so the block that computes
usd_axis, axis_quat (quat_between_axes) and expected_quat remains the same but
is guarded by the enum-based condition.
In `@newton/tests/test_sensor_contact.py`:
- Around line 274-297: Duplicate CUDA-graph stepping boilerplate appears in two
places; extract it into a helper (e.g., _simulate) that accepts solver,
state_in, state_out, control, sim_dt, num_steps, device and implements the
warmup (two manual steps), ScopedCapture to build graph, replay via
wp.capture_launch, and final odd-step handling; replace both duplicated blocks
with calls to _simulate and return/assign the updated (state_in, state_out) as
needed. Ensure the helper references wp.ScopedCapture, wp.capture_launch, and
the solver.step signature exactly so behavior is unchanged.
|
Very cool. I was gonna mention the Windows CPU jobs taking ~28 mins and being the bottleneck last night, actually! |
test_mesh_build_sdf_works_on_gpu called build_sdf() on the shared class-level mesh, which persisted across tests. When test_sdf_disabled_works_on_cpu ran afterwards, the mesh already had an SDF, causing finalize(device="cpu") to raise ValueError. Use a local mesh in that test instead, matching the pattern used by test_mesh_build_sdf_guard_and_clear.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
newton/tests/test_sdf_compute.py (1)
837-849: Optional: release shared GPU volumes intearDownClass
cls.sparse_volumeandcls.coarse_volumearewp.VolumeGPU handles allocated once insetUpClassand never explicitly freed. They will be held until the class-levelgcpass after all tests complete. In a tight-GPU-memory CI configuration this could block device memory from other test classes running in the same process.♻️ Suggested tearDownClass
+ `@classmethod` + def tearDownClass(cls): + cls.sparse_volume = None + cls.coarse_volume = None + wp.synchronize()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_sdf_compute.py` around lines 837 - 849, Add a class-level tearDownClass that releases the GPU volume handles allocated in setUpClass: check for cls.sparse_volume and cls.coarse_volume and call their release() method (e.g., cls.sparse_volume.release(), cls.coarse_volume.release()), set them to None afterward, and run a garbage-collection pass to free device memory; this ensures the resources created in setUpClass are explicitly freed between test classes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@newton/tests/test_sdf_compute.py`:
- Around line 837-849: Add a class-level tearDownClass that releases the GPU
volume handles allocated in setUpClass: check for cls.sparse_volume and
cls.coarse_volume and call their release() method (e.g.,
cls.sparse_volume.release(), cls.coarse_volume.release()), set them to None
afterward, and run a garbage-collection pass to free device memory; this ensures
the resources created in setUpClass are explicitly freed between test classes.
There was a problem hiding this comment.
Pull request overview
This PR optimizes the test suite runtime by implementing several performance improvements, achieving an 18% reduction in wall time (12m 04s → 9m 56s). The changes focus on better parallelization through test class splitting, reducing unnecessary simulation iterations, minimizing GPU-CPU synchronization, and adding CUDA graph capture for repeated simulation loops.
Changes:
- Split 4 monolithic test classes (95+ methods) into 20 smaller classes to enable better parallel execution by unittest-parallel
- Reduced simulation loop counts by 50-80% in 4 test files where excessive iterations provided diminishing test value
- Optimized GPU-CPU synchronization by hoisting
.numpy()calls out of inner loops and pre-computing device-resident arrays
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test_model.py | Split TestModel into 4 focused classes (Mesh, Joints, World, Validation) |
| test_import_usd.py | Split 2 classes into 6 classes; extracted verify_usdphysics_parser as module-level helper |
| test_import_urdf.py | Split TestImportUrdf into 3 classes (Basic, BaseJoints, Composition); extracted parse_urdf helper |
| test_import_mjcf.py | Split TestImportMjcf into 5 classes (Basic, Geometry, SolverParams, ActuatorsFrames, Composition) |
| test_softbody.py | Reduced test_tet_energy iterations from 100 to 30 (property testing still adequate) |
| test_rigid_contact.py | Reduced shapes_on_plane frames from 250 to 120; hoisted .numpy() to outer loop |
| test_equality_constraints.py | Reduced simulation steps from 10,000 to 2,000 (still sufficient for constraint validation) |
| test_collision_pipeline.py | Reduced frames from 200 to 100; hoisted .numpy() calls out of per-contact loop |
| test_sensor_contact.py | Added CUDA graph capture to 2 simulation loops (480 steps each) |
| test_heightfield.py | Added CUDA graph capture to 500-step simulation loop |
| test_fixed_tendon.py | Added CUDA graph capture to 200-step simulation loop |
| test_hydroelastic.py | Pre-computed external forces as device-resident wp.array to avoid per-substep allocation |
| test_sdf_compute.py | Moved mesh creation from setUp() to setUpClass() in 4 test classes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* [Warp Raytrace] Added device parameter (newton-physics#1544) * [Warp Raytrace] Added device parameter to previously overlooked call (newton-physics#1545) * SolverMuJoCo: Fix tolerance clamping in update_solver_options_kernel (newton-physics#1546) * Change default shape_ke to align with MuJoCo, parse geom solref from MJCF for contact stiffness/damping (newton-physics#1491) Signed-off-by: Alain Denzler <adenzler@nvidia.com> * Fix log_shapes broadcasting for length-1 warp arrays (newton-physics#1550) * Fix XPBD restitution particle index (newton-physics#1557) * Out-of-Bound memory read in example_diffsim_bear newton-physics#1386 (newton-physics#1533) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add versioned documentation deployment to GitHub Pages (newton-physics#1560) * Fix broken documentation links after versioned docs deployment (newton-physics#1566) * VBD New Features (newton-physics#1479) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Add banners to membership verification workflow steps (newton-physics#1569) * Support cable junctions (newton-physics#1519) Signed-off-by: JC <jumyungc@nvidia.com> * Rename parameter I to inertia newton-physics#1543 (newton-physics#1551) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix example_robot_anymal_c_walk.py (newton-physics#1574) * Change everywhere linesearch to iterative (newton-physics#1573) * Remove standard collision pipeline (newton-physics#1538) * USD Plumbing MJC solver attributes through resolver and custom attribute framework (newton-physics#1463) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix child shape filtering (newton-physics#1559) * Fix ViewerRerun ignoring hidden parameter in log_mesh and log_instances (newton-physics#1555) * Make NxN and SAP broad phase respect filtered pairs (newton-physics#1554) * Add --quiet flag to examples to suppress Warp messages (newton-physics#1585) * Defer resolution of MESH_MAXHULLVERT default in importers (newton-physics#1587) * Fix TypeError when finalizing SDF geometry with device kwarg (newton-physics#1586) * Make MESH_MAXHULLVERT a static class attribute Mesh.MAX_HULL_VERTICES. (newton-physics#1598) * Significant non-determinism in unified collision pipeline for anymal_c_walking example newton-physics#1505 (newton-physics#1588) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add test for non-contiguous case (newton-physics#1549) * Fix nightly Warp CI to resolve pre-release builds (newton-physics#1606) * Verify default class and value handling (newton-physics#1556) * SolverMuJoCo: Expand geom_margin to avoid OOB read with heterogeneous worlds (newton-physics#1607) * Fix bug in control clear method (newton-physics#1602) * Enable Use of Newton IK in Lab newton-physics#662 (newton-physics#1539) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix import of non-articulated joints (newton-physics#1535) * Deduplicate _process_joint_custom_attributes frequency handling (newton-physics#1584) * Add CI check for stale API docs and fix local build warnings (newton-physics#1570) * Update Pillow 12.0.0 to 12.1.1 (newton-physics#1612) * Prepare handling of mimic constraints in Newton (newton-physics#1523) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support floating, base_joint and parent_body arguments for importers (newton-physics#1498) * Fix contact buffer memory overestimation (newton-physics#1614) * Configure banned-module-level-imports for ruff (newton-physics#1583) * Explicit `Contacts` instantiation with `Model.contacts()` and `CollisionPipeline.contacts()` (newton-physics#1445) * Fix the quadruped benchmark regression (newton-physics#1615) * Change default ignore_inertial_definitions from True to False (newton-physics#1537) * Finalize the Recording API (newton-physics#1600) * SolverMuJoCo: Fix ccd_iterations default (newton-physics#1631) * update gitignore to ignore Claude Code sandbox files (newton-physics#1628) * Add mimic joint support to SolverMuJoCo (newton-physics#1627) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add --no-cache-clear flag to test runner (newton-physics#1629) * Update MuJoCo and MuJoCo Warp to 3.5.0 release (newton-physics#1633) * Improve inertia parsing from USD (newton-physics#1605) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Remove standalone .typos.toml in favor of pyproject.toml config (newton-physics#1642) * Heightfield support newton-physics#1189 (newton-physics#1547) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Example_robot_policy: Replace ValueError with clean error for missing PhysX policy (newton-physics#1636) Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Avoid unnecessary inflation of the contact reduction voxel aabb (newton-physics#1650) * Rename num_worlds to world_count (newton-physics#1634) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support parsing autolimits from MJCF (newton-physics#1651) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix particle-shape restitution ignoring body velocity (newton-physics#1273) (newton-physics#1580) * Add overflow warnings for narrow-phase collision buffers (newton-physics#1643) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Documentation: add units to model/state docstrings (newton-physics#1649) * fix(viewer): add missing JointType.BALL support to contact line kernel (newton-physics#1640) * Make terrain mesh visual-only in anymal C walking example (newton-physics#1660) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Fix initialization of collider state in MPM finite difference mode (newton-physics#1652) * docs: document ModelBuilder.default_shape_cfg (newton-physics#1662) * Finalize the collision API (newton-physics#1581) * Remove hardcoded subnet ID from AWS workflow (newton-physics#1664) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Attempt to fix AWS config (newton-physics#1666) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Update AWS workflows to g7e.2xlarge with multi-AZ failover (newton-physics#1669) * fix(viewer-usd): disambiguate log_points colors for N=3 warp arrays (newton-physics#1661) * Viewer gl optimizations (newton-physics#1656) Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> * docs: add articulation workflow guidance and regression check (newton-physics#1663) * fix(examples): propagate IK solution to model state in Franka example (newton-physics#1637) * fix(deps,docs): bump nbconvert to 7.17.0 and fix ArticulationView doctest (newton-physics#1670) * Cleanup and improve some example (newton-physics#1625) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Handle zero-mass bodies and flip ensure_nonstatic_links default (newton-physics#1635) * Additional testing for ArticulationView (newton-physics#1527) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Update warp-lang nightly to 1.12.0.dev20260217 (newton-physics#1677) * Change default friction coefficients to match MuJoCo (newton-physics#1681) * Refactor mesh creation functions (newton-physics#1654) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Parse joint frictionloss from MJCF (newton-physics#1680) * Fix free joint body_pos and add ref/qpos0 support for MuJoCo solver (newton-physics#1645) * Fix root shapes in ArticulationView with fixed base (newton-physics#1639) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use model collision methods and remove `create_collision_pipeline` from examples (newton-physics#1648) Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> * Fix XPBD apply_joint_forces ignoring child joint transform (newton-physics#1582) * Adjust SDF API (newton-physics#1644) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Optimize test suite runtime (~18% faster) (newton-physics#1689) * Remove ensure_nonstatic_links option from importers (newton-physics#1682) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> * SolverMuJoCo: Add geom_margin support, align thickness default with MuJoCo and schemas (newton-physics#1653) * refactor: privatize non-public solver internals (newton-physics#1683) * Fix option parsing with multiple <option> elements from includes (newton-physics#1692) * Bump warp-lang nightly and newton-usd-schemas (newton-physics#1693) * Get rid of tkinter dependency (newton-physics#1676) * Fix SDF example contact buffer overflow (newton-physics#1695) * Fix implicit biastype for position/velocity actuator shortcuts (newton-physics#1678) * Fix include processor to respect meshdir/texturedir (newton-physics#1685) * Reduce cold-cache Warp compile time for geometry modules (newton-physics#1618) Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix xyzw-to-wxyz quaternion conversion in body inertia kernel (newton-physics#1694) * Rename key to label and add hierarchical labels (newton-physics#1592) (newton-physics#1632) * Expose geometry SDF helpers on public API (newton-physics#1684) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Improve custom frequency handling from USD, parse MuJoCo actuators and tendons (newton-physics#1510) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Collapse fixed joints with non articulated bodies (newton-physics#1608) * Fix renaming joint_key -> joint_label (newton-physics#1700) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Bump .python-version from 3.11 to 3.12 (newton-physics#1702) * Replace CITATION.md with CITATION.cff (newton-physics#1706) * Respect MJCF contype=conaffinity=0 via collision_group=0 (newton-physics#1703) * Make ViewerUSD reuse existing USD layers for the same output path (newton-physics#1704) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove dead up-axis conversion from MuJoCo solver (newton-physics#1707) * Skip IK cube stacking example test (newton-physics#1713) * Fix global pairs (world=-1) not exported to MuJoCo spec (newton-physics#1705) * Reduce the memory consumption of hydroelastic contacts (newton-physics#1609) * Fix flakiness cube stacking (newton-physics#1714) * Fix collision shapes not toggleable in viewer UI (newton-physics#1715) * Fix softbody examples table layout in README (newton-physics#1716) * Standardize sensor APIs: label matching, keyword args, and update() method naming (newton-physics#1665) * Fix intermittent crash in parallel test runner from Manager proxy race (newton-physics#1721) * Clean up inertia.py function arguments to match Mesh.create_* API (newton-physics#1719) * Reduce default test runner verbosity (newton-physics#1723) * Add menagerie comparison tests for SolverMuJoCo (newton-physics#1720) Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Add spatial tendon support for MuJoCo solver (newton-physics#1687) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Expose qfrc_actuator from mujoco (newton-physics#1698) * Skip non-MODEL custom attributes in finalize validation (newton-physics#1734) * Resolve inheritrange for position actuators in MJCF parser (newton-physics#1727) * Support dampratio for position/velocity actuator shortcuts (newton-physics#1722) * Limit concurrency to 1 (newton-physics#1736) * Add a helper method for checking applied usd (newton-physics#1731) * Enhance playback URL handling in ViewerViser (newton-physics#1742) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Removed RenderShapeType (newton-physics#1748) * Override only MassAPI attributes that have been authored (newton-physics#1688) * Integration of newton-actuators (newton-physics#1342) Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> * Fix ArticulationView crash with fixed-joint-only articulations (newton-physics#1726) * Improve retrieval of Jupyter base URL in ViewerViser (newton-physics#1750) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Disable dynamics testing for UR5e and Apollo tests to avoid CI flakiness (newton-physics#1755) * Margin and Gap rename (newton-physics#1732) * Vbd Demos Fixing (newton-physics#1740) * Fix ViewerViser.log_lines method (newton-physics#1764) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Update warp-lang dependency to 1.12.0rc1 (newton-physics#1763) * Fix fromto capsule/cylinder orientation in MJCF parser (newton-physics#1741) * fix: multi-world particle BVH indexing (newton-physics#1641) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Clean up unused and internal-only kwargs in SolverMuJoCo (newton-physics#1766) * Parsing of the mimic joint and contact gap/margin from newton schemas (newton-physics#1690) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> * API Refactor v2 (newton-physics#1749) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Support explicit geom mass attributes in MJCF (newton-physics#1744) * Bump flask and werkzeug in lockfile for security (newton-physics#1769) Co-authored-by: Cursor <cursoragent@cursor.com> * Split MJCF worldbody root bodies into separate articulations (newton-physics#1754) * Expose VBD rigid contact forces for solver coupling (newton-physics#1745) Signed-off-by: JC <jumyungc@nvidia.com> * Add MJCF ellipsoid geom import and regression test (newton-physics#1772) Co-authored-by: Cursor <cursoragent@cursor.com> * Weld equality constraints parsed from mjcf are given Nan as the default value of torquescale. The correct default should be 1.0 (newton-physics#1760) * Improve picking accuracy and stability (newton-physics#1712) * Franka cloth demo improvement (newton-physics#1765) * Support computing sensing object transforms & API cleanup (newton-physics#1759) * Remove threading workaround (newton-physics#1751) * [Warp Raytrace] Consolidated ray intersect functions, renamed Options to Config (newton-physics#1767) * Improve README example gallery for PyPI compatibility (newton-physics#1776) * Fix issue with mesh in rerun viewer (newton-physics#1768) * Add PhysxMimicJointAPI parsing to USD importer (newton-physics#1735) * Move some math functions to Warp (newton-physics#1717) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Add test to ensure MJCF xform argument is relative (newton-physics#1777) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Emit diaginertia instead of fullinertia for diagonal body inertia (newton-physics#1780) * Change default joint armature from 0.01 to 0 (newton-physics#1782) * Fix default kp/kv for position and velocity actuators (newton-physics#1786) * Lock body inertia after explicit MJCF <inertial> element (newton-physics#1784) * Fix for MJCF actuator custom attributes (newton-physics#1783) * Bump version to 0.2.3 Prepare the package metadata for the v0.2.3 release tag. * Fix ViewerRerun rendering of instances from hidden meshes (newton-physics#1788) * API cleanup (newton-physics#1789) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * BODY actuator target name bypasses body name de-duplication in SolverMuJoCo (newton-physics#1729) * Use default density for visual geoms in MJCF import (newton-physics#1781) * Fix GL viewer crash on Wayland (newton-physics#1793) * Make USD xform parameter control absolute articulation placement (newton-physics#1771) * Fix CUDA context corruption in SDF implementation (newton-physics#1792) * Bump mujoco-warp dependency to 3.5.0.2 (newton-physics#1779) * Fix MuJoCo margin/gap conversion (newton-physics#1785) * Bump version to 1.1.0.dev0 (newton-physics#1798) * Missing unittest.main added back to test_import_mjcf.py. Helps with F5 debugging in VS Code. (newton-physics#1796) * Improve H1 example (newton-physics#1801) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Fix ViewerViser.set_camera() (newton-physics#1805) * Rename examples to follow prefix-first naming convention (newton-physics#1802) * Improve MuJoCo actuator domain randomization (newton-physics#1773) * Restore in_cup test in hydro example (newton-physics#1775) * Fix `newton.geometry` imports and change of Mesh maxhullverts global constant * Adapt to having both margin and gap arrays for each geom/shape * Fix for newton.geometry API changes in primitive/narrowphase.py * Fix removal of `BroadPhaseMode` IntEnum and revert to newton-sytle string literals * WIP: Adapt geometry/unified.py to fix breaking changes to `newton.geometry` API * First pass of API adjustments * Patch more gaps (with respect to margin and gap renaming) * GeoType.SDF was removed - reflect that in Kamino * Introduce CoM position offsets w.r.t body frame and operations to convert between body CoM state and generic local body-fixed reference frames. * Add caching of per-entity labels/names/keys in the Model subcontainers * Remove SDF shape wrapper since it's now internal to mesh handling in CD pipelines * Fix USD test assets * Add Newton <--> Kamino joint type conversion operations and per-space default limit constants * Add some cleanup to geometry and unified CD + UTs * Add Newton <--> Kamino shape type conversion operations * Apply new default joint coord limit constants to limits.py * Adapt foubrar model builder and USD asset to produce the same result in sim example * Purge "physical" goems and collapse all into a single group, and purge geometry "layers" * Disable allocation per-joint wrenches by default and make them optional * Make `Model` a dataclass * Separate ModelData* containers into own `core/data.py` module * Fix imports of ModelData * Rename `Model` as `ModelKamino` * Rename `ModelData` as `DataKamino` * Rename `State` as `StateKamino` * Rename `Control` as `ControlKamino` * Rename `Limits` as `LimitsKamino` * Rename `Contacts` as `ContactsKamino` * Rename `ModelBuilder` as `ModelBuilderKamino` * Make imports in test utilities relative * Revise CD meta-data attributes and their computation in GeometryModel and ModelBuilderKamino * Revise primitive CD pipeline * Revise unified CD pipeline * Revise CD front-end interfaces * Fix UTs and relevant utils for interface changes to CD * Change to `wp.DeviceLike` to account for upcoming deprecation of `Devicelike` * Depracate legacy HDF5 data io (will be replaced in the future) * Fix banned imports at module level * Modify USD importer to detect articulations and order geoms and joints similarly to how the Newton `parse_usd` function does. * Add conversion operation from `newton.Model` to `ModelKamino` * Add data, state and control container conversions * Add SolverKamino wrapper that fullfils newton integration interface * Add newton integration examples * Add SolverKamino to newton solver module imports * WIP: fix problem with lambda_j being allocated for only kinematic constraints and failing on array copying * Fix banned git import in benchmark * Rename *Settings to *Config (#213) * Rename SolverKaminoSettings -> SolverKaminoConfig * Rename DualProblemSettings -> DualProblemConfig * Rename CollisionDetectorSettings -> CollisionDetectorConfig * Rename PADMMSettings -> PADMMConfig * Rename ForwardKinematicsSolverSettings -> ForwardKinematicsSolverConfig * Rename SimulatorSettings -> SimulatorConfig * Add check for model compatibility in SolverKamino (#209) * Fix device assignment in sparse CG test on CPU (#216) * Replace Enum-type config attributes with Literal (#215) * Replace warmstart mode config param with literal * Replace contact warmstart mode config param with literal * Replace rotation correction config param with literal * Replace penalty update config param with literal * Replace FK preconditioner option config param with literal * Add post-init checks for dual/PADMM configs * Rename FKPreconditionerOptions to FKPreconditionerType * Remove WorldDescriptor from ModelKamino (#219) * Add geom index offset array to model info * Replace access to world description in model * Remove world descriptor from model * Fix computation of kinematics residual with sparse Jacobian (#220) * Migrates `ModelKaminoSize` to it's own module to avoid circular dependency between core/model.py and core/state.py and rename it as `SizeKamino`. * WIP: Fix SolverKamino wrapper * Fix circular dependency in conversions.py * Fix some broken unit tests and WIP to fix fourbar contact conversions and rendering * Make some conversions @staticmethods instead, because they dont need common class attributes * Fix declaration of custom state attributes and their conversion to/from newton and kamino * WIP: Debug model conversion and newton sim examples * Rename and cleanup start index array of per-world geoms * Model conversion and newton sim examples now work. * Make gravity conversion operation re-usable * Migrates boxes_fourbar builder using newton.ModelBuilder to it's own module to prepare for migration. * Use gravity conversion utility func in SolverKamino * Add reusable joint-parameterization conversion utility * Remove world-descriptor from model converter * Rename helper converter that handles entity-local transforms * Add some cleanup to DR Legs, ANYmal D and basic four-bar examples * Fix module-level imports of additional kamino-specific development dependencies * Fix module-level imports of additional kamino-specific development dependencies * Fix erroneous merge conflict. --------- Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Signed-off-by: JC <jumyungc@nvidia.com> Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: Daniela Hase <116915287+daniela-hase@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> Co-authored-by: Eric Shi <97630937+shi-eric@users.noreply.github.com> Co-authored-by: Anka Chen <AnkaChan@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: JC-nvidia <116605903+jumyungc@users.noreply.github.com> Co-authored-by: Kenny Vilella <kvilella@nvidia.com> Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> Co-authored-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Lennart Röstel <65088822+lenroe@users.noreply.github.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: camevor <camevor@nvidia.com> Co-authored-by: mzamoramora-nvidia <mzamoramora@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alessandro Roncone <alecive87@gmail.com> Co-authored-by: gdaviet <57617656+gdaviet@users.noreply.github.com> Co-authored-by: Miles Macklin <mmacklin@nvidia.com> Co-authored-by: Gordon Yeoman <gyeomannvidia@users.noreply.github.com> Co-authored-by: Lukasz Wawrzyniak <lwawrzyniak@nvidia.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Lorenzo Terenzi <lorenzoterenzi96@gmail.com> Co-authored-by: smollerNV <164020096+smollerNV@users.noreply.github.com> Co-authored-by: twidmer <twidmer@nvidia.com> Co-authored-by: Christian Schumacher <christian.schumacher@disney.com> Co-authored-by: Guirec-Maloisel <25688871+Guirec-Maloisel@users.noreply.github.com>
* [Warp Raytrace] Added device parameter (newton-physics#1544) * [Warp Raytrace] Added device parameter to previously overlooked call (newton-physics#1545) * SolverMuJoCo: Fix tolerance clamping in update_solver_options_kernel (newton-physics#1546) * Change default shape_ke to align with MuJoCo, parse geom solref from MJCF for contact stiffness/damping (newton-physics#1491) Signed-off-by: Alain Denzler <adenzler@nvidia.com> * Fix log_shapes broadcasting for length-1 warp arrays (newton-physics#1550) * Fix XPBD restitution particle index (newton-physics#1557) * Out-of-Bound memory read in example_diffsim_bear newton-physics#1386 (newton-physics#1533) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add versioned documentation deployment to GitHub Pages (newton-physics#1560) * Fix broken documentation links after versioned docs deployment (newton-physics#1566) * VBD New Features (newton-physics#1479) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Add banners to membership verification workflow steps (newton-physics#1569) * Support cable junctions (newton-physics#1519) Signed-off-by: JC <jumyungc@nvidia.com> * Rename parameter I to inertia newton-physics#1543 (newton-physics#1551) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix example_robot_anymal_c_walk.py (newton-physics#1574) * Change everywhere linesearch to iterative (newton-physics#1573) * Remove standard collision pipeline (newton-physics#1538) * USD Plumbing MJC solver attributes through resolver and custom attribute framework (newton-physics#1463) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix child shape filtering (newton-physics#1559) * Fix ViewerRerun ignoring hidden parameter in log_mesh and log_instances (newton-physics#1555) * Make NxN and SAP broad phase respect filtered pairs (newton-physics#1554) * Add --quiet flag to examples to suppress Warp messages (newton-physics#1585) * Defer resolution of MESH_MAXHULLVERT default in importers (newton-physics#1587) * Fix TypeError when finalizing SDF geometry with device kwarg (newton-physics#1586) * Make MESH_MAXHULLVERT a static class attribute Mesh.MAX_HULL_VERTICES. (newton-physics#1598) * Significant non-determinism in unified collision pipeline for anymal_c_walking example newton-physics#1505 (newton-physics#1588) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add test for non-contiguous case (newton-physics#1549) * Fix nightly Warp CI to resolve pre-release builds (newton-physics#1606) * Verify default class and value handling (newton-physics#1556) * SolverMuJoCo: Expand geom_margin to avoid OOB read with heterogeneous worlds (newton-physics#1607) * Fix bug in control clear method (newton-physics#1602) * Enable Use of Newton IK in Lab newton-physics#662 (newton-physics#1539) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix import of non-articulated joints (newton-physics#1535) * Deduplicate _process_joint_custom_attributes frequency handling (newton-physics#1584) * Add CI check for stale API docs and fix local build warnings (newton-physics#1570) * Update Pillow 12.0.0 to 12.1.1 (newton-physics#1612) * Prepare handling of mimic constraints in Newton (newton-physics#1523) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support floating, base_joint and parent_body arguments for importers (newton-physics#1498) * Fix contact buffer memory overestimation (newton-physics#1614) * Configure banned-module-level-imports for ruff (newton-physics#1583) * Explicit `Contacts` instantiation with `Model.contacts()` and `CollisionPipeline.contacts()` (newton-physics#1445) * Fix the quadruped benchmark regression (newton-physics#1615) * Change default ignore_inertial_definitions from True to False (newton-physics#1537) * Finalize the Recording API (newton-physics#1600) * SolverMuJoCo: Fix ccd_iterations default (newton-physics#1631) * update gitignore to ignore Claude Code sandbox files (newton-physics#1628) * Add mimic joint support to SolverMuJoCo (newton-physics#1627) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add --no-cache-clear flag to test runner (newton-physics#1629) * Update MuJoCo and MuJoCo Warp to 3.5.0 release (newton-physics#1633) * Improve inertia parsing from USD (newton-physics#1605) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Remove standalone .typos.toml in favor of pyproject.toml config (newton-physics#1642) * Heightfield support newton-physics#1189 (newton-physics#1547) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Example_robot_policy: Replace ValueError with clean error for missing PhysX policy (newton-physics#1636) Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Avoid unnecessary inflation of the contact reduction voxel aabb (newton-physics#1650) * Rename num_worlds to world_count (newton-physics#1634) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support parsing autolimits from MJCF (newton-physics#1651) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix particle-shape restitution ignoring body velocity (newton-physics#1273) (newton-physics#1580) * Add overflow warnings for narrow-phase collision buffers (newton-physics#1643) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Documentation: add units to model/state docstrings (newton-physics#1649) * fix(viewer): add missing JointType.BALL support to contact line kernel (newton-physics#1640) * Make terrain mesh visual-only in anymal C walking example (newton-physics#1660) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Fix initialization of collider state in MPM finite difference mode (newton-physics#1652) * docs: document ModelBuilder.default_shape_cfg (newton-physics#1662) * Finalize the collision API (newton-physics#1581) * Remove hardcoded subnet ID from AWS workflow (newton-physics#1664) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Attempt to fix AWS config (newton-physics#1666) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Update AWS workflows to g7e.2xlarge with multi-AZ failover (newton-physics#1669) * fix(viewer-usd): disambiguate log_points colors for N=3 warp arrays (newton-physics#1661) * Viewer gl optimizations (newton-physics#1656) Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> * docs: add articulation workflow guidance and regression check (newton-physics#1663) * fix(examples): propagate IK solution to model state in Franka example (newton-physics#1637) * fix(deps,docs): bump nbconvert to 7.17.0 and fix ArticulationView doctest (newton-physics#1670) * Cleanup and improve some example (newton-physics#1625) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Handle zero-mass bodies and flip ensure_nonstatic_links default (newton-physics#1635) * Additional testing for ArticulationView (newton-physics#1527) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Update warp-lang nightly to 1.12.0.dev20260217 (newton-physics#1677) * Change default friction coefficients to match MuJoCo (newton-physics#1681) * Refactor mesh creation functions (newton-physics#1654) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Parse joint frictionloss from MJCF (newton-physics#1680) * Fix free joint body_pos and add ref/qpos0 support for MuJoCo solver (newton-physics#1645) * Fix root shapes in ArticulationView with fixed base (newton-physics#1639) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use model collision methods and remove `create_collision_pipeline` from examples (newton-physics#1648) Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> * Fix XPBD apply_joint_forces ignoring child joint transform (newton-physics#1582) * Adjust SDF API (newton-physics#1644) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Optimize test suite runtime (~18% faster) (newton-physics#1689) * Remove ensure_nonstatic_links option from importers (newton-physics#1682) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> * SolverMuJoCo: Add geom_margin support, align thickness default with MuJoCo and schemas (newton-physics#1653) * refactor: privatize non-public solver internals (newton-physics#1683) * Fix option parsing with multiple <option> elements from includes (newton-physics#1692) * Bump warp-lang nightly and newton-usd-schemas (newton-physics#1693) * Get rid of tkinter dependency (newton-physics#1676) * Fix SDF example contact buffer overflow (newton-physics#1695) * Fix implicit biastype for position/velocity actuator shortcuts (newton-physics#1678) * Fix include processor to respect meshdir/texturedir (newton-physics#1685) * Reduce cold-cache Warp compile time for geometry modules (newton-physics#1618) Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix xyzw-to-wxyz quaternion conversion in body inertia kernel (newton-physics#1694) * Rename key to label and add hierarchical labels (newton-physics#1592) (newton-physics#1632) * Expose geometry SDF helpers on public API (newton-physics#1684) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Improve custom frequency handling from USD, parse MuJoCo actuators and tendons (newton-physics#1510) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Collapse fixed joints with non articulated bodies (newton-physics#1608) * Fix renaming joint_key -> joint_label (newton-physics#1700) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Bump .python-version from 3.11 to 3.12 (newton-physics#1702) * Replace CITATION.md with CITATION.cff (newton-physics#1706) * Respect MJCF contype=conaffinity=0 via collision_group=0 (newton-physics#1703) * Make ViewerUSD reuse existing USD layers for the same output path (newton-physics#1704) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove dead up-axis conversion from MuJoCo solver (newton-physics#1707) * Skip IK cube stacking example test (newton-physics#1713) * Fix global pairs (world=-1) not exported to MuJoCo spec (newton-physics#1705) * Reduce the memory consumption of hydroelastic contacts (newton-physics#1609) * Fix flakiness cube stacking (newton-physics#1714) * Fix collision shapes not toggleable in viewer UI (newton-physics#1715) * Fix softbody examples table layout in README (newton-physics#1716) * Standardize sensor APIs: label matching, keyword args, and update() method naming (newton-physics#1665) * Fix intermittent crash in parallel test runner from Manager proxy race (newton-physics#1721) * Clean up inertia.py function arguments to match Mesh.create_* API (newton-physics#1719) * Reduce default test runner verbosity (newton-physics#1723) * Add menagerie comparison tests for SolverMuJoCo (newton-physics#1720) Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Add spatial tendon support for MuJoCo solver (newton-physics#1687) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Expose qfrc_actuator from mujoco (newton-physics#1698) * Skip non-MODEL custom attributes in finalize validation (newton-physics#1734) * Resolve inheritrange for position actuators in MJCF parser (newton-physics#1727) * Support dampratio for position/velocity actuator shortcuts (newton-physics#1722) * Limit concurrency to 1 (newton-physics#1736) * Add a helper method for checking applied usd (newton-physics#1731) * Enhance playback URL handling in ViewerViser (newton-physics#1742) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Removed RenderShapeType (newton-physics#1748) * Override only MassAPI attributes that have been authored (newton-physics#1688) * Integration of newton-actuators (newton-physics#1342) Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> * Fix ArticulationView crash with fixed-joint-only articulations (newton-physics#1726) * Improve retrieval of Jupyter base URL in ViewerViser (newton-physics#1750) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Disable dynamics testing for UR5e and Apollo tests to avoid CI flakiness (newton-physics#1755) * Margin and Gap rename (newton-physics#1732) * Vbd Demos Fixing (newton-physics#1740) * Fix ViewerViser.log_lines method (newton-physics#1764) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Update warp-lang dependency to 1.12.0rc1 (newton-physics#1763) * Fix fromto capsule/cylinder orientation in MJCF parser (newton-physics#1741) * fix: multi-world particle BVH indexing (newton-physics#1641) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Clean up unused and internal-only kwargs in SolverMuJoCo (newton-physics#1766) * Parsing of the mimic joint and contact gap/margin from newton schemas (newton-physics#1690) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> * API Refactor v2 (newton-physics#1749) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Support explicit geom mass attributes in MJCF (newton-physics#1744) * Bump flask and werkzeug in lockfile for security (newton-physics#1769) Co-authored-by: Cursor <cursoragent@cursor.com> * Split MJCF worldbody root bodies into separate articulations (newton-physics#1754) * Expose VBD rigid contact forces for solver coupling (newton-physics#1745) Signed-off-by: JC <jumyungc@nvidia.com> * Add MJCF ellipsoid geom import and regression test (newton-physics#1772) Co-authored-by: Cursor <cursoragent@cursor.com> * Weld equality constraints parsed from mjcf are given Nan as the default value of torquescale. The correct default should be 1.0 (newton-physics#1760) * Improve picking accuracy and stability (newton-physics#1712) * Franka cloth demo improvement (newton-physics#1765) * Support computing sensing object transforms & API cleanup (newton-physics#1759) * Remove threading workaround (newton-physics#1751) * [Warp Raytrace] Consolidated ray intersect functions, renamed Options to Config (newton-physics#1767) * Improve README example gallery for PyPI compatibility (newton-physics#1776) * Fix issue with mesh in rerun viewer (newton-physics#1768) * Add PhysxMimicJointAPI parsing to USD importer (newton-physics#1735) * Move some math functions to Warp (newton-physics#1717) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Add test to ensure MJCF xform argument is relative (newton-physics#1777) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Emit diaginertia instead of fullinertia for diagonal body inertia (newton-physics#1780) * Change default joint armature from 0.01 to 0 (newton-physics#1782) * Fix default kp/kv for position and velocity actuators (newton-physics#1786) * Lock body inertia after explicit MJCF <inertial> element (newton-physics#1784) * Fix for MJCF actuator custom attributes (newton-physics#1783) * Bump version to 0.2.3 Prepare the package metadata for the v0.2.3 release tag. * Fix ViewerRerun rendering of instances from hidden meshes (newton-physics#1788) * API cleanup (newton-physics#1789) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * BODY actuator target name bypasses body name de-duplication in SolverMuJoCo (newton-physics#1729) * Use default density for visual geoms in MJCF import (newton-physics#1781) * Fix GL viewer crash on Wayland (newton-physics#1793) * Make USD xform parameter control absolute articulation placement (newton-physics#1771) * Fix CUDA context corruption in SDF implementation (newton-physics#1792) * Bump mujoco-warp dependency to 3.5.0.2 (newton-physics#1779) * Fix MuJoCo margin/gap conversion (newton-physics#1785) * Bump version to 1.1.0.dev0 (newton-physics#1798) * Missing unittest.main added back to test_import_mjcf.py. Helps with F5 debugging in VS Code. (newton-physics#1796) * Improve H1 example (newton-physics#1801) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Fix ViewerViser.set_camera() (newton-physics#1805) * Rename examples to follow prefix-first naming convention (newton-physics#1802) * Improve MuJoCo actuator domain randomization (newton-physics#1773) * Restore in_cup test in hydro example (newton-physics#1775) * Fix `newton.geometry` imports and change of Mesh maxhullverts global constant * Adapt to having both margin and gap arrays for each geom/shape * Fix for newton.geometry API changes in primitive/narrowphase.py * Fix removal of `BroadPhaseMode` IntEnum and revert to newton-sytle string literals * WIP: Adapt geometry/unified.py to fix breaking changes to `newton.geometry` API * First pass of API adjustments * Patch more gaps (with respect to margin and gap renaming) * GeoType.SDF was removed - reflect that in Kamino * Introduce CoM position offsets w.r.t body frame and operations to convert between body CoM state and generic local body-fixed reference frames. * Add caching of per-entity labels/names/keys in the Model subcontainers * Remove SDF shape wrapper since it's now internal to mesh handling in CD pipelines * Fix USD test assets * Add Newton <--> Kamino joint type conversion operations and per-space default limit constants * Add some cleanup to geometry and unified CD + UTs * Add Newton <--> Kamino shape type conversion operations * Apply new default joint coord limit constants to limits.py * Adapt foubrar model builder and USD asset to produce the same result in sim example * Purge "physical" goems and collapse all into a single group, and purge geometry "layers" * Disable allocation per-joint wrenches by default and make them optional * Make `Model` a dataclass * Separate ModelData* containers into own `core/data.py` module * Fix imports of ModelData * Rename `Model` as `ModelKamino` * Rename `ModelData` as `DataKamino` * Rename `State` as `StateKamino` * Rename `Control` as `ControlKamino` * Rename `Limits` as `LimitsKamino` * Rename `Contacts` as `ContactsKamino` * Rename `ModelBuilder` as `ModelBuilderKamino` * Make imports in test utilities relative * Revise CD meta-data attributes and their computation in GeometryModel and ModelBuilderKamino * Revise primitive CD pipeline * Revise unified CD pipeline * Revise CD front-end interfaces * Fix UTs and relevant utils for interface changes to CD * Change to `wp.DeviceLike` to account for upcoming deprecation of `Devicelike` * Depracate legacy HDF5 data io (will be replaced in the future) * Fix banned imports at module level * Modify USD importer to detect articulations and order geoms and joints similarly to how the Newton `parse_usd` function does. * Add conversion operation from `newton.Model` to `ModelKamino` * Add data, state and control container conversions * Add SolverKamino wrapper that fullfils newton integration interface * Add newton integration examples * Add SolverKamino to newton solver module imports * WIP: fix problem with lambda_j being allocated for only kinematic constraints and failing on array copying * Fix banned git import in benchmark * Rename *Settings to *Config (#213) * Rename SolverKaminoSettings -> SolverKaminoConfig * Rename DualProblemSettings -> DualProblemConfig * Rename CollisionDetectorSettings -> CollisionDetectorConfig * Rename PADMMSettings -> PADMMConfig * Rename ForwardKinematicsSolverSettings -> ForwardKinematicsSolverConfig * Rename SimulatorSettings -> SimulatorConfig * Add check for model compatibility in SolverKamino (#209) * Fix device assignment in sparse CG test on CPU (#216) * Replace Enum-type config attributes with Literal (#215) * Replace warmstart mode config param with literal * Replace contact warmstart mode config param with literal * Replace rotation correction config param with literal * Replace penalty update config param with literal * Replace FK preconditioner option config param with literal * Add post-init checks for dual/PADMM configs * Rename FKPreconditionerOptions to FKPreconditionerType * Remove WorldDescriptor from ModelKamino (#219) * Add geom index offset array to model info * Replace access to world description in model * Remove world descriptor from model * Fix computation of kinematics residual with sparse Jacobian (#220) * Migrates `ModelKaminoSize` to it's own module to avoid circular dependency between core/model.py and core/state.py and rename it as `SizeKamino`. * WIP: Fix SolverKamino wrapper * Fix circular dependency in conversions.py * Fix some broken unit tests and WIP to fix fourbar contact conversions and rendering * Make some conversions @staticmethods instead, because they dont need common class attributes * Fix declaration of custom state attributes and their conversion to/from newton and kamino * WIP: Debug model conversion and newton sim examples * Rename and cleanup start index array of per-world geoms * Model conversion and newton sim examples now work. * Make gravity conversion operation re-usable * Migrates boxes_fourbar builder using newton.ModelBuilder to it's own module to prepare for migration. * Use gravity conversion utility func in SolverKamino * Add reusable joint-parameterization conversion utility * Remove world-descriptor from model converter * Rename helper converter that handles entity-local transforms * Add some cleanup to DR Legs, ANYmal D and basic four-bar examples * Fix module-level imports of additional kamino-specific development dependencies * Fix module-level imports of additional kamino-specific development dependencies * Fix erroneous merge conflict. --------- Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Signed-off-by: JC <jumyungc@nvidia.com> Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: Daniela Hase <116915287+daniela-hase@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> Co-authored-by: Eric Shi <97630937+shi-eric@users.noreply.github.com> Co-authored-by: Anka Chen <AnkaChan@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: JC-nvidia <116605903+jumyungc@users.noreply.github.com> Co-authored-by: Kenny Vilella <kvilella@nvidia.com> Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> Co-authored-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Lennart Röstel <65088822+lenroe@users.noreply.github.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: camevor <camevor@nvidia.com> Co-authored-by: mzamoramora-nvidia <mzamoramora@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alessandro Roncone <alecive87@gmail.com> Co-authored-by: gdaviet <57617656+gdaviet@users.noreply.github.com> Co-authored-by: Miles Macklin <mmacklin@nvidia.com> Co-authored-by: Gordon Yeoman <gyeomannvidia@users.noreply.github.com> Co-authored-by: Lukasz Wawrzyniak <lwawrzyniak@nvidia.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Lorenzo Terenzi <lorenzoterenzi96@gmail.com> Co-authored-by: smollerNV <164020096+smollerNV@users.noreply.github.com> Co-authored-by: twidmer <twidmer@nvidia.com> Co-authored-by: Christian Schumacher <christian.schumacher@disney.com> Co-authored-by: Guirec-Maloisel <25688871+Guirec-Maloisel@users.noreply.github.com>
* [Warp Raytrace] Added device parameter (newton-physics#1544) * [Warp Raytrace] Added device parameter to previously overlooked call (newton-physics#1545) * SolverMuJoCo: Fix tolerance clamping in update_solver_options_kernel (newton-physics#1546) * Change default shape_ke to align with MuJoCo, parse geom solref from MJCF for contact stiffness/damping (newton-physics#1491) Signed-off-by: Alain Denzler <adenzler@nvidia.com> * Fix log_shapes broadcasting for length-1 warp arrays (newton-physics#1550) * Fix XPBD restitution particle index (newton-physics#1557) * Out-of-Bound memory read in example_diffsim_bear newton-physics#1386 (newton-physics#1533) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add versioned documentation deployment to GitHub Pages (newton-physics#1560) * Fix broken documentation links after versioned docs deployment (newton-physics#1566) * VBD New Features (newton-physics#1479) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Add banners to membership verification workflow steps (newton-physics#1569) * Support cable junctions (newton-physics#1519) Signed-off-by: JC <jumyungc@nvidia.com> * Rename parameter I to inertia newton-physics#1543 (newton-physics#1551) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix example_robot_anymal_c_walk.py (newton-physics#1574) * Change everywhere linesearch to iterative (newton-physics#1573) * Remove standard collision pipeline (newton-physics#1538) * USD Plumbing MJC solver attributes through resolver and custom attribute framework (newton-physics#1463) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix child shape filtering (newton-physics#1559) * Fix ViewerRerun ignoring hidden parameter in log_mesh and log_instances (newton-physics#1555) * Make NxN and SAP broad phase respect filtered pairs (newton-physics#1554) * Add --quiet flag to examples to suppress Warp messages (newton-physics#1585) * Defer resolution of MESH_MAXHULLVERT default in importers (newton-physics#1587) * Fix TypeError when finalizing SDF geometry with device kwarg (newton-physics#1586) * Make MESH_MAXHULLVERT a static class attribute Mesh.MAX_HULL_VERTICES. (newton-physics#1598) * Significant non-determinism in unified collision pipeline for anymal_c_walking example newton-physics#1505 (newton-physics#1588) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add test for non-contiguous case (newton-physics#1549) * Fix nightly Warp CI to resolve pre-release builds (newton-physics#1606) * Verify default class and value handling (newton-physics#1556) * SolverMuJoCo: Expand geom_margin to avoid OOB read with heterogeneous worlds (newton-physics#1607) * Fix bug in control clear method (newton-physics#1602) * Enable Use of Newton IK in Lab newton-physics#662 (newton-physics#1539) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix import of non-articulated joints (newton-physics#1535) * Deduplicate _process_joint_custom_attributes frequency handling (newton-physics#1584) * Add CI check for stale API docs and fix local build warnings (newton-physics#1570) * Update Pillow 12.0.0 to 12.1.1 (newton-physics#1612) * Prepare handling of mimic constraints in Newton (newton-physics#1523) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support floating, base_joint and parent_body arguments for importers (newton-physics#1498) * Fix contact buffer memory overestimation (newton-physics#1614) * Configure banned-module-level-imports for ruff (newton-physics#1583) * Explicit `Contacts` instantiation with `Model.contacts()` and `CollisionPipeline.contacts()` (newton-physics#1445) * Fix the quadruped benchmark regression (newton-physics#1615) * Change default ignore_inertial_definitions from True to False (newton-physics#1537) * Finalize the Recording API (newton-physics#1600) * SolverMuJoCo: Fix ccd_iterations default (newton-physics#1631) * update gitignore to ignore Claude Code sandbox files (newton-physics#1628) * Add mimic joint support to SolverMuJoCo (newton-physics#1627) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add --no-cache-clear flag to test runner (newton-physics#1629) * Update MuJoCo and MuJoCo Warp to 3.5.0 release (newton-physics#1633) * Improve inertia parsing from USD (newton-physics#1605) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Remove standalone .typos.toml in favor of pyproject.toml config (newton-physics#1642) * Heightfield support newton-physics#1189 (newton-physics#1547) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Example_robot_policy: Replace ValueError with clean error for missing PhysX policy (newton-physics#1636) Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Avoid unnecessary inflation of the contact reduction voxel aabb (newton-physics#1650) * Rename num_worlds to world_count (newton-physics#1634) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support parsing autolimits from MJCF (newton-physics#1651) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix particle-shape restitution ignoring body velocity (newton-physics#1273) (newton-physics#1580) * Add overflow warnings for narrow-phase collision buffers (newton-physics#1643) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Documentation: add units to model/state docstrings (newton-physics#1649) * fix(viewer): add missing JointType.BALL support to contact line kernel (newton-physics#1640) * Make terrain mesh visual-only in anymal C walking example (newton-physics#1660) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Fix initialization of collider state in MPM finite difference mode (newton-physics#1652) * docs: document ModelBuilder.default_shape_cfg (newton-physics#1662) * Finalize the collision API (newton-physics#1581) * Remove hardcoded subnet ID from AWS workflow (newton-physics#1664) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Attempt to fix AWS config (newton-physics#1666) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Update AWS workflows to g7e.2xlarge with multi-AZ failover (newton-physics#1669) * fix(viewer-usd): disambiguate log_points colors for N=3 warp arrays (newton-physics#1661) * Viewer gl optimizations (newton-physics#1656) Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> * docs: add articulation workflow guidance and regression check (newton-physics#1663) * fix(examples): propagate IK solution to model state in Franka example (newton-physics#1637) * fix(deps,docs): bump nbconvert to 7.17.0 and fix ArticulationView doctest (newton-physics#1670) * Cleanup and improve some example (newton-physics#1625) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Handle zero-mass bodies and flip ensure_nonstatic_links default (newton-physics#1635) * Additional testing for ArticulationView (newton-physics#1527) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Update warp-lang nightly to 1.12.0.dev20260217 (newton-physics#1677) * Change default friction coefficients to match MuJoCo (newton-physics#1681) * Refactor mesh creation functions (newton-physics#1654) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Parse joint frictionloss from MJCF (newton-physics#1680) * Fix free joint body_pos and add ref/qpos0 support for MuJoCo solver (newton-physics#1645) * Fix root shapes in ArticulationView with fixed base (newton-physics#1639) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use model collision methods and remove `create_collision_pipeline` from examples (newton-physics#1648) Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> * Fix XPBD apply_joint_forces ignoring child joint transform (newton-physics#1582) * Adjust SDF API (newton-physics#1644) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Optimize test suite runtime (~18% faster) (newton-physics#1689) * Remove ensure_nonstatic_links option from importers (newton-physics#1682) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> * SolverMuJoCo: Add geom_margin support, align thickness default with MuJoCo and schemas (newton-physics#1653) * refactor: privatize non-public solver internals (newton-physics#1683) * Fix option parsing with multiple <option> elements from includes (newton-physics#1692) * Bump warp-lang nightly and newton-usd-schemas (newton-physics#1693) * Get rid of tkinter dependency (newton-physics#1676) * Fix SDF example contact buffer overflow (newton-physics#1695) * Fix implicit biastype for position/velocity actuator shortcuts (newton-physics#1678) * Fix include processor to respect meshdir/texturedir (newton-physics#1685) * Reduce cold-cache Warp compile time for geometry modules (newton-physics#1618) Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix xyzw-to-wxyz quaternion conversion in body inertia kernel (newton-physics#1694) * Rename key to label and add hierarchical labels (newton-physics#1592) (newton-physics#1632) * Expose geometry SDF helpers on public API (newton-physics#1684) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Improve custom frequency handling from USD, parse MuJoCo actuators and tendons (newton-physics#1510) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Collapse fixed joints with non articulated bodies (newton-physics#1608) * Fix renaming joint_key -> joint_label (newton-physics#1700) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Bump .python-version from 3.11 to 3.12 (newton-physics#1702) * Replace CITATION.md with CITATION.cff (newton-physics#1706) * Respect MJCF contype=conaffinity=0 via collision_group=0 (newton-physics#1703) * Make ViewerUSD reuse existing USD layers for the same output path (newton-physics#1704) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove dead up-axis conversion from MuJoCo solver (newton-physics#1707) * Skip IK cube stacking example test (newton-physics#1713) * Fix global pairs (world=-1) not exported to MuJoCo spec (newton-physics#1705) * Reduce the memory consumption of hydroelastic contacts (newton-physics#1609) * Fix flakiness cube stacking (newton-physics#1714) * Fix collision shapes not toggleable in viewer UI (newton-physics#1715) * Fix softbody examples table layout in README (newton-physics#1716) * Standardize sensor APIs: label matching, keyword args, and update() method naming (newton-physics#1665) * Fix intermittent crash in parallel test runner from Manager proxy race (newton-physics#1721) * Clean up inertia.py function arguments to match Mesh.create_* API (newton-physics#1719) * Reduce default test runner verbosity (newton-physics#1723) * Add menagerie comparison tests for SolverMuJoCo (newton-physics#1720) Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Add spatial tendon support for MuJoCo solver (newton-physics#1687) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Expose qfrc_actuator from mujoco (newton-physics#1698) * Skip non-MODEL custom attributes in finalize validation (newton-physics#1734) * Resolve inheritrange for position actuators in MJCF parser (newton-physics#1727) * Support dampratio for position/velocity actuator shortcuts (newton-physics#1722) * Limit concurrency to 1 (newton-physics#1736) * Add a helper method for checking applied usd (newton-physics#1731) * Enhance playback URL handling in ViewerViser (newton-physics#1742) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Removed RenderShapeType (newton-physics#1748) * Override only MassAPI attributes that have been authored (newton-physics#1688) * Integration of newton-actuators (newton-physics#1342) Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> * Fix ArticulationView crash with fixed-joint-only articulations (newton-physics#1726) * Improve retrieval of Jupyter base URL in ViewerViser (newton-physics#1750) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Disable dynamics testing for UR5e and Apollo tests to avoid CI flakiness (newton-physics#1755) * Margin and Gap rename (newton-physics#1732) * Vbd Demos Fixing (newton-physics#1740) * Fix ViewerViser.log_lines method (newton-physics#1764) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Update warp-lang dependency to 1.12.0rc1 (newton-physics#1763) * Fix fromto capsule/cylinder orientation in MJCF parser (newton-physics#1741) * fix: multi-world particle BVH indexing (newton-physics#1641) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Clean up unused and internal-only kwargs in SolverMuJoCo (newton-physics#1766) * Parsing of the mimic joint and contact gap/margin from newton schemas (newton-physics#1690) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> * API Refactor v2 (newton-physics#1749) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Support explicit geom mass attributes in MJCF (newton-physics#1744) * Bump flask and werkzeug in lockfile for security (newton-physics#1769) Co-authored-by: Cursor <cursoragent@cursor.com> * Split MJCF worldbody root bodies into separate articulations (newton-physics#1754) * Expose VBD rigid contact forces for solver coupling (newton-physics#1745) Signed-off-by: JC <jumyungc@nvidia.com> * Add MJCF ellipsoid geom import and regression test (newton-physics#1772) Co-authored-by: Cursor <cursoragent@cursor.com> * Weld equality constraints parsed from mjcf are given Nan as the default value of torquescale. The correct default should be 1.0 (newton-physics#1760) * Improve picking accuracy and stability (newton-physics#1712) * Franka cloth demo improvement (newton-physics#1765) * Support computing sensing object transforms & API cleanup (newton-physics#1759) * Remove threading workaround (newton-physics#1751) * [Warp Raytrace] Consolidated ray intersect functions, renamed Options to Config (newton-physics#1767) * Improve README example gallery for PyPI compatibility (newton-physics#1776) * Fix issue with mesh in rerun viewer (newton-physics#1768) * Add PhysxMimicJointAPI parsing to USD importer (newton-physics#1735) * Move some math functions to Warp (newton-physics#1717) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Add test to ensure MJCF xform argument is relative (newton-physics#1777) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Emit diaginertia instead of fullinertia for diagonal body inertia (newton-physics#1780) * Change default joint armature from 0.01 to 0 (newton-physics#1782) * Fix default kp/kv for position and velocity actuators (newton-physics#1786) * Lock body inertia after explicit MJCF <inertial> element (newton-physics#1784) * Fix for MJCF actuator custom attributes (newton-physics#1783) * Bump version to 0.2.3 Prepare the package metadata for the v0.2.3 release tag. * Fix ViewerRerun rendering of instances from hidden meshes (newton-physics#1788) * API cleanup (newton-physics#1789) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * BODY actuator target name bypasses body name de-duplication in SolverMuJoCo (newton-physics#1729) * Use default density for visual geoms in MJCF import (newton-physics#1781) * Fix GL viewer crash on Wayland (newton-physics#1793) * Make USD xform parameter control absolute articulation placement (newton-physics#1771) * Fix CUDA context corruption in SDF implementation (newton-physics#1792) * Bump mujoco-warp dependency to 3.5.0.2 (newton-physics#1779) * Fix MuJoCo margin/gap conversion (newton-physics#1785) * Bump version to 1.1.0.dev0 (newton-physics#1798) * Missing unittest.main added back to test_import_mjcf.py. Helps with F5 debugging in VS Code. (newton-physics#1796) * Improve H1 example (newton-physics#1801) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Fix ViewerViser.set_camera() (newton-physics#1805) * Rename examples to follow prefix-first naming convention (newton-physics#1802) * Improve MuJoCo actuator domain randomization (newton-physics#1773) * Restore in_cup test in hydro example (newton-physics#1775) * Fix `newton.geometry` imports and change of Mesh maxhullverts global constant * Adapt to having both margin and gap arrays for each geom/shape * Fix for newton.geometry API changes in primitive/narrowphase.py * Fix removal of `BroadPhaseMode` IntEnum and revert to newton-sytle string literals * WIP: Adapt geometry/unified.py to fix breaking changes to `newton.geometry` API * First pass of API adjustments * Patch more gaps (with respect to margin and gap renaming) * GeoType.SDF was removed - reflect that in Kamino * Introduce CoM position offsets w.r.t body frame and operations to convert between body CoM state and generic local body-fixed reference frames. * Add caching of per-entity labels/names/keys in the Model subcontainers * Remove SDF shape wrapper since it's now internal to mesh handling in CD pipelines * Fix USD test assets * Add Newton <--> Kamino joint type conversion operations and per-space default limit constants * Add some cleanup to geometry and unified CD + UTs * Add Newton <--> Kamino shape type conversion operations * Apply new default joint coord limit constants to limits.py * Adapt foubrar model builder and USD asset to produce the same result in sim example * Purge "physical" goems and collapse all into a single group, and purge geometry "layers" * Disable allocation per-joint wrenches by default and make them optional * Make `Model` a dataclass * Separate ModelData* containers into own `core/data.py` module * Fix imports of ModelData * Rename `Model` as `ModelKamino` * Rename `ModelData` as `DataKamino` * Rename `State` as `StateKamino` * Rename `Control` as `ControlKamino` * Rename `Limits` as `LimitsKamino` * Rename `Contacts` as `ContactsKamino` * Rename `ModelBuilder` as `ModelBuilderKamino` * Make imports in test utilities relative * Revise CD meta-data attributes and their computation in GeometryModel and ModelBuilderKamino * Revise primitive CD pipeline * Revise unified CD pipeline * Revise CD front-end interfaces * Fix UTs and relevant utils for interface changes to CD * Change to `wp.DeviceLike` to account for upcoming deprecation of `Devicelike` * Depracate legacy HDF5 data io (will be replaced in the future) * Fix banned imports at module level * Modify USD importer to detect articulations and order geoms and joints similarly to how the Newton `parse_usd` function does. * Add conversion operation from `newton.Model` to `ModelKamino` * Add data, state and control container conversions * Add SolverKamino wrapper that fullfils newton integration interface * Add newton integration examples * Add SolverKamino to newton solver module imports * WIP: fix problem with lambda_j being allocated for only kinematic constraints and failing on array copying * Fix banned git import in benchmark * Rename *Settings to *Config (#213) * Rename SolverKaminoSettings -> SolverKaminoConfig * Rename DualProblemSettings -> DualProblemConfig * Rename CollisionDetectorSettings -> CollisionDetectorConfig * Rename PADMMSettings -> PADMMConfig * Rename ForwardKinematicsSolverSettings -> ForwardKinematicsSolverConfig * Rename SimulatorSettings -> SimulatorConfig * Add check for model compatibility in SolverKamino (#209) * Fix device assignment in sparse CG test on CPU (#216) * Replace Enum-type config attributes with Literal (#215) * Replace warmstart mode config param with literal * Replace contact warmstart mode config param with literal * Replace rotation correction config param with literal * Replace penalty update config param with literal * Replace FK preconditioner option config param with literal * Add post-init checks for dual/PADMM configs * Rename FKPreconditionerOptions to FKPreconditionerType * Remove WorldDescriptor from ModelKamino (#219) * Add geom index offset array to model info * Replace access to world description in model * Remove world descriptor from model * Fix computation of kinematics residual with sparse Jacobian (#220) * Migrates `ModelKaminoSize` to it's own module to avoid circular dependency between core/model.py and core/state.py and rename it as `SizeKamino`. * WIP: Fix SolverKamino wrapper * Fix circular dependency in conversions.py * Fix some broken unit tests and WIP to fix fourbar contact conversions and rendering * Make some conversions @staticmethods instead, because they dont need common class attributes * Fix declaration of custom state attributes and their conversion to/from newton and kamino * WIP: Debug model conversion and newton sim examples * Rename and cleanup start index array of per-world geoms * Model conversion and newton sim examples now work. * Make gravity conversion operation re-usable * Migrates boxes_fourbar builder using newton.ModelBuilder to it's own module to prepare for migration. * Use gravity conversion utility func in SolverKamino * Add reusable joint-parameterization conversion utility * Remove world-descriptor from model converter * Rename helper converter that handles entity-local transforms * Add some cleanup to DR Legs, ANYmal D and basic four-bar examples * Fix module-level imports of additional kamino-specific development dependencies * Fix module-level imports of additional kamino-specific development dependencies * Fix erroneous merge conflict. --------- Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Signed-off-by: JC <jumyungc@nvidia.com> Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: Daniela Hase <116915287+daniela-hase@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> Co-authored-by: Eric Shi <97630937+shi-eric@users.noreply.github.com> Co-authored-by: Anka Chen <AnkaChan@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: JC-nvidia <116605903+jumyungc@users.noreply.github.com> Co-authored-by: Kenny Vilella <kvilella@nvidia.com> Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> Co-authored-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Lennart Röstel <65088822+lenroe@users.noreply.github.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: camevor <camevor@nvidia.com> Co-authored-by: mzamoramora-nvidia <mzamoramora@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alessandro Roncone <alecive87@gmail.com> Co-authored-by: gdaviet <57617656+gdaviet@users.noreply.github.com> Co-authored-by: Miles Macklin <mmacklin@nvidia.com> Co-authored-by: Gordon Yeoman <gyeomannvidia@users.noreply.github.com> Co-authored-by: Lukasz Wawrzyniak <lwawrzyniak@nvidia.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Lorenzo Terenzi <lorenzoterenzi96@gmail.com> Co-authored-by: smollerNV <164020096+smollerNV@users.noreply.github.com> Co-authored-by: twidmer <twidmer@nvidia.com> Co-authored-by: Christian Schumacher <christian.schumacher@disney.com> Co-authored-by: Guirec-Maloisel <25688871+Guirec-Maloisel@users.noreply.github.com>
Summary
.numpy()calls out of inner loops to reduce GPU-CPU synchronizationsetUp()tosetUpClass()in SDF compute tests to avoid redundant mesh creationDetails
Parallelization improvements (class splitting)
The test runner (
unittest-parallel) parallelizes at class level. These monolithic classes were bottlenecks:test_import_mjcf.pytest_import_usd.pytest_model.pytest_import_urdf.pyLoop count reductions
test_equality_constraintstest_rigid_contact(shapes_on_plane)test_softbody(tet_energy)test_collision_pipelineGPU-CPU sync reduction
test_collision_pipeline: hoist.numpy()out of per-contact loop in_contact_pairs()test_rigid_contact: move.numpy()from inner substep loop to outer frame loop (480 → 60 syncs)CUDA graph capture
test_heightfield: 500-step simulation looptest_sensor_contact: 480-step loops (×2 tests)test_fixed_tendon: 200-step simulation loopsetUp → setUpClass
test_sdf_compute: 4 classes moved mesh creation from per-methodsetUp()to once-per-classsetUpClass()Hydroelastic optimization
wp.arrayinstead of per-substep NumPy allocation + CPU→GPU transferTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit