Small fixes for the CollisionPipeline#2632
Conversation
…allow to user control more collision buffer sizes (relevant for very big scenes)
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughContact matching tie-breaks now use the low 32 bits of per-contact sort keys instead of thread IDs; CollisionPipeline gained a ChangesContact matching (deterministic tie-break and resolve)
Collision pipeline & sizing
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
newton/tests/test_collision_pipeline.py (1)
1403-1408: Align test name with actual run length.At Line 1407,
num_frames = 100conflicts withtest_deterministic_pipeline_sticky_500_steps; consider renaming or restoring 500 frames for clarity.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_collision_pipeline.py` around lines 1403 - 1408, The test function named test_deterministic_pipeline_sticky_500_steps is setting num_frames = 100 which makes the name misleading; either rename the test to reflect 100 frames or restore the loop to 500 frames by changing num_frames to 500 in the same test function (look for the variable num_frames and the function name test_deterministic_pipeline_sticky_500_steps) so the test name and actual run length match.
🤖 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_collision_pipeline.py`:
- Line 1363: Replace the private Sphinx target
":mod:`newton._src.geometry.contact_match`" in the docstring with a public API
reference or plain inline code; specifically change it to a public module
cross-reference like ":mod:`newton.geometry.contact_match`" or use inline code
"newton.geometry.contact_match" so the docstring no longer references the
private newton._src path.
---
Nitpick comments:
In `@newton/tests/test_collision_pipeline.py`:
- Around line 1403-1408: The test function named
test_deterministic_pipeline_sticky_500_steps is setting num_frames = 100 which
makes the name misleading; either rename the test to reflect 100 frames or
restore the loop to 500 frames by changing num_frames to 500 in the same test
function (look for the variable num_frames and the function name
test_deterministic_pipeline_sticky_500_steps) so the test name and actual run
length match.
🪄 Autofix (Beta)
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
Run ID: d8b96af9-d840-4328-9faf-f4ebb37349f1
📒 Files selected for processing (1)
newton/tests/test_collision_pipeline.py
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
adenzler-nvidia
left a comment
There was a problem hiding this comment.
Thanks for picking this up. The sticky-determinism fix is well-targeted and the regression test (two parallel pipelines, sticky on, identical state) is the right shape. The shape_pairs_max knob addresses a real multi-GB allocation issue on large SAP scenes.
A few questions inline — none blocking.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
newton/_src/geometry/contact_match.py (1)
177-191:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftDuplicate low-32 keys can still leave multiple winners on one previous contact.
The updated docstring already notes that the reduced-contact path can produce two contacts in the same shape pair with the same fingerprint-derived
sort_sub_key. In that case, pass 2 now keeps both claimants alive because it only checkswinner_key_low == my_key_low, even though only one packed claim actually wonatomic_min. That breaks the injective new→prev mapping sticky replay assumes and is a worse failure mode than the upstream sort merely having an unstable order for equal keys.Also applies to: 364-366
🧹 Nitpick comments (1)
newton/_src/sim/collide.py (1)
501-553: ⚡ Quick winFail fast when
shape_pairs_maxis unsupported on the selected construction path.Right now a non-
Noneshape_pairs_maxis accepted even though the expert-component branch and the"explicit"branch ignore it. Since this knob exists specifically to control VRAM, silently accepting a no-op value is easy to miss and can leave callers with the full allocation they were trying to avoid. RaisingValueErrorhere would make misconfiguration obvious.♻️ Suggested guard
using_expert_components = broad_phase_instance is not None or narrow_phase is not None + resolved_mode = mode_from_broad_phase if mode_from_broad_phase is not None else "explicit" + if shape_pairs_max is not None and (using_expert_components or resolved_mode == "explicit"): + raise ValueError( + "shape_pairs_max is only supported for broad_phase='nxn'/'sap' when " + "CollisionPipeline constructs its own broad/narrow phase components" + ) if using_expert_components: @@ - self.broad_phase_mode = mode_from_broad_phase if mode_from_broad_phase is not None else "explicit" + self.broad_phase_mode = resolved_modeAlso applies to: 650-709
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/sim/collide.py` around lines 501 - 553, If shape_pairs_max is provided but will be ignored on the selected construction path, raise a ValueError instead of silently accepting it: in the CollisionPipeline initializer (parameters shape_pairs_max, broad_phase, narrow_phase) detect when shape_pairs_max is not None and the chosen path ignores it (e.g. broad_phase == "explicit" or when an expert prebuilt narrow_phase is supplied) and raise ValueError with a clear message; apply the same guard in the other construction branch handling the same parameters (the alternative initializer area around the 650-709 diff) so callers fail fast when they pass a no-op shape_pairs_max.
🤖 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/_src/sim/collide.py`:
- Around line 501-553: If shape_pairs_max is provided but will be ignored on the
selected construction path, raise a ValueError instead of silently accepting it:
in the CollisionPipeline initializer (parameters shape_pairs_max, broad_phase,
narrow_phase) detect when shape_pairs_max is not None and the chosen path
ignores it (e.g. broad_phase == "explicit" or when an expert prebuilt
narrow_phase is supplied) and raise ValueError with a clear message; apply the
same guard in the other construction branch handling the same parameters (the
alternative initializer area around the 650-709 diff) so callers fail fast when
they pass a no-op shape_pairs_max.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 3f9f9d51-b330-4bc7-b5ec-f16309ff2cb4
📒 Files selected for processing (3)
CHANGELOG.mdnewton/_src/geometry/contact_match.pynewton/_src/sim/collide.py
✅ Files skipped from review due to trivial changes (1)
- CHANGELOG.md
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
Fix non-determinism when sticky mode is used in contact matching and allow to user control more collision buffer sizes (relevant for very big scenes)
Checklist
CHANGELOG.mdhas been updated (if user-facing change)Summary by CodeRabbit
New Features
Bug Fixes
Tests