Skip to content

Author Newton MPM particles through USD - #7637

Merged
StafaH merged 17 commits into
isaac-sim:developfrom
maxkra15:maximiliank/isaac-lab-mpm-spawners-newton-usd-authoring
Sep 21, 2026
Merged

StafaH merged 17 commits into
isaac-sim:developfrom
maxkra15:maximiliank/isaac-lab-mpm-spawners-newton-usd-authoring

Conversation

@maxkra15

@maxkra15 maxkra15 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR migrates Isaac Lab's Newton MPM spawners from direct ModelBuilder particle emission to schema-valid USD authoring and Newton's standard USD import path.

MPMGridCfg and MPMPointsCfg remain the user-facing convenience APIs. They now author:

  • a real UsdGeom.Points prim with positions, velocities, widths = 2 * radius, and explicit physics:masses;
  • Newton deformable/simulation schemas and a relationship to the owning MPM scene;
  • a physics-purpose bound material carrying NewtonMPMMaterialAPI;
  • all supported material values, including the new hardening_rate and softening_rate fields; and
  • solver-global MPM settings, including critical_fraction, on NewtonMPMSceneAPI.

Newton imports the authored particles through ModelBuilder.add_usd(). Isaac Lab consumes the returned path_particle_map to retain each MPMObject particle range across both homogeneous batched replication and heterogeneous builder merges.

Behavior preserved

  • Explicit particle masses are retained instead of being reconstructed from density and particle width.
  • Existing particle ordering, initial velocities, and initial transforms are preserved.
  • Grid generation remains deterministic with the existing fixed jitter seed.
  • Isaac Lab's relaxation-time damping is converted to schema viscosity with elastic_damping = damping * young_modulus.
  • The existing independently mutable <MPM asset>/Particles visualization prim and synchronization path remain in place for GL, Newton RTX, and Kit rendering.
  • MPMGridCfg continues generating explicit points procedurally in Isaac Lab because the USD schema represents explicit particles rather than a procedural grid.

The four MPM demos and the Franka Pour and UR10 Particle Push tasks use the new authoring path. Their manually added MPM ground colliders were removed in favor of the standard scene ground-plane workflow.

Dependencies

  • Uses the Newton 1.6.0rc1 release already pinned on develop.
  • Requires newton-usd-schemas >= 0.5.0.

Breaking changes

  • Removes the direct emit_mpm_particles() helper. Use MPMGridCfg or MPMPointsCfg through the standard spawner workflow.
  • Grid jitter is authored once in asset-local space and shared by USD clones. Independent per-environment distributions should use reset events or domain randomization.

Per-point multi-material authoring through UsdGeomSubset remains intentionally out of scope until Isaac Lab has a user-facing subset configuration API.

Type of change

  • Breaking change
  • Documentation update

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Not applicable; existing runtime visualization behavior is retained.

Validation

  • 216 passed across the focused MPM spawner, MPM object, Newton cloning, and Newton manager suites.
  • CUDA smoke-tested all four MPM demos: granular, two-way coupling, snowball smash, and teapot fill.
  • CUDA smoke-tested IsaacContrib-UR10-Particle-Push and IsaacContrib-Franka-Pour.
  • Built the complete documentation with warnings treated as errors.
  • Ran all formatting and pre-commit checks successfully.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have updated focused tests for the feature
  • I have added changelog fragments for every touched source package
  • My name already exists in CONTRIBUTORS.md

…lab-mpm-spawners-newton-usd-authoring

# Conflicts:
#	pyproject.toml
#	source/isaaclab/test/install_ci/uv_pip/test_uv_pip_install_isaaclab_all_trains_cartpole.py
#	source/isaaclab/test/install_ci/uv_pip/uv-overrides.txt
#	source/isaaclab_newton/isaaclab_newton/assets/mpm_object/mpm_object.py
#	source/isaaclab_newton/isaaclab_newton/cloner/newton_clone_utils.py
#	source/isaaclab_newton/isaaclab_newton/cloner/replicate.py
#	source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py
#	source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py
#	tools/wheel_builder/res/__init__.py
#	tools/wheel_builder/uv-overrides.txt
#	uv.lock
@maxkra15
maxkra15 requested a review from a team September 8, 2026 12:02
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team infrastructure labels Sep 8, 2026
@maxkra15

