Skip to content

Cache Lightwheel assets on disk and in CI - #1740

Merged
david-tingdahl-nvidia merged 25 commits into
mainfrom
dtingdahl/feature/lightwheel-asset-cache
Nov 25, 2026
Merged

david-tingdahl-nvidia merged 25 commits into
mainfrom
dtingdahl/feature/lightwheel-asset-cache

Conversation

@david-tingdahl-nvidia

@david-tingdahl-nvidia david-tingdahl-nvidia commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Use Lightwheel assets from the local SDK cache without calling the Lightwheel servers, and cache them in CI together with the kit and Warp caches.

Why this change?

CI tests that use Lightwheel assets keep failing because of the Lightwheel servers (gateway 504s, certificate errors on the asset download), not because of the code under test. The Lightwheel SDK has a disk cache, but it asks the server for the current version before it looks at the disk, so a cached file still needs the API to be up.

What changes?

Lightwheel assets

  • Lightwheel asset sources look in the SDK cache first. A hit returns the file with no network call. A miss downloads as before.
  • The one asset without a stable name, the broccoli, is pinned to a single variant so it can be cached.
    -Refactored existing LightWheel classes to reduce duplication of cache management code.
    -Renamed LightwheelUsdSource -> LightwheelObjectUsdSource to better distinguish between Object and Floorplan

CI

  • The CI cache action now also caches the Lightwheel assets.
  • PRE/POST merge jobs start with a warm cache to reduce risk of endpoint failure
  • NIGHTLY starts from a cold cache to test everything e2e. Since we save the freshly populated cache, any stale cache entries will be pruned by this step. It also mean that NIGHTLY may fail when endpoints are down, but it will not block developers.

Validation

  • The Lightwheel assets add about 0.9 GB per saved cache entry on top of about 1.9 GB for the kit and Warp caches.
  • Verified locally in the Arena image: cache hits work with the Lightwheel SDK unavailable.
  • Not yet run in CI: the first post-merge runs will show the cache being saved. The cache size is worth watching: the repo is already near its 10 GB limit, and saves on every merge add about 2.8 GB each.

The SDK writes null when the server omits versionUuid, which made an
already downloaded floorplan a permanent cache miss. Check for the key
instead of its truthiness; a missing key is still a miss.

Signed-off-by: David Tingdahl <[email protected]>
Pass lightwheel: 'true' to setup-caches in the jobs whose tests fetch Lightwheel
assets, and call save-caches as the last step of every job that calls
setup-caches (it also reports the kit and Warp caches). Widen the helper test
discovery to test_report_*.py.

Job -> test file mapping (Lightwheel users only):
- tests (not with_cameras and not with_subprocess and not with_newton):
  test_kitchen_bench_yaml_env.py (no markers, builds kitchen_bench envs),
  test_lightwheel.py and test_usd_sources.py (Lightwheel source/acquire),
  test_usd_prim_tree.py (Lightwheel Robocasa kitchen USD)
- tests_with_subprocess (with_subprocess and not with_newton):
  test_object_control_kitchen.py (kitchen_bench_lightwheel_* YAMLs)
- gr00t: no Lightwheel use (galileo_g1_locomanip_pick_and_place, brown_box);
  it calls save-caches with the same if as setup-caches, without lightwheel.

