Skip to content

Add R2E-Gym patch execution reward - #12

Merged
kaiwenKevinn merged 2 commits into
mainfrom
codex/r2e-patch-execution
Sep 28, 2026
Merged

kaiwenKevinn merged 2 commits into
mainfrom
codex/r2e-patch-execution

Conversation

@kaiwenKevinn

Copy link
Copy Markdown
Collaborator

R2E-Gym currently rewards generated issue text; model outputs are never applied as patches or evaluated by task tests. This adds an opt-in patch mode that asks for a unified diff, applies it in an isolated task checkout or Singularity sandbox, runs tests before and after the patch, and rewards a candidate only when the baseline fails and the patched tests pass. Execution feedback is returned to the next rollout turn. The existing issue-generation mode remains the default.

The Docker path uses a local repository checkout and the dataset image. The Singularity path supports R2E task SIF images with /testbed and /r2e_tests. Both require an explicit test command; configuration and prerequisites are documented in docs/r2e_patch_execution.md.

Validation: the R2E workflow and harness tests passed in the remote PyTorch environment. A real SymPy R2E SIF task failed before the known patch and passed after it, and a R2EGymWorkflow.run_episode smoke returned reward 1.0 from that container execution. The new harness and workflow tests are included in the CPU CI suite.

@kaiwenKevinn
kaiwenKevinn merged commit a1e1619 into main Sep 28, 2026
6 checks passed
@kaiwenKevinn
kaiwenKevinn deleted the codex/r2e-patch-execution branch September 28, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant