Skip to content

[omniperf-agent] test(sim): reproduce Newton/UsdPhysics rigid-body de… - #7452

Draft
yts-nv wants to merge 1 commit into
isaac-sim:developfrom
yts-nv:test/newton-usdphysics-shadowhand-repro
Draft

[omniperf-agent] test(sim): reproduce Newton/UsdPhysics rigid-body de…#7452
yts-nv wants to merge 1 commit into
isaac-sim:developfrom
yts-nv:test/newton-usdphysics-shadowhand-repro

Conversation

@yts-nv

@yts-nv yts-nv commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

…scriptor crash

Add a regression reproducer for the intermittent native crash in OpenUSD/usd-exchange UsdPhysics::moveDescsToDict, reached via UsdPhysics.LoadUsdPhysicsFromRange (newton.ModelBuilder.add_usd) when building the Isaac-Shadow-Handover-Direct env on the Newton (newton_mjwarp) backend.

  • check_newton_usdphysics_shadowhand_crash.py: standalone reproducer; amplifies the offending load so the ~2-3%/call fault becomes ~100%/run. Prints COMPLETED_NO_CRASH (exit 0) only when the underlying bug is fixed.
  • test_newton_usdphysics_shadowhand_repro.py: pytest wrapper; runs the reproducer as a subprocess and asserts it completes. Skips on non-Ada GPUs and without Isaac Sim/Newton.

The bug is in OpenUSD/usd-exchange UsdPhysics (or needs a Newton import_usd guard), NOT in Isaac Lab. Verified on develop 630317b on an L40 (Ada, sm_89): SIGSEGV in moveDescsToDict (exit 139) or a glibc heap-corruption abort. Expected to FAIL until the upstream fix lands; ship it in the same PR as that fix.

Description

Important

Confirm the pull request base before submitting. Target develop for all
contributions. The release/3.0.0-beta2 branch is a frozen stable landing
snapshot and is not used for ongoing maintenance.

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Release backport

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

Screenshots

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

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • 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 (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

…scriptor crash

Add a regression reproducer for the intermittent native crash in OpenUSD/usd-exchange
UsdPhysics::moveDescsToDict<UsdPhysicsRigidBodyDesc>, reached via
UsdPhysics.LoadUsdPhysicsFromRange (newton.ModelBuilder.add_usd) when building the
Isaac-Shadow-Handover-Direct env on the Newton (newton_mjwarp) backend.

- check_newton_usdphysics_shadowhand_crash.py: standalone reproducer; amplifies the
  offending load so the ~2-3%/call fault becomes ~100%/run. Prints COMPLETED_NO_CRASH
  (exit 0) only when the underlying bug is fixed.
- test_newton_usdphysics_shadowhand_repro.py: pytest wrapper; runs the reproducer as a
  subprocess and asserts it completes. Skips on non-Ada GPUs and without Isaac Sim/Newton.

The bug is in OpenUSD/usd-exchange UsdPhysics (or needs a Newton import_usd guard), NOT in
Isaac Lab. Verified on develop 630317b on an L40 (Ada, sm_89): SIGSEGV in moveDescsToDict
(exit 139) or a glibc heap-corruption abort. Expected to FAIL until the upstream fix lands;
ship it in the same PR as that fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yts-nv
yts-nv requested a review from a team August 31, 2026 13:34
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Aug 31, 2026
@yts-nv
yts-nv marked this pull request as draft August 31, 2026 13:34

@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

Adds a standalone Newton/UsdPhysics native-crash reproducer and subprocess pytest wrapper, but the PR knowingly introduces a failing Ada test without the corresponding upstream fix. The test also violates the required launcher workflow and has unreliable completion and teardown handling. A changelog fragment is missing for the touched package.

  • Design and architecture: Using a subprocess is appropriate for isolating a process-fatal native crash. However, adding the reproducer directly to the shared simulation suite before the upstream fix makes that suite intentionally red on targeted Ada systems. The wrapper also depends on the repository-root isaaclab.sh launcher despite the repository requirement to run Python scripts and tests through the uv-managed environment.
  • API: No public Isaac Lab API, configuration, or export changes are introduced. The helper consumes existing AppLauncher, task-resolution, Gym, Newton, and UsdPhysics interfaces and monkeypatches LoadUsdPhysicsFromRange only within the subprocess.
  • Implementation: The wrapper accepts the COMPLETED_NO_CRASH marker without requiring a zero subprocess exit code, although the marker is printed before teardown. Additionally, calling simulation_app.close() before os._exit(0) cannot avoid the documented teardown deadlock, while the finally can convert teardown exceptions into success. The regression should land with the fix or be explicitly opt-in/xfail, use the prescribed uv-managed Python path, require coherent marker and exit-status signaling, correct teardown termination, and include the required changelog fragment or .skip fragment.

Significant concerns. Posted 5 actionable findings inline.

Automated review; human maintainers own approval decisions.



@pytest.mark.skipif(not _HELPER.is_file(), reason="reproducer helper script not found")
def test_newton_usdphysics_shadowhand_no_native_crash():

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 · Implementation — Known-failing test added to shared suite

The module docstring and PR description state this test fails until an upstream OpenUSD/usd-exchange or Newton fix lands, and no such fix is included here. On Ada (sm_89) runners every non-skipped path ends in the assert or pytest.fail, making the shared isaaclab sim suite permanently red for a defect outside this repository. Land it together with the fix, or gate it behind an explicit opt-in marker/xfail.


proc = subprocess.run(
[
str(isaaclab_sh),

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 · Design Architecture — Test shells out to isaaclab.sh launcher

Repository guidance reserves ./isaaclab.sh for installer workflows and requires uv run python for scripts and tests. Beyond the rule, _find_isaaclab_sh() returns None for installed/non-checkout environments, so the test silently skips and the regression is never exercised there, and the child may resolve a different interpreter than the parent. Launch the helper via sys.executable or the uv-managed Python entry point.

)
output = (proc.stdout or "") + (proc.stderr or "")

if "COMPLETED_NO_CRASH" in output:

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 · Implementation — Success ignores subprocess exit code

The test returns as soon as COMPLETED_NO_CRASH appears in the captured output, without checking proc.returncode. The helper prints that marker before simulation_app.close(), so a SIGSEGV or heap-corruption abort during Isaac Sim teardown still leaves the marker in stdout and is reported as a clean run. Require both the marker and a zero exit code.


print(f"COMPLETED_NO_CRASH task={args.task} num_envs={args.num_envs} loops={_loops}", flush=True)
try:
simulation_app.close()

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.

🔵 Suggestion · Implementation — Hard exit cannot break teardown deadlock

simulation_app.close() runs before the finally: os._exit(0), so the stated purpose of the hard exit is defeated: if teardown deadlocks as the comment claims, the finally is never reached and the parent blocks until its 900s timeout. The finally also swallows teardown exceptions into exit 0, and makes the declared -> int return unreachable. Hard-exit directly after flushing the marker.

@@ -0,0 +1,132 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).

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.

🔵 Suggestion · Implementation — Missing changelog fragment for isaaclab package

Repository rules require a fragment under source/<pkg>/changelog.d/ for every touched package, using .skip when no release note is warranted. This PR adds files under source/isaaclab without any fragment, leaving the release tooling with no record for the package.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a subprocess-based regression reproducer for the intermittent Newton/UsdPhysics crash when constructing the Shadow Handover environment on Ada GPUs.

  • Wraps LoadUsdPhysicsFromRange to attempt repeated loading of the environment subtree.
  • Adds an Ada-gated pytest wrapper that launches the reproducer and classifies native-crash output.

Confidence Score: 4/5

The PR should not merge until the amplifier is made to repeat the LoadUsdPhysicsFromRange invocation that the target task actually uses.

The target task reaches the wrapped binding with include_paths=["/"], so the new path condition skips all configured amplification and allows the intermittent native crash to produce false-green test runs.

Files Needing Attention: source/isaaclab/test/sim/check_newton_usdphysics_shadowhand_crash.py

Important Files Changed

Filename Overview
source/isaaclab/test/sim/check_newton_usdphysics_shadowhand_crash.py Adds the standalone crash amplifier, but its path gate does not match the flat-load call used by the target task, disabling repetition.
source/isaaclab/test/sim/test_newton_usdphysics_shadowhand_repro.py Adds the subprocess wrapper, platform checks, and native-crash diagnostics without an independent actionable defect.

Reviews (1): Last reviewed commit: "[omniperf-agent] test(sim): reproduce Ne..." | Re-trigger Greptile

Comment on lines +66 to +68
if any("/World/envs/env" in r for r in roots):
for _ in range(_loops):
_orig_load(stage, include_paths, *rest, **kw)

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 When this task uses the default /World/envs/env_{} layout, Newton takes the flat-load path and calls LoadUsdPhysicsFromRange with include_paths=["/"]. This condition therefore skips every repeated call, leaving only the original 2–3% crash opportunity and allowing false-green regression runs.

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.

1 participant