Repository navigation
Filter immovable collision pairs and tighten MJWarp capacities in NIST - #9202
Conversation
Expose Newton's include_static_kinematic_pairs option on NewtonCollisionPipelineCfg (default True) and disable static/kinematic-vs-kinematic SDF collision pairs in NISTEnvCfg along with compact MJWarp solver capacities (njmax=1024, nconmax=256). On 4,096-env IsaacContrib-NIST-Franka (20 variants), this eliminates ~63% of redundant SDF contacts (312k -> 115k) and improves end-to-end PPO throughput by ~31% (33.8k -> 44.2k steps/s) with zero solver overflows across full 8,192-state reset precollection and rollout. Signed-off-by: Mehdi Ataei <[email protected]>
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Scope and over-engineering (1), Style consistency (2), Test quality (1). Other reviewed categories look good.
- PR description: The title matches the diff and measurements support workload-specific gains; qualify equivalence and overflow claims, and add reproducible baseline/candidate revisions, command, backend versions, warmup, and sample count to the supplied hardware/environment metrics.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: Minimal implementation: extend existing NewtonCollisionPipelineCfg and NISTEnvCfg through the current pipeline path, retain the behavioral test and package changelogs, and collapse the test’s discarded contact list into a set; no source modules were added. Scope is cohesive; no split recommended.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Implementation looks good.
- Style consistency: The added assertion comment claims both baseline pair categories exist although the OR requires only one; retain the body-ID mapping and remove that inaccurate claim.
- Test quality: The baseline OR permits either filtered pair category to be absent, leaving its removal unproven; require both static–kinematic and kinematic–kinematic baseline pairs in the existing distinct GPU fixture.
Minor fixes needed. Posted 4 inline findings.
Automated review; human maintainers own approval decisions.
|
|
||
| @pytest.mark.kitless | ||
| @pytest.mark.parametrize("device", test_devices(DeviceScope.CUDA)) | ||
| def test_collision_cfg_filters_static_and_kinematic_pairs(device): |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Annotate the new test signature
The new function omits its parameter and return annotations, contrary to the type-hinting guide. Annotate device and add -> None.
| s0 = backend.contacts.rigid_contact_shape0.numpy()[:n] | ||
| s1 = backend.contacts.rigid_contact_shape1.numpy()[:n] | ||
| shape_body = backend.model.shape_body.numpy() | ||
| return [tuple(sorted((int(shape_body[a]), int(shape_body[b])))) for a, b in zip(s0, s1)] |
There was a problem hiding this comment.
🟡 Warning · Scope Complexity — Avoid an intermediate contact list
Both callers immediately turn this list into a set, allocating a representation they discard. Return a set comprehension and update the annotation.
| with_immovable = set(_run_collision(True)) | ||
| without_immovable = set(_run_collision(False)) | ||
|
|
||
| # Static (-1) vs kinematic (0, 1) and kinematic (0) vs kinematic (1) are present by default and filtered when False. |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Keep only the body-ID explanation
The comment narrates the assertions and claims both pairs are present when the next assertion requires only one. Keep the useful body-ID mapping; remove the narrated claim.
| without_immovable = set(_run_collision(False)) | ||
|
|
||
| # Static (-1) vs kinematic (0, 1) and kinematic (0) vs kinematic (1) are present by default and filtered when False. | ||
| assert (-1, 0) in with_immovable or (0, 1) in with_immovable |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Require both baseline pair categories
The OR allows either immovable pair category to be absent before filtering, so its removal remains unproven. Require both static–kinematic and kinematic–kinematic baseline pairs.
[Medium impact] The changes reach Newton collision settings and NIST training runs. The PR appears safe to merge, with a non-blocking gap in the new test. Findings
SummaryExposes Newton’s immovable-pair filter and enables it for NIST while reducing MJWarp capacities.
Reviews (1) · Last reviewed commit: "Filter immovable collision pairs and tig..." · Reviewed by Greptile |
| without_immovable = set(_run_collision(False)) | ||
|
|
||
| # Static (-1) vs kinematic (0, 1) and kinematic (0) vs kinematic (1) are present by default and filtered when False. | ||
| assert (-1, 0) in with_immovable or (0, 1) in with_immovable |
There was a problem hiding this comment.
The or assertion only requires one immovable pair type to exist when filtering is off. The test still passes if Newton stops generating either static–kinematic or kinematic–kinematic contacts in both modes. Assert both baseline pairs separately so the test checks that the flag controls both promised pair types.
| assert (-1, 0) in with_immovable or (0, 1) in with_immovable | |
| assert (-1, 0) in with_immovable | |
| assert (0, 1) in with_immovable |
|
run-ci |
Description
Improves 4,096-env
IsaacContrib-NIST-Franka(20-variant) PPO training throughput by ~31% (1.31x) with exact dynamic physics and zero solver overflows via two targeted changes:Expose
include_static_kinematic_pairsonNewtonCollisionPipelineCfgand disable it inNISTEnvCfgCollisionPipelinealready supportsinclude_static_kinematic_pairs: bool = Trueto filter static–kinematic and kinematic–kinematic pairs in the broadphase, butNewtonCollisionPipelineCfgdid not yet expose it.NISTEnvCfg,groundis static whiletable,nistboard, andfixed_asset(bolts/sockets/gear bases) are kinematic (kinematic_enabled=True). Because they rest against each other (ground ↔ table,table ↔ nistboard,nistboard ↔ fixed_asset,table ↔ fixed_asset), Newton's 256³ SDF narrowphase was generating ~63% of all scene contacts (311.7ktotal vs114.1kdynamic) that MuJoCo Warp immediately discards because two immovable bodies cannot exert constraint impulses on each other.include_static_kinematic_pairs=FalseinNISTEnvCfgremoves only immovable-vs-immovable pairs while keeping 100% of dynamic contacts untouched — including theassembly_contactsensor between the dynamicHeldAssetand kinematicFixedAsset. The default remainsTrueonNewtonCollisionPipelineCfg, so no other task changes behavior.Right-size MJWarp solver capacities in
NISTEnvCfg(njmax: 3000 → 1024,nconmax: 600 → 256)nefc_peak = 283(max311across runs) andnacon_per_world_peak = 165, withoverflow_max = 0.njmax=1024, nconmax=256matches pyramidal friction cone scaling (4 × 256 = 1024) with ~3.3–3.6× headroom on constraint rows and ~1.55× headroom on per-world contacts while significantly reducing MJWarp solver memory bandwidth.Benchmark (
IsaacContrib-NIST-Franka, 4,096 envs, 20 variants, RTX PRO 6000 Blackwell MIG 2g.48gb)nefc/naconmain(include_sk=True,3000/600)include_sk=Falseonly (3000/600)include_sk=False+1536/300include_sk=False+1024/256)Type of change
Validation
test_collision_cfg_filters_static_and_kinematic_pairsinsource/isaaclab_newton/test/physics/test_newton_manager.pyverifying thatinclude_static_kinematic_pairs=Falseremoves static–kinematic and kinematic–kinematic pairs while preserving dynamic–kinematic contacts.source/isaaclab_newton/test/physics/test_newton_manager.pyandsource/isaaclab_tasks/test/contrib/test_nist_reset_monitor.py.IsaacContrib-NIST-Frankaat 4,096 envs with fullstate_table_size=8192(140/140 joint cells populated) and 5 PPO iterations:nefc_peak=283,nacon_per_world_peak=165,overflow_max=0.ruff check,ruff format --check, andgit diff --check.Checklist
ruff check/ruff format --check)source/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.md(via Add isaaclab_neural integration for Newton neural robot dynamics #9200)