ProgramGym

ProgramGym: Scaling Training Environments for Long-Horizon Program Reproduction Agents

Chengyi Yang1*, Renxu Bao1*, Jue Hou1*, Zongpei Teng1, Ziheng Wang1, Yujie Lin1, Chengsong Huang2, Junnan Zhu3, Delai Qiu4, Yining Wang4, Shengping Liu4, Fei Long1†, Jinsong Su1†

1Xiamen University  ·  2Washington University in St. Louis
3Institute of Automation, Chinese Academy of Sciences  ·  4Unisound

*Equal contributions  ·  †Corresponding authors

Agents need coding like software engineers. So we build the gym

Overview

What the gym holds, and what training in it buys

Program-Env · Corpus
Executable tasks by source language
Program-Env 0 executable tasks
  • Go 818 49.64%
  • C++ 378 22.94%
  • Rust 303 18.39%
  • C 149 9.04%
ProgramBench · Results
Tests Passed Score (%)
Opus 4.8xhigh
GPT-5.6xhigh
GLM-5.2 
Gemini 3.7Flash
DS-V4Flash-0731
Qwen3.8-SFTProgram-Agent
Qwen3.8-27BProgram-Agent
Gemini 3.6Flash
Kimi K2.7Code
Qwen3.8-SFTClaude Code
Qwen3.8-27B 
0
20
40
60
80
70.9
69.9
64.6
61.2
57.68
56.25
55.71
55.7
53.6
42.84
34.87
Ours Baseline Program-Env Program-Agent

Tests Passed Score on ProgramBench (%)

Figure 1. Overview of ProgramGym. Program-Env contributes 1,648 executable tasks across four systems languages. Training in it carries Qwen3.8-27B from 34.87 to 42.84 (solid), and running either model under Program-Agent carries it to 55.71 and 56.25 (dashed) — closing much of the gap to far larger proprietary models.

Program-Env

How a repository becomes an environment

Program-Agent

How an agent rebuilds a program from its black box

psampaz/go-mod-outdated · Go · five revisions, in 19 beats. Click a line to replay it; hover a box for its file. Open full screen ↗
Program-Env · Results

1,648 repositories, eight domains, one contract.

Each environment is a real GitHub project, rebuilt into a sandboxed executable with a black-box suite. Developer tools and system utilities dominate, and almost every subagent targets I/O behaviour.

Figure 4 · Repositories by functional category
Developer Tools441 (26.76%)CLI &System Utilities372 (22.57%)Data &Scientific Computing243 (14.75%)Security &Forensics227 (13.77%)Media &Graphics115 (6.98%)Games &Education110 (6.67%)Productivity &Communication73 (4.43%)Languages &Runtimes67 (4.07%) 0repositories

Distribution of the 1,648 repositories across eight functional categories.

Table 1 · Black-box interaction categories

Distribution of the black-box interaction categories over 5,918 subagents from 1,648 repositories.

Tests Category# Subagents% Percentage
Arguments4,90182.82%
Configuration2,38840.35%
Help4,07068.77%
I/O5,87399.24%
Subcommands1,30522.05%
TUI71612.10%
Cost and quality

136.77B tokens. 72.99% coverage. 404 tests per repository.

Building the test suites takes almost the whole budget: 130.83B of the 136.77B tokens. Those suites cover 72.99% of the gold executable's lines on average (median 81.63%) and keep 404 tests per repository (median 287).

Cost and quality · (a) tokens by stage, (b) mean coverage, (c) mean test cases
Per Repository   Mean: 82.99M   Median: 55.48M
0501001504.66BExecutable generation1.29BDispatcher130.83BTest constructionTotal tokens (billions)
(a)
025507510072.60%Gon=81864.83%C++n=37880.92%Rustn=30379.66%Cn=149Overall Mean: 72.99%Overall Median: 81.63%Mean Coverage (%)
(b)
0200400600800255Gon=818484C++n=378572Rustn=303673Cn=149Overall Mean: 404Overall Median: 287Mean Test Cases
(c)
Distributions

Small tools and large codebases, the same pipeline.

Code size spans four orders of magnitude; coverage and test counts stay high across all four languages, with C++ carrying the longest tail.

Figure 5 · Distributions of code lines, coverage, and test cases in Program-Env
101102103104105106Gon=818C++n=378Rustn=303Cn=149Code lines per repository
0255075100Gon=818C++n=378Rustn=303Cn=149Coverage (%)
101102103Gon=818C++n=378Rustn=303Cn=149Test cases per repository
DensityInterquartile rangeMedianMean1.5 IQROutliers

Distributions of code lines, coverage, and test cases in Program-Env (all 1,648 repositories).

Across the 1,648 repositories, test construction accounts for 130.83B of the 136.77B tokens spent; a repository costs 82.99M tokens on average.

Program-Agent · Results on ProgramBench

Training lifts the whole curve. Program-Agent lifts it again.

Share of the 200 ProgramBench instances whose rebuilt program passes at least a given fraction of the behavioural tests. Program-Agent lifts the curve for both models, and the fine-tuned one holds the most instances at the high thresholds.

Test pass-rate distribution · hover or tap for the exact values at any threshold
00101020203030404050506060707080809090100100Instances Exceeding Threshold (%)Test Pass Rate Threshold (%)Qwen3.8-27B + Claude CodeQwen3.8-27B + Program-AgentQwen3.8-27B-SFT + Claude CodeQwen3.8-27B-SFT + Program-Agent
Qwen3.8-27B + Claude Code 34.87% 198 / 200 usableQwen3.8-27B + Program-Agent 55.71% 198 / 200 usableQwen3.8-27B-SFT + Claude Code 42.84% 198 / 200 usableQwen3.8-27B-SFT + Program-Agent 56.25% 199 / 200 usable
ProgramBench · Across models and agents

A 27B open model, trained here, lands beside the frontier.

Test pass rate against output tokens per task, for the public ProgramBench leaderboard and our own runs. The mascot marks Program-Agent and the fine-tuned model.

0%10%20%30%40%50%60%70%80%025k50k75k100k200k300k400k600k900k1.2M1.5MTest Passed (%)Output tokens (per task)GPT-5.4 miniGPT-5 miniGPT-5.4GPT-5.5GPT-5.6 SolGemini 3.1 ProGemini 3 FlashGPT-5.5 (high)Claude Opus 4.7Claude Haiku 4.5GPT-5.5 (xhigh)GPT-5.6 Sol (xhigh)Gemini 3.7 FlashClaude Opus 4.6Claude Opus 4.7 (xhigh)Kimi K2.7 CodeGemini 3.6 FlashGemini 3.5 FlashClaude Sonnet 4.6GLM-5.2Claude Opus 4.8 (xhigh)DS-V4-Flash-0731Claude CodeClaude Opus 5 (xhigh)DS-V4-Flash-0731Program-AgentQwen3.8-27B-SFTClaude CodeQwen3.8-27B-SFTProgram-AgentQwen3.8-27BProgram-AgentQwen3.8-27BClaude Code
Program-Agent · Round budget

Each implement-review round raises the pass rate; five rounds raise it furthest.

The same fine-tuned model under Program-Agent at K = 1, 3 and 5 implementation rounds, against Claude Code and DeepSeek-V4-Flash. More rounds cost more tokens and keep paying off.

Test pass rate versus output tokens · K rounds
30%35%40%45%50%55%60%300k500k700k900k1.1M1.4M1.5MTest Passed (%)Output tokens (per task)DeepSeek-V4-Flash-0731Claude CodeQwen3.8-27B-SFTClaude CodeQwen3.8-27B-SFTProgram-Agent (K = 1)Qwen3.8-27B-SFTProgram-Agent (K = 3)Qwen3.8-27B-SFTProgram-Agent (K = 5)Qwen3.8-27BClaude Code
Program-Agent · What the agent does, turn by turn

Under Program-Agent the agent works longer, and more of each turn goes to reading and writing code.

One unit of mass per agent turn, split across the tool actions it made and summed over each setting's 200 trajectories. Under Program-Agent the fine-tuned model averages about 1,340 turns per task against 730 under Claude Code.

Normalized action count per agent turn · hover or tap for the breakdown at any turn
Normalized Action Count
Qwen3.8-27B +
Claude Code
0501001502000555111016642219Agent Turn
Qwen3.8-27B +
Program-Agent
042685112761702Agent Turn
Qwen3.8-27B-SFT +
Claude Code
0606121318202426Agent Turn
Qwen3.8-27B-SFT +
Program-Agent
0688137520622750Agent Turn
ReadWriteProbeExecuteGitOther

Cite this work

arXiv:2610.13395
BibTeX
@misc{yang2026programgym,
  title = {{ProgramGym}: Scaling Training Environments for Long-Horizon Program Reproduction Agents},
  author = {Chengyi Yang and Renxu Bao and Jue Hou and Zongpei Teng and
            Ziheng Wang and Yujie Lin and Chengsong Huang and Junnan Zhu and
            Delai Qiu and Yining Wang and Shengping Liu and Fei Long and Jinsong Su},
  year = {2026},
  eprint = {2610.13395},
  archivePrefix = {arXiv},
  primaryClass = {cs.SE},
  url = {https://arxiv.org/abs/2610.13395}
}