Add asset snapshot in browser-based spec reviewer tool#791
Draft
qianl-nv wants to merge 3 commits into
Draft
Conversation
Adds a Streamlit-based live editor for reviewing and editing UnresolvedArenaEnvGraphSpec YAMLs. The review tool renders: - A mermaid.js spatial graph of initial-state constraints with anchor highlighting, task-constraint dashed edges, and objectReference dotted edges - A task table (index, kind, description, params) - A node card grid with type badges and per-node YAML stanzas The YAML editor auto-renders when the spec is valid and changed. Node cards display a two-letter placeholder thumbnail by default. Also adds YAML round-trip serialization to ArenaEnvGraphSpec and moves assert_unique_ids/assert_references_exist to __post_init__ so validation fires on every load-from-yaml/dict path. Signed-off-by: Qian Lin <qianl@nvidia.com>
Node cards now display real USD viewport captures when a previously- rendered PNG exists in the disk cache (.cache/llm_env_gen_thumbnails/). The thumbnail is inlined as a base64 data URI so the HTML stays fully self-contained. Nodes with no cached file fall back to the two-letter placeholder — no Isaac Sim or network connection needed at review time. Key additions: - _THUMBNAIL_CACHE_DIR / _THUMBNAIL_SIZE constants - render_html_for_spec() gains a thumbnails parameter - _render_node_thumbnail() shows a real <img> when png_bytes provided - load_cached_thumbnails() reads existing PNGs from the cache dir without booting Isaac Sim (_resolve_node_usd_paths + _usd_cache_key) - review_app: _render_with_cached_thumbnails() wires the cache reader into the auto-render loop Signed-off-by: Qian Lin <qianl@nvidia.com>
Adds a long-lived Isaac Sim subprocess (simapp_sidecar.py) that the Streamlit editor communicates with over a JSON-RPC stdin/stdout pipe. This lets Kit's SimulationApp boot once per server lifetime (~30s) and reuse the same viewport session for every thumbnail render request, reducing per-update cost to ~2s for cache misses. Key additions: - simapp_sidecar.py — standalone Kit host; JSON-RPC _serve() loop renders USD thumbnails on demand and writes PNGs to the shared disk cache; exits cleanly on stdin EOF (parent crash) or SIGTERM - SimAppSidecarError / SimAppSidecar in review_graph.py — subprocess wrapper with start/render_spec/ping/close; handles boot timeout, sidecar crash detection, and graceful shutdown - _render_thumbnails_with_app() / _launch_simulation_app() — called by the sidecar to resolve USD paths, capture viewport frames, and write cache-miss PNGs (_capture_usd_thumbnails, _render_one_usd, _wait_for_stage_load, _wait_for_capture, _ensure_default_lighting) - review_app.py: _get_simapp_sidecar() (@st.cache_resource, one Kit per server), _ensure_sidecar() (auto-respawn on crash), and _render_with_thumbnails() replace the cache-only path; falls back to placeholders when the sidecar is unavailable Signed-off-by: Qian Lin <qianl@nvidia.com>
023cabd to
ce1d94b
Compare
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.
Summary
Spin up a sim app and render snapshots for each node to visualize in the browser.
Detailed description