maxkra15 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 8, 2026
@greptile-apps

greptile-apps Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR migrates Newton MPM particle creation from direct ModelBuilder emission to schema-valid USD authoring and Newton's standard USD import path.

  • Authors explicit particle positions, velocities, widths, masses, materials, and solver-global MPM settings in USD.
  • Preserves particle ranges and transforms across homogeneous and heterogeneous replication.
  • Adds hardening and softening material parameters and requires newton-usd-schemas>=0.5.0.
  • Updates MPM demos and tasks to use the standard scene ground-plane workflow.
  • No changes were made after the previous review SHA.

Confidence Score: 5/5

The PR appears safe to merge because no new issues were introduced after the previous review and both prior findings were resolved after Greptile conceded them.

The current changes consistently author and import MPM particles through USD, preserve particle ranges across replication paths, and expose the required schema revision. The two previous findings are not outstanding: both threads were resolved after the implementation details showed the reported failures were unreachable.

Important Files Changed

Filename Overview
source/isaaclab_newton/isaaclab_newton/sim/spawners/mpm/mpm.py Authors validated MPM particles and materials as schema-backed USD geometry instead of emitting particles directly into Newton.
source/isaaclab_newton/isaaclab_newton/assets/mpm_object/mpm_object.py Registers imported particle ranges and restores clone transforms so each MPM object retains its corresponding Newton particle slice.
source/isaaclab_newton/isaaclab_newton/cloner/newton_clone_utils.py Propagates USD import results and particle offsets through homogeneous replication and heterogeneous builder merges.
source/isaaclab_newton/isaaclab_newton/physics/mpm_manager.py Authors solver settings on NewtonMPMSceneAPI and constructs the runtime solver configuration from the validated schema.
source/isaaclab_newton/isaaclab_newton/cloner/replicate.py Connects source import particle maps to MPM range registration during mapped replication.
source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py Records imported MPM particle ranges in the standard Newton scene-building paths.
pyproject.toml Raises the Newton USD schema requirement to the revision needed for MPM USD authoring.
uv.lock Resolves newton-usd-schemas 0.5.0 and refreshes workspace package versions.

Sequence Diagram

sequenceDiagram
    participant C as MPMGridCfg / MPMPointsCfg
    participant U as USD Stage
    participant N as Newton ModelBuilder
    participant R as Clone Replication
    participant O as MPMObject

    C->>U: Author UsdGeom.Points, masses, velocities, widths
    C->>U: Bind NewtonMPMMaterialAPI material
    C->>U: Relate particles to NewtonMPMSceneAPI
    U->>N: add_usd()
    N-->>R: path_particle_map and source builder
    R->>R: Replicate or merge builders
    R->>O: Record destination particle ranges
    O->>O: Synchronize simulation and visualization state
Loading

Reviews (2): Last reviewed commit: "Merge remote-tracking branch 'origin/dev..." | Re-trigger Greptile

Comment thread scripts/demos/mpm/snowball_smash.py Resolved

@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

The USD-based Newton MPM authoring and import pipeline is coherent, including explicit points, materials, solver schemas, and particle-range tracking across replication. One API compatibility issue remains: the exported emit_mpm_particles helper is removed without the deprecation period required by repository policy.

  • Design and architecture: The spawner-to-USD-to-path_particle_map flow consistently connects authored particles to MPMObject registry ranges across homogeneous replication and heterogeneous builder merges. No actionable architecture defect was established.
  • API: The new material fields, schema dependency, documentation, and changelog updates are aligned. However, removing the publicly exported emit_mpm_particles symbol outright violates the repository requirement for prior deprecation and migration; retain a deprecated compatibility wrapper for the required transition period.
  • Implementation: The particle generation, explicit mass and width authoring, transform restoration, and range-recording paths were traced without finding another concrete implementation defect. Importing the shared private suffix constant keeps the producer and consumer path synchronized, so that candidate concern does not warrant a separate change.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

