Skip to content

Add task-first GenSim action and orchestration pipeline - #531

Closed
skywhite1024 wants to merge 143 commits into
mainfrom
ljd/action_engine_refactor
Closed

skywhite1024 wants to merge 143 commits into
mainfrom
ljd/action_engine_refactor

Conversation

@skywhite1024

@skywhite1024 skywhite1024 commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Superseded by native GitHub Stack #539 (PRs #532 through #538). Review and merge the incremental stack instead of this closed aggregate PR.

Description

This PR introduces a task-first GenSim pipeline that connects scene preparation, symbolic task planning, direct AtomicAction graph execution, and auditable workflow recovery.

The main changes are:

  • add Action Engine v2 contracts, capability registration, SeedGraph compilation, planning, runtime execution, recovery, recording, and A/B evaluation;
  • add Task Engine orchestration with unified prepare, run, and run-all CLI flows across image, image-edit, scene, and scene-edit inputs;
  • extend Scene Engine generation/editing, semantic scene graphs, layout, scale/orientation handling, import/export, and final inspection;
  • integrate motion planning, coordinated dual-arm behavior, grasp collision filtering, task-level validation, and deterministic workflow recovery;
  • add architecture documentation and broad Action Engine, Task Engine, and Scene Engine regression coverage.

The change consolidates cross-engine ownership under Task Engine while keeping Scene Engine responsible for scene materialization and Action Engine responsible for graph compilation and execution.

Issue: none linked.

Dependencies: no new third-party Python dependency is introduced. Runtime workflows continue to use the existing optional model, image/geometry service, simulator, and motion-planning integrations.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Validation

  • git diff --check origin/main...origin/ljd/action_engine_refactor
  • black --check --diff --color ./ — one file requires reformatting: tests/gen_sim/action_engine/config/test_runtime_policy.py; 845 files pass.
  • pytest -q tests/gen_sim/action_engine tests/gen_sim/task_engine tests/gen_sim/scene_engine — 703 passed, 3 failed, 9 warnings. The failures are stale expectations for CoordinatedPickment.middle_empty_ratio (0.4 expected, 0.7 configured) and camera recording interval_step (5 expected, 1 configured).
  • Full simulator/GPU end-to-end validation was not run locally.

The source branch is currently four commits behind main; it should be synchronized before merge so CI validates the final integration state.

Screenshots

Not included. Generated SeedGraph PNGs and runtime artifacts are covered by the visualization and generation tests.

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • Dependencies have been updated, if applicable (no new dependency required).

Copilot AI lite review requested due to automatic review settings August 20, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

…refactor_v37

# Conflicts:
#	embodichain/gen_sim/task_engine/_task_program/assembly.py
#	embodichain/gen_sim/task_engine/task_program_bundle.py
Copilot AI lite review requested due to automatic review settings September 30, 2026 02:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment on lines +411 to +420
count = (
len(tracks[0])
if scope.kind == "slide"
else trajectory.positions.shape[1]
)
simulation = SimulationManager.get_instance(
scope.generator.planner.cfg.sim_instance_id
)
collision = check_free_motion(
robot, simulation, trajectory.positions[0, :count], part

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Recovered retreat skips collision checks

When a failed E6 Slide plan is recovered, the new path includes a release retreat after the approach, reach, and pull. This check examines only the approach frames, so it can accept a retreat that moves the robot through an obstacle.

Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/gen_sim/task_engine/_task_program/articulation_recovery.py
Line: 411-420

Comment:
**Recovered retreat skips collision checks**

When a failed E6 Slide plan is recovered, the new path includes a release retreat after the approach, reach, and pull. This check examines only the approach frames, so it can accept a retreat that moves the robot through an obstacle.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex Fix in Claude Code

Comment on lines +155 to +168
has_place = any(node["call"].get("kind") == "place" for node in result["nodes"])
if not has_place:
return result
for group in result.get("task_groups", ()):
ids = group.get("node_ids", ())
if group.get("task_type") != "E6" or not ids:
continue
first = nodes[ids[0]]["call"]
if first.get("arguments", {}).get("state") != "closed":
continue
primary = first.get("resources", {}).get("primary")
# The right arm is the alternate in the supported dual-arm profile.
# Keep an already-right close route idempotent across bundle passes.
alternate = "right" if primary == "left" else primary

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unrelated drawer closes switch arms

If the graph contains any Place call, this rewrite moves every left-arm E6 close group to the right arm. It does not check whether the close belongs to that placement or whether the left arm was explicitly selected, so an unrelated drawer close can run on the wrong arm and fail to reach its target.

Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/gen_sim/task_engine/_task_program/drawer_binding.py
Line: 155-168

Comment:
**Unrelated drawer closes switch arms**

If the graph contains any Place call, this rewrite moves every left-arm E6 close group to the right arm. It does not check whether the close belongs to that placement or whether the left arm was explicitly selected, so an unrelated drawer close can run on the wrong arm and fail to reach its target.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex Fix in Claude Code

@yuecideng yuecideng mentioned this pull request Sep 30, 2026
7 of 10 tasks
@yuecideng

Copy link
Copy Markdown
Contributor

Superseded by #729, which carries v36 onto the latest main and includes the drawer, cuRobo, IK, policy, test, and API documentation fixes.

@yuecideng yuecideng closed this Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Features related to agentic system atomic action atomic action related functionality enhancement New feature or request refactor task A task written in openai gym format for imitation learning or reinforcement learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants