Skip to content

Add independent physical objective evaluation - #657

Merged
yuecideng merged 4 commits into
mainfrom
codex/task-catalog-objectives
Sep 27, 2026
Merged

yuecideng merged 4 commits into
mainfrom
codex/task-catalog-objectives

Conversation

@yuecideng

@yuecideng yuecideng commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

Stack

This PR now contains only the physical-objective layer originally developed with the task catalog. The catalog, CLI, static gallery, packaging foundation, and their focused tests have moved to #664.

  • Add an opt-in ordered stable-region objective with per-environment progress, sustained-duration requirements, revocable final success, isolated snapshots, and partial reset.
  • Keep physical results separate from program completion, segment acceptance, termination, and dataset persistence. Stable pose and velocity do not establish gripper release.
  • Add explicit expert-controller trajectory replay with joint-layout and cadence validation while preserving legacy raw-policy replay.
  • Add an expert/dynamic-replay evaluation runner with bounded initial XY variation, effective seeds, actual initial poses, configuration/component snapshots, and separate execution, physical, acceptance, and persistence outcomes.
  • Add the repeated_pick_place objective deployment, checked-in startup evidence, public API documentation, project context, and focused tests.

Refs #106 and #655. This remains the first incremental physical-evaluation slice; learned-policy adapters, named multi-run experiments, and broader predicates remain follow-up work.

Dependencies: #664 must merge first. No new Python dependencies are introduced. Real physical qualification requires a DexSim build compatible with the repository spawn descriptor API.

Validation

  • black . with Black 26.3.1: no files changed.
  • python docs/scripts/check_api_docs.py: 2186/2186 exports documented.
  • python .agents/skills/project-dev-context/scripts/context.py check: passed.
  • python -m compileall -q embodichain embodichain_tasks: passed.
  • Architecture snapshot generation and both architecture validators: passed (113 nodes, 227 edges).
  • Focused objective/replay/evaluator pytest collection is blocked in the current local runtime by missing dexsim.engine; no functional assertions ran locally after the split.
  • Before the history-only split, the same feature tree reported 123 passing focused tests. Fresh stacked-branch CI is authoritative.

The checked-in startup record reports an initialization error and unavailable physical outcome because the available DexSim build rejected com_quaternion. It does not claim either measured failure or success.

Type of change

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

Screenshots

Not applicable. The dependent catalog PR provides the static gallery UI.

Checklist

  • I have run the black . command to format the code base.
  • I reviewed affected documentation and agent context, updated it where needed, or explained why no update was needed.
  • 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 at the covered boundaries; local runtime limitations are documented above.
  • Dependencies have been reviewed; no dependency changes are required.

@yuecideng yuecideng added enhancement New feature or request task A task written in openai gym format for imitation learning or reinforcement learning gym robot learning env and its related features labels Sep 18, 2026
@greptile-apps

greptile-apps Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds optional physical objective measurement to environment evaluation.

The PR appears safe to merge, with a non-blocking CUDA performance concern in milestone recording.

Fix All in CodexFindings

  1. P2 Per-step GPU synchronization ▶
Fix with agent prompt
### Issue 1
embodichain/lab/gym/envs/objectives/ordered_placement.py:182
If the objective runs on CUDA, `torch.nonzero(reached)` forces a GPU-to-CPU synchronization on every control step, even when no milestone is reached. This can slow the simulation loop; milestone timestamps could be updated using tensor masks without extracting indices.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

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

Summary

The PR adds an optional ordered physical objective, expert-command dynamic replay, and a single-deployment evaluator that reports physical outcomes separately from execution and persistence.

  • Recent changes add milestone timestamps, align replay action-kind metadata, and bound component snapshot reads.
  • Milestone recording introduces a per-step GPU synchronization cost when objectives run on CUDA.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Control step] --> B[Physics and interval events]
  B --> C[Physical objective update]
  C --> D[Isolated progress snapshot]
  D --> E[Expert evaluation report]
  A --> F[Recorded trajectory]
  F --> G[Dynamic replay]
  G --> C
Loading

Reviews (5) · Last reviewed commit: "Merge origin/main into task-objective-fo..."

@greptile-apps

This comment has been minimized.

@yuecideng
yuecideng force-pushed the codex/task-catalog-objectives branch from 9309e87 to e97a120 Compare September 21, 2026 08:00
@yuecideng yuecideng changed the title Add task catalog and independent physical objective evaluation Add independent physical objective evaluation Sep 21, 2026
@yuecideng
yuecideng changed the base branch from main to codex/task-catalog September 21, 2026 08:01
Base automatically changed from codex/task-catalog to main September 21, 2026 12:20
@yuecideng
yuecideng force-pushed the codex/task-catalog-objectives branch from e97a120 to 43a5d0e Compare September 27, 2026 07:51
atol=0.0,
)
reached = (self._progress < len(self.cfg.regions)) & held
reached_ids = torch.nonzero(reached, as_tuple=False).squeeze(-1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Per-step GPU synchronization

If the objective runs on CUDA, torch.nonzero(reached) forces a GPU-to-CPU synchronization on every control step, even when no milestone is reached. This can slow the simulation loop; milestone timestamps could be updated using tensor masks without extracting indices.

Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/gym/envs/objectives/ordered_placement.py
Line: 182

Comment:
**Per-step GPU synchronization**

If the objective runs on CUDA, `torch.nonzero(reached)` forces a GPU-to-CPU synchronization on every control step, even when no milestone is reached. This can slow the simulation loop; milestone timestamps could be updated using tensor masks without extracting indices.

---

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

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex Fix in Claude Code

@yuecideng
yuecideng merged commit 630e46b into main Sep 27, 2026
9 checks passed
@yuecideng
yuecideng deleted the codex/task-catalog-objectives branch September 27, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gym robot learning env and its related features 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.

1 participant