@maxkra15

maxkra15 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 8, 2026
@maxkra15

maxkra15 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 8, 2026
…lab-mpm-spawners-newton-usd-authoring

# Conflicts:
#	docs/source/overview/core-concepts/physical-backends/newton/using-mpm.rst
#	scripts/demos/mpm/snowball_smash.py
#	uv.lock
@maxkra15

Copy link
Copy Markdown
Contributor Author

run-ci

@maxkra15

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 16, 2026
@maxkra15

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 17, 2026
@maxkra15

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 19, 2026
@maxkra15

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 21, 2026
@maxkra15

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 21, 2026
Comment thread pyproject.toml
"open3d>=0.19.0 ; python_version < '3.13' and (sys_platform != 'linux' or platform_machine != 'aarch64')",
# Loose bound co-resolves with isaacsim's ==0.2.0; the override below forces >=0.4.1.
"newton-usd-schemas>=0.2.0",
# Authored MPM particle import requires the 0.5 schema revision. The managed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove this comment completely, we don't need to explain the version choice

r"/World/envs/env_.*/MPMBinLeft",
r"/World/envs/env_.*/MPMBinRight",
],
shape_label_patterns=[GROUND_PLANE_SHAPE_PATTERN],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's just used in one place we can inline the value

import numpy as np
import pytest

newton = pytest.importorskip("newton")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this skip, newton is in our base isntallation


