Skip to content

[Core] Fix USD localization edge cases - #8070

Merged
ooctipus merged 6 commits into
isaac-sim:developfrom
kellyguo11:codex/fix-usd-localization-followups
Sep 28, 2026
Merged

ooctipus merged 6 commits into
isaac-sim:developfrom
kellyguo11:codex/fix-usd-localization-followups

Conversation

@kellyguo11

@kellyguo11 kellyguo11 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix USD localization while keeping dependency interpretation with USD and the material loaders.

  • Retrieve the requested file in the destination stage's resolver context before creating its prim. Failed retrieval leaves no empty prim blocking retry.
  • Resolve references afresh on each retrieval. Remove the persistent resolved-tree cache and its dependency/file-stamp bookkeeping, which missed newly available files and changed search-path precedence. Keep raw download reuse, atomic writes, and request-local deduplication for shared dependencies and cycles.
  • Retry failed remote metadata queries; forced retrieval refreshes the relevant revision metadata.
  • Preserve unresolved references and original MDL/UDIM source anchors. Remove regex-based MDL dependency parsing and contiguous UDIM enumeration; native loaders handle these resources.

Authored layers and raw downloads remain unchanged. Requested-file and transfer failures still raise. Localization does not validate composition or rendering readiness. Public function signatures are unchanged.

Related: #8011, #8061.

Validation

  • 65 local asset tests passed; two live-server checks excluded. Existing resolution/retry tests were extended, with failures verified before the fix.
  • Three additional review probes passed: a newly available local reference, a nearer search-path match, and forced retry of a previously missing remote dependency.
  • Cartpole, Franka, and Kuka assets composed successfully. A 4096-environment Kuka/Newton run initialized, reset, and stepped on GPU 0.
  • Three Kit prim tests and the textured-first-frame camera test passed on GPU 0.
  • uv run isaaclab -f passed, including the changelog check against this PR's base.

Cache trade-off: isolated repeated localization added approximately 4 ms for Cartpole and 30–37 ms for Franka/Kuka compared with the old resolved-tree shortcut. First retrieval was similar in the measured pair. The startup runs overlapped another GPU job, so they are not used as performance evidence; no startup speedup is claimed.

The complete PR is net −99 production lines and −32 lines overall against its base. No new production class, module, or public API is introduced.

Release backport

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

@kellyguo11
kellyguo11 requested a review from a team September 26, 2026 20:10
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Sep 26, 2026
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Fixes USD asset localization and path resolution edge cases.

The PR should not merge until cached localization checks remote dependencies before reusing a working copy.

Findings

  1. P1 Remote dependencies become stale ▶

Summary

This PR changes USD prim creation to retrieve references before defining prims, adds authored-path aliases for completed localization trees, preserves unresolved relative references, and resolves Windows drive paths as local paths.

  • The new cache-hit path does not check freshness of remote dependencies before reusing a localized tree.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Request USD source] --> B{Completed tree cached?}
  B -- No --> C[Prepare source and dependencies]
  B -- Yes --> D[Check local file stamps]
  D --> E[Check remote freshness of entry source only]
  E --> F[Return localized working copy]
  C --> F
Loading

Reviews (1) · Last reviewed commit: "Fix USD localization edge cases"

except OSError:
pass
files_match = False
remote_is_current = not _is_remote_path(source) or bool(_usable_mirror(source, cached_download_dir))

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 Remote dependencies become stale

When a local USD scene has a remote sublayer, this cache check treats the local source as current without checking the sublayer. If the sublayer changes on the server while the local file stamps stay the same, a later request returns the old working copy instead of the updated scene. Check remote dependencies before reusing the completed tree.

@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

Reviewed the four localization changes: retrieving a USD before prim definition, indexing completed localization trees by authored and produced paths, preserving unresolved relative references, and distinguishing Windows drive paths from URL schemes. The patch and targeted regressions consistently support these fixes; no candidate findings were supplied or substantiated.

  • Design and architecture: The localization cache now stores source, result, cache directory, and file stamps under both source and produced-path keys. Reuse remains guarded by cache identity, file stamps, and remote freshness, while incomplete trees are excluded from registration. Preserving unresolved references intentionally retains dependence on the caller’s OpenUSD resolver context.
  • API: Public signatures and return types remain unchanged. The observable change to create_prim is limited to avoiding a residual prim after failed USD retrieval. The new path-classification and cache-key helpers are private, and the user-visible fixes have an isaaclab changelog fragment.
  • Implementation: Traced successful and incomplete localization paths, source/result cache lookups, stamp and remote-freshness validation, unresolved-reference rewriting, Windows path joining through ntpath, and the reordered create_prim reference flow. Tests cover authored-path reuse, resolver-context sublayers, Windows drive paths, and retry after failed retrieval; the latter still relies on simulator-backed CI on a supported 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.

@ooctipus

Copy link
Copy Markdown
Collaborator

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 27, 2026
@ooctipus

Copy link
Copy Markdown
Collaborator

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 27, 2026
@ooctipus

Copy link
Copy Markdown
Collaborator

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 27, 2026
@ooctipus

Copy link
Copy Markdown
Collaborator

Fixed the material-path regression in 790d29c. Kit resolves OmniPBR.mdl but returns false for IsContextDependentPath; that check was incorrectly turning built-in module names into asset-relative HTTP URLs. The fix preserves native module names and keeps explicit relative module paths anchored to their source.

The ground-plane tests now read the textures resolved by USD rather than assuming the returned file sits beside the raw downloads. The existing USD-contract test also checks that OmniPBR.mdl remains intact; it fails before this fix and passes afterward. No image tolerances were changed.

GPU 0 validation:

  • 65 asset tests passed in standalone USD; five focused material/localization cases also passed under Kit.
  • All three ground-plane tests passed.
  • The previously failing Newton/Kit tiled visualizer cases for Cartpole, Shadow Hand, and Anymal-D passed.
  • PPISP (two tests) and PhysX scene partitioning (five tests) passed on both the candidate and unchanged PR base locally. Their CI failures did not reproduce here.
  • PhysX/Isaac RTX Cartpole passed. Newton/Isaac RTX still reports a 2.07% golden mismatch on both base and candidate; the actual RGB PNGs have identical SHA-256 hashes, so this remaining mismatch is not introduced by this PR.
  • Formatting and changelog checks passed.

Separately, the follow-up review found that repeated localization now produces different layer identifiers, preventing identical references from sharing a native USD prototype. This CI fix does not address that remaining issue; passing CI alone will not establish that the PR is ready to merge.

@ooctipus

Copy link
Copy Markdown
Collaborator

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 28, 2026
@ooctipus
ooctipus merged commit 12674d1 into isaac-sim:develop Sep 28, 2026
53 checks passed
@ooctipus
ooctipus deleted the codex/fix-usd-localization-followups branch September 28, 2026 00:58
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 28, 2026
## Summary

Fix USD localization while keeping dependency interpretation with USD
and the material loaders.

- Retrieve the requested file in the destination stage's resolver
context before creating its prim. Failed retrieval leaves no empty prim
blocking retry.
- Resolve references afresh on each retrieval. Remove the persistent
resolved-tree cache and its dependency/file-stamp bookkeeping, which
missed newly available files and changed search-path precedence. Keep
raw download reuse, atomic writes, and request-local deduplication for
shared dependencies and cycles.
- Retry failed remote metadata queries; forced retrieval refreshes the
relevant revision metadata.
- Preserve unresolved references and original MDL/UDIM source anchors.
Remove regex-based MDL dependency parsing and contiguous UDIM
enumeration; native loaders handle these resources.

Authored layers and raw downloads remain unchanged. Requested-file and
transfer failures still raise. Localization does not validate
composition or rendering readiness. Public function signatures are
unchanged.

Related: #8011, #8061.

## Validation

- 65 local asset tests passed; two live-server checks excluded. Existing
resolution/retry tests were extended, with failures verified before the
fix.
- Three additional review probes passed: a newly available local
reference, a nearer search-path match, and forced retry of a previously
missing remote dependency.
- Cartpole, Franka, and Kuka assets composed successfully. A
4096-environment Kuka/Newton run initialized, reset, and stepped on GPU
0.
- Three Kit prim tests and the textured-first-frame camera test passed
on GPU 0.
- `uv run isaaclab -f` passed, including the changelog check against
this PR's base.

Cache trade-off: isolated repeated localization added approximately 4 ms
for Cartpole and 30–37 ms for Franka/Kuka compared with the old
resolved-tree shortcut. First retrieval was similar in the measured
pair. The startup runs overlapped another GPU job, so they are not used
as performance evidence; no startup speedup is claimed.

The complete PR is net **−99 production lines** and **−32 lines
overall** against its base. No new production class, module, or public
API is introduced.

## Release backport

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

---------

Co-authored-by: Octi Zhang <[email protected]>

(cherry picked from commit 12674d1)
@isaaclab-bot

isaaclab-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as 7916baa.

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.

2 participants