Skip to content

Move Kamino tests to Newton test folder - #3807

Open
chschuma-disney wants to merge 20 commits into
newton-physics:mainfrom
chschuma-disney:chschuma/relocate-kamino-tests
Open

Move Kamino tests to Newton test folder#3807
chschuma-disney wants to merge 20 commits into
newton-physics:mainfrom
chschuma-disney:chschuma/relocate-kamino-tests

Conversation

@chschuma-disney

@chschuma-disney chschuma-disney commented Aug 5, 2026

Copy link
Copy Markdown
Member

Description

This moves most of the previously internal Kamino tests to the Newton test folder, so that they will now run during the CI pipeline.

Test files that only test functionality that is not user-facing have been left as internal Kamino tests.

The changes in this PR are mostly just a pure migration, without changes to the test setups. There seem to be no issues with integration with the Newton test scaffolding, so a basic migration seemed appropriate to unblock developers that might have changes to the test lined up or planned. Future revisions to the tests will look into adapting more of Newton's test structure (e.g., testing across devices).

Some of the changes besides pure migration:

  • Kamino has been added to a number of cross-solver tests (e.g., testing control forces, controllers, friction).
  • test_solver_kamino_dvi.py and test_solver_kamino_dvi_cuda.py have been removed, since these tests are now directly called.
  • Zero inertia warnings in some tests have been fixed.
  • Tests that expect a warning now capture and check this explicitly.
  • The "missing base body" warning has been moved to the reset/FK routines, and are now checked only if called with relevant parameters.
  • Extraneous simulations in the gimbal joint tests have been removed.
  • The Kamino Anymal example has been updated to no longer show a warning.

I tried keeping these changes clean in the commits, in case someone wants to have a look at changes besides the migration. The overall goal of most of these has been to avoid emitting output during the tests, so that we could transition to using NewtonTestCase in the future.

Performance

Performance-wise, the Kamino tests currently take ~5 minutes on my machine.

Claude also gathered the statistics of the latest 100 merges on main as a reference:

platform mean min max
windows-latest 29.0 min 26.4 34.0
ubuntu-latest 25.6 min 20.7 28.2
macos-latest 23.6 min 18.7 28.8
ubuntu-24.04-arm 13.7 min 12.8 14.5

Checklist

  • New or existing tests cover these changes
  • The documentation is up to date with these changes
  • CHANGELOG.md has been updated (if user-facing change)

Test plan

uv run --extra dev -m newton.tests -k kamino.test_kamino

This should run all new tests added to the test folder.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Expanded Kamino coverage across physics, control, contact, friction, and axis-related scenarios.
    • Improved handling of models containing worlds without an assigned base body.
    • Added shared testing utilities and derivative-checking support.
  • Bug Fixes

    • Removed unnecessary warnings for valid models without base bodies.
    • Added clear warnings when base pose or velocity inputs cannot affect certain worlds.
    • Improved contact handling in the Kamino robot example.
  • Tests

    • Expanded validation across geometry, dynamics, kinematics, resets, and solver workflows.

@chschuma-disney chschuma-disney self-assigned this Aug 5, 2026
@chschuma-disney
chschuma-disney requested a review from a team as a code owner August 5, 2026 13:26
@chschuma-disney chschuma-disney added the testing Issues that are related to unit and other types of testing label Aug 5, 2026
@chschuma-disney chschuma-disney added the kamino Issues that come up while integrating/implementing the Kamino solver label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: ec06c808-fbbd-4e2e-bd5a-fd1a5232eeb0

📥 Commits

Reviewing files that changed from the base of the PR and between 8881c40 and 1712588.

📒 Files selected for processing (6)
  • newton/_src/solvers/kamino/_src/core/conversions.py
  • newton/_src/solvers/kamino/_src/solver_kamino_impl.py
  • newton/_src/solvers/kamino/_src/solvers/fk/solver.py
  • newton/tests/kamino/test_kamino_kinematics_resets.py
  • newton/tests/kamino/test_kamino_solvers_forward_kinematics.py
  • newton/tests/kamino/utils/rand.py
🚧 Files skipped from review as they are similar to previous changes (6)
  • newton/_src/solvers/kamino/_src/solver_kamino_impl.py
  • newton/_src/solvers/kamino/_src/solvers/fk/solver.py
  • newton/_src/solvers/kamino/_src/core/conversions.py
  • newton/tests/kamino/utils/rand.py
  • newton/tests/kamino/test_kamino_kinematics_resets.py
  • newton/tests/kamino/test_kamino_solvers_forward_kinematics.py

