Repository navigation
Conversation
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Scope and over-engineering (1), Compatibility and deprecation (4), Implementation (1), Style consistency (6), Test quality (2). Other reviewed categories look good.
- PR description: The title matches; replace template prompts with problem, behavior, and validation, and supply reproducible baseline/candidate hashing-and-copy measurements naming revisions, command, hardware, backend, environment count, warmup, latency, and peak memory.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: Minimal implementation: extend assets.py localization and the existing prims.py and BaseUsdExporter stage owners; keep _asset_cache.py for delegate and filesystem-view lifecycles, but delete its synthetic content origin, publication stack, and associated hashing and locking, writing lease-owned bytes directly. Retain remote caching, dependency localization, stage-held leases, and caller-owned downloads. Scope is cohesive; no split recommended.
- API: API changes look good.
- Compatibility and deprecation: Breaking changes: retrieved and published checkpoint paths expire, legacy mirrors lose offline reuse, and saved paths lose refresh behavior; preserve these contracts through functional bridges, targeted warnings, migration/removal guidance, and transition coverage.
- Implementation: Remote dependency localization now propagates OVStorage errors that previously left unavailable references anchored, aborting even unselected dependencies; restore the availability-based fallback.
- Style consistency: Replacement public docstrings omit argument, return, failure, and loader constraints required by the documentation guide; restore concise Google-style contracts.
- Test quality: The cache glob checks the wrong directory and the nested checkpoint assertion repeats an unchanged branch; correct or remove these assertions while retaining distinct lifetime, revision, eviction, packaging, and deferred-payload coverage.
Needs rework. Posted 14 inline findings.
Automated review; human maintainers own approval decisions.
| ) | ||
|
|
||
|
|
||
| class _CacheReads(ovstorage.LayerBase): |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Group public definitions first
Private classes and functions precede public functions in the new module, contrary to the contribution guide's module order. Group constants, public functions, private functions, then private classes.
|
|
||
| payload: bytes | ||
|
|
||
| async def stat(self, address: str, **kwargs): |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Annotate new helper returns
_PublishedContent.stat and read, _recover_views, and AssetLease.init omit return annotations required by the typing guide. Add concrete results and -> None where appropriate.
| self.active = True | ||
| path.parent.mkdir(exist_ok=True, parents=True) | ||
|
|
||
| def _remove_view(self, marker: BinaryIO) -> None: |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Move private cleanup below public methods
_remove_view interrupts AssetLease's public lifecycle methods, contrary to the prescribed class order. Place it after close.
| if isinstance(content, ovstorage.LocalDelegate): | ||
| delegate = self.enter_context(content) | ||
| else: | ||
| address = "isaaclab-content:///" + hashlib.sha256(content).hexdigest() |
There was a problem hiding this comment.
🟡 Warning · Scope Complexity — Remove synthetic rewritten-byte caching
Rewritten layer bytes already have a lease-owned tree. The synthetic origin adds another stack, hash, lock, and materialization before writing that tree. Write the bytes directly and remove that origin.
| """Guards the lazily built OVStorage stacks.""" | ||
|
|
||
| _OVSTORAGE_STACKS: dict[str, ovstorage.LayerBase] = {} | ||
| _OVSTORAGE_STACKS: dict[tuple[str, Path | None], ovstorage.LayerBase] = {} |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Correct the stack-key description
The adjacent docstring says stacks are keyed only by URL origin, but the new key also includes cache mode and directory. Describe the actual key.
| elif _is_remote_path(dependency): | ||
| # An offline byte-cache hit can compose even when the provider cannot stat it. | ||
| try: | ||
| resolved = localize(dependency) |
There was a problem hiding this comment.
🟡 Warning · Implementation — Preserve unavailable reference anchors
Remote dependencies are now downloaded during rewriting, but only two failure types preserve their anchors. Other OVStorage errors abort even an unselected reference. Restore the availability-based fallback.
| del stage | ||
| assert not Path(path).exists() | ||
| assert assets_utils.read_file(f"{root}/actuator.pt").read() == b"network weights" | ||
| assert not list(asset_cache.glob("http/**/actuator.pt")) |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Remove ineffective cache assertion
The fixture sets XDG_CACHE_HOME to tmp_path/cache, but this glob searches tmp_path/http. It passes even if read_file writes the file being checked. Assert the actual cache location or remove it.
| """ | ||
|
|
||
|
|
||
| def checkpoint_log_dir(checkpoint_path: str, log_root: str, *, nested: bool = False) -> str: |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Document checkpoint directory selection
This shared helper does not define nested or its return value in Google-style sections. Document which directory each mode selects.
| print(f"Fetching pre-trained checkpoint : {ov_path}") | ||
| try: | ||
| resume_path = retrieve_file_path(ov_path, download_dir) | ||
| resume_path = retrieve_file_path(ov_path) |
There was a problem hiding this comment.
🟡 Warning · Compatibility — Keep published checkpoint paths persistent
Fresh downloads now return an expiring cache path rather than the established .pretrained_checkpoints path. Retained paths and output locations change. Keep the persistent download and existing defaults through a complete deprecation transition.
|
|
||
| output_dir = str(tmp_path / "logs") | ||
| assert checkpoint_log_dir(path, output_dir) == output_dir | ||
| assert checkpoint_log_dir(path, output_dir, nested=True) == output_dir |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Remove redundant nested assertion
For a leased checkpoint, checkpoint_log_dir returns before reading nested. This second call exercises the same branch and contract as the preceding assertion. Keep one.
Confidence Score: 4/5
[High impact] The PR changes shared asset retrieval used across simulation, training, and task workflows. The PR appears safe to merge, with non-blocking improvements needed for large downloads and shared-file write protection. FindingsSummaryReplaces the temporary asset mirror with OVStorage caching and scoped file leases.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Asset request] --> B[OVStorage cache]
B --> C[Leased local filenames]
C --> D[USD stage or file reader]
D --> E[Consumer finishes]
E --> F[Release lease and remove filenames]
C --> G[Explicit download directory]
G --> H[Persistent caller-owned copy]
Reviews (1) · Last reviewed commit: "Manage localized asset lifetimes with OV..." · Reviewed by Greptile |
| delegate = _asset_cache.cached_delegate(stack, url) | ||
| if delegate is not None: | ||
| return delegate | ||
| data, info = _asset_cache.run(stack.read_bytes(url)) |
There was a problem hiding this comment.
On a cache miss, read_bytes puts the entire asset in Python memory before returning a local path. This includes files larger than the cache budget. Previously, _materialize copied from a local file without reading it all into Python memory. Large checkpoints and USD assets can now cause memory spikes or kill a worker. Keep a download-to-file path for callers that request a lease.
| try: | ||
| os.link(delegate.path, path) |
There was a problem hiding this comment.
Writes can change shared assets
publish exposes the shared cache file through a hard link without enforcing the promised read-only access. If a consumer writes in place through the returned path, it changes the cached bytes and every other hard-linked lease. One consumer's mistake can then give other readers bad data. Enforce read-only access before exposing the path, or use a separate copy when writes cannot be blocked.
Description
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
Release backport
mainScreenshots
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-cion the pull request, orrun-ci ovstageto include kitless OVStage rendering tests for that run.Subsequent pushes and plain
run-cicomments do not run OVStage tests unless you commentrun-ci ovstageagain.pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there