Skip to content

Unify Expert Program runtime integration - #551

Merged
yuecideng merged 5 commits into
mainfrom
enhance/expert-program-runtime
Aug 26, 2026
Merged

Unify Expert Program runtime integration#551
yuecideng merged 5 commits into
mainfrom
enhance/expert-program-runtime

Conversation

@yuecideng

Copy link
Copy Markdown
Contributor

Description

This PR makes EmbodiedEnv the shared execution boundary for declarative Expert Programs and removes duplicate runtime assembly across the semantic-skill and task layers.

Key changes:

  • centralize semantic runtime assembly and scene/profile validation for both AtomicSkills and Expert Program execution;
  • add registration-owned factories for custom semantic lowerers, including the Open Drawer Slide call;
  • add typed planning-failure classification, named trajectory-segment events, and bound skill/call availability queries;
  • let EnvSpec inject one immutable Expert Program adapter factory and derive preflight registration metadata from the same owner;
  • let EmbodiedEnv.create_demo_segments() accept either static configuration or an episode-level ExpertProgramCfg/CompiledProgram, providing the handoff required by a future MLLM frontend;
  • migrate Repeated Pick/Place and Open Drawer to the shared environment path without task-local adapter properties or runtime assembly;
  • consolidate completed design material into maintained Sphinx documentation and routed agent context.

HandOver and ActionBank are intentionally unchanged. ActionBank deprecation and GPU-backed physical qualification remain outside this PR.

Dependencies: None.

Refs #471
Refs #474

Type of change

  • Enhancement (non-breaking change which improves existing functionality)

Screenshots

Not applicable; this change has no visual UI.

Validation

  • black . — 815 files unchanged
  • python docs/scripts/check_api_docs.py — 1709/1709 exports documented
  • pytest -q tests/sim/atomic_actions -m 'not gpu and not requires_sim' --disable-warnings --maxfail=10 — 564 passed, 4 deselected
  • pytest -q tests/sim/skills -m 'not gpu and not requires_sim' --disable-warnings --maxfail=10 — 333 passed, 13 deselected
  • pytest -q tests/gym/envs/expert_program tests/gym/envs/test_embodied_env_expert_program.py tests/gym/utils/test_gym_utils.py -m 'not gpu and not requires_sim' --disable-warnings --maxfail=10 — 321 passed, 1 deselected
  • pytest -q tests/docs --confcutdir=tests/docs --disable-warnings --maxfail=10 — 20 passed
  • git diff --check HEAD^ — passed

GPU and real-simulator trajectory qualification were not run locally.

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation.
  • Public API changes are reflected in the API docs (python docs/scripts/check_api_docs.py).
  • I have added tests that prove the feature works.
  • Dependencies have been updated, if applicable (not applicable; no dependency changes).

Centralize semantic runtime assembly and validation, add registration-owned lowerers and typed planning diagnostics, and let EmbodiedEnv bind Expert Program adapters after scene initialization. Migrate repeated pick/place and open drawer to the shared path and document the consolidated architecture.
@yuecidengyuecideng added enhancement New feature or request refactor atomic action atomic action related functionality gym robot learning env and its related features labels Aug 25, 2026
@yuecideng
yuecideng marked this pull request as ready for review August 26, 2026 04:50
@greptile-apps

greptile-appsBot commented Aug 26, 2026

Copy link
Copy Markdown

Greptile Summary

The PR centralizes Expert Program compilation and runtime assembly behind EmbodiedEnv, with registration-owned adapter and semantic-lowerer factories.

  • Adds episode-level Expert Program selection and shared environment lifecycle integration.
  • Consolidates semantic runtime assembly, availability diagnostics, planning-failure classification, and trajectory-segment events.
  • Migrates the reference Expert Program tasks to registration-owned shared runtime construction.
  • Updates tests, API documentation, and maintained architecture guidance while removing superseded design and reporting material.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the eligible follow-up review scope.

No blocking failure remains.

Important Files Changed

FilenameOverview
embodichain/lab/gym/envs/embodied_env.pyAdds registration-injected adapter binding, episode-level program selection, and bridge-aware task-success handling.
embodichain/lab/gym/utils/registration.pyExtends environment registration to own and inject an immutable Expert Program adapter factory.
embodichain/lab/gym/envs/expert_program/environment.pyRoutes Expert Program construction through the shared semantic runtime assembly and registration-owned lowerers.
embodichain/lab/gym/envs/expert_program/extensions.pyDefines immutable declarations and factories for registered semantic lowerers.
embodichain/lab/gym/envs/expert_program/simulation_environment.pyImplements simulation-backed adapter and lowerer creation from the task registration.
embodichain/lab/sim/skills/_assembly.pyIntroduces the common provider-free semantic runtime assembly path.
embodichain/lab/sim/atomic_actions/plans.pyAdds typed planning-failure metadata with a compatibility default for unclassified failed plans.
embodichain/lab/sim/atomic_actions/execution.pyEmits named segment events and handles non-retryable planning failures without charging retry budgets.
embodichain/lab/sim/skills/runtime.pyExposes bound skill and semantic-call availability while using the shared runtime assembly.
embodichain_tasks/embodichain_tasks/expert_program/open_drawer.pyMoves the task-specific Slide lowerer into a registration-owned factory and shared environment path.

Sequence Diagram

sequenceDiagram
participant Caller
participant EnvSpec
participant Env as EmbodiedEnv
participant Adapter
participant Runtime as SkillRuntime
participant Gym
EnvSpec->>Env: construct with adapter factory
Env->>Adapter: create_adapter(live environment)
Caller->>Env: create_demo_segments(program)
Env->>Adapter: compile and create bridge
Adapter->>Runtime: assemble fresh semantic runtime
loop Program segments
Runtime-->>Env: controller action
Env-->>Gym: DemoSegment action
Gym->>Gym: env.step(action)
end
Env-->>Caller: completion mask
Loading

Reviews (4): Last reviewed commit: "wip" | Re-trigger Greptile

@greptile-apps

Copy link
Copy Markdown

Too many files changed for review (125 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@yuecideng
yuecideng merged commit cf976a3 into mainAug 26, 2026
@yuecideng
yuecideng deleted the enhance/expert-program-runtime branch August 26, 2026 15:06
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

atomic actionatomic action related functionalityenhancementNew feature or requestgymrobot learning env and its related featuresrefactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@yuecideng