Conversation
|
| if env_ids_to_commit.numel() > 0: | ||
| functor_cfg.func.save_and_clear( | ||
| env_ids=env_ids_to_process | ||
| ) | ||
| else: | ||
| functor_cfg.func.discard_and_clear( | ||
| env_ids=env_ids_to_process | ||
| env_ids=env_ids_to_commit | ||
| ) | ||
| discard_ids = env_ids_to_process[ | ||
| ~torch.isin(env_ids_to_process, env_ids_to_commit) | ||
| ] | ||
| if discard_ids.numel() > 0: | ||
| functor_cfg.func.discard_and_clear(env_ids=discard_ids) |
There was a problem hiding this comment.
When an expanded batch commits only some environments, this code passes that subset to every camera recorder. The synchronous recorder ignores env_ids and saves the full multi-environment frame mosaic, so failed or unselected rows are included. The asynchronous recorder tracks at most four environments and requires every tracked row to have a committed episode before flushing, so selected rows numbered four or higher can be dropped and partial commits can fail during finalization. Camera recording therefore does not match the dataset and trajectory commit boundary.
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/gym/envs/embodied_env.py
Line: 993-1001
Comment:
**Camera subset commits break**
When an expanded batch commits only some environments, this code passes that subset to every camera recorder. The synchronous recorder ignores `env_ids` and saves the full multi-environment frame mosaic, so failed or unselected rows are included. The asynchronous recorder tracks at most four environments and requires every tracked row to have a committed episode before flushing, so selected rows numbered four or higher can be dropped and partial commits can fail during finalization. Camera recording therefore does not match the dataset and trajectory commit boundary.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
The Temporarily perturbing Please fix the material binding in DexSim so the authored contact material is valid before the first physics step, then remove |
yuecideng
left a comment
There was a problem hiding this comment.
Documentation-focused review: I found two medium-priority contract/reproducibility issues and one low-priority observability mismatch. Details are attached inline.
| Expansion collection submits only rows with successful completion and recorded | ||
| frames. `--max_episodes` counts actual committed rows across batches; a partial | ||
| last batch selects at most the remaining quota. A batch with no accepted rows | ||
| uses the bounded existing attempt budget. Successful subsets commit once, and |
There was a problem hiding this comment.
[P2] This overstates the camera recorder contract. The synchronous record_camera_data.save_and_clear() ignores env_ids and persists a grid that already contains every environment, so rejected rows remain in the video. The asynchronous recorder queues only the selected rows, but _flush_committed_episodes() requires every recorder-local queue to be non-empty and finalize() rejects an incomplete partial batch. Therefore, with mixed-success rows or a partial final batch, camera output does not honor the same subset as dataset/trajectory output and may either contain uncommitted rows or fail at finalization. Please either implement true row-selective camera commits or document the two recorder limitations instead of claiming subset parity. See embodichain/lab/gym/envs/managers/record.py lines 140-158, 193-200, and 226-302.
|
|
||
| ## Run the packaged tasks | ||
|
|
||
| Run these commands from the repository root in the `embodichain2` environment: |
There was a problem hiding this comment.
[P2] The runnable example depends on an undocumented local environment name. The repository never instructs users to create a Conda environment named embodichain2; the public installation guide uses a .venv workflow. A clean user following the installation docs will fail immediately at conda activate embodichain2. Please make this environment-agnostic (for example, 'run in the environment where EmbodiChain is installed') and link the installation guide, or document the complete Conda setup.
| orders. Expansion does not promise that all N outputs are distinct. It also | ||
| does not fabricate arbitrary pose noise when only one legal candidate exists. | ||
|
|
||
| Diagnostics expose `candidate_ids`, `valid_candidate_counts`, |
There was a problem hiding this comment.
[P3] This reads as if the listed candidate diagnostics are retained by every expanded action plan, but several documented paths discard them. AxisAlign._resolve_grasp_pose() binds the third value from select() to _ and its build_plan() call does not add selection metadata; InteractionPoints.sample_poses() and AssembleAffordance.get_assemble_object_pose() similarly return only select(...)[1]. Those paths retain only the generic expansion-context metadata, not candidate_ids, valid/unique counts, or reused. Please scope this statement to the actions that actually retain selection metadata, or propagate the metadata through these paths.
Description
Add
--n_affordance_expandN to generate and execute affordance variations across N parallel environments. Variations follow task geometry, using valid grasp candidates, declared symmetries, or accepted motion ranges.Main changes
Example commands
conda activate embodichain2
Nine branches mean nine total environments. With all rows accepted, 20 episodes require three batches (9 + 9 + 2), while 180 episodes require twenty batches.
Append --record_trajectory --trajectory_save_dir ./outputs/affordance_trajectories to save joint trajectories.
Documentation
docs/source/overview/sim/atomic_actions/affordance_expansion.md: commands, sampling algorithm, candidate-to-trajectory pipeline, geometric constraints, collection semantics, and drawer tuning/workaround.docs/source/overview/sim/atomic_actions/builtin_actions.md: updated action behavior and optional sampling ranges.docs/source/api_reference/public_api.rst: public sampling API.agent_context/topics/atomic-actions/affordance-expansion.md: implementation ownership and integration contracts.Type of change
Checklist
black .command to format the code base.python docs/scripts/check_api_docs.py), if applicable