Skip to content

feat(gym): add declarative expert program runtime - #497

Merged
yuecideng merged 48 commits into
mainfrom
feat/declarative-expert-program-runtime
Aug 24, 2026
Merged

feat(gym): add declarative expert program runtime#497
yuecideng merged 48 commits into
mainfrom
feat/declarative-expert-program-runtime

Conversation

@yuecideng

@yuecidengyuecideng commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Stack

The environment retains its normal env.step() cadence and dataset lifecycle. Expert Programs compile into the existing semantic/atomic runtime instead of creating a third workflow engine.

Refs #471
Refs #474

Type of change

  • New feature (non-breaking change which adds functionality)

Screenshots

Not applicable.

Validation

  • Focused coverage: tests/gym/envs/expert_program, demo, settling, registration, and run-env integration tests
  • Final affected-suite regression on the stack tip: 1215 passed, 2 skipped, 8 deselected
  • Changed Python files pass Black 26.3.1; the Sphinx build and rollout-report drift check pass at the stack tip

Checklist

  • Changed Python files pass Black 26.3.1.
  • Corresponding public/design documentation is included in this stack.
  • Tests cover the affected behavior.
  • No dependency update is required.

@yuecidengyuecideng added gym robot learning env and its related features enhancement New feature or request labels Aug 11, 2026
@yuecideng
yuecideng marked this pull request as ready for review August 11, 2026 16:46
CopilotAI lite review requested due to automatic review settings August 11, 2026 16:46

CopilotAI 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.

@greptile-apps

greptile-appsBot commented Aug 11, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a strict, versioned Expert Program frontend that compiles declarative programs into the existing semantic-skill runtime while preserving normal Gym stepping and dataset lifecycle.

  • Adds schema decoding, loading, validation, and preflight compilation.
  • Adds lazy sequential and parallel segment execution, simulation adapters, settling policies, validators, and completion metadata.
  • Integrates Expert Programs with Gym configuration, demonstrations, environment launching, and public documentation.

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/expert_program/decoder.pyImplements bounded, path-aware decoding with strict discriminator, field, numeric, and executable-value validation.
embodichain/lab/gym/envs/expert_program/compiler.pyPerforms static preflight and lowers declarative sequential or parallel program structure into semantic runtime inputs.
embodichain/lab/gym/envs/expert_program/bridge.pyAdapts lazy Expert Program execution to demo segments, Gym actions, post-policies, validators, and completion metadata.
embodichain/lab/gym/envs/expert_program/simulation_environment.pyConnects simulation-backed scene, runtime, policy, and validation services to the Expert Program environment contract.
embodichain/lab/gym/envs/demo.pyExtends demonstration execution with richer segment lifecycle, runtime failure traces, and completion metadata.
embodichain/lab/sim/skills/runtime.pyRefines the canonical semantic runtime and row-local lifecycle used by Expert Program execution.
embodichain/lab/scripts/run_env.pyAdds launcher support for loading and applying an explicit Expert Program configuration.
embodichain/lab/gym/envs/settling.pyAdds reusable batched settling monitors and policies for segment post-processing.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[JSON or YAML Expert Program] --> B[Strict decoder and loader]
B --> C[ExpertProgramCfg]
C --> D[Preflight compiler]
D --> E[Lazy program segments]
E --> F[Semantic SkillRuntime]
F --> G[Atomic action runtime]
G --> H[AtomicDemoBridge]
H --> I[Normal env.step cadence]
I --> J[Settling and validators]
J --> K[Completion and dataset metadata]
Loading

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

