Repository navigation
Unify placement sampling and replay - #1427
Conversation
🤖 Isaac Lab-Arena Review BotSummaryThis PR replaces Findings🟡 Warning: Not tied to a changed line:
VerdictMinor fixes needed |
|
|
/review |
|
/review |
cvolkcvolk
left a comment
There was a problem hiding this comment.
Thanks Qian. Nice cleanup!
Feel free to have a stab at the "Ai-drafted" design suggestions, skip or to mark them as follow ups
Use one placement sample representation for solved, recorded, and replayed layouts. Apply live and replayed samples through the variation scheduler so placement metadata and scene poses stay synchronized. Signed-off-by: Qian Lin <[email protected]>
Infer placement replay from JSONL contents and let recorded samples define per-episode reset behavior. Skip unreplayable object-set placements, allow repeated source layout IDs, and release run-time samples after recording each episode. Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
zhx06
left a comment
There was a problem hiding this comment.
LGTM! Left some non-blocking comments here
Signed-off-by: Qian Lin <[email protected]>
836feb5 to
a34413b
Compare
Signed-off-by: Qian Lin <[email protected]>
Add run-level multi-file variation replay and split the recorded-variations workflow into separate recording and replay Experiments. Reuse one builder-level placement recording across live rebuilds, then assign each recorded episode JSONL to its corresponding replay rebuild. ## Why this change? [PR #1427](#1427) adds recorded placement and variation replay for one environment build. Experiments also need to record variations across multiple rebuilds and replay each resulting JSONL without manually creating one Run per file. The sample workflow first holds settled placement layouts fixed across two live rebuilds while sampling ordinary variations. It then replays the two 500-episode recordings with a different number of parallel environments. ## What changes? - Add `ArenaRunCfg.recorded_variation_samples_paths` as an ordered, run-level replay list. - Infer `num_rebuilds` from the list and assign one JSONL to each rebuild. - Replay every row by default, or split an explicit total `rollout_limit.num_episodes` across the rebuilds. - Allow one `environment_builder.recorded_variation_samples_path` to be reused across multiple rebuilds. - Keep the existing single-file placement replay examples unchanged. - Add separate 1,000-episode recording and two-file replay Experiment Definitions. - Document the three-step placement recording, variation recording, and replay workflow. ## Usage example Record live variations over two rebuilds while reusing one placement file: ```yaml environment_builder: recorded_variation_samples_path: outputs/recording/placements.jsonl num_rebuilds: 2 rollout_limit: num_episodes: 1000 ``` Replay the resulting files: ```yaml recorded_variation_samples_paths: - outputs/recording/episode_results_rebuild0.jsonl - outputs/recording/episode_results_rebuild1.jsonl rollout_limit: num_episodes: 1000 ``` The replay list creates two rebuilds and assigns 500 episodes to each file. ## Validation Passing checks: - Targeted pre-commit hooks passed for all changed Python, YAML, and RST files. - 59 focused run-configuration, Hydra, and execution tests passed. - Fresh settled placement recording accepted 8/8 layouts. - Compared 64 existing partial source/replay rows: all placement and variation payloads matched exactly, and replay source indices were consecutive. --------- Signed-off-by: Qian Lin <[email protected]>
Spawn each `RigidObjectSet` member from its own spawn configuration through Isaac Lab's `MultiAssetSpawnerCfg`, so members keep their scale and the physics settings, USD variant selections and materials set in their spawn configurations. This is the second step toward choosing an object's asset through a variation, after #1430. ## Why this change? We plan to let experiments choose which registered asset a scene object spawns with, the way they already vary lighting, camera pose or mass. This will be a build-time variation, `AssetSelectionVariation`: for an object such as `pickup` it picks one of several registered assets, for example a cracker box or a sugar box, for each environment. Each chosen asset must spawn exactly as registered, with its own scale and physics settings. Isaac Lab supports this natively: `MultiAssetSpawnerCfg` spawns every entry from its own spawn configuration. `RigidObjectSet` does not use it yet. It spawns a `MultiUsdFileCfg`, which gives all members one configuration, so members lose the physics settings, USD variant selections and visual materials set in their spawn configurations, and Arena writes rescaled copies of member USD files to keep their scale. Materials authored in the USD files were already kept. This PR switches `RigidObjectSet` to `MultiAssetSpawnerCfg`. It keeps one step that Isaac Lab does not cover: Isaac Lab finds a rigid object's body through one path for all environments, so members whose bodies sit at different paths get a cached copy with the body moved to a common path. `AssetSelectionVariation` will use both: `MultiAssetSpawnerCfg` to spawn the assets chosen for the environments, and `align_rigid_body_paths` to give them a common body path. ## What changes? - `align_rigid_body_paths(spawn_cfgs)` (`utils/usd/rigid_body_path_alignment.py`) returns copies of the spawn configurations with their rigid bodies at one path. If the paths already agree, the copies are unchanged and nothing is written. Otherwise every member must be a USD asset, and each gets a cached `rigid_<sha256>.usd` copy with its body at `/rigid_body`, its materials kept and its USD variant selections baked in. Settings that name prims inside the asset, such as `prim_physics` or `visual_material_bindings`, are rejected in that case. - `RigidObjectSet` spawns the aligned copies: one member as a plain config, more members as a `MultiAssetSpawnerCfg`. Members may be primitive shapes when their body paths agree. - Per-environment assignment is unchanged: `assign_variants()` still expands the spawn entries to one per environment. This expansion is transitional. The next PR pins assignments through Isaac Lab's clone strategy. - `object_set_utils.py`, the old rescale-and-rename cache, and its tests are deleted. - The file-based `find_shallowest_rigid_body` is deleted, because its last production caller was the old set code. Its tests use `find_shallowest_rigid_body_from_stage` instead. Effect on existing code: - The physics settings, USD variant selections and visual materials set in members' spawn configurations now reach the spawned set. The YCB members share a body path and spawn their own files. `sweet_potato` and `jug` keep their rigid body at different paths, so they spawn copies with the body moved to `/rigid_body`, with their scales kept on the spawn config instead of baked into the file. - `member_usd_paths` and `object_usd_paths` are removed. A set with several members exposes its spawn entries as `object_cfg.spawn.assets_cfg`: one per member, or one per environment after `assign_variants()`. A one-member set spawns the member's own config at `object_cfg.spawn`. Callers in the repo are updated. - Configure members before building the set. Per-environment assignment rebuilds the entries in `object_cfg.spawn.assets_cfg` from the members, so edits to single entries do not survive it. Set-wide settings on `object_cfg.spawn` do. - A set-level `scale` or `spawn_cfg_addon` is rejected, and a set-level `asset_cfg_addon` now applies, as for `Object`. No caller passes any of them. - A copy with the body moved drops an authored root translation and rotation, as Isaac Lab's spawn does. For `computer_mouse_hot3d_robolab`, this swaps two bounds axes compared with #1430's bounds, which keep the rotation (follow-up: #1430's bounds will drop the authored root rotation too). ## Usage example Before (the set kept only each member's USD path and scale): ```python sugar_box.object_cfg.spawn.mass_props = sim_utils.MassPropertiesCfg(mass=0.3) pickup_object = RigidObjectSet(name="pickup", objects=[cracker_box, sugar_box]) pickup_object.object_cfg.spawn.mass_props # None: one MultiUsdFileCfg for both members, the mass is dropped ``` After: ```python sugar_box.object_cfg.spawn.mass_props = sim_utils.MassPropertiesCfg(mass=0.3) pickup_object = RigidObjectSet(name="pickup", objects=[cracker_box, sugar_box]) pickup_object.object_cfg.spawn.assets_cfg[1].mass_props.mass # 0.3 ``` ## Validation - `pre-commit run --all-files` passes. - Test phases in the Arena container: Phase 1 1488 passed and 3 failed, Phase 2 27 passed, Phase 3 64 passed and 2 failed. The 5 failures are the same as on main and #1430: four need the optional tetrahedralization dependency (`pytetwild`), and the multi-env mimic test hits its 900 s timeout. The review GUI tests give 45 passed and 1 failed (`test_run_sim_preview_via_simapp_subprocess`), which fails the same way on #1430's head. - Library check over all 173 registered rigid assets: contact paths are unchanged, and the YCB members already share a body path, so their set spawns the original files and writes no copies. Moving the rigid body of every registered rigid USD asset into a copy: 169 keep their bounds, 1 changes (the rotated mouse above), none are rejected. - The full phases ran on cde46e2. The commits after it were checked with the affected test files. - At 5e01c88, which included main with #1427 and #1426 and the final #1430, before the branch was rebased onto main after #1430 merged (the rebased head aa9b074 has identical files): the object-set, body-path alignment, geometry, environment-graph and clutter tests pass (80 passed), the heterogeneous placement and rigid-body tests pass (35), the camera test passes, and the review GUI tests pass apart from the known `test_run_sim_preview_via_simapp_subprocess` (45 passed). #1427's placement tests passed after the main merge (16 and 51). The library check gives the same result as above. - After the rename of the module to `rigid_body_path_alignment.py` (7941495), its tests and the object-set tests pass (45 passed). - A relation-free set with a fixed pose still blocks placement, as on main (eafbb63). Set, collision and placement tests pass (50 and 46). - New tests were checked to fail when the behaviour they guard is removed: clearing the root translation and rotation before the body is moved, de-instancing before body discovery, and keeping path-keyed settings when the body paths already match. --------- Signed-off-by: Clemens Volk <[email protected]>
Fix variation overrides and recorder binding when using Isaac Lab’s `record_demos.py` with Arena environments. ## Why this change? Arena variation overrides were not forwarded to the builder. Isaac Lab also constructed the environment without Arena’s recorder kwargs, causing reset-time recording to fail. Relation placement introduced in #1427 encounters the same binding failure. Recreating an environment from the same registration also retained stale recording samples and replay assignments. ## What changes? - Extract variation-override routing into `split_variation_overrides`, preserving Isaac Lab’s remaining arguments. - Forward the original recorder and replay scheduler through the registered constructor. - Bind the recorder to the environment through a weak reference. - Clear runtime samples and restart replay assignments for each new environment, preserving build-time samples. - Verify recorded placement poses against actual simulator poses immediately after reset. `recorded_variation_samples_path` Hydra support through IL interop remains deferred, with a TODO as agreed. Isaac Lab’s separate `annotate_demos.py` routing issue is outside this recording fix. No Isaac Lab changes are included. ## Validation - 51 focused tests passed, covering routing, recorder lifetime, environment recreation, replay and partial resets. - Both environment-recreation regressions failed before the fix and passed afterward. - Two native recording tests passed, including relation placement, enabled mass variation and HDF5 export. - Applicable pre-commit hooks, strict Sphinx build and `git diff --check` passed. --------- Signed-off-by: zhx06 <[email protected]>
Add a `draft-pr-review` skill to turn review findings into a pending GitHub review, with comments attached to the relevant lines. The reviewer approves the text before it is added to GitHub and submits the review themselves. ## Why this change? Findings from a review done in chat together with an agent have to be copied into GitHub by hand. This can lose Markdown formatting, and line numbers can become outdated when the author pushes changes. The review is still guided by a human. The skill makes it easier to transfer the findings and their context from the review session to GitHub, where the author and their agent can use them to address the feedback. ## What changes? The skill covers creating a pending review, adding comments to one already started, and editing its comments. It requires showing the exact summary and comments locally for approval before writing to GitHub. Every summary and comment starts with `_AI-drafted (<agent name>), reviewed by me._` so readers can see how it was drafted. The reviewer reads and edits the text before submitting it. A Python script checks that comments refer to the current PR version and valid lines in the diff, include the attribution, and do not request immediate publication. The skill also explains how to preserve edits made in GitHub and avoid duplicating comments when retrying a failed request. ## How to use it Review the PR as you normally would, using your agent to investigate questions and discuss possible issues. Once you’ve decided which findings are worth raising, say: “Turn these findings into a pending review on PR #1234.” You can also invoke `$draft-pr-review` explicitly. The agent shows you the proposed comments for approval, then adds them to GitHub as a pending review. Open the PR, make any final edits, and submit the review yourself. The skill transfers findings you’ve already discussed; it doesn’t perform the code review for you. ## Validation - All ten tests pass. They cover comment locations, deleted lines, filenames with special characters, invalid review data, attribution, and changes to the PR during validation. - Pre-commit checks and the skill metadata check pass. - The script was checked against PR #1428 without posting a review. - Earlier manual checks on #1427 confirmed that reviews stay pending when created, extended, and edited. Submitting a review remains a manual step. --------- Signed-off-by: Clemens Volk <[email protected]> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Unify solved, recorded, and replayed relation layouts around one
PlacementSamplerepresentation. Route live placement and replay through the variation scheduler and shared scene-root pose application.Why this change?
Placement and variation record/replay uses separate param and scheduler on main, allowing the two to diverge when assigned to episodes. Route placement record/replay through PlacementSampler to reuse the variation recorder and replay scheduler.
What changes?
PlacementSamplethe canonical representation for one layout, with a layout ID and asset poses. ReplacePlacementLayouts.This removes the
PlacementLayoutscontainer. Callers now passlist[PlacementSample]and use the helpers inplacement_sampler.py.Warning
This changes breaks IL interop for any scene with relation. IL is broken already for variation recorder, but this change adds a recorder for relations. A follow up PR will fix this breakage.
Validation
Passed:
pre-commit run --all-files