Repository navigation
[Backport release/3.0.0] Align USD dependencies, OVRTX API, and renderer goldens - #8061
Conversation
## Summary USD composition could fail for `scene.usda -> local robot.usda -> remote asset.usd`, or when a downloaded layer still referenced a remote URL. The common USD reference loader now prepares both local and remote files through one recursive dependency traversal. Changed layers are written as working copies, preserving authored files and raw downloads. Renderer-provided MDL identifiers such as `OmniPBR.mdl` and self-contained USDZ packages retain their resolution behavior. Completed managed local trees skip discovery while their file stamps match; incomplete downloads remain retryable, and remote URL requests retain freshness checks. Fixes isaac-sim#7999 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Validation - Full asset test suite: 66 passed. - Extended the existing composition test with renderer module identifiers and a remote USDZ case; all four composition cases fail on the previous PR revision and pass with this change. - Verified the common reference loader composes a real remote Cartpole through two local wrapper layers. - All 48 previously failing CI cases passed locally with Isaac Sim 6.1.0.0, OVRTX 0.5.0.377615, and OVPhysX 0.6.3. These include the existing Kit and Kitless image comparisons, visualizers, scene partitioning, USDZ demos, and later core/contributed-environment failures. Golden images and rendering thresholds were unchanged. - `uv run isaaclab -f`: passed, including changelog validation against upstream develop. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `uv run isaaclab -f` - [x] My changes generate no new warnings - [x] I have added a test that proves the fix - [x] I have added a changelog fragment for the touched package - [x] My name is already in `CONTRIBUTORS.md` --------- Co-authored-by: Octi Zhang <[email protected]> (cherry picked from commit 5d208f8)
|
| if file_status == 2: | ||
| usd_path = retrieve_file_path(usd_path, force_download=False) | ||
| stage = get_current_stage() | ||
| if not stage.GetPrimAtPath(prim_path).IsValid(): |
There was a problem hiding this comment.
Failed retrieval leaves empty prim
If the USD file is missing or retrieval fails, create_prim defines the prim before add_usd_reference retrieves the file. The failed spawn leaves a valid prim with no USD reference. A retry at the same path then sees that prim and skips adding the reference, so the asset remains empty.
| prepared = {} | ||
| files = {} | ||
| complete = True | ||
| copy_dir = os.path.join(download_dir, f"isaaclab_usd_{uuid.uuid4().hex}") |
There was a problem hiding this comment.
Repeated loads accumulate working copies
Each resolution that rewrites a USD layer creates a new working-copy directory. The completed-tree cache is keyed by the returned path, while repeated spawns pass the configured source path again. Those spawns traverse and export the tree again, leaving another copy and cache entries each time. This adds disk use and parsing work during long runs.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
run-ci |
There was a problem hiding this comment.
Isaac Lab Review Bot
The recursive USD localization backport centralizes dependency traversal and reference rewriting in retrieve_file_path, but its completion cache does not cover repeated calls using the original authored path. This causes redundant traversal and generation of new UUID-named working copies.
- Design and architecture: Localization ownership is coherently centralized in
retrieve_file_path, with callers delegating resolution to it. However,_LOCALIZED_ASSETSrecords produced paths rather than the original request path, so the cache does not serve the normal producer/consumer flow where callers repeatedly submit the authored asset path. - API: The public signatures remain compatible, but repeated
retrieve_file_pathandadd_usd_referencecalls with the same authored path do not receive stable reuse from the new completion-cache behavior. The memo should also index the requested source path. - Implementation: At line 757, completed trees are stored only under each produced
local_pathwhen it differs fromsource. Repeating the original source therefore re-traverses dependencies and may export anotherisaaclab_usd_<uuid>tree, preventing layer sharing and accumulating temporary copies. Indexing completed results by the original request path would address the demonstrated path mismatch.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
| if complete: | ||
| for source, local_path in prepared.items(): | ||
| if source != local_path: | ||
| _LOCALIZED_ASSETS[local_path] = (source, files) |
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Completion cache keyed by output, not requested path
_LOCALIZED_ASSETS is keyed by the produced copy path and written only when source != local_path. Callers such as add_usd_reference pass the authored usd_path on every spawn, so each call re-walks the dependency tree and, when references are rewritten, exports another isaaclab_usd_<uuid> copy. The same asset then resolves to different layer files across calls, defeating layer sharing and accumulating temp copies. Also index the memo by the requested path.
|
run-ci |
| and check_file_path(dependency) == 0 | ||
| ): | ||
| return ref | ||
| resolved = prepare(dependency) or dependency |
There was a problem hiding this comment.
P1: A local USD layer can resolve a relative sublayer through an OpenUSD search path. I reproduced scene.usda with @robot.usda@ found through Ar.DefaultResolverContext and a remote sibling that requires a working copy. Before retrieval the stage contains /robot; after retrieval, the exported layer points robot.usda to a nonexistent absolute path beside scene.usda, and /robot disappears even with the same resolver context. Here prepare(dependency) returns None, but the fallback writes that guessed absolute path. Could we preserve the original relative asset path when preparation fails, or resolve it through Ar before rewriting?
| nonlocal changed | ||
| if not ref: | ||
| return ref | ||
| dependency = _resolve_reference_url(source, ref) |
There was a problem hiding this comment.
P1: This traversal now reaches relative references from local Windows layers. For a local C:\assets\scene.usda referring to robot.usda, _resolve_reference_url treats C: as a URL scheme and returns c://robot.usda instead of the sibling C:\assets\robot.usda. The local child is never traversed, so a local -> local -> remote chain is not prepared on Windows. Could we classify drive paths as local before URL resolution and add a Windows-path regression test?
| @@ -0,0 +1,7 @@ | |||
| Removed | |||
There was a problem hiding this comment.
P1: The .major.rst suffix tells the changelog compiler to bump isaaclab_ov from 3.2.1 to 4.0.0; python3 tools/changelog/cli.py compile --package isaaclab_ov --dry-run prints that exact result on this head. The scheduled compiler includes release/3.0.0 and pushes its version updates. Is a 4.0.0 package version intended for this release backport? If the release line should stay on 3.x, please use the appropriate fragment tier while keeping the breaking-change note and migration guidance.
marcodiiga
left a comment
There was a problem hiding this comment.
I found no P0 in this code-owner pass, so approving. USD dependency preparation remains in Isaac Lab before OVStage population and OVPhysX attachment; I found no new OVPhysX USD coupling. Please resolve the inline findings on search-path composition, Windows drive paths, and the release version bump before merge. The existing retry and repeated-copy comments are also actionable.
## 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]>
## 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)
Description
Aligns
release/3.0.0withdevelopfor the remaining source behavior and coordinated renderer baselines:5d208f81d4f8895b4e564ebebce232031171a3e8, preserving its recursive local/remote USD dependency resolution and regression coverage.ovrtx_mappingmodule andmap_attribute_for_warp_writespublic export, plus their obsolete contract tests and API entry. Later renderer backports already moved release to persistent caller-owned buffers, so no production caller remains.The OVRTX removal includes a major changelog fragment with migration guidance: use a persistent caller-owned Warp buffer with
binding.write(..., cuda_stream=...); if mapping is unavoidable, pass the producer stream tounmap(stream=...).After this update, a source-tree comparison against
developreports no production-source differences other than the allowed package-version fields inpyproject.toml.Type of change
Release backport
release/3.0.0; no further backport is needed.Validation
git diff --checkpassed.developexactly.developis empty after excluding branch-specific version metadata.uv run isaaclab -fand the full documentation build cannot resolve on this macOS ARM64 host because the release lockfile supports Linux x86_64/aarch64 and Windows AMD64. Simulator-backed rendering coverage remains for Linux CI.Checklist