Repository navigation
Conversation
Use explicit row mappings for scene preparation, restoration and Task Program attempts. Keep initial checks, canonical completion, measured acceptance and recording eligibility independent per environment. Migrate production callers and remove the workspace compatibility adapter. BREAKING CHANGE: use execute_scene_variants and the host's plural state APIs; validators receive environment IDs and results require an explicit env_id. Refs #760.
This branch has not been deployed
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.
Description
The scene preparation host and Task Program attempt API currently reject Worlds with more than one environment. This change replaces that single-row contract with explicit environment-to-candidate/result mappings, so selected environments can be prepared, restored and evaluated together while retaining independent recording eligibility.
execute_scene_variants(env, {3: candidate_a, 1: candidate_b}, ...)executes only rows whose initial checks pass. Program completion and measured acceptance use each row's evidence, so one rejected candidate cannot invalidate a successful peer. The host preflights every requested row before reset/writes, preserves unselected state during preparation/restoration, and rejects snapshots assigned to another row. Vector bridges isolate policy sessions, and one scene attempt owns the World at a time.All environments share one physical clock. Settling requires the complete World selection and runs once for the batch. Source tracing and specialized workspace/search adapters retain their own qualification limits.
Refs #760. The remaining general-region and large-scene roadmap is outside this PR.
Dependencies: no new dependencies.
Breaking API changes
execute_scene_variantwithexecute_scene_variants; preparation returns the requested row mapping, and measured validators accept an environment ID.SimulationSceneExpansionHostaccepts orderedenv_idsand row-addressed initial validation. Useinitial_states,capture_initial_states(parent_scene_ids=...)andrestore_initial_states(...)mappings.SceneVariantEpisodeResultrequiresenv_id, evaluates row-specific completion, and publishes metadata schema version 2.embodichain.lab.sim.scene.workspace, whose result isSceneCheckReport.Production feasibility, Real2Sim collection, asset-generalization consumers, examples and tests are migrated directly; the old signatures and compatibility imports are not retained.
Validation
black .; syntax, Apache headers, future annotations and public module exports checked for all 14 changed Python files.pytest -q --noconftest -c /dev/null tests/gym/envs/task_program/test_scene_expansion_sim.py): Default/Newton two-row execution, Default four-row partial selection(3, 1), and single-row recording/restoration.New coverage closes the multi-row integration gaps: noncontiguous selections, all-row preflight before mutation, snapshot row ownership, independent initial/program/measured rejection, delayed persistence and nested-World ownership. Existing production suites retain single-row/reset/receipt behavior. Tests dedicated solely to the removed workspace compatibility adapter are deleted; shared workspace IK/FK coverage remains at its source owner.
Affected scene-expansion and environment-lifecycle context and API references are updated. Other affected context remains accurate because task semantics, registration and persistence ownership are unchanged.
Runnable scene construction, solving and augmentation
The native scene-only example incrementally declares a table, two namespaced containers, a visual keep-out marker and six colored parts. It repairs the deliberately invalid authored layout with
solve_layout, generates three addressedgenerate(recipe, seed, ordinal)candidates under identical assets/constraints, applies their poses through scene services, then qualifies actual settled poses withcheck_layoutand measured convergence. Outputs include native before/after RGB, a four-layout gallery, a construction/solving/augmentation video, an HTML report and JSON plans/evidence.A real run passed: 2 overlapping part pairs, 2 keep-out intrusions and 1 boundary violation became zero in the repaired layout and all three variants. Fixed components stayed unchanged; geometry operations did not step physics; gravity converged after 51 physical steps (0.51 seconds). Variant RMS XY displacements from the repaired layout were 0.61/0.67/0.71 m. The example explicitly limits its claims to the configured XY/AABB constraints and native settling checks.
--help, Black, API coverage and 82 existing example-launcher/composition/layout/procedural checks passed. This follow-up changes only example code and instructions; the production contract coverage above remains applicable.Type of change
Checklist
black .to format the code base.python docs/scripts/check_api_docs.py).