refactor(task-engine): execute GenSim semantic graphs via Task Program - #578
Conversation
… refactor/gen-sim-task-program-phase1
Greptile SummaryThis PR routes GenSim semantic task graphs through generated, fingerprint-bound Task Program deployments and extends the canonical runtime for coordinated dual-arm workflows.
Confidence Score: 4/5The PR should not merge until vectorized runs preserve successful rows instead of converting every partial result into a global failure. The runner defeats its own Files Needing Attention: embodichain/gen_sim/task_engine/_bundle_runner.py
|
| Filename | Overview |
|---|---|
| embodichain/gen_sim/task_engine/_bundle_runner.py | Introduces canonical Gym-based bundle execution and reporting, but collapses partial vector outcomes into a global failure that defeats threshold success policies. |
| embodichain/gen_sim/task_engine/task_program_bundle.py | Generates program, scene, integration, and fingerprint artifacts with runtime projection checks. |
| embodichain/gen_sim/task_engine/semantic_graph.py | Adds immutable JSON-safe semantic graph validation and deterministic hashing. |
| embodichain/gen_sim/task_engine/semantic_planner.py | Converts supported task candidates and scene bindings into provider-free semantic calls with explicit unsupported-capability failures. |
| embodichain/lab/gym/envs/task_program/bridge.py | Extends canonical Task Program execution while preserving Gym action-consumption and row-local lifecycle boundaries. |
| embodichain/lab/sim/atomic_actions/primitives/coordinated_pickment.py | Adds coordinated dual-arm grasp selection, synchronized planning, masking, and verified attachment effects. |
| embodichain/lab/sim/atomic_actions/primitives/hand_over.py | Expands handover planning and execution for coordinated source/destination workflows. |
| embodichain/gen_sim/task_engine/config.py | Defines vector execution acceptance policies whose partial-success semantics are not preserved by the new bundle runner. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Semantic task candidate] --> B[SemanticTaskGraph]
B --> C[Fingerprint-bound Task Program bundle]
C --> D[Configured Gym environment]
D --> E[Task Program bridge]
E --> F[Atomic Action runtime]
F --> G[Per-environment results]
G --> H[Task Engine execution report]
Prompt To Fix All With AI
### Issue 1
embodichain/gen_sim/task_engine/_bundle_runner.py:135-138
**Global failure erases row success**
When a vectorized execution has both successful and failed environments, this branch creates a global `failure`, and report construction consequently marks every environment unsuccessful. This causes `any` and `at_least` policies to reject runs that satisfy their configured success threshold and discards the successful replicas with the failed batch.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/ljd..." | Re-trigger Greptile
| failure = { | ||
| "type": "TaskProgramRuntimeFailure", | ||
| "terminal_reason": str(result.terminal_reason), | ||
| } |
There was a problem hiding this comment.
Global failure erases row success
When a vectorized execution has both successful and failed environments, this branch creates a global failure, and report construction consequently marks every environment unsuccessful. This causes any and at_least policies to reject runs that satisfy their configured success threshold and discards the successful replicas with the failed batch.
Knowledge Base Used: Gym environments and task integration
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/gen_sim/task_engine/_bundle_runner.py
Line: 135-138
Comment:
**Global failure erases row success**
When a vectorized execution has both successful and failed environments, this branch creates a global `failure`, and report construction consequently marks every environment unsuccessful. This causes `any` and `at_least` policies to reject runs that satisfy their configured success threshold and discards the successful replicas with the failed batch.
**Knowledge Base Used:** [Gym environments and task integration](https://app.greptile.com/dexforce/-/custom-context/knowledge-base/dexforce/embodichain/-/docs/gym-environments.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Too many files changed for review (232 files, 100 file limit). Bypass the limit by tagging |
… refactor/gen-sim-task-program-phase1
Keep partial vector-environment successes available to Task Engine policies. Preserve relative placement scene dependencies through Atomic Action goals and require verified held state for every eligible row.
…sk Program integration
Description
This stacked PR targets
ljd/action_engine_refactor(PR #531). The target wasfirst synchronized with current
main, then this branch was restacked on thatexact target:
503026bf(main->ljd/action_engine_refactor);c96912b1(ljd/action_engine_refactor-> this branch);2620929c.The resulting architecture makes Task Program / Semantic Skill the only GenSim
path from semantic intent to physical execution.
Functional changes
feat(task-program): support coordinated dual-arm workflowstransport, handover, named park postures, fresh observations, verified
effects, and dual-arm execution policies;
by the reference task.
refactor(task-engine): execute semantic graphs via task programsSemanticTaskGraphcontracts anddeterministic semantic planning;
them through the canonical bridge/runtime;
calls and runtime results;
execution.
refactor(gen-sim): remove legacy action execution stackembodichain.gen_sim.action_engineproductionpackage and implementation-specific tests;
adapter, physical executor, command scheduler, robot-part/motion-policy
compatibility layers, duplicate physical state, and legacy reports;
scene binding under
task_engine.orchestration.Post-sync correctness fixes
result no longer creates a synthetic batch-wide failure that incorrectly
breaks
anyandat_leastsuccess policies; real infrastructure exceptionsstill mask every row.
simulation.place_relativelate-bound toSceneEntityPose, includingreference orientation and world displacement, so a fresh observation can
re-ground a moved or rotated reference entity.
HeldObjectState.env_maskforevery eligible row before lowering.
simulation.coordinated_transportfrom observed pose deltas with theunchanged
0.03 m/sand0.20 rad/sthresholds. This avoids stale contactvelocity-cache values after coordinated release without accepting an object
that is geometrically moving.
This intentionally breaks the unmerged #531 GenSim runtime/artifact contract.
Compatibility adapters around its direct Atomic Action execution path are not
retained.
Dependency/landing order: merge this PR into
ljd/action_engine_refactor, thenland/update PR #531 against
main.Type of change
Validation
black --check .: 891 files unchanged.git diff --check: passed.python docs/scripts/check_api_docs.py: 1981/1981 exports documented.open_drawerconfiguration case is blocked beforeexecution because the external
Drawer.zipmirror does not match therepository-pinned MD5.
embodichain/gen_sim/action_engineand prevent the removed physical executorclasses from returning.
End-to-end acceptance
The requested scene-mode command was rerun unchanged on exact pushed head
2620929c:python -m embodichain.gen_sim.task_engine run-all \ --mode scene \ --task-id task1_2 \ --instruction "用左臂把魔方递给右臂,用右臂把魔方放到苹果右边,然后把苹果放到盘子前面,然后用左臂把苹果放到盘子里,然后用右臂把魔方放到盘子里,最后用双臂把盘子端起来向前移动并放下" \ --scene /root/task1_2/gym_export \ --output-root outputs/gen_sim/task1_2 \ --robot-profile dual_frankaResult:
20260903_154102;succeeded(process exit code 0);(
0.00209 m/s,0.02114 rad/s).Ignored local artifacts are under
outputs/gen_sim/task1_2/20260903_154102/.Checklist