Signed-off-by: David Tingdahl <[email protected]>
Exclude object/*.zip (left behind by the SDK after extraction) from the
Lightwheel cache path list in both setup-caches and save-caches, add a warning
fallback to the Lightwheel compare step so a helper crash cannot fail a green
job, and correct the comments: the credential is the login/ directory holding
account.json.

Signed-off-by: David Tingdahl <[email protected]>
LightwheelUsdSource and LightwheelFloorplanUsdSource repeated the same
memo, cache lookup, hit/miss logging, SDK call and path check. Move that
flow into LightwheelAssetSource, which the two classes extend. Each
subclass now supplies four hooks: the log key, the cached-path lookup,
the lazily imported SDK loader, and the loader method that fetches the
asset.

Public names, constructor arguments and behaviour are unchanged. Share
the floorplan cache directory name between the lookup and the log key,
and add tests for the base class's hit, miss, not-cacheable and memo
paths, including the log lines.

Signed-off-by: David Tingdahl <[email protected]>
The object and floorplan lookups were module-level functions that each
source class called from its _find_cached_usd hook. Put each lookup in
its class's hook instead, and give the floorplan class a _cache_name
method that the lookup and the log key share. The module keeps only the
cache root, the base class, the two sources and the retry helper.

Behaviour is unchanged. The lookup tests now go through the source
classes.

Signed-off-by: David Tingdahl <[email protected]>
Rename LightwheelAssetSource to LightwheelSource and LightwheelUsdSource
to LightwheelObjectUsdSource. The two concrete classes are now
LightwheelObjectUsdSource and LightwheelFloorplanUsdSource, both
extending LightwheelSource, so the object class no longer looks like the
general one.

LightwheelUsdSource is no longer defined; update its seven uses in
object_library.py and the tests. The v0.4 migration guide still names
LightwheelUsdSource and is not changed here.

Signed-off-by: David Tingdahl <[email protected]>
Rename the cache and download hooks with a get_ prefix, add a module
constant for the SDK cache path, return once from the cache-or-download
method, and document the constructor arguments.

Signed-off-by: David Tingdahl <[email protected]>
Comment thread .github/actions/setup-caches/action.yml Resolved
Comment thread .github/actions/setup-caches/action.yml Resolved
Comment thread .github/actions/setup-caches/action.yml Resolved
Comment thread .github/actions/setup-caches/action.yml Resolved
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes reach Lightwheel asset loading and the CI test jobs that share the cache action.

The PR appears safe to merge, with non-blocking fixes recommended for the migration example and real-cache test coverage.

Findings

  1. P2 Migration example names removed class ▶
  2. P2 Real object cache remains untested ▶

Summary

Adds disk-first lookup for Lightwheel objects and floorplans, pins broccoli to one variant, and includes Lightwheel assets in CI caches.

  • Lightwheel assets use complete local cache files before downloading.
  • CI jobs carry Lightwheel assets between the runs that need them.

Cache size: david-tingdahl-nvidia explicitly acknowledged the repository's cache limit and the added storage per merge; no duplicate finding is reported.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Resolve Lightwheel source] --> B{Path already remembered?}
  B -->|Yes| F[Return local path]
  B -->|No| C{Complete disk cache found?}
  C -->|Yes| E[Remember local path]
  C -->|No| D[Download through SDK with retries]
  D --> E
  E --> F
Loading

Reviews (1) · Last reviewed commit: "Define the cache paths once in setup-cac..." · Reviewed by Greptile

Comment thread .github/actions/setup-caches/action.yml Resolved
@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

The Lightwheel object and floorplan sources now return a complete copy from the SDK's disk cache without calling the Lightwheel API. Broccoli is pinned to Broccoli015, and the CI cache now includes the Lightwheel directories and is saved on every merge to main. Pinning the broccoli is a good fix for reproducibility. Two things need a decision: cache-first changes the default for every user, not only CI, and saving on every merge uses a lot of the shared cache budget.

Design, Boundaries & Scope

  • Cache-first is now the default everywhere. Cache hits skip the SDK's version check. Local users keep the first version of an asset they downloaded, and runs don't record which version they used. See the inline comment on lightwheel.py:82.

  • The root cause is in the SDK. ObjectLoader.acquire_by_registry and FloorplanLoader.get_usd always call the API before they look at disk. To work around that, Arena now copies the SDK's private cache layout:

    • object/<Name>/<Name>.usd with a <fileVersionId>.txt marker
    • floorplan/usd_version.json
    • the _usd_cache_name naming format

    If a later SDK version changes any of these, lookups quietly miss and CI depends on the API again, with no failure to point at it. Has anyone asked Lightwheel for a cache-first or offline option? If this stays in Arena, add a NOTE on LightwheelSource that names the SDK version it mirrors (1.0.3 in uv.lock) and when it can be removed.

  • Saving on every merge adds three cache uploads per merge, about 2.8 GB each by the PR description's estimate. The gain only lasts until the next nightly run. See action.yml:72.

Findings

🟡 Warning: isaaclab_arena/assets/sources/lightwheel.py:82 — Cache hits never refresh assets that Lightwheel has since updated, and the log line doesn't record which version was used. Consider making cache-first opt-in, or at least print the version.
🟡 Warning: .github/actions/setup-caches/action.yml:72 — Post-merge runs now save the cache on every merge, and manual runs on main no longer start with an empty cache.
🔵 Improvement: isaaclab_arena/assets/sources/lightwheel.py:102 — Making file_name required would make every object source cacheable and remove the None cache-key path.
🔵 Improvement: isaaclab_arena/tests/test_lightwheel_cache_lookup.py:88 — The "missing entry" test sets up the same state as the "missing file" test, so a file without an entry for the floorplan is never tested.
🔵 Improvement: isaaclab_arena/tests/test_lightwheel_cache_lookup.py:106 — Simplify the SDK lookup, and check the SDK's CACHE_PATH without a network call.
🔵 Improvement: isaaclab_arena/tests/test_usd_sources.py:273 — The _FakeLightwheelSource tests repeat the tests that run the real classes.

An existing comment already covers the stale LightwheelUsdSource reference in docs/pages/references/migration_guide_v0_4.rst. When you update the guide, add a line about the Broccoli pin under behavior changes. registry_name=["broccoli"] let the server pick the variant, so results that used broccoli can change.

Test Coverage and CI Cost

  • test_lightwheel.py::test_acquire_lightwheel_asset_fetches_object calls object_loader.acquire_by_registry directly, so every PR run still calls the Lightwheel API. A warm cache only skips the file download, not the API request. If the goal is that PR CI stops failing during Lightwheel outages, this test should run only in the nightly job. The same applies to the live-download test suggested in the existing review thread.
  • The new tests are plain Python and fast (the new lookup file runs in about 0.1 s), so their CI cost isn't a concern.
  • Pre-commit fails on this commit, so the test jobs and the new cache step were skipped. None of this has run in CI yet.

Verdict

Minor fixes needed

@alexmillane alexmillane left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome!

A few tiny nits.

…s, comment cache lookup

Signed-off-by: David Tingdahl <[email protected]>

@alexmillane alexmillane left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@david-tingdahl-nvidia
david-tingdahl-nvidia merged commit f974095 into main Nov 25, 2026
10 checks passed
peterd-NV added a commit that referenced this pull request Nov 25, 2026
Update five Lightwheel fixtures to use `LightwheelObjectUsdSource`.

## Why this change?

The fixtures added in #1562 still reference `LightwheelUsdSource` after
#1740 renamed the class. The first stale reference raises `NameError`
when Python imports `object_library.py`. Flake8 reports all five
references as `F821`.

## What changes?

Switch the two blenders, stand mixer, toaster, and toaster oven to the
source class already used by the other Lightwheel fixtures. Keep their
asset names and constructor arguments as-is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants