Skip to content

Handle single-world coupled MPM resets - #6955

Merged
maxkra15 merged 2 commits into
isaac-sim:developfrom
maxkra15:maxkra15/fix-coupled-mpm-reset
Aug 7, 2026
Merged

Handle single-world coupled MPM resets#6955
maxkra15 merged 2 commits into
isaac-sim:developfrom
maxkra15:maxkra15/fix-coupled-mpm-reset

Conversation

@maxkra15

@maxkra15 maxkra15 commented Aug 7, 2026

Copy link
Copy Markdown

Description

Handle the single-world coupled implicit-MPM reset case extracted from #6875.

Isaac Lab represents “reset the only local world” with the canonical mask [True, False], where the final entry selects global entities. Newton MPM cannot apply that masked reset to a one-world grid whose partition has no environment offsets, even though selecting the only local world is equivalent to resetting the full local grid.

For a one-world coupler containing MPM, this change promotes that local selection to an unmasked full-grid reset through the root coupled solver. Newton already synchronizes the coupled entry states through Newton #3649, so Isaac Lab resets only its current parent state and adds no MPM-manager API.

Non-MPM coupled solvers retain the existing device-mask path. Multi-world MPM masks are not promoted because a full reset would incorrectly clear every environment; partial reset of a shared multi-world grid still requires isolated grids or a Newton-side solution.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Validation

  • uv run --frozen isaaclab -f
  • uv run --frozen --extra test python -m pytest source/isaaclab_contrib/test/coupling/test_coupler.py -q — 53 passed
  • Confirmed the regression test fails without the override and passes with it.
  • Reproduced the real Newton failure for masked one-world MPM reset, then verified that one full root-solver reset succeeds and overwrites a deliberately stale parent output state.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks
  • My changes generate no new warnings
  • I have added tests that prove the fix is effective
  • I have added a changelog fragment for the touched package
  • My name already exists in CONTRIBUTORS.md
  • Documentation changes are not required for this internal reset-lifecycle fix

Reset both Newton manager state buffers for single-world coupled MPM so stale solver history cannot return after a buffer swap. Keep non-MPM coupled resets on the existing device-mask path.
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 7, 2026
Rely on Newton to synchronize coupled entry state and keep only the single-world grid-mask promotion in Isaac Lab. Leave multi-world masks unchanged so a partial reset cannot clear every environment.
@maxkra15 maxkra15 changed the title Fix coupled implicit MPM state resets Handle single-world coupled MPM resets Aug 7, 2026
@maxkra15
maxkra15 marked this pull request as ready for review August 7, 2026 03:44
@maxkra15
maxkra15 requested a review from a team August 7, 2026 03:44
@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR fixes single-world coupled MPM resets by converting the canonical local-only mask into a full-grid reset through the root coupled solver.

  • Adds a narrowly guarded MPM reset override for one-world coupled configurations.
  • Preserves device-mask behavior for non-MPM and multi-world coupled solvers.
  • Adds regression coverage for promoted, empty, non-MPM, and multi-world reset masks.
  • Documents the fix in the contrib changelog.

Confidence Score: 5/5

The PR appears safe to merge, with the new behavior constrained to the documented single-world coupled MPM reset case.

The override matches the established reset lifecycle and canonical mask shape, while its guards and tests preserve existing non-MPM, empty-mask, and multi-world behavior.

Important Files Changed

Filename Overview
source/isaaclab_contrib/isaaclab_contrib/coupling/coupler.py Adds a guarded reset override that promotes only the canonical selected single-world MPM mask to the root solver’s full-reset path.
source/isaaclab_contrib/test/coupling/test_coupler.py Covers successful promotion, empty-mask no-op behavior, preservation of non-MPM device masks, and multi-world fallthrough.
source/isaaclab_contrib/changelog.d/maxkra15-coupled-mpm-reset.rst Accurately records the single-world coupled MPM reset fix.

Reviews (1): Last reviewed commit: "Simplify coupled MPM reset handling" | Re-trigger Greptile

@isaaclab-review-bot isaaclab-review-bot 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.

Isaac Lab Review Bot

Reviewed the narrowly gated reset override that promotes the canonical single-local-world MPM mask to an unmasked root coupled-solver reset. The changed path is covered for selected and empty masks, non-MPM solvers, and multi-world MPM configurations; no candidate findings were supplied or supported.

  • Design and architecture: The override is confined to one-world coupled solvers containing an MPM entry and delegates all other cases to the existing reset path. Its correctness depends on the documented canonical mask layout and Newton’s coupled-state synchronization; the host mask read and unmasked reset are limited to that exceptional configuration.
  • API: No public symbols, configuration fields, exports, or defaults change. The private classmethod preserves the inherited reset signature, and the isaaclab_contrib changelog fragment is present under a correctly formatted Fixed section.
  • Implementation: The promoted branch resets the root solver’s current parent state with world_mask=None and flags=0. Tests exercise promotion of [True, False], the empty-mask no-op, preservation of the device-mask path for non-MPM solvers, and non-promotion for multi-world MPM solvers. The all-false MPM case intentionally returns without forwarding the mask, a small behavioral distinction consistent with an empty reset.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@maxkra15
maxkra15 merged commit 50a244e into isaac-sim:develop Aug 7, 2026
47 of 48 checks passed
kellyguo11 added a commit that referenced this pull request Aug 8, 2026
## Summary

- Add graph-safe right-click rigid-body dragging to the Newton
visualizer for compatible standalone and coupled solvers.
- Initialize picking before CUDA graph capture and rebind it after hard
model resets.
- Keep existing pause, resume, step, and reset behavior unchanged.

Picking is automatically disabled for headless viewers, standalone MPM,
non-Newton physics, and solvers that do not consume rigid-body force
input. This supersedes #6403.

## Examples

- XPBD NVIDIA-logo domino cascade.
- VBD 4:1 block-and-tackle.
- Three MJWarp boxes coupled to an implicit-MPM granular bed.

The coupled-MPM example uses the single-world reset support merged in
#6955; this PR no longer duplicates that fix.

## Performance

- No visualizer: ~0.02 µs/tick host overhead, with no added GPU work or
graph changes.
- Interactive viewer: +2.08 µs/tick (+0.27%) with four MJWarp substeps.
- After viewer close: 0.168 vs 0.169 ms/step, within measurement noise.

## Validation

- 212 focused unit tests passed.
- 3 standalone-script registration tests passed.
- XPBD, VBD, and coupled MJWarp/MPM CUDA smoke tests passed.
- Warning-free documentation build and full pre-commit suite passed.

The Kit-only visualization-marker test requires a full Isaac Sim runtime
and remains covered by CI.

---------

Co-authored-by: Kelly Guo <kellyg@nvidia.com>
kellyguo11 pushed a commit that referenced this pull request Aug 10, 2026
# Description

Disable backface culling by default for newton warp renderer. User can
opt out if needed by setting
`NewtonWarpRendererCfg.enable_backface_culling`.

Fixes OMPE-103486

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

Please attach before and after screenshots of the change if applicable.

| State | Screenshot |
| ------ | ----- |
| Before | <img width="1030" height="1030"
alt="franka_cloth-ovphysx-newton_renderer-rgb-before"
src="https://github.com/user-attachments/assets/77e1ac3a-88a4-4580-8303-53c696a5a2ef"
/> |
| After | <img width="1030" height="1030"
alt="franka_cloth-ovphysx-newton_renderer-rgb-after"
src="https://github.com/user-attachments/assets/44e15c0d-eff2-462d-8566-cd16d273126c"
/> |

## Dexsuite runtime benchmark

Performance and memory impact of disabling Newton Warp backface culling
by default
(`NewtonWarpRendererCfg.enable_backface_culling: True → False`).

### Comparison — before vs. after

Δ = after (`afc3ebd9`) − before (`50a244ec` / develop). Positive FPS Δ%
means after is faster; negative GPU-mem / RAM Δ% means after uses less
memory.

| Variant | Envs | FPS Δ% | Env create Δ% | First step Δ% | GPU mem peak
Δ% | RAM peak Δ% |
| ------------- | ---: | -----: | ------------: | ------------: |
--------------: | ----------: |
| homogeneous   | 4096 | +2.98% | -1.14% | -2.87% | +4.15% | -0.24% |

**Takeaways:**

- FPS change is within typical run-to-run noise for this single-config
sample.
- GPU memory peak and host RAM peak are essentially unchanged.
- Env-creation / first-step times are also within noise for this setup.

### Before — `50a244ec70a` (develop)

Baseline with `enable_backface_culling=True` (previous default).

| Item        | Value |
| ----------- | ----- |
| Commit | `50a244ec70a Handle single-world coupled MPM resets (#6955)`
|
| Setting     | `NewtonWarpRendererCfg.enable_backface_culling = True` |
| Results dir |
`huidongc/benchmarks/20260807_newton_bfc_before_develop/` |

| Variant | Envs | FPS mean | FPS peak | Iter s mean | GPU mem mean (GB)
| GPU mem peak (GB) | RAM mean (GB) | RAM peak (GB) | GPU util % | Env
create s | First step s |
| ------------- | ---: | -------: | -------: | ----------: |
----------------: | ----------------: | ------------: | ------------: |
---------: | -----------: | -----------: |
| homogeneous | 4096 | 42192.8 | 48652.8 | 0.0971 | 4.82 | 4.82 | 4.14 |
4.14 | 87.9 | 35.9 | 0.8 |

### After — `afc3ebd9` (`enable_backface_culling=False`)

Same benchmark after disabling backface culling by default.

| Item        | Value |
| ----------- | ----- |
| Commit | `afc3ebd9 Disable Newton Warp backface culling by default` |
| Setting | `NewtonWarpRendererCfg.enable_backface_culling = False` |
| Results dir | `huidongc/benchmarks/20260807_newton_bfc_after_7a64e7b/`
|

| Variant | Envs | FPS mean | FPS peak | Iter s mean | GPU mem mean (GB)
| GPU mem peak (GB) | RAM mean (GB) | RAM peak (GB) | GPU util % | Env
create s | First step s |
| ------------- | ---: | -------: | -------: | ----------: |
----------------: | ----------------: | ------------: | ------------: |
---------: | -----------: | -----------: |
| homogeneous | 4096 | 43450.7 | 49929.3 | 0.0943 | 4.93 | 5.02 | 4.13 |
4.13 | 87.2 | 35.5 | 0.8 |

### Setup

| Item                | Value                           |
| ------------------- | ------------------------------- |
| GPU                 | NVIDIA RTX A6000 |
| Task                | `Isaac-Lift-KukaAllegro-Camera` |
| Physics             | `newton_mjwarp`                 |
| Renderer            | `newton_renderer`               |
| Homogeneous presets | `rgb64,single_camera,cube`      |
| Seed                | `42`                            |
| Iterations          | `1000` (after warmup) |
| Command             | `huidongc/benchmark_dexsuite.sh` |

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants