Repository navigation
Align explicit Newton contact capacity before solver construction - #8957
Conversation
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummarySets an explicit
Reviews (1) · Last reviewed commit: "Align explicit Newton contact capacity b..." · Reviewed by Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Implementation (1), Test quality (1). Other reviewed categories look good.
- PR description: Clarify that Kamino previously overrode model.rigid_contact_max, remove the unrelated PR references, and include the exact pytest command so the stated 52-test validation is reproducible.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: KaminoSolver.build checks against None although zero is the documented unset model capacity, causing valid configurations to fail; compare only positive existing capacities.
- Style consistency: Style consistency looks good.
- Test quality: The capacity-ordering regression is correctly placed, but the direct KaminoSolver.build test is outside its owner file; move it beside existing Kamino rejection coverage in test_newton_solvers.py.
Significant concerns. Posted 2 inline findings.
Automated review; human maintainers own approval decisions.
| if cfg.max_contacts_per_world is not None: | ||
| model.rigid_contact_max = int(cfg.max_contacts_per_world) * model.world_count | ||
| contact_max = int(cfg.max_contacts_per_world) * model.world_count | ||
| if model.rigid_contact_max is not None and model.rigid_contact_max != contact_max: |
There was a problem hiding this comment.
🔴 Critical · Implementation — Conflict guard uses wrong unset sentinel
newton_collision_cfg.py documents the model value as resolved via model.rigid_contact_max > 0, i.e. an int unset at 0, so this guard fires for every default model. Compare > 0 instead of is not None.
There was a problem hiding this comment.
seems like a valid point?
| backend.init_solver() | ||
|
|
||
|
|
||
| def test_kamino_rejects_conflicting_contact_capacities(): |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Kamino test belongs in solver file
This exercises KaminoSolver.build only, not NewtonManager or NewtonBackend, contradicting the file docstring. test_newton_solvers.py already owns Kamino config rejection beside test_kamino_rejects_incompatible_settings; move it there.
## Description Use Newton's `CONTACT_F` solver observables for Isaac Lab contact sensors with MuJoCo, XPBD, VBD, Kamino, and Steel. The backend allocates the solver output when a contact sensor is registered, requests it on the final solver substep of the environment step, and passes it to the sensor. Native collision detectors receive a `Contacts` buffer for observable contact indexing. Late sensor registration invalidates captured step graphs. Newton deprecated `Contacts.force` and `solver.update_contacts()` in version 1.7. Isaac Lab no longer uses that path for contact sensors. Featherstone and implicit MPM do not provide `CONTACT_F` in the pinned Newton version, so contact-sensor registration reports that limitation directly. The changelog fragment records this until Newton adds support. This PR contains no Steel solver or task presets and no contact-capacity change. [#8940](#8940) adds Steel; [#8957](#8957) independently aligns explicit contact capacity. ## Base Rebased on `main` at `bb4d9915f`, which includes [#8953](#8953) (Newton 1.9 and MuJoCo/MuJoCo Warp 3.17) and [#8946](#8946) (Newton manager redesign). The solver observable changes use the new instance-based solver interface. ## Validation - On `bb4d9915f`: the Newton manager, Newton solver, and contact-sensor test files passed with 119 passed and 3 existing skips. Resting-contact cases cover both MuJoCo collision paths, XPBD, VBD, and Kamino with both collision paths. - Pre-commit hooks, changelog gate, and diff whitespace checks passed. - Follow-up `90e1f74d9`: 4 coupled-solver runtime tests and 56 Newton manager tests passed locally. [Activated Docker + Tests CI](https://github.com/isaac-sim/IsaacLab/actions/runs/42301974155) passed, including `isaaclab_assets` and contrib environments.
| f"Newton deterministic mode {mode.name} is not supported by {type(solver_cfg).__name__}." | ||
| " Use MJWarp on the GPU, XPBD, or Featherstone, or disable deterministic mode." | ||
| ) | ||
| if self.cfg.collision_cfg is not None and (contact_max := self.cfg.collision_cfg.rigid_contact_max) is not None: |
There was a problem hiding this comment.
can this also depend on the per world contact budget?
There was a problem hiding this comment.
i feel like we should just expose the same cfg from newton
|
run-ci |
8e2682c to
2431cf9
Compare
# Description Add Newton Steel as a solver in the shared Newton backend and expose `presets=newton_steel` across supported Isaac Lab task families. Steel uses point friction by default, the shared Newton manager, and one owner for each task family preset. This branch is rebased onto upstream `main` at `d4be26397`. The Steel presets include the tuned settings from contributor PR [#12](ooctipus#12). Franka Reach and Drawer select the driven PhysX USD variant. ## Dependencies - [PR #8953](#8953) updates Newton to 1.9 and MuJoCo/MuJoCo Warp to 3.17. Dependency pins, the lockfile, wheel overrides, the actuator compatibility fix, and the MPM rendering reference are there. - [PR #8954](#8954) migrates contact sensors for Steel, MuJoCo, XPBD, VBD, and Kamino to Newton solver observables. - [PR #8957](#8957) aligns explicit contact capacity before solver construction. PRs #8953 and #8954 are merged into `main`. PR #8957 is still open and remains a dependency for explicit contact-capacity alignment. The benchmark table below was collected before the Newton Manager redesign and is retained as historical data, not as a current-revision performance claim. ## Historical benchmark: Steel point friction vs MJWarp All 42 Steel-configured task families were benchmarked sequentially on RTX 5090 GPU 0. The original 16,384-environment pairs used point-friction runtime code at `8b8799c40`. Steel rows affected by the driven Franka USD variant or the default solver tuning were rerun with the final integration settings; their MJWarp rows are unchanged. The SO101 row was rerun after #8954's contact-observable migration, before the Newton Manager redesign merged into `main`. The other rows predate that migration and should be read as a baseline, not current-code measurements. The measurements include the dependency versions in #8953: official Newton `7f0c13af6e4d` and MuJoCo/MuJoCo Warp 3.17. Steel uses `friction_anchor_beta=0.0`. - 41 task pairs completed at **16,384 environments**. Both SO101 solvers ran out of GPU memory there, so SO101 was rerun at its configured default of **4,096 environments**; both completed. - In that earlier run, Steel was faster on **28 of 39** pairs without MJWarp line-search warnings at 16,384 environments. The historical geometric mean Steel/MJWarp ratio was **1.31×** (median **1.12×**). - Two 16,384-environment pairs emitted MJWarp line-search warnings; their numbers are shown but excluded from that summary. SO101 uses 4,096 environments and is also outside the 16,384-environment summary. - After #8954's migration on the earlier base, SO101 measured 172,477 aggregate steps/s with Steel and 135,059 with MJWarp on GPU 0. Earlier Steel reruns ranged from 157,878 to 172,872 aggregate steps/s. GPU process checks detected brief unrelated startup overlap on one earlier rerun; per-step contention was not continuously measured. The shared runtime uses Isaac Sim 6.1, while the repository lock targets 6.2. The SO101 task packs 108 keyboard joints into one Newton articulation per environment. Its default Steel preset keeps two substeps. On the earlier combined code with #8954, Steel took 23.7 ms per full `env.step()` call at 4,096 environments; MJWarp took 30.3 ms in its paired rerun. Each result is one 100-call run. These timings have not been repeated after the Newton Manager redesign on current `main`. ### What the numbers mean We timed **100 full `env.step()` calls** after 20 warmup calls. The table shows the **total environment steps per second across all environments**: environments × 100 ÷ the combined host wall time of those calls. Higher is better. This includes work inside `env.step()`, not just the physics solver. GPU completion is not synchronized at every call. ### Default Steel tuning The tuned solver settings from contributor PR #12 are selected by `presets=newton_steel`. The measurements below were taken before this rebase; the tuning improves some tasks and reduces throughput on others in that earlier run. ### Historical result table (`presets=newton_steel`) | Task | Envs | Steel aggregate env steps/s | MJWarp aggregate env steps/s | Steel / MJWarp | Note | |---|---:|---:|---:|---:|---| | Isaac-Ant | 16,384 | 5,318,029 | 2,626,845 | 2.02× | | | Isaac-Ant-Direct | 16,384 | 6,559,093 | 5,599,628 | 1.17× | | | Isaac-Cartpole | 16,384 | 9,422,295 | 8,633,389 | 1.09× | | | Isaac-Cartpole-Camera | 16,384 | 970,962 | 938,307 | 1.03× | | | Isaac-Cartpole-Camera-Direct | 16,384 | 1,014,796 | 987,499 | 1.03× | | | Isaac-Cartpole-Direct | 16,384 | 10,603,728 | 11,049,601 | 0.96× | | | Isaac-Humanoid | 16,384 | 1,716,377 | 1,381,116 | 1.24× | | | Isaac-Humanoid-Direct | 16,384 | 1,889,483 | 1,567,169 | 1.21× | | | Isaac-Lift-Franka | 16,384 | 761,653 | 723,584 | 1.05× | | | Isaac-Lift-KukaAllegro | 16,384 | 630,889 | 473,922 | 1.33× | | | Isaac-Lift-KukaAllegro-Camera | 16,384 | 269,357 | 232,573 | 1.16× | | | Isaac-Open-Drawer-Franka | 16,384 | 3,724,915 | 793,857 | 4.69× | | | Isaac-Open-Drawer-Franka-Direct | 16,384 | 3,768,857 | 818,514 | 4.60× | | | Isaac-Reach-Franka | 16,384 | 2,836,122 | 2,031,628 | 1.40× | | | Isaac-Reach-Franka-OSC | 16,384 | 1,467,223 | 1,248,146 | 1.18× | | | Isaac-Reach-UR10 | 16,384 | 4,697,814 | 2,458,897 | 1.91× | | | Isaac-Reorient-Cube-Allegro | 16,384 | 474,390 | 321,799 | 1.47× | | | Isaac-Reorient-Cube-Allegro-Direct | 16,384 | 473,186 | 330,940 | 1.43× | MJWarp line search (3) | | Isaac-Reorient-KukaAllegro | 16,384 | 619,824 | 475,442 | 1.30× | | | Isaac-Reorient-KukaAllegro-Camera | 16,384 | 260,914 | 236,028 | 1.11× | | | Isaac-Velocity-Flat-AnymalD | 16,384 | 623,494 | 394,514 | 1.58× | MJWarp line search (1) | | Isaac-Velocity-Flat-Cassie | 16,384 | 980,049 | 872,366 | 1.12× | | | Isaac-Velocity-Flat-G1 | 16,384 | 395,715 | 413,783 | 0.96× | | | Isaac-Velocity-Flat-H1 | 16,384 | 811,177 | 732,821 | 1.11× | | | Isaac-Velocity-Flat-UnitreeGo2 | 16,384 | 861,115 | 929,370 | 0.93× | | | Isaac-Velocity-Rough-AnymalD | 16,384 | 262,903 | 309,238 | 0.85× | | | Isaac-Velocity-Rough-Cassie | 16,384 | 626,981 | 546,664 | 1.15× | | | Isaac-Velocity-Rough-G1 | 16,384 | 219,665 | 225,923 | 0.97× | | | Isaac-Velocity-Rough-H1 | 16,384 | 534,495 | 480,473 | 1.11× | | | Isaac-Velocity-Rough-UnitreeGo2 | 16,384 | 360,563 | 385,435 | 0.94× | | | IsaacContrib-Cartpole-Showcase-Direct | 16,384 | 13,125,361 | 11,187,047 | 1.17× | | | IsaacContrib-Keyboard-SO101 | 4,096 | 172,477 | 135,059 | 1.28× | Both OOM at 16,384; rerun with #8954 contact observables | | IsaacContrib-Open-Drawer-Franka-IK-Abs | 16,384 | 3,278,941 | 637,379 | 5.14× | | | IsaacContrib-Open-Drawer-Franka-IK-Rel | 16,384 | 3,120,403 | 584,387 | 5.34× | | | IsaacContrib-Velocity-Flat-AnymalB | 16,384 | 752,575 | 462,837 | 1.63× | | | IsaacContrib-Velocity-Flat-AnymalC | 16,384 | 757,105 | 442,263 | 1.71× | | | IsaacContrib-Velocity-Flat-UnitreeA1 | 16,384 | 789,132 | 1,041,755 | 0.76× | | | IsaacContrib-Velocity-Flat-UnitreeGo1 | 16,384 | 635,813 | 937,895 | 0.68× | | | IsaacContrib-Velocity-Rough-AnymalB | 16,384 | 431,995 | 439,662 | 0.98× | | | IsaacContrib-Velocity-Rough-AnymalC | 16,384 | 410,209 | 404,162 | 1.01× | | | IsaacContrib-Velocity-Rough-UnitreeA1 | 16,384 | 396,145 | 451,066 | 0.88× | | | IsaacContrib-Velocity-Rough-UnitreeGo1 | 16,384 | 330,732 | 396,851 | 0.83× | | | **Geometric mean (39 comparable pairs)** | 16,384 | — | — | **1.31×** | Excludes pairs with MJWarp line-search warnings; SO101 uses 4,096 envs | ## Type of change - New feature - Bug fix - Documentation update ## Validation Focused checks on the rebased branch: - Newton Steel solver: 5 passed - Newton manager Steel build and step: 1 passed - Steel contact-sensor force: 1 passed - Steel task presets: 17 passed - Benchmark capture: 20 passed - Ruff lint and format checks passed; `git diff --check` passed The historical benchmark table has not been rerun on this revision. PR #8957 is still open, so the full integration and CI remain subject to that dependency. ## Checklist - [x] I have read and understood the contribution guidelines - [ ] I have run pre-commit checks on the changed files - [x] I have made corresponding documentation changes - [ ] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the test-audit criteria - [x] I have added changelog fragments for every touched source package - [x] My name already exists in CONTRIBUTORS.md
2431cf9 to
8bb5674
Compare
Description
Set an explicit
NewtonCollisionPipelineCfg.rigid_contact_maxon the model before constructing the solver. This keeps solver scratch and the collision pipeline at the same contact capacity. Reject a conflictingKaminoPADMMSolverCfg.max_contacts_per_worldinstead of silently overriding that value.This change is independent of the contact-sensor observable migration in #8954. #8940 has merged. This PR remains a needed follow-up: its SO101 Steel preset sets an explicit collision capacity, and this change applies that capacity to the model before solver construction.
Validation
Type of change