Make endpoint bindings, timed command frames, transports, routing, safe holds, and profile lowering controller-agnostic. Preserve joint trajectories as optional feedback artifacts and add staged, same-address invocation revision semantics for mobile and whole-body safety.
…2c-runtime-endpoints
# Conflicts:
#	docs/design/declarative_expert_program_plan.md
#	embodichain/lab/sim/atomic_actions/primitives/coordinated_pickment.py
#	embodichain/lab/sim/atomic_actions/primitives/coordinated_placement.py
#	embodichain/lab/sim/atomic_actions/primitives/hand_over.py
#	embodichain/lab/sim/atomic_actions/primitives/move_end_effector.py
#	embodichain/lab/sim/atomic_actions/primitives/move_held_object.py
#	embodichain/lab/sim/atomic_actions/primitives/move_joints.py
#	embodichain/lab/sim/atomic_actions/primitives/pick_up.py
#	embodichain/lab/sim/atomic_actions/primitives/place.py
#	embodichain/lab/sim/atomic_actions/primitives/press.py
#	embodichain/lab/sim/skills/profiles.py
#	scripts/tutorials/atomic_action/assemble.py
#	scripts/tutorials/atomic_action/coordinated_pickment.py
#	scripts/tutorials/atomic_action/coordinated_placement.py
#	scripts/tutorials/atomic_action/hand_over.py
#	scripts/tutorials/atomic_action/move_end_effector.py
#	scripts/tutorials/atomic_action/move_held_object.py
#	scripts/tutorials/atomic_action/move_joints.py
#	scripts/tutorials/atomic_action/place.py
#	scripts/tutorials/atomic_action/press.py
Remove fallback control periods from motion policies and the atomic action engine. Require planners and custom actions to provide validated timing, propagate explicit interpolation cadence through planning contexts, and update built-ins, tasks, benchmarks, tutorials, docs, and tests.
BREAKING CHANGE: planner results with positions must include dt and duration, custom atomic actions must return TimedTrajectory, and fallback_control_dt is removed.
…pr2c-runtime-endpoints
# Conflicts:
#	agent_context/topics/atomic-actions/atomic-actions.md
#	docs/source/overview/sim/atomic_actions/builtin_actions.md
#	docs/source/overview/sim/atomic_actions/index.md
#	docs/source/tutorial/atomic_actions.rst
#	embodichain/lab/sim/atomic_actions/execution.py
#	scripts/tutorials/atomic_action/dynamic_obstacle_recovery.py
#	tests/sim/atomic_actions/test_core.py
#	tests/sim/atomic_actions/test_engine.py
#	tests/sim/atomic_actions/test_runner.py
@skywhite1024
skywhite1024force-pushed the feat/declarative-expert-program-runtime branch from f5ec186 to d6be5c1CompareAugust 21, 2026 09:35
@skywhite1024
skywhite1024force-pushed the feat/declarative-expert-program-runtime branch from d6be5c1 to f5ec186CompareAugust 21, 2026 11:31
…rified-runtime
# Conflicts:
#	agent_context/topics/atomic-actions/atomic-actions.md
#	docs/source/overview/sim/atomic_actions/index.md
#	docs/source/overview/sim/semantic_skills.md
#	docs/source/tutorial/atomic_actions.rst
#	docs/source/tutorial/semantic_skills.rst
#	embodichain/lab/sim/atomic_actions/core.py
#	embodichain/lab/sim/atomic_actions/execution.py
#	embodichain/lab/sim/atomic_actions/plans.py
#	embodichain/lab/sim/atomic_actions/primitives/pick_up.py
#	embodichain/lab/sim/skills/runtime.py
#	tests/sim/atomic_actions/test_actions.py
#	tests/sim/atomic_actions/test_engine_per_env.py
#	tests/sim/skills/test_runtime.py
Base automatically changed from feat/semantic-skill-runtime to mainAugust 22, 2026 15:42
@yuecideng
yuecidengforce-pushed the feat/declarative-expert-program-runtime branch from f5ec186 to bf2f2c7CompareAugust 22, 2026 15:42
@greptile-apps

greptile-appsBot commented Aug 24, 2026

Copy link
Copy Markdown

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

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

@yuecideng
yuecideng merged commit 7b11331 into mainAug 24, 2026
4 checks passed
@yuecideng
yuecideng deleted the feat/declarative-expert-program-runtime branch August 24, 2026 08:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or requestgymrobot learning env and its related features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yuecideng