📝 Walkthrough

Walkthrough

Kamino records worlds without assigned base bodies and warns when supplied base inputs have no effect. Shared Kamino test utilities move to newton.tests.kamino. Kamino coverage expands across physics, contacts, kinematics, and solver matrices.

Changes

Kamino solver integration

Layer / File(s) Summary
Base-body metadata and warnings
newton/_src/solvers/kamino/_src/core/*, newton/_src/solvers/kamino/_src/solver_kamino_impl.py, newton/_src/solvers/kamino/_src/solvers/fk/solver.py, newton/tests/kamino/test_kamino_core_model.py, newton/tests/kamino/test_kamino_kinematics_resets.py, newton/tests/kamino/test_kamino_solvers_forward_kinematics.py
Missing base bodies are recorded in ModelKaminoInfo. Reset and FK warn when base pose or velocity is supplied for affected worlds.
Shared Kamino test support
newton/tests/kamino/__init__.py, newton/tests/kamino/utils/*, newton/tests/kamino/test_kamino_*.py, newton/_src/solvers/kamino/tests/*
Tests use shared setup and utility paths. Finite-difference helpers, absolute imports, explicit test inertias, and warning assertions are added.
Gimbal conformance helpers
newton/tests/kamino/test_kamino_gimbal.py
Reusable D6 fixtures, device-aware rollouts, and Kamino-specific limit coverage are added.
Solver matrix and example coverage
newton/examples/kamino/example_kamino_robot_anymal_d.py, newton/tests/test_*.py
Kamino is added to shared solver test matrices. Contact data follows the active collision pipeline, and friction scenes use distinct collision groups.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: vastsoun

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: moving Kamino tests into the Newton test folder.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
newton/_src/solvers/kamino/_src/core/builder.py (2)

912-923: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Verify follower_idx = joint.bid_F does not reference an unbound joint.

follower_idx = joint.bid_F executes inside if world.has_base_joint:. In this branch, joint is never assigned. The only assignment of joint in finalize() happens in the elif branch's loop for jt_idx, joint in enumerate(self._joints[w]):, several lines below.

Python treats joint as a local variable of finalize() because it is assigned somewhere in the function body. If the first world processed by the outer loop has world.has_base_joint == True, joint has not been assigned yet on that call, and this line raises UnboundLocalError.

This line looks like it should read base_joint.bid_F (the local variable defined at line 913), not joint.bid_F.

🐛 Proposed fix
-                follower_idx = joint.bid_F  # Note: index among world bodies
+                follower_idx = base_joint.bid_F  # Note: index among world bodies
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@newton/_src/solvers/kamino/_src/core/builder.py` around lines 912 - 923, In
the world base-joint handling within finalize(), update follower_idx to read
bid_F from the already validated base_joint variable rather than the unbound
joint variable. Preserve the existing base-body compatibility check and
set-base-body behavior.

924-939: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Fix the fallback condition: it marks worlds with a valid base body as having none.

Trace the case where the unary-joint loop finds a FREE unary joint. world.set_base_body(joint.bid_F) runs at line 932, so world.has_base_body becomes True before the loop ends.

At line 936, the condition is not world.has_base_body and not has_unary_joint and world.num_bodies > 0. Because world.has_base_body is now True, not world.has_base_body is False. The whole condition is False. Execution falls to the else branch and sets has_world_without_base_body = True, even though the world has a valid base body and base joint.

Compare this with the equivalent logic in newton/_src/solvers/kamino/_src/core/conversions.py (lines 1508-1512). That version skips the fallback entirely when base_body_idx_np[wid] != -1 (checked earlier at line 1495), so it never marks a world with a valid base body as missing one.

Because of this bug, every ModelBuilderKamino-built floating-base model whose base is auto-detected through a unary free joint reports has_world_without_base_body = True. Callers of SolverKamino.reset() and ForwardKinematicsSolver.solve_fk() then get spurious "no base body assigned" warnings whenever they pass a base pose or velocity, even for correctly configured floating-base models.

None of the added tests catch this: test_kamino_core_model.py::test_05_model_conversions_base_assignment_non_floating_root exercises ModelKamino.from_newton() (the conversions.py path), not ModelBuilderKamino.finalize() directly.

🐛 Proposed fix
-                if not world.has_base_body and not has_unary_joint and world.num_bodies > 0:
-                    world.set_base_body(0)
-                else:
-                    has_world_without_base_body = True
+                if world.has_base_body:
+                    pass  # Base body/joint already assigned via a free unary joint
+                elif not has_unary_joint and world.num_bodies > 0:
+                    world.set_base_body(0)
+                else:
+                    has_world_without_base_body = True

Consider also adding a direct unit test that calls ModelBuilderKamino.finalize() on a world with a unary free joint and asserts has_world_without_base_body is False, since the current tests only cover this behavior through ModelKamino.from_newton().

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@newton/_src/solvers/kamino/_src/core/builder.py` around lines 924 - 939, Fix
the fallback and missing-base flag logic in ModelBuilderKamino.finalize around
the unary-joint detection: after a FREE unary joint assigns a base body, do not
enter the missing-base path. Only assign body 0 when no unary joint was found
and no base body exists, and set has_world_without_base_body only when the world
still lacks a base body after all valid assignments. Add a direct test covering
finalize with a unary free joint and asserting the flag remains false.
🧹 Nitpick comments (3)
newton/tests/kamino/__init__.py (1)

46-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the exported setup_tests API.

Add a Google-style docstring with Args: entries for verbose, device, and clear_cache. Add an explicit -> None return annotation.

Suggested update
-def setup_tests(verbose: bool = False, device: wp.DeviceLike | str | None = None, clear_cache: bool = False):
+def setup_tests(
+    verbose: bool = False,
+    device: wp.DeviceLike | str | None = None,
+    clear_cache: bool = False,
+) -> None:
+    """Configure the shared Kamino test runtime.
+
+    Args:
+        verbose: Enable verbose test output.
+        device: Warp device to use for tests.
+        clear_cache: Clear Warp kernel and LTO caches before testing.
+    """
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@newton/tests/kamino/__init__.py` at line 46, Update the exported setup_tests
function signature to explicitly return None and add a Google-style docstring
documenting verbose, device, and clear_cache under Args:, including each
parameter’s purpose and expected value.

Source: Coding guidelines

newton/tests/kamino/utils/diff_check.py (1)

21-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use Google-style docstrings.

Convert both docstrings from NumPy-style Parameters and Returns sections to Google-style sections. Keep type information in the annotations. Format argument entries as name: description.

As per coding guidelines, “Use Google-style docstrings, keep types in annotations rather than docstrings, and format Args: entries as name: description.”

Also applies to: 71-105

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@newton/tests/kamino/utils/diff_check.py` around lines 21 - 42, Convert the
docstrings for central_finite_differences and the additionally referenced
function around the later diff to Google style: replace NumPy-style Parameters
and Returns sections with Args and Returns, format arguments as name:
description, and remove redundant type declarations from docstrings while
preserving the existing annotations and behavior.

Source: Coding guidelines

newton/tests/kamino/test_kamino_gimbal.py (1)

101-186: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add Google-style Args: sections to the helper docstrings.

_build_fixture, _make_solver, and _run accept configuration inputs that control model construction and solver behavior. Document each parameter, including fixture_kwargs, in an Args: section.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@newton/tests/kamino/test_kamino_gimbal.py` around lines 101 - 186, Add
Google-style Args sections to the docstrings of _build_fixture, _make_solver,
and _run, documenting every parameter each helper accepts, including _run’s
fixture_kwargs and keyword-only configuration inputs. Keep the existing
summaries and accurately describe how each argument controls fixture
construction, solver selection, or rollout behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@newton/examples/kamino/example_kamino_robot_anymal_d.py`:
- Around line 88-90: Add an imperative changelog entry under the [Unreleased]
Fixed section describing the example_kamino_robot_anymal_d behavior change:
default use_kamino_contacts=True and passing None to SolverKamino.step() when
Kamino handles collision detection. Reuse an existing entry only if it clearly
covers this behavior.

In `@newton/tests/kamino/test_kamino_kinematics_resets.py`:
- Around line 583-611: Remove the leftover print(logs.output) statement from
test_06_reset_warns_without_base_body_when_base_provided; retain the existing
assertLogs capture and assertion that verifies the warning content.

---

Outside diff comments:
In `@newton/_src/solvers/kamino/_src/core/builder.py`:
- Around line 912-923: In the world base-joint handling within finalize(),
update follower_idx to read bid_F from the already validated base_joint variable
rather than the unbound joint variable. Preserve the existing base-body
compatibility check and set-base-body behavior.
- Around line 924-939: Fix the fallback and missing-base flag logic in
ModelBuilderKamino.finalize around the unary-joint detection: after a FREE unary
joint assigns a base body, do not enter the missing-base path. Only assign body
0 when no unary joint was found and no base body exists, and set
has_world_without_base_body only when the world still lacks a base body after
all valid assignments. Add a direct test covering finalize with a unary free
joint and asserting the flag remains false.

---

Nitpick comments:
In `@newton/tests/kamino/__init__.py`:
- Line 46: Update the exported setup_tests function signature to explicitly
return None and add a Google-style docstring documenting verbose, device, and
clear_cache under Args:, including each parameter’s purpose and expected value.

In `@newton/tests/kamino/test_kamino_gimbal.py`:
- Around line 101-186: Add Google-style Args sections to the docstrings of
_build_fixture, _make_solver, and _run, documenting every parameter each helper
accepts, including _run’s fixture_kwargs and keyword-only configuration inputs.
Keep the existing summaries and accurately describe how each argument controls
fixture construction, solver selection, or rollout behavior.

In `@newton/tests/kamino/utils/diff_check.py`:
- Around line 21-42: Convert the docstrings for central_finite_differences and
the additionally referenced function around the later diff to Google style:
replace NumPy-style Parameters and Returns sections with Args and Returns,
format arguments as name: description, and remove redundant type declarations
from docstrings while preserving the existing annotations and behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e579e4c-5bd2-4adf-a8c3-719f23e0c03d

📥 Commits

Reviewing files that changed from the base of the PR and between 238c2f6 and 22f9e5d.

📒 Files selected for processing (68)
  • newton/_src/solvers/kamino/_src/core/builder.py
  • newton/_src/solvers/kamino/_src/core/conversions.py
  • newton/_src/solvers/kamino/_src/core/model.py
  • newton/_src/solvers/kamino/_src/solver_kamino_impl.py
  • newton/_src/solvers/kamino/_src/solvers/fk/solver.py
  • newton/_src/solvers/kamino/tests/test_utils_io_usd.py
  • newton/_src/solvers/kamino/tests/test_utils_random.py
  • newton/examples/kamino/example_kamino_robot_anymal_d.py
  • newton/tests/kamino/__init__.py
  • newton/tests/kamino/test_kamino_core_geometry.py
  • newton/tests/kamino/test_kamino_core_joints.py
  • newton/tests/kamino/test_kamino_core_materials.py
  • newton/tests/kamino/test_kamino_core_model.py
  • newton/tests/kamino/test_kamino_core_shapes.py
  • newton/tests/kamino/test_kamino_core_types.py
  • newton/tests/kamino/test_kamino_core_world.py
  • newton/tests/kamino/test_kamino_dynamics_delassus.py
  • newton/tests/kamino/test_kamino_dynamics_dual.py
  • newton/tests/kamino/test_kamino_dynamics_wrenches.py
  • newton/tests/kamino/test_kamino_geometry_aggregation.py
  • newton/tests/kamino/test_kamino_geometry_contacts.py
  • newton/tests/kamino/test_kamino_geometry_detector.py
  • newton/tests/kamino/test_kamino_geometry_keying.py
  • newton/tests/kamino/test_kamino_geometry_margin_gap.py
  • newton/tests/kamino/test_kamino_geometry_mesh_heightfield.py
  • newton/tests/kamino/test_kamino_geometry_primitive.py
  • newton/tests/kamino/test_kamino_geometry_unified.py
  • newton/tests/kamino/test_kamino_gimbal.py
  • newton/tests/kamino/test_kamino_kinematics_constraints.py
  • newton/tests/kamino/test_kamino_kinematics_jacobians.py
  • newton/tests/kamino/test_kamino_kinematics_joints.py
  • newton/tests/kamino/test_kamino_kinematics_limits.py
  • newton/tests/kamino/test_kamino_kinematics_resets.py
  • newton/tests/kamino/test_kamino_linalg_conjugate_fused.py
  • newton/tests/kamino/test_kamino_linalg_core.py
  • newton/tests/kamino/test_kamino_linalg_factorize_llt_blocked.py
  • newton/tests/kamino/test_kamino_linalg_factorize_llt_sequential.py
  • newton/tests/kamino/test_kamino_linalg_solve_cg.py
  • newton/tests/kamino/test_kamino_linalg_solver_llt_blocked.py
  • newton/tests/kamino/test_kamino_linalg_solver_llt_blocked_rcm.py
  • newton/tests/kamino/test_kamino_linalg_solver_llt_sequential.py
  • newton/tests/kamino/test_kamino_linalg_sparse.py
  • newton/tests/kamino/test_kamino_solver_kamino.py
  • newton/tests/kamino/test_kamino_solver_kamino_joint_frames.py
  • newton/tests/kamino/test_kamino_solver_kamino_notify.py
  • newton/tests/kamino/test_kamino_solvers_dvi.py
  • newton/tests/kamino/test_kamino_solvers_forward_kinematics.py
  • newton/tests/kamino/test_kamino_solvers_metrics.py
  • newton/tests/kamino/test_kamino_solvers_padmm.py
  • newton/tests/kamino/test_kamino_utils_world_equivalence.py
  • newton/tests/kamino/utils/__init__.py
  • newton/tests/kamino/utils/checks.py
  • newton/tests/kamino/utils/diff_check.py
  • newton/tests/kamino/utils/extract.py
  • newton/tests/kamino/utils/joints.py
  • newton/tests/kamino/utils/make.py
  • newton/tests/kamino/utils/print.py
  • newton/tests/kamino/utils/rand.py
  • newton/tests/kamino/utils/sampling.py
  • newton/tests/test_body_velocity.py
  • newton/tests/test_control_force.py
  • newton/tests/test_joint_controllers.py
  • newton/tests/test_physics_verification.py
  • newton/tests/test_rigid_contact.py
  • newton/tests/test_rigid_friction_ramp.py
  • newton/tests/test_solver_kamino_dvi.py
  • newton/tests/test_solver_kamino_dvi_cuda.py
  • newton/tests/test_up_axis.py
💤 Files with no reviewable changes (2)
  • newton/tests/test_solver_kamino_dvi_cuda.py
  • newton/tests/test_solver_kamino_dvi.py

Comment thread newton/examples/kamino/example_kamino_robot_anymal_d.py
Comment thread newton/tests/kamino/test_kamino_kinematics_resets.py
@chschuma-disney
chschuma-disney force-pushed the chschuma/relocate-kamino-tests branch from 22f9e5d to cf87212 Compare August 5, 2026 13:47
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
4251 4 4247 663
View the top 3 failed test(s) by shortest run time
TestSoftBody::test_tet_energy_cpu
Stack Traces | 0.563s run time
Traceback (most recent call last):
  File ".../newton/tests/unittest_utils.py", line 536, in test_func
    func(self, device, **kwargs)
  File ".../newton/tests/test_softbody.py", line 469, in test_tet_energy
    test.assertTrue(force_autodiff_comparison.all())
AssertionError: np.False_ is not true

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../newton/tests/unittest_utils.py", line 535, in test_func
    with CheckOutput(self):
         ^^^^^^^^^^^^^^^^^
  File ".../newton/tests/unittest_utils.py", line 273, in __exit__
    self.test.fail(f"Unexpected output:\n'{s.rstrip()}'")
AssertionError: Unexpected output:
'Module test_softbody cc7a7af load on device 'cpu' took 544.55 ms  (compiled)

=== Autodiff Force vs Analytical Force Mismatch ===
autodiff force:
 [[-0. -0. -0.]
 [-0. -0. -0.]
 [-0. -0. -0.]
 [-0. -0. -0.]]

analytical force:
 [[ 0.00647112  -0.005136326  0.119829774]
 [-0.6973517   -0.50548065  -0.03293482 ]
 [ 0.27333298   0.2117629   -0.27886847 ]
 [ 0.41754764   0.29885402   0.19197349 ]]

difference:
 [[-0.00647112   0.005136326 -0.119829774]
 [ 0.6973517    0.50548065   0.03293482 ]
 [-0.27333298  -0.2117629    0.27886847 ]
 [-0.41754764  -0.29885402  -0.19197349 ]]'
TestJointBodyStateConversions::test_01_reset_joint_states_from_body_state
Stack Traces | 1.82s run time
Traceback (most recent call last):
  File ".../tests/kamino/test_kamino_kinematics_resets.py", line 647, in test_01_reset_joint_states_from_body_state
    data = set_model_to_random_pose(self, model, rng)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../tests/kamino/test_kamino_kinematics_resets.py", line 354, in set_model_to_random_pose
    np.testing.assert_allclose(data.joints.dr_j.numpy(), 0.0, rtol=0, atol=atol)
  File ".../newton/newton/.venv/lib/python3.12.../testing/_private/utils.py", line 1780, in assert_allclose
    assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
  File ".../newton/newton/.venv/lib/python3.12.../testing/_private/utils.py", line 852, in assert_array_compare
    flagged = func_assert_same_pos(x, y, func=isnan, hasval='nan')
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../newton/newton/.venv/lib/python3.12.../testing/_private/utils.py", line 795, in func_assert_same_pos
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=0, atol=1e-05

nan location mismatch:
 ACTUAL: array([-0.,  0., -0.,  0., -0.,  0., -0., nan, nan, nan, nan, nan, nan,  0.,  0., -0.,  0.,  0.,  0., -0.,  0.,  0., -0.,  0., -0., -0., -0., -0., -0.,  0.], dtype=float32)
 DESIRED: array(0.)
TestLinAlgLLTBlockedRCMSolver::test_04_multiple_problems_dims_partially_active
Stack Traces | 2.35s run time
Traceback (most recent call last):
  File ".../tests/kamino/test_kamino_linalg_solver_llt_blocked_rcm.py", line 721, in test_04_multiple_problems_dims_partially_active
    self.assertTrue(is_A_close)
AssertionError: False is not true
View the full list of 1 ❄️ flaky test(s)
unittest_parallel::parallel_timeout

Flake rate in main: 100.00% (Passed 0 times, Failed 7 times)

Stack Traces | 3300s run time
Parallel test run exceeded timeout of 3300 seconds while waiting for worker results. Increase --parallel-timeout or reduce the test workload.

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Comment thread newton/_src/solvers/kamino/_src/core/conversions.py Outdated
# Host-side Metadata
###

has_world_without_base_body: bool = False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should use an underscore prefix here (_has_world_without_base_body) to indicate that it's an internal flag? Or do we expect users to read this somewhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd argue it's more consistent without the underscore. The attribute is not internal to the class, in fact it's only accessed from outside the class. And the whole Kamino model class is never exposed to the user, so there is no expectation that this will be read (by a regular user).

) and self._model.info.has_world_without_base_body:
msg.warning(
"Some worlds have no base body assigned (empty world or non-free articulation root). "
"Base resets and FK base handling will have no effect for those worlds."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested small reformulations:
"Some worlds have no base body assigned (possibly due to articulation roots not being free joints, e.g. fixed-base systems)."
"Base pose/velocity resets will have no effect for those worlds."

I'd also suggest moving this a bit higher after other validations (length checks etc) since it only reads the config.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking back above I see that the point was having the same warning for FK and the general reset, so up to you. But it could still make sense to have the messages similar, but more explicit about whether it's the resets (that could also be a pure base reset without FK), or the FK solver (which a user could also call in isolation).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update these, let me know if you think these are good now.

Comment thread newton/tests/kamino/test_kamino_solvers_forward_kinematics.py Outdated
return builder.finalize(device="cpu"), d6


@dataclass(frozen=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't fully get what this commit is doing, it seems that the code is moved within the same file rather than removed. Could you clarify what the removed unnecessary computations are then?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The differences are somewhat hidden by moving around the code. Basically, test_limits used to also run a simulation for MJWarp, but never actually compared anything between Kamino and MJWarp. I removed the MJWarp simulation and moved the test to TestGimbal, so it also runs on CPU and the split in tests is clearer. I moved the existing helper code to clean up the file structure.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@newton/tests/kamino/test_kamino_gimbal.py`:
- Around line 236-243: Add concise triple-double-quoted imperative docstrings to
the lifecycle methods TestGimbal.setUp, TestGimbal.tearDown, and
TestGimbalMJWarp.setUp, preserving their existing setup and teardown behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8abad1a7-3f3c-4038-8bbe-5d9b9de0ec51

📥 Commits

Reviewing files that changed from the base of the PR and between cf87212 and 8881c40.

📒 Files selected for processing (5)
  • newton/examples/kamino/example_kamino_robot_anymal_d.py
  • newton/tests/kamino/test_kamino_geometry_unified.py
  • newton/tests/kamino/test_kamino_gimbal.py
  • newton/tests/kamino/test_kamino_solvers_forward_kinematics.py
  • newton/tests/test_physics_verification.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • newton/examples/kamino/example_kamino_robot_anymal_d.py
  • newton/tests/kamino/test_kamino_geometry_unified.py
  • newton/tests/test_physics_verification.py
  • newton/tests/kamino/test_kamino_solvers_forward_kinematics.py

Comment thread newton/tests/kamino/test_kamino_gimbal.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kamino Issues that come up while integrating/implementing the Kamino solver testing Issues that are related to unit and other types of testing

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[BUG] Intermittent velocity pops in standing Anymal D under SolverKamino cause flaky example test

2 participants