def _material_custom_attributes(material: MPMParticleMaterialCfg) -> dict[str, float]:
"""Map material cfg values to Newton ``mpm:*`` custom attributes for ``add_particles``.
from isaaclab.sim.utils import get_current_stage # noqa: PLC0415

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move all imports to top of file, unless theres a really critical reason they need to be inline (like pxr)

@StafaH
StafaH merged commit af36c79 into isaac-sim:develop Sep 21, 2026
53 checks passed
@ooctipus
ooctipus deleted the maximiliank/isaac-lab-mpm-spawners-newton-usd-authoring branch September 21, 2026 18:43
ooctipus pushed a commit that referenced this pull request Sep 21, 2026
…) (#7933)

# Description

Backports #7637 to `release/3.0.0`.

This migrates Newton MPM particle creation to schema-valid USD authoring
and Newton's standard USD import path while preserving explicit masses,
point ordering, deterministic jitter, initial transforms and velocities,
damping conversion, and the existing dynamic visualization path. It also
carries the original MPM demo/task updates, documentation, focused
tests, and changelog fragments.

## Backport resolution

| Field | Commit |
| --- | --- |
| Original merged change | `af36c79edced44e914bb9fd81e3aaedd1bd562eb` |
| Release base used | `c2bce3e232ea5134f98ab14a1e47b3abc900c247` |
| Proposed backport | `67c5e65125241d6ffcf1fd6028aaa80f199892a5` |

All 25 non-lockfile paths cherry-picked without conflict. `uv.lock` was
regenerated from the release manifests to retain release-specific
workspace package versions while applying `newton-usd-schemas >= 0.5.0`.
The repository backport validator confirms that the result changes no
paths outside the original PR.

## Type of change

- Breaking change
- Documentation update

## Release backport

This pull request targets `release/3.0.0` directly; no further backport
is requested.

## Validation

- **270 focused tests passed**:
  - 12 MPM spawner and object tests.
  - 256 cloning, manager, reset-mask, and MPM visualization tests.
- Franka Pour and UR10 Particle Push contributed-environment smoke
tests.
- `uv lock --check` passed.
- Release-relative formatting, lint, changelog, and repository hooks
passed.
- Warning-as-error documentation build passed across 247 sources.
- Backport path-scope validation and `git diff --check` passed.

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] I have run the pre-commit checks.
- [x] I have included the original documentation changes.
- [x] My changes generate no new warnings.
- [x] I have preserved the focused tests for the feature.
- [x] I have included the original changelog fragments for every touched
package.
- [x] My name already exists in `CONTRIBUTORS.md`.
ooctipus added a commit that referenced this pull request Sep 24, 2026
…ng docs (#7957)

Backports the three changes from the September 20–23 `develop` audit
that are missing from `release/3.0.0`, alongside the existing
cloning-guide backport:

- #7722 (`4cf439dfeb`): reject a second `SimulationContext` construction
instead of silently discarding its configuration. Includes the original
fixture cleanup and regression coverage.
- #7893 (`22fcd71bc4`): validate DelayBuffer lag values before mutating
its live configuration.
- #7947 (`6e9ef17f59`): make `v3.0.0-EA` the default documentation
version in deployment and local multi-version builds.
- #7129 (`354168560f`): clarify that `replicate_physics=False` skips the
active physics context while other declared replication contexts still
run.

**Compatibility:** repeated `SimulationContext(...)` calls now raise.
Retrieve the live context with `SimulationContext.instance()`, or call
`clear_instance()` before constructing a replacement. The original major
changelog fragment includes this migration.

The runtime and test files match current `develop`. The docs-default
backport adapts the release branch's existing redirect template,
validates the target page, and preserves explicit overrides. The
cloning-guide backport preserves the current release APIs; its obsolete
sections were already removed.

## Release audit

Checked all **35 PRs** merged into `develop` from **2026-09-20 16:43:18
UTC** through `cff81e8473` (September 23), against release head
`5d3e0b695e`. **32 are already covered; the remaining three are included
here.** Git history, patch equivalence, GitHub's merged PR list, and
remaining file differences were checked. Branch-specific
version/changelog compilation and existing release-only changes are
preserved.

<details>
<summary>Already covered PRs</summary>

26 have an equivalent patch in release: #7919, #7922, #7923, #7924,
#7925, #6758, #7928, #7902, #7927, #7891, #7931, #7691, #7861, #7929,
#7916, #7939, #4609, #7942, #7940, #7948, #7937, #7955, #7960, #7961,
#7970, #7958.

Six were squash-merged or adapted: #7530 and #7899 in #7926; #7637 in
#7933; #7860 in #7936; #7954 and #7950 in #7964. Their implementation
differences were checked against the current release tree.

</details>

## Validation

- **276 tests passed**: SimulationContext (51, including CPU/CUDA),
headless context construction (15), nine schema/fragment suites (165),
four manager suites (38), and DelayBuffer (7).
- Both backported regressions reproduce with the original release
implementations.
- Docs redirect recipe: local/deployment EA defaults, explicit override,
and missing-target rejection passed with a stubbed Sphinx builder.
- All 22 changed files match the intended backport scope; `uv run
isaaclab -f` and `git diff --check` passed.
- Fresh Sphinx validation (`-b dummy -W --keep-going`): passed without
warnings, excluding static assets as the HTML builder does. Full HTML
documentation CI is running.

Local runtime validation used PyTorch 2.12.0, CUDA 13.0, Isaac Sim
6.0.1.0, and an RTX 5090. Existing runtime/deprecation warnings
occurred; the CI jobs validate the pinned environments.

The previous [docs CI
failure](https://github.com/isaac-sim/IsaacLab/actions/runs/35795116307/job/106972539281)
was an external connection reset fetching the Omniverse intersphinx
inventory, producing one warning under `-W`. That URL returned HTTP 200
when rechecked. This update starts a fresh docs build.

---------

Co-authored-by: hujc <[email protected]>
Co-authored-by: Zihan Xu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants