Skip to content

[Fix] Set Warp's global determinism mode under --deterministic - #7561

Merged
kellyguo11 merged 6 commits into
isaac-sim:developfrom
hujc7:jichuanh/warp-global-determinism
Sep 4, 2026
Merged

kellyguo11 merged 6 commits into
isaac-sim:developfrom
hujc7:jichuanh/warp-global-determinism

Conversation

@hujc7

@hujc7 hujc7 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Description

--deterministic did not make camera observations reproducible. Training Isaac-Cartpole-Camera --deterministic on an RTX PRO 6000 Blackwell splits into two bitwise-identical outcome clusters; on an L40 it does not. Reported as NVBug 6658578 against Isaac Lab 3.0 GA.

Newton's solvers accept a deterministic argument and apply it as a per-module option, so PR #7334 already covered the physics kernels. Its sensor and geometry kernels take no such argument and fall back to warp.config.deterministic, which stayed at NOT_GUARANTEED — Isaac Lab has never set it (git log --all -S "config.deterministic" is empty).

The concrete path: newton._src.geometry.bvh.compute_enabled_shapes claims output slots with wp.atomic_add, so the enabled-shape order — and with it the primitive order the scene BVH is built over — varies between processes. Ray queries then break ties differently, and a tiled camera renders a few pixels differently from bit-identical simulation state. That is enough to make an image-observation policy diverge.

apply_env_overrides now also requests wp.config.deterministic = RUN_TO_RUN. Warp reads the setting at module build time and the BVH is built during ModelBuilder.finalize(), so the request must land before the environment is created — _apply_deterministic_request at solver init is too late. An explicitly chosen mode such as GPU_TO_GPU is left alone.

Type of change

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

Validation

Where the divergence starts, from the real training path with every renderer input fingerprinted per frame (6 runs, Blackwell). All geometric inputs are bit-identical at the frame where the output already differs:

cam_xform / cam_rays / shape_transform / shape_body : never diverge
body_q, BVH bounds                                  : render 390  (after)
rendered colour (output)                            : render 389  (first)

Isaac-Cartpole-Camera --deterministic, epoch-25 reward, unique run dirs, 8 runs per arm:

Branch Configuration Runs Distinct outcomes
develop before this change 8 2
develop wp.config.deterministic set externally 8 1
develop this change, plain --deterministic 8 1
release/3.0.0 before 8 2
release/3.0.0 wp.config set 8 1

Architecture control on L40 (4gpu), 12 runs, unique run dirs: all identical — the defect does not reproduce on Ada, which is why PR #7334's L40-only validation missed it.

Unit tests: 31 pass in test_entrypoints_common.py, including three added here covering the request, an explicit mode being preserved, and no change without the flag.

Fixes NVBug 6658578.

Follow-up (not in this PR)

Newton-side: sensor and geometry modules should accept a deterministic option like the solvers do, rather than depending on a process global; and compute_enabled_shapes produces order-dependent output regardless of that setting.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • 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

Newton's solvers take a deterministic argument and apply it as a per-module
option, so the solver kernels already honoured PhysicsCfg.deterministic. Its
sensor and geometry kernels take no such argument and fall back to
warp.config.deterministic, which stayed at NOT_GUARANTEED.

The scene BVH is built over a shape list compacted with wp.atomic_add, so its
primitive order varied between processes. Ray queries then broke ties
differently and a tiled camera rendered a few pixels differently from
bit-identical simulation state, which was enough to make an image-observation
policy diverge.

Warp reads the setting at module build time, so it is requested in
apply_env_overrides, before the environment is created. An explicitly chosen
mode is left alone.
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 4, 2026
…un-to-run

NewtonCfg.deterministic_mode maps to the same warp.DeterministicMode enum the
global uses, so a backend asking for gpu_to_gpu was getting the stronger
guarantee on its solver kernels and a weaker run_to_run everywhere else.

The config strings are the enum members lowercased, so the mode is resolved by
name rather than by duplicating Newton's mapping table.
The previous guard skipped the request whenever warp.config.deterministic was
not NOT_GUARANTEED, treating any non-default value as a deliberate choice. It
cannot tell one from the other, and it left a configured gpu_to_gpu below the
requested guarantee when something had already selected run_to_run.

The modes are ordered by strength, so the request now only ever raises the
setting: a stronger guarantee already in place is kept, a weaker one is
upgraded.
@hujc7

hujc7 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator 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 4, 2026
@hujc7
hujc7 marked this pull request as ready for review September 4, 2026 07:31
@hujc7
hujc7 requested a review from a team September 4, 2026 07:31
@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes deterministic training request Warp's process-global determinism mode before environment creation, preserving stronger configured guarantees.

  • Adds mode selection and monotonic global configuration to the shared training override path.
  • Adds unit coverage for default, stronger, preconfigured, and disabled behavior.
  • Documents the Newton camera/BVH determinism mechanism and adds a changelog entry.

Confidence Score: 4/5

The PR needs the play and evaluation entrypoints to apply the new Warp request before merging, otherwise --deterministic still leaves camera observations nondeterministic on those supported paths.

The mode mapping and training call order are sound, but the shared CLI flag reaches play entrypoints that create environments without invoking the newly added global Warp configuration.

Files Needing Attention: source/isaaclab_rl/isaaclab_rl/entrypoints/common.py and the play entrypoints

Important Files Changed

Filename Overview
source/isaaclab_rl/isaaclab_rl/entrypoints/common.py Adds correct Warp mode mapping for training overrides, but the helper is not reached by play/evaluation entrypoints.
source/isaaclab_rl/test/test_entrypoints_common.py Thoroughly covers isolated helper behavior but does not cover play-entrypoint integration.
docs/source/features/reproducibility.rst Explains the determinism mechanism accurately but states an unqualified flag guarantee that play paths do not satisfy.
source/isaaclab_rl/changelog.d/warp-determinism-global.rst Records the camera determinism fix, though its broad wording shares the play-path limitation.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Flag[--deterministic] --> Train[Training entrypoints]
  Flag --> Play[Play entrypoints]
  Train --> Overrides[apply_env_overrides]
  Overrides --> Warp[Set Warp deterministic mode]
  Warp --> TrainEnv[Create training environment]
  Play --> Seed[Configure seed only]
  Seed --> PlayEnv[Create play environment]
  PlayEnv -. missing Warp request .-> Warp
Loading

Reviews (1): Last reviewed commit: "Raise Warp's determinism mode instead of..." | Re-trigger Greptile

physics_cfg = getattr(getattr(env_cfg, "sim", None), "physics", None)
if physics_cfg is not None:
physics_cfg.deterministic = True
request_warp_determinism(physics_cfg)

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 Play paths skip Warp determinism

When a camera-based play or evaluation command uses --deterministic, the play entrypoints configure the seed but never invoke apply_env_overrides or request_warp_determinism, causing Newton sensor and geometry kernels to retain Warp's nondeterministic default and camera observations to remain non-reproducible.

Knowledge Base Used: Learning workflows

@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 implementation correctly applies Warp’s process-global determinism mode before environment and BVH construction, but the reproducibility documentation overstates the scope of this behavior.

  • Design and architecture: Applying the request in the RL entrypoint’s apply_env_overrides path satisfies Warp’s module-build-time ordering requirement and preserves stronger configured modes. The behavior is specifically tied to RL entrypoints, not AppLauncher globally.
  • API: The documentation states that --deterministic sets warp.config.deterministic, although the new behavior only occurs when isaaclab_rl.entrypoints.common.apply_env_overrides is called. Qualify this promise as applying to the RL training entrypoints so standalone AppLauncher users are not given an incorrect contract.
  • Implementation: The helper raises the Warp mode monotonically, preserves GPU_TO_GPU, tolerates absent physics configuration, and is covered by focused tests that restore the process-global setting through monkeypatch.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

**Warp determinism.** Newton's solvers accept a ``deterministic`` argument that Isaac Lab supplies
from :attr:`~isaaclab.physics.PhysicsCfg.deterministic`, and they apply it as a per-module option.
Its sensor and geometry kernels take no such argument and fall back to ``warp.config.deterministic``,
so ``--deterministic`` sets that global to ``RUN_TO_RUN`` as well. Without it the scene BVH is built

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 — Warp determinism promise is not entrypoint-scoped

The paragraph opens by attributing --deterministic to AppLauncher.add_app_launcher_args and then states the flag sets warp.config.deterministic to RUN_TO_RUN. In this diff the global is only set by isaaclab_rl.entrypoints.common.apply_env_overrides, so a standalone script that launches with --deterministic but never calls that helper still renders Newton cameras with NOT_GUARANTEED. Qualify the sentence as applying to the RL training entrypoints, as the Torch and physics paragraphs already do.

@AntoineRichard AntoineRichard left a comment

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'd double check if we really need all these tests. Otherwise looks good.

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.

Are all these tests really required?

Six near-identical cases each set up a config and asserted one mode. They are
one function over (already set, configured mode) -> expected, which covers two
combinations the separate tests missed and drops roughly half the test code.
apply_env_overrides is a training-entrypoint helper, so --deterministic reached
neither the physics config nor Warp's global on the play paths, which build their
own environments. They now share a request_determinism() helper, called before the
environment exists so Warp's module-build-time read still sees it.

Also qualify the reproducibility docs: the flag configures Warp through the RL
entrypoints, not through AppLauncher, so a script that builds its own environment
must set warp.config.deterministic itself.
@kellyguo11

Copy link
Copy Markdown
Contributor

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 4, 2026
@kellyguo11
kellyguo11 merged commit 838fb6d into isaac-sim:develop Sep 4, 2026
83 of 84 checks passed
kellyguo11 pushed a commit that referenced this pull request Sep 5, 2026
## Summary

- Bumps Newton from `1.5.1` to `1.6.0rc1`, the first release carrying
[newton#4017](newton-physics/newton#4017),
unblocking the MuJoCo tendon adapter that PR #7161 needs.
- `warp-lang` and `mujoco`/`mujoco-warp` move with it, because
`1.6.0rc1` requires them.
- Pins `newton[sim]` in `[project].dependencies` as well, so a wheel
built from this metadata resolves the fix rather than falling back to
the newest stable.
- Updates test literals in `isaaclab` and `isaaclab_newton` for Newton's
new actuator class names, and asks for a determinism guarantee in the
manipulation determinism test.

# Description

`resolve_fixed_tendon_actuator_columns` reads `mujoco.actuator_trntype`
through an
`ArticulationView`. Every Newton 1.5.x release rejects that with *"has
custom frequency
'mujoco:actuator' which is not supported by ArticulationView"*;
newton#4017 makes
`ArticulationView` generic over custom frequencies.

`1.6.0rc1` (published 2026-09-03) is the first release containing that
fix — verified two ways:
the merge commit `4055a159` is an ancestor of `v1.6.0rc1`, and
`custom_frequency_label_attributes`,
the symbol the fix introduces in `newton/_src/sim/model.py`, is present
at `v1.6.0rc1` and absent
at `v1.5.1`. No `1.6.0` final exists yet, and no 1.5.x backport carries
the fix, so `1.6.0rc1` is
the only released option.

The release requires `warp-lang>=1.17.0` and `mujoco-warp~=3.12.0`, so
those pins move too:

| Package | Before | After |
| --- | --- | --- |
| `newton[sim]` | `1.5.1` | `1.6.0rc1` |
| `warp-lang` | `1.16.0` | `1.17.0` |
| `mujoco` | `3.11.0` | `3.12.0` |
| `mujoco-warp` | `3.11.0` | `3.12.0` |

`warp-lang` is pinned to the `1.17.0` release rather than left as
`>=1.17.0`: Newton's prerelease
enables prerelease resolution, and an unbounded bound then resolves to a
nightly
(`1.18.0.dev20260903`).

## Wheel installs get the pin too

`[tool.uv].override-dependencies` only reaches `uv sync`, so it does not
constrain a wheel built
from this metadata. `1.6.0rc1` is a prerelease, which a default resolve
skips, so a loose bound
resolved `newton 1.5.1` — without newton#4017, the fix this bump exists
to deliver. Since
`wheel.yml` builds on every push to `develop`, that would have shipped.

`[project].dependencies` now pins `newton[sim]==1.6.0rc1`, matching the
override. A default
resolve of the new metadata returns `1.6.0rc1` under both `uv pip
compile` and `pip download`,
with no `--pre` flag. `isaacsim-core==6.0.1.0` requires
`newton[sim]==1.2.1`, so installing the
`isaacsim` extra still needs an override — exactly as on `develop`,
which carries an equally
exact pin in the same place.

## Newton actuator class rename

`1.6.0rc1` introduces `DrivePD` / `DriveNeuralMLP` / `DriveNeuralLSTM`
alongside the existing
`ControllerPD` / `ControllerNeural*`. Both names remain importable, so
this is **not** a breaking
API change and no production code changes. Tests in `isaaclab` and
`isaaclab_newton` assert on the
class name Newton *constructs with*, which switched to the `Drive*`
form, so those literals are
updated.

## Determinism

`test_manipulation_env_determinism[cuda-Isaac-Open-Drawer-Franka]`
failed on this branch in CI.
Two separate questions: whether the bump caused it, and why it failed at
all.

**Not caused by the bump.** Each arm was run 5x on the same machine,
because a single run of an
intermittent test samples a coin rather than measuring it:

| GPU | develop pins (`newton 1.5.1` / `warp 1.16.0` / `mujoco 3.11.0`)
| this PR (`newton 1.6.0rc1` / `warp 1.17.0` / `mujoco 3.12.0`) |
| --- | --- | --- |
| RTX PRO 6000 Blackwell | 3 / 5 failed | 3 / 5 failed |
| L40 | 3 / 3 passed | 4 / 4 passed |

Both pin sets fail at the same rate on Blackwell and both are clean on
L40, so the failure is
hardware-dependent, not version-dependent. Intermediate Newton revisions
(the commits before and
at [newton#4119](newton-physics/newton#4119),
the MuJoCo 3.12 bump) show
the same behaviour, so neither Warp 1.17, MuJoCo 3.12, nor #4119 is
implicated.

**Why it failed.** The test asserted bit-reproducible rewards without
ever asking for a
determinism guarantee. Newton defaults to
`wp.DeterministicMode.NOT_GUARANTEED`, under which
Warp's atomics may accumulate in any order, so two runs of the same
environment are not required
to agree — the assertion was stricter than the configuration it ran
under, and whether it held
came down to GPU scheduling.

The Newton-backed case now passes `deterministic_mode="run_to_run"`,
which is exactly the
guarantee this test asserts: one device, one process, run twice.
`deterministic_mode` is a Newton
setting, so the PhysX-backed `IsaacContrib-Lift-Cube-Franka` case leaves
it unset and the helper
keeps asserting that the mode is only applied to a `NewtonCfg` backend.
This is a
test-configuration fix, not a masking of the intermittency: the
guarantee the assertion depends
on is now actually requested.

Related: [#7561](#7561)
addresses the adjacent layer and
does not overlap this PR. Newton's solvers take a per-module
`deterministic` argument, which is
what `deterministic_mode` reaches and what this PR sets; Newton's sensor
and geometry kernels take
no such argument and fall back to the `warp.config.deterministic`
global, which #7561 raises from
the same config field in the RL entrypoint.

## Type of change

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

## Release backport

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

## Validation

- `uv lock --check` — clean; the relock moves exactly the four packages
above, and the
  `[project].dependencies` pin moves exactly one further lockfile line
- Default resolve of the published metadata returns `newton==1.6.0rc1`
under both
  `uv pip compile` and `pip download`, with no `--pre` flag
- `uv run --frozen python -m pytest
source/isaaclab/test/cli/test_wheel_builder_metadata.py
source/isaaclab/test/cli/test_uv_run_pyproject.py` — 21 passed, which
enforces that the two generated `uv-overrides.txt` files match the
override table and that `[tool.isaaclab.versions]` mirrors the
dependency pins
- `uv run isaaclab -f` — passed
- Full Docker + Tests suite — **48 passed / 0 failed** on `b184335e80b`
kellyguo11 added a commit that referenced this pull request Sep 5, 2026
…7561) (#7586)

# Description

Backports #7561 to `release/3.0.0`.

This branch cherry-picks the canonical merged commit
`838fb6d66288cc5f452c3aa1b1ad57f420e0f0e4` with `-x` provenance. The
change applied without conflicts or release-specific edits. The
repository backport validator confirms an exact patch replay across all
eight source paths, and the stable source/backport patch IDs match.

| Field | Commit |
|---|---|
| Original merged change | `838fb6d66288cc5f452c3aa1b1ad57f420e0f0e4` |
| Release base used | `1c754876008f0806fdcfda8e3a6b2f593b34d6fc` |
| Backport commit | `6044466990af2cb4b54f07f3705e37f16e6a4d58` |
| Stable patch ID | `643b6fbbd03866389488b17070db3504315b4a41` |

## Type of change

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

## Release backport

- This PR targets the active `release/3.0.0` branch directly.

## Validation

- Repository exact-patch backport validation passed; all eight source
paths are preserved.
- Stable source/backport patch IDs match:
`643b6fbbd03866389488b17070db3504315b4a41`.
- `test_entrypoints_common.py` — 36 passed in an isolated uv
environment.
- All changed-file pre-commit hooks passed, including changelog and Git
LFS checks.
- `sphinx-lint` reported no problems for the modified RST files.
- `git diff --check upstream/release/3.0.0...HEAD` passed.
- The canonical project formatter and warning-as-error docs build cannot
resolve the release lock on this macOS/arm64 host; Linux CI remains
authoritative for those checks.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the available pre-commit checks
- [x] The original documentation update is preserved exactly
- [x] My changes generate no new warnings
- [x] The original regression coverage is preserved and passes
- [x] The `isaaclab_rl` changelog fragment is preserved
- [x] The original contributor is already listed in `CONTRIBUTORS.md`

Co-authored-by: hujc <[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 isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants