Skip to content

Enable deterministic Newton physics - #6930

Open
kellyguo11 wants to merge 4 commits into
isaac-sim:developfrom
kellyguo11:kellyguo11/newton-gpu-determinism
Open

Enable deterministic Newton physics#6930
kellyguo11 wants to merge 4 commits into
isaac-sim:developfrom
kellyguo11:kellyguo11/newton-gpu-determinism

Conversation

@kellyguo11

@kellyguo11 kellyguo11 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Add an explicit NewtonCfg.deterministic_mode setting for Newton physics. The not_guaranteed, run_to_run, and gpu_to_gpu values map to Warp's corresponding deterministic modes.

Apply the selected mode to supported Newton solver kernels and deterministic contact ordering in the collision pipeline, including matching the pipeline's deterministic sort capacity to solver contact capacity. MJWarp on the GPU, XPBD, and Featherstone are supported. Unsupported solver paths (Kamino, implicit MPM, and MJWarp's MuJoCo CPU backend) are rejected only when a Newton determinism guarantee is explicitly configured.

The existing AppLauncher --deterministic RTX setting and behavior remain unchanged. Supported custom solver-configuration subclasses retain deterministic support.

No new dependencies are required. The pinned Newton revision already provides the required solver and collision-pipeline determinism APIs.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Screenshots

Not applicable; this is a physics-configuration change.

Validation

  • uv run --frozen python -m pytest source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py -k deterministic -q — 8 passed, 84 deselected
  • Subclass regression test verified to fail before the fix and pass after it
  • uv run --isolated --extra test -- sphinx-build -W --keep-going -j auto docs docs/_build/current — build succeeded
  • uv run --frozen isaaclab -f — all hooks passed before commit and before push

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run --frozen isaaclab -f
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Map --deterministic to Newton's GPU_TO_GPU mode and apply it to supported solvers and the collision pipeline. Reject unsupported solver paths instead of silently weakening the guarantee.

Keep deterministic collision buffers aligned with solver contact capacity and document and test the new behavior.
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Aug 6, 2026
@kellyguo11
kellyguo11 marked this pull request as ready for review August 6, 2026 04:41
@kellyguo11
kellyguo11 requested a review from a team August 6, 2026 04:41
@kellyguo11 kellyguo11 moved this to In review in Isaac Lab Aug 6, 2026
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR maps the launcher’s deterministic flag to Newton’s cross-GPU deterministic mode and propagates that setting through supported solvers and collision processing.

  • Adds the Newton determinism configuration field, validation, and solver argument propagation.
  • Enables deterministic collision ordering and aligns collision-pipeline contact capacity with solver capacity.
  • Rejects solver paths that cannot provide the requested guarantee.
  • Updates launcher behavior, documentation, changelog fragments, and focused tests.

Confidence Score: 4/5

The PR needs a fix before merging because deterministic initialization rejects subclasses of otherwise supported solver configurations.

Exact class-name validation turns a supported solver configuration into an initialization error as soon as users derive a custom configuration class from it.

Files Needing Attention: source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/app/sim_launcher.py Propagates launcher determinism to every concrete Newton configuration after physics overrides are resolved.
source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py Applies determinism to solver and collision initialization, but exact-name validation incorrectly rejects subclasses of supported solver configurations.
source/isaaclab_newton/isaaclab_newton/physics/newton_manager_cfg.py Adds and validates the public Newton deterministic-mode configuration.
source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py Covers propagation, unsupported built-in solvers, and deterministic contact capacity, but not supported configuration subclasses.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[--deterministic] --> B[Simulation config scan]
    B --> C[NewtonCfg deterministic_mode = gpu_to_gpu]
    C --> D[NewtonManager initialization]
    D --> E{Solver supported?}
    E -->|No| F[Raise ValueError]
    E -->|Yes| G[Pass DeterministicMode to solver]
    G --> H[Create deterministic collision pipeline]
    H --> I[Match contact capacity to solver]
Loading

Reviews (1): Last reviewed commit: "Enable deterministic Newton physics" | Re-trigger Greptile

Comment on lines +1960 to +1961
solver_cfg_type = type(solver_cfg).__name__
if solver_cfg_type not in _DETERMINISTIC_SOLVER_CFG_TYPES:

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.

P1 Supported subclasses fail validation

When a custom configuration subclasses FeatherstoneSolverCfg, MJWarpSolverCfg, VBDSolverCfg, or XPBDSolverCfg, exact class-name validation rejects it even though it retains a supported deterministic solver, causing solver initialization to raise ValueError.

@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 deterministic-mode wiring is coherent and preserves existing Newton configuration when the flag is omitted. However, the changelog does not disclose that --deterministic now rejects unsupported Newton solver configurations that previously continued running.

  • Design and architecture: Determinism intent is applied during launcher scanning and translated to Warp’s enum at the Newton boundary. The fail-loud policy for Kamino, implicit MPM, and MuJoCo CPU is explicit and defensible, but it changes existing launcher behavior from advisory to run-blocking for those configurations.
  • API: NewtonCfg.deterministic_mode is validated and defaults to "not_guaranteed", while --deterministic selects "gpu_to_gpu". Because existing --deterministic command lines using unsupported Newton paths now raise an error, the Isaac Lab changelog must record this under Changed as a breaking behavior change and provide migration guidance.
  • Implementation: The implementation applies the launcher override after physics selection, forwards the resolved mode to supported solvers, enables deterministic collision ordering, and rebuilds the collision pipeline when needed to match solver contact capacity. No additional implementation defect is established by the candidate review.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

Added
^^^^^

* Added Newton physics handling to ``--deterministic`` so the flag selects

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.

🟡 Warning · Api — Changelog omits --deterministic behavior change

--deterministic previously only affected rendering and torch determinism, so it ran fine with any Newton solver. The launcher now stamps gpu_to_gpu on every NewtonCfg, and _validate_deterministic_solver_cfg raises for Kamino, implicit MPM, and MuJoCo-CPU configs, aborting command lines that worked before. Per the changelog rules this belongs under Changed (breaking) with migration guidance, in addition to the Added entry.

kellyguo11 and others added 3 commits August 6, 2026 08:43
Keep the existing RTX launcher setting unchanged.

Expose Newton determinism only through NewtonCfg.

Validate supported solver config subclasses by type.

Custom configurations now retain deterministic support.
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 isaac-lab Related to Isaac Lab team

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

1 participant