Skip to content

[Test] Fix OpenUSD thread limit in LEAPP tests - #7229

Merged
StafaH merged 2 commits into
isaac-sim:developfrom
StafaH:mh/fix-leapp-openusd-thread-limit
Aug 21, 2026
Merged

[Test] Fix OpenUSD thread limit in LEAPP tests#7229
StafaH merged 2 commits into
isaac-sim:developfrom
StafaH:mh/fix-leapp-openusd-thread-limit

Conversation

@StafaH

@StafaH StafaH commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Fix the recurring isaaclab_rl LEAPP export failure for Isaac-Reach-Franka on Newton MJWarp.

The existing workaround passes limit_cpu_threads=1 to SimulationApp, but the failing stack is in OpenUSD's concurrent parser and OpenUSD reads PXR_WORK_THREAD_LIMIT during process startup. Set that environment variable on every LEAPP child process so USD is serialized before any USD module is imported, while retaining the existing Kit-side limit.

This keeps the current task and Newton backend coverage. It also adds a deterministic subprocess probe for the environment contract.

Observed in unrelated PRs:

OpenUSD documents PXR_WORK_THREAD_LIMIT=1 as single-threaded mode: https://openusd.org/dev/api/thread_limits_8h.html

Type of change

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

Validation

  • uv run --extra sb3 --extra skrl --extra rl-games --extra leapp python -m pytest source/isaaclab_rl/test/export/test_leapp_export_flow.py -k 'openusd_thread_limit or rsl_rl-Isaac-Reach-Franka' -vv (2 passed)
  • uv run isaaclab -f
  • uv run python tools/changelog/cli.py check develop

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab -f
  • Documentation is not required for this test-only mitigation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • I have added a changelog fragment for every touched package
  • My name is already in CONTRIBUTORS.md

@StafaH
StafaH requested a review from a team August 20, 2026 23:07
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 20, 2026

@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 test-only mitigation sets PXR_WORK_THREAD_LIMIT=1 at the shared LEAPP subprocess boundary and adds a focused environment-contract probe plus an isaaclab_rl .skip changelog fragment. The patch is narrowly scoped to the affected integration tests.

  • Design and architecture: Applying the OpenUSD limit in _run_checked consistently covers checkpoint creation and export subprocesses before their Python modules initialize, while retaining the existing Kit-side thread limit. This centralization avoids duplicating environment setup across subprocess call sites.
  • API: The changed constant and helper are private to the test module, so no public API or compatibility surface changes. Copying os.environ before overriding PXR_WORK_THREAD_LIMIT preserves the subprocesses' inherited environment.
  • Implementation: The changed subprocess path injects only the intended variable, reuses the existing thread-limit constant, and retains timeout, output capture, and error reporting behavior. The probe verifies environment propagation rather than OpenUSD behavior itself, but the existing LEAPP export coverage exercises the affected process path.

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.

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR applies PXR_WORK_THREAD_LIMIT=1 to every LEAPP test subprocess before OpenUSD can initialize, while retaining the existing SimulationApp CPU-thread limit.

  • Adds the OpenUSD environment override to the shared subprocess helper.
  • Adds a deterministic subprocess probe for the startup environment contract.
  • Adds the corresponding changelog skip fragment.

Confidence Score: 5/5

The PR appears safe to merge, with the startup environment override consistently applied to every subprocess in the LEAPP export flow.

All relevant checkpoint and export children run through the modified helper, which preserves the parent environment while setting the required OpenUSD thread limit before child initialization.

Important Files Changed

Filename Overview
source/isaaclab_rl/test/export/test_leapp_export_flow.py The shared subprocess helper now establishes the OpenUSD thread limit at child-process startup, and the added probe verifies that contract.
source/isaaclab_rl/changelog.d/mh-fix-leapp-openusd-thread-limit.skip Adds the expected empty skip fragment for this test-only mitigation.

Sequence Diagram

sequenceDiagram
    participant Test as LEAPP pytest
    participant Helper as _run_checked
    participant Child as LEAPP child process
    participant USD as OpenUSD
    Test->>Helper: checkpoint/export command
    Helper->>Child: "start with PXR_WORK_THREAD_LIMIT=1"
    Child->>USD: import and initialize
    USD-->>Child: use single-threaded parsing
Loading

Reviews (1): Last reviewed commit: "Limit OpenUSD threads in LEAPP tests" | Re-trigger Greptile

@StafaH StafaH changed the title Fix OpenUSD thread limit in LEAPP tests [Test] Fix OpenUSD thread limit in LEAPP tests Aug 20, 2026
@StafaH
StafaH enabled auto-merge (squash) August 21, 2026 08:14
@StafaH
StafaH merged commit 35c37ca into isaac-sim:develop Aug 21, 2026
47 of 48 checks passed
kellyguo11 added a commit that referenced this pull request Aug 22, 2026
## Description

Bundled backport to `release/3.0.0` to reduce CI load.

Source PRs reviewed for this bundle:

- #7020 — already represented in `release/3.0.0`; its cherry-pick was
empty, so no duplicate commit was added.
- #7207
- #7229
- #7227
- #7231
- #6762
- #7208
- #7168 — backports the current PR head while the source PR is still
open.
- #7157
- #7216

## Type of change

- Bug fix
- Documentation update
- Workflow / packaging update

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] I have run formatting checks.
- [x] Documentation changes are included.
- [x] Documentation build generates no new warnings.
- [x] Focused regression coverage passed.
- [x] Required changelog fragments are included by the source PRs.
- [x] Contributors are already listed or included by the source PRs.

---------

Signed-off-by: Kelly Guo <kellyg@nvidia.com>
Co-authored-by: Mustafa H <34825877+StafaH@users.noreply.github.com>
Co-authored-by: Richard Lei <rilei@nvidia.com>
Co-authored-by: Mustafa Haiderbhai <mhaiderbhai@nvidia.com>
Co-authored-by: Kelly Guo <kellyg@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants