Refactor ArenaEnvGraphSpec - #864
Conversation
49e2387 to
d076801
Compare
Replace the dual initial/linked graph representation with a single ArenaEnvGraphSpec that is the source of truth: it validates the schema, reads/writes YAML, applies CLI overrides, and converts to a live IsaacLabArenaEnvironment. Drop EnvironmentIntentSpec and IntentCompiler and have the generation agent emit ArenaEnvGraphSpec directly. Migrate robolab YAMLs, tests, runners, and the review GUI to the unified spec, and fix default-light injection so runtime-injected assets land in the scene. Signed-off-by: Qian Lin <qianl@nvidia.com>
Add back the runner example commands, drop the stray backslash in the try-schema docstring, and revert the robolab *_linked.yaml numeric lists from multi-line back to compact single-line form. Signed-off-by: Qian Lin <qianl@nvidia.com>
- Move the assert_graph_spec_* checks into ArenaEnvGraphSpec private methods and remove the redundant spatial-relation-shape check (already enforced by SpatialRelationSpec). - Inline ObjectRelationLibraryRegistry lookups, relocate unique_node_id into the conversion utils and add_cli_override_args into isaaclab_arena_environments/cli.py. - Move coerce_number_sequence into arena_env_graph_types and delete the now-empty graph_spec_utils module. - Make ObjectReferenceSpec.prim_path optional and tidy task-param/CLI field docs. Signed-off-by: Qian Lin <qianl@nvidia.com>
- Add spec_validation helpers for non-raising parse and agent-ready task traces. - Have EnvironmentGenerationAgent return None with last_validation_traces on failure. - Update runner, GUI, and try script to surface validation traces to callers. Signed-off-by: Qian Lin <qianl@nvidia.com>
- generate_spec now returns the parsed JSON dict as its second value instead of raw text - Load invalid agent output into the GUI editor with validation traces shown alongside - try_environment_intent_schema and the runner dump invalid spec YAML plus traces on failure - Add write_env_graph_dict helper and update agent tests for the new return type Signed-off-by: Qian Lin <qianl@nvidia.com>
The unknown-registry-name and duplicate-asset-id cases are already covered by the parametric test_graph_spec_rejects_invalid_data matrix. Signed-off-by: Qian Lin <qianl@nvidia.com>
Make TaskSpec.description a required non-empty field and drop the agent validation checks now covered by ArenaEnvGraphSpec (present param node references) and the schema (description presence). Signed-off-by: Qian Lin <qianl@nvidia.com>
asset_matcher was a leftover from the removed intent-compiler path and is no longer referenced by production code or examples. Signed-off-by: Qian Lin <qianl@nvidia.com>
🤖 Isaac Lab-Arena Review BotSummaryThis PR collapses the dual Findings🔵 arena_env_graph_spec.py:66 — 🔵 arena_env_graph_conversion_utils.py:105 — Test CoverageGood — the invalid-spec/validation-trace path is covered by VerdictMinor fixes needed |
Greptile SummaryThis PR replaces the two-phase
Confidence Score: 3/5Two conversion-layer gaps can crash at runtime with unhelpful errors rather than failing at spec-load time with a clear message. The core unification is well-executed and significantly reduces complexity. prim_path=None reaching ObjectReference and an unordered object_reference list reaching the assets dict are both real defects on the agent-generated spec path, even though existing robolab YAMLs are unlikely to trigger them. arena_env_graph_spec.py (_assert_asset_ids_unique annotation and object-reference ordering validation), arena_env_graph_conversion_utils.py (prim_path=None guard before ObjectReference instantiation) Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant Agent as EnvironmentGenerationAgent
participant Spec as ArenaEnvGraphSpec
participant IO as spec_io
participant Conv as arena_env_graph_conversion_utils
participant Env as IsaacLabArenaEnvironment
User->>Agent: generate_spec(prompt)
Agent->>Agent: LLM call
Agent->>Spec: model_validate(data)
alt validation fails
Spec-->>Agent: ValidationError traces
Agent-->>User: (None, data) + last_validation_traces
Agent->>IO: write_env_graph_dict(data)
else validation passes
Spec-->>Agent: ArenaEnvGraphSpec
Agent->>Agent: collect_agent_ready_task_validation_traces
Agent-->>User: (spec, data)
User->>IO: write_env_graph_spec(spec)
IO->>Spec: write_yaml(path)
end
User->>Spec: from_yaml(path)
User->>Spec: to_arena_env()
Spec->>Conv: build_arena_env_from_graph_spec(spec)
Conv->>Conv: _instantiate_assets_from_spec
Conv->>Conv: _ensure_scene_lighting
Conv->>Conv: _attach_spatial_relations_to_assets
Conv-->>Env: IsaacLabArenaEnvironment
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant Agent as EnvironmentGenerationAgent
participant Spec as ArenaEnvGraphSpec
participant IO as spec_io
participant Conv as arena_env_graph_conversion_utils
participant Env as IsaacLabArenaEnvironment
User->>Agent: generate_spec(prompt)
Agent->>Agent: LLM call
Agent->>Spec: model_validate(data)
alt validation fails
Spec-->>Agent: ValidationError traces
Agent-->>User: (None, data) + last_validation_traces
Agent->>IO: write_env_graph_dict(data)
else validation passes
Spec-->>Agent: ArenaEnvGraphSpec
Agent->>Agent: collect_agent_ready_task_validation_traces
Agent-->>User: (spec, data)
User->>IO: write_env_graph_spec(spec)
IO->>Spec: write_yaml(path)
end
User->>Spec: from_yaml(path)
User->>Spec: to_arena_env()
Spec->>Conv: build_arena_env_from_graph_spec(spec)
Conv->>Conv: _instantiate_assets_from_spec
Conv->>Conv: _ensure_scene_lighting
Conv->>Conv: _attach_spatial_relations_to_assets
Conv-->>Env: IsaacLabArenaEnvironment
|
fa641e3 to
4a9f8c7
Compare
alexmillane
left a comment
There was a problem hiding this comment.
LGTM. Massive simplification!
- Include background tags in agent asset catalogue - Rename the relation-param coercion helper to convert_to_float_tuple - Fix wrong return type for _assert_asset_ids_unique - Guard against prim_path=None for ObjectReference in arena_env_graph_coversion_utils.py - _assert_object_reference_parents ensures parent is background or objects id Signed-off-by: Qian Lin <qianl@nvidia.com>
Summary
Unify into one ArenaEnvGraphSpec type cross agentic env gen pipeline; modify its nodes representation for agent compatibility
Detailed description
Note: this breaks compatibility of existing env yaml. The yamls checked into the repo has all be converted.