Skip to content

Add asset snapshot in browser-based spec reviewer tool#791

Draft
qianl-nv wants to merge 3 commits into
qianl/dev/agentic_reviewfrom
qianl/dev/agentic_review_snapshot
Draft

Add asset snapshot in browser-based spec reviewer tool#791
qianl-nv wants to merge 3 commits into
qianl/dev/agentic_reviewfrom
qianl/dev/agentic_review_snapshot

Conversation

@qianl-nv

Copy link
Copy Markdown
Collaborator

Summary

Spin up a sim app and render snapshots for each node to visualize in the browser.

Detailed description

  • What was the reason for the change?
  • What has been changed?
  • What is the impact of this change?

qianl-nv added 3 commits June 12, 2026 20:29
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>
@qianl-nv qianl-nv force-pushed the qianl/dev/agentic_review branch from 023cabd to ce1d94b Compare June 16, 2026 14:59
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.

1 participant