Fix device for gravity data allocation in Kamino#2823
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR updates the gravity model output validation in the Kamino solver to correctly handle ChangesGravity Model Array Shape and Device Allocation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Pull request overview
Fixes Kamino gravity model updates so that reallocated Warp arrays are created on the same device as the source Newton model, and corrects the shape check that previously forced unnecessary reallocations during runtime gravity updates. Adds SolverKamino to the existing Newton runtime gravity test matrix to cover this regression.
Changes:
- Fix
convert_model_gravity()to (1) validate Warp array shape correctly forvec4farrays and (2) allocate replacement arrays onmodel_in.device. - Extend
test_runtime_gravity.pysolver matrix to includeSolverKaminofor body-based runtime gravity tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
newton/_src/solvers/kamino/_src/core/gravity.py |
Corrects shape checks for vec4f Warp arrays and ensures reallocations happen on model_in.device during in-place updates. |
newton/tests/test_runtime_gravity.py |
Adds SolverKamino to the existing runtime gravity body-solver test combinations to exercise the runtime update path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
vastsoun
left a comment
There was a problem hiding this comment.
LGTM, thanks @chschuma-disney
4abbb78 to
c6160e3
Compare
Bumps the Newton pin from v1.2.0rc2 (current develop) directly to the v1.2.0 stable release across all five pin sites (isaaclab_newton, isaaclab_physx, isaaclab_visualizers x3, tools/wheel_builder/res/python_packages.toml), keeping the canonical `newton[sim] @ git+...` form everywhere. The full upstream release notes are at https://github.com/newton-physics/newton/releases/tag/v1.2.0 (published 2026-05-12). IsaacLab-relevant changes vs the rc2 pin: - MPR/GJK convex-hull centering fix (newton-physics/newton#2651) - Kamino FK solver performance (newton-physics/newton#2703) - HDR color output for tiled camera sensors (newton-physics/newton#2721) - Collada texture URDF import fix (newton-physics/newton#2743) - Kamino multi-GPU gravity-data device fix (newton-physics/newton#2823) - CollisionPipeline small fixes (newton-physics/newton#2632) - DelassusOperator attribute refactor (newton-physics/newton#2734) -- not used in IsaacLab source, no adapt needed. - SolverMuJoCo fixes: planar meshes, contact-anchor computation, distance conversion. mjwarp moves 3.8.0.1 -> 3.8.0.3 transitively via newton[sim]; no IsaacLab-side mujoco / mujoco-warp pin change since isaac-sim#5566 dropped explicit pins.
Bumps the Newton pin from v1.2.0rc2 (current develop) directly to the v1.2.0 stable release across all five pin sites (isaaclab_newton, isaaclab_physx, isaaclab_visualizers x3, tools/wheel_builder/res/python_packages.toml), keeping the canonical `newton[sim] @ git+...` form everywhere. The full upstream release notes are at https://github.com/newton-physics/newton/releases/tag/v1.2.0 (published 2026-05-12). IsaacLab-relevant changes vs the rc2 pin: - MPR/GJK convex-hull centering fix (newton-physics/newton#2651) - Kamino FK solver performance (newton-physics/newton#2703) - HDR color output for tiled camera sensors (newton-physics/newton#2721) - Collada texture URDF import fix (newton-physics/newton#2743) - Kamino multi-GPU gravity-data device fix (newton-physics/newton#2823) - CollisionPipeline small fixes (newton-physics/newton#2632) - DelassusOperator attribute refactor (newton-physics/newton#2734) -- not used in IsaacLab source, no adapt needed. - SolverMuJoCo fixes: planar meshes, contact-anchor computation, distance conversion. mjwarp moves 3.8.0.1 -> 3.8.0.3 transitively via newton[sim]; no IsaacLab-side mujoco / mujoco-warp pin change since isaac-sim#5566 dropped explicit pins.
## Summary Bumps the Newton pin from `v1.2.0rc2` (current develop) directly to the [`v1.2.0` stable release](https://github.com/newton-physics/newton/releases/tag/v1.2.0) across all five pin sites, keeping the canonical `newton[sim] @ git+...` form everywhere. Per Kelly Guo's suggestion: skip the rc bump and go straight to stable. Upstream published `v1.2.0` on 2026-05-12. **Alternative**: [#5614](#5614) (rc3 bump) — pick whichever target based on CI signal. This one is the most forward target. > Branch is still named `jichuanh/newton-1.2.0rc4-bump` from when this PR was originally proposing rc4 — the branch name doesn't match the current target but the diff is correct. Force-pushing the rename would close/reopen the PR, which adds noise without changing the artifact. ## What's new in Newton v1.2.0 vs v1.2.0rc2 Full release notes: [newton-physics/newton release v1.2.0](https://github.com/newton-physics/newton/releases/tag/v1.2.0). Notable IsaacLab-relevant fixes: - [newton-physics/newton#2651](newton-physics/newton#2651) — MPR/GJK no longer assumes convex hulls are centered around the origin. - [newton-physics/newton#2703](newton-physics/newton#2703) — Kamino FK solver performance. - [newton-physics/newton#2721](newton-physics/newton#2721) — HDR color output for tiled camera sensors. - [newton-physics/newton#2743](newton-physics/newton#2743) — Collada textures in URDF import. - [newton-physics/newton#2823](newton-physics/newton#2823) — Gravity-data device allocation in Kamino (multi-GPU). - [newton-physics/newton#2632](newton-physics/newton#2632) — CollisionPipeline small fixes. - [newton-physics/newton#2734](newton-physics/newton#2734) — `DelassusOperator` attribute refactor. Not used in IsaacLab source today (verified by grep), no adapt needed. - SolverMuJoCo fixes: planar meshes, contact-anchor computation, distance conversion. ## Required dep bumps None on the IsaacLab side. The `mjwarp 3.8.0.1 → 3.8.0.3` bump flows in transitively through `newton[sim]`, since [#5566](#5566) dropped IsaacLab's explicit `mujoco` / `mujoco-warp` pins. `warp-lang` stays at `1.13.0` (set by [#5523](#5523)). ## Pins updated | File | Change | |---|---| | `source/isaaclab_newton/setup.py` | `v1.2.0rc2` → `v1.2.0` | | `source/isaaclab_physx/setup.py` | `v1.2.0rc2` → `v1.2.0` | | `source/isaaclab_visualizers/setup.py` | 3× `v1.2.0rc2` → `v1.2.0` | | `tools/wheel_builder/res/python_packages.toml` | `v1.2.0rc2` → `v1.2.0` | ## Test plan - [x] Pre-commit clean. - [ ] CI smoke verifies clean install picks up `newton 1.2.0` and downstream `mjwarp 3.8.0.3`.
## Summary Bumps the Newton pin from `v1.2.0rc2` (current develop) directly to the [`v1.2.0` stable release](https://github.com/newton-physics/newton/releases/tag/v1.2.0) across all five pin sites, keeping the canonical `newton[sim] @ git+...` form everywhere. Per Kelly Guo's suggestion: skip the rc bump and go straight to stable. Upstream published `v1.2.0` on 2026-05-12. **Alternative**: [isaac-sim#5614](isaac-sim#5614) (rc3 bump) — pick whichever target based on CI signal. This one is the most forward target. > Branch is still named `jichuanh/newton-1.2.0rc4-bump` from when this PR was originally proposing rc4 — the branch name doesn't match the current target but the diff is correct. Force-pushing the rename would close/reopen the PR, which adds noise without changing the artifact. ## What's new in Newton v1.2.0 vs v1.2.0rc2 Full release notes: [newton-physics/newton release v1.2.0](https://github.com/newton-physics/newton/releases/tag/v1.2.0). Notable IsaacLab-relevant fixes: - [newton-physics/newton#2651](newton-physics/newton#2651) — MPR/GJK no longer assumes convex hulls are centered around the origin. - [newton-physics/newton#2703](newton-physics/newton#2703) — Kamino FK solver performance. - [newton-physics/newton#2721](newton-physics/newton#2721) — HDR color output for tiled camera sensors. - [newton-physics/newton#2743](newton-physics/newton#2743) — Collada textures in URDF import. - [newton-physics/newton#2823](newton-physics/newton#2823) — Gravity-data device allocation in Kamino (multi-GPU). - [newton-physics/newton#2632](newton-physics/newton#2632) — CollisionPipeline small fixes. - [newton-physics/newton#2734](newton-physics/newton#2734) — `DelassusOperator` attribute refactor. Not used in IsaacLab source today (verified by grep), no adapt needed. - SolverMuJoCo fixes: planar meshes, contact-anchor computation, distance conversion. ## Required dep bumps None on the IsaacLab side. The `mjwarp 3.8.0.1 → 3.8.0.3` bump flows in transitively through `newton[sim]`, since [isaac-sim#5566](isaac-sim#5566) dropped IsaacLab's explicit `mujoco` / `mujoco-warp` pins. `warp-lang` stays at `1.13.0` (set by [isaac-sim#5523](isaac-sim#5523)). ## Pins updated | File | Change | |---|---| | `source/isaaclab_newton/setup.py` | `v1.2.0rc2` → `v1.2.0` | | `source/isaaclab_physx/setup.py` | `v1.2.0rc2` → `v1.2.0` | | `source/isaaclab_visualizers/setup.py` | 3× `v1.2.0rc2` → `v1.2.0` | | `tools/wheel_builder/res/python_packages.toml` | `v1.2.0rc2` → `v1.2.0` | ## Test plan - [x] Pre-commit clean. - [ ] CI smoke verifies clean install picks up `newton 1.2.0` and downstream `mjwarp 3.8.0.3`.
Description
When converting gravity from a Newton model to Kamino's gravity data structure, a specific code path failed to allocate new warp arrays on the same device the model data lives, instead allocating it on the default device. This specific case generally happens when an existing gravity data structure is updated, e.g., as a reaction to the solver being notified about an update to the gravity values.
At the same time, an issue with the size check of the existing array was addressed. The issue lead to a new array being allocated with every change, even if the size was compatible with the new gravity data.
To simplify the testing and in anticipation of the test migration, I added Kamino to the existing Newton gravity tests, instead of creating a new test in Kamino.
Checklist
CHANGELOG.mdhas been updated (if user-facing change)Test plan
Bug fix
Steps to reproduce:
test_runtime_gravity.pyuv run --extra dev -m newton.tests -k test_runtime_gravitySummary by CodeRabbit
Tests
Bug Fixes