[Assets] Resolve spawner USD assets from SimReady semantic search queries#6522
Draft
hujc7 wants to merge 3 commits into
Draft
[Assets] Resolve spawner USD assets from SimReady semantic search queries#6522hujc7 wants to merge 3 commits into
hujc7 wants to merge 3 commits into
Conversation
Spawn configurations previously required hardcoded USD file paths. This adds the isaaclab.sim.spawners.simready sub-module, which resolves the usd_path of a spawner configuration from a SimReady USD-Search semantic query at configuration construction time: SimReadyUsdFileCfg uses the top-ranked result and SimReadyMultiUsdFileCfg freezes the top-k results for heterogeneous cloning. No spawner changes are needed since the resolved paths feed the existing UsdFileCfg/MultiUsdFileCfg machinery. The required simready-search package is optional and lazy-imported, available through the new 'simready' extra (./isaaclab.sh -i simready). Search failures raise typed errors, results are tie-broken deterministically for multi-process runs, and already-resolved configurations skip the query on copy()/replace().
The constant tests assert the literal contents of VALID_EXTRA_FEATURES and MANUAL_EXTRA_FEATURES, so the new 'simready' extra must be added to their expected sets. Also mirror the manual-extra dispatch test used by 'ov' for the new selector-less 'simready' token.
The search function is spawner-agnostic: it takes a query and returns USD asset paths. Move it and the endpoint constant to isaaclab.utils.assets, next to the other asset retrieval helpers, so non-spawner consumers can use it without importing spawner modules. The simready spawner sub-module keeps only the two cfg subclasses. Split the tests to mirror the layout: resolver tests move to the utils asset tests together with the fake simready.search module; the spawner cfg tests stub the resolver directly and gain a parameter-forwarding test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Summary
SimReadyUsdFileCfg(query="food box")picks the top-ranked asset,SimReadyMultiUsdFileCfg(query="food box", top_k=15)resolves a top-k list for heterogeneous cloning / clutter randomization.isaaclab.utils.assets.search_simready_usd_paths, placed next to the existing asset-retrieval helpers (retrieve_file_path,retrieve_git_asset_path) so non-spawner consumers (collections, tooling, user scripts) can call it directly. The newisaaclab.sim.spawners.simreadysub-module contains only the two cfg subclasses (~150 LOC total). Zero changes to existing spawners — the query resolves once at cfg construction, and downstream code sees a plainusd_path.simready-search(public PyPI) ships behind a newsimreadyextra:./isaaclab.sh -i simreadyorpip install isaaclab[simready]. The import is lazy, so the core install stays dependency-free.simready.search(no network, no optional dep needed); spawner-cfg tests stub the resolver directly. The resolver is additionally validated against the real package.2. Design notes
__post_init__freezes the resolved paths intousd_path, so no network calls happen during simulation.copy()/replace()re-run__post_init__, but an already-resolved guard prevents re-querying (configclass default factories deepcopyMISSING, so the guard matches by type rather than identity).(-relevance_score, asset_path)so relevance ties resolve identically across processes — relevant for multi-GPU runs where each rank queries independently.raise_on_network_error=True: auth/network failures raise typed errors instead of the library default of silently returning zero results. A genuinely empty result raisesValueErrorwith the query in the message.min_relevance,filter_profiles, andfilter_featuresmap to the library's relevance/profile/feature filters — e.g.filter_features=["FET004_BASE_PHYSX"]restricts results to physics-ready SimReady assets.simreadyextra is excluded from./isaaclab.sh -i all: the search service requires credentials (USD_SEARCH_USERNAME/USD_SEARCH_PASSWORDenvironment variables, documented in the resolver docstring).usd_pathreproduces a run exactly (documented on the cfg class).3. Test plan
pytest source/isaaclab/test/utils/test_assets.py -k simready— 6 resolver tests against a fakesimready.searchmodule (runs in CI without the optional dependency or network).pytest source/isaaclab/test/sim/test_spawn_simready.py— 7 spawner-cfg tests with the resolver stubbed (resolve-once contract, copy/replace no-requery, parameter forwarding, explicitusd_pathpinning).simready-search2026.4.2 end-to-end; the un-authenticated 403 from the dev endpoint surfaces as a typedAssetLibraryRemoteResponseErrorinstead of an empty result.SimReadyUsdFileCfgandSimReadyMultiUsdFileCfgimport from bothisaaclab.simandisaaclab.sim.spawners;search_simready_usd_pathsimports fromisaaclab.utils.assets.4. Out of scope / follow-ups