Skip to content

[Backport release/3.0.0] Fix MJWarp USD friction loss import (#7298) - #7622

Merged
kellyguo11 merged 3 commits into
isaac-sim:release/3.0.0from
kellyguo11:codex/backport-7298-release-3.0.0
Sep 7, 2026
Merged

kellyguo11 merged 3 commits into
isaac-sim:release/3.0.0from
kellyguo11:codex/backport-7298-release-3.0.0

Conversation

@kellyguo11

@kellyguo11 kellyguo11 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Backports #7298 to release/3.0.0.

This preserves MuJoCo-authored joint friction and damping when USD stages are imported for Newton managers that register MuJoCo solvers. Both vectorized clone replication and standalone stage import now use the active manager's schema-resolver policy, with MuJoCo values remaining lower-priority fallbacks behind Newton and PhysX values. Coupled managers inherit the same solver-capability policy.

The merged source commit f948fa596c1c61a155d55778976b7547799e6200 cherry-picked without conflicts. The release branch intentionally retains its Torch-based clone mapping contract; the backported clone-path regression test is adapted from the source PR's NumPy inputs to the release API's Torch tensors. Backporting #7462 is out of scope because it is a broad, breaking ClonePlan and NumPy API migration that explicitly did not request a release backport.

A separate follow-up adds the isaaclab_contrib changelog fragment required for the second changed source package and omitted from the source PR.

No dependency or public API is added.

Type of change

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

Release backport

  • This PR already targets the active release branch; do not backport it again.

Screenshots

Not applicable; this fixes a non-visual USD import path.

Validation

  • uvx --from pre-commit==4.6.2 pre-commit run --all-files — passed after the release-specific test adaptation.
  • tools/changelog/cli.py check release/3.0.0 — passed for both changed packages against the current release base.
  • Python bytecode compilation passed for all changed Python files.
  • git diff --check upstream/release/3.0.0..HEAD — passed.
  • Source PR validation: the focused production-path regression matrix passed all five cases; the broader Newton manager, cloner, custom coupling, generic coupler, and MJCF converter suites also passed on the source branch.
  • The first release CI run exposed that the source test passed NumPy arrays introduced by develop-only Route clone backends through ClonePlan #7462 into the release helper's Torch API. The test now uses the same Torch input convention as the neighboring release cloner coverage.

The runtime Newton tests cannot run on this macOS host because the current lockfile supports Linux x86_64/aarch64 and Windows AMD64 only. Release CI provides the supported-platform verification.

Checklist

  • I have read and understood the contribution guidelines.
  • I have run the available pre-commit checks.
  • Documentation changes are not required because no public API or user workflow changed.
  • My changes generate no new warnings in the available checks.
  • The source PR includes focused regression coverage for both production import paths.
  • I have included changelog fragments for isaaclab_newton and isaaclab_contrib.
  • The original contributor already appears in CONTRIBUTORS.md.

NeoZng and others added 2 commits September 7, 2026 12:29
# Description

Fixes isaac-sim#6829.

Preserve MuJoCo-authored joint friction loss when Isaac Lab imports USD
stages for the Newton MJWarp backend.

Before this change, both Newton production import paths passed only
`SchemaResolverNewton` and `SchemaResolverPhysx` to Newton:

* vectorized clone replication; and
* standalone stage import.

Consequently, a joint authored with `mjc:frictionloss=0.11` finalized
with `Model.joint_friction=0.0`, even though Newton supports the
attribute through `SchemaResolverMjc`.

This PR makes USD resolver selection an active-manager policy:

* `NewtonManager` defaults to Newton then PhysX resolvers;
* `NewtonMJWarpManager` appends the MuJoCo resolver;
* clone and standalone imports consume the same manager-owned resolver
list; and
* resolver order remains Newton → PhysX → MuJoCo, so MJC values are
fallbacks and do not override higher-priority authored values.

MuJoCo custom attributes continue to be registered through the existing
`_builder_attribute_solvers = (SolverMuJoCo,)` mechanism. The follow-up
removes the redundant MJWarp registration override instead of
duplicating that base-class path.

## Scope and alternative considered

PR isaac-sim#7386 fixes the immediate `frictionloss` symptom by appending the
complete `SchemaResolverMjc` to every Newton physics import. That
resolver also interprets additional joint, shape, contact, and scene
attributes. Applying it unconditionally would therefore expand MJC
semantics to Featherstone, XPBD, VBD, Kamino, and MPM rather than
changing only MJWarp.

This PR intentionally keeps the immediate fix solver-scoped: the manager
that registers and consumes MuJoCo-specific attributes also owns the
MuJoCo resolver. Regression coverage verifies that MJWarp imports
`mjc:frictionloss` and `mjc:damping`, while Featherstone preserves its
previous behavior.

A broader cross-backend solution should separately classify portable MJC
core semantics from MuJoCo-specific extensions, ideally by splitting
those resolver responsibilities in Newton upstream. That larger
architecture change is outside the scope of this bug fix.

No dependency or public API is added.

## Type of change

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

## Release backport

* [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Screenshots

Not applicable; this fixes a non-visual USD import path.

## Verification

Latest follow-up commit:

* focused production-path regression matrix: 5 passed;

* MJWarp × clone/standalone preserves `frictionloss=0.11` and
`damping=0.23`;
* Featherstone × clone/standalone leaves both MJC-authored values
unconsumed;
  * the existing explicit-global clone import test still passes;
* full pre-commit suite passed;
* changelog validation passed;
* Python bytecode compilation passed; and
* `git diff --check` passed.

Previous PR head verification in the matching isolated environment:

* Python 3.12.13;
* `isaaclab-newton==5.4.0`;
* `newton==1.5.0`;
* `warp-lang==1.16.0`;
* `mujoco-warp==3.11.0`; and
* full Newton manager abstraction suite: 157 passed on a CUDA host.

## Checklist

* [x] I have read and understood the [[contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
* [x] I have run the pre-commit checks
* [x] I have made corresponding changes to the documentation (not
applicable: no public API or user workflow changed)
* [x] My changes generate no new warnings
* [x] I have added tests that prove my fix is effective
* [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
* [x] I have added my name to `CONTRIBUTORS.md`

---------

Co-authored-by: NeoZng <[email protected]>
@kellyguo11
kellyguo11 requested a review from a team September 7, 2026 19:32
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 7, 2026
@kellyguo11

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 7, 2026
@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This backport preserves MuJoCo-authored joint friction and damping when Newton imports USD physics models.

  • Centralizes USD schema-resolver selection on the active Newton manager.
  • Enables the MuJoCo resolver only for managers that register MuJoCo solver attributes, including nested and custom coupled managers.
  • Applies the policy to standalone stage import and vectorized clone replication while retaining Newton and PhysX precedence.
  • Adds regression coverage and changelog fragments for both affected packages.

Confidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule violations were identified.

The active standalone and clone import paths consistently use the manager-owned resolver policy, current MuJoCo-capable managers advertise the required capability, resolver precedence is covered, and fixed resolvers remain confined to the shadow visualization model.

Important Files Changed

Filename Overview
source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py Adds manager-owned schema-resolver selection and conditionally enables MuJoCo property import based on registered solver capabilities.
source/isaaclab_newton/isaaclab_newton/cloner/replicate.py Replaces the clone path’s fixed resolver pair with the active manager’s resolver policy.
source/isaaclab_contrib/isaaclab_contrib/coupling/coupler.py Extends capability detection across configured nested solver entries for coupled managers.
source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py Covers standalone and cloned imports, solver scoping, and Newton-over-PhysX-over-MuJoCo precedence.
source/isaaclab_contrib/test/coupling/test_coupler.py Verifies that generic coupled managers import MuJoCo joint properties only when a nested solver consumes them.
source/isaaclab_contrib/test/custom_coupling/test_manager.py Verifies MuJoCo property preservation for the custom MJWarp/VBD coupled manager.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[USD stage] --> B{Import path}
    B -->|Standalone| C[NewtonManager.instantiate_builder_from_stage]
    B -->|Clone replication| D[_build_newton_builder_from_mapping]
    C --> E[Active manager resolver policy]
    D --> E
    E --> F[Newton resolver]
    E --> G[PhysX resolver]
    E -->|MuJoCo-capable manager| H[MJC fallback resolver]
    F --> I[Newton ModelBuilder]
    G --> I
    H --> I
    I --> J[Final Newton model with joint properties]
Loading

Reviews (1): Last reviewed commit: "Add missing isaaclab_contrib changelog f..." | 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

The backport centralizes USD schema-resolver selection on the active Newton manager and applies it consistently to standalone stage imports and clone-mapping imports, including nested coupled solvers.

  • Design and architecture: The manager-owned resolver policy aligns with existing builder-attribute delegation. Coupled managers propagate nested solver capabilities, allowing MuJoCo schemas only when a configured solver consumes them.
  • API: No public API or dependency changes are introduced. The new private classmethod hooks preserve resolver precedence by appending the MuJoCo resolver after Newton and PhysX, and both affected source packages include changelog fragments.
  • Implementation: The standalone and Torch-based clone producer paths both consume the active manager's resolver policy, while focused tests cover manager selection, coupled solvers, and resolver precedence. Supported-platform runtime validation remains delegated to release CI because it was not rerun on the reported macOS host.

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.

@kellyguo11

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 7, 2026
@kellyguo11
kellyguo11 merged commit e180372 into isaac-sim:release/3.0.0 Sep 7, 2026
80 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants