MainframeGym
We evaluate frontier agents in private production mainframe systems.
- 1Claude Opus 5.5Claude Code · medium effort60.9%16 tasks × 4 trials · $3.88 per trial · 2026-10-14
- 1Gemini 4 ArgonAntigravity · high effort29.7%16 tasks × 4 trials · $13 per trial · 2026-10-14
- 2Gemini 3.8 FlashTerminus 2 · medium effort12.5%16 tasks × 4 trials · $10 per trial · 2026-10-14
Takeaways
- The shipped sample never shows the defect. Agents test on it and report everything else unchanged.
- Agents that build their own test input pass more often than agents that trust the sample.
- Moving Argon from Gemini CLI, which refused its shell calls, to Antigravity, which refused none, changed one trial.
01Environment
Mainframes still carry the core ledgers of carriers, banks and insurers, in COBOL and JCL written over decades. A business rule there lives across many batch programs and the jobs that chain them, and a change is correct only when the business outcome of every job it touches is right. MainframeGym places an agent in such an estate with a request worded as the business makes it, and grades the outputs of the jobs it changed.
- System
- A monolithic billing estate for a telephone carrier: a median of 123 production COBOL programs (175k lines), some 200 JCL members, 53 copybooks and 177 Db2 tables. Each task starts from the estate at its own point in history, so the tree differs by task: 228k to 410k lines of COBOL, JCL, copybooks and DDL.
- Observation
- The full source tree, the task statement, and sample input data staged for the agent's own runs. The statement names the business outcome, never the program, the job or the field.
- Action
- A shell in the agent's container.
harwell submit <deck>compiles what the deck needs, runs the batch job on Harwell and returns its report: every job and step, return code, printed output and output dataset. - Hidden
- The cases: input datasets and Db2 rows, the job and step each case grades, and the expected outputs. The reference fix. The sample data is never built from the cases.
- Budget
- Two hours of wall clock per trial. No network. A trial that runs out of time scores 0.
- Reward
- Binary. r = 1 when every fail-to-pass case and every pass-to-pass case passes, else 0. A case passes when the output records, Db2 rows and report counters its graded step writes match the expected ones. Any implementation with that behaviour passes.
- Grader
- A separate container. It compiles the changed programs, runs each case's batch job on Harwell from that case's own input, and checks the business outcome, never the source text. Fail-to-pass cases test the requested change; pass-to-pass cases pin billing that must not move.
Task
A business request, as the business states it
Agent container
- Estate source: COBOL, JCL, copybooks, Db2 DDL
- Sample data, never built from the cases
- harwell submit <deck>: run a job, read its report
Grader container
- Compile the changed programs on Harwell
- Run each hidden case's batch job from its own input
- Check output records, Db2 rows and report counters
Reward
1 if every case passes, else 0
- Task CI
- Each defect lives in the estate's own programs. Task CI runs every known-wrong fix (must fail) and every known-right fix (must pass). Authored with Kennet.
- Environment
- A mainframe runtime for batch and online work, with its divergences from IBM published. No network.
- Agent
- Claude Opus 5.5 on Claude Code 2.1.288, medium effort; Gemini 4 Argon on Antigravity 1.3.5, high effort; Gemini 3.8 Flash on Terminus 2 2.0.0, medium effort. 4 trials per task.
- Score
- Share of passing trials, averaged over tasks.
- Interval
- 95% bootstrap over tasks. Shared rank unless intervals separate.
02Runtime: Harwell
Harwell is our mainframe runtime. The agent and the grader run the same engine, so what the agent observes is what the reward reads.
A mainframe reward is only as sound as the runtime beneath it: COBOL packed and zoned decimal has truncation rules a stock compiler does not follow, and a runtime one cent off grades a correct fix as wrong. Harwell's patched GnuCOBOL 3.2 reproduces IBM numeric behaviour. Every run states its fidelity, clean or degraded with each divergence named against a published table; a case whose verdict would rest on one is refused at authoring.
Harwell runs code and reports. It grades nothing and knows no task; the grader reads its report.
- Batch
- JCL jobs and procedures, COBOL, DFSORT, IDCAMS, VSAM and generation data groups.
- Data
- Embedded SQL against the estate's Db2 schema, on SQLite through GixSQL.
- Online
- A CICS region with BMS maps, started transaction by transaction. Not exercised by this release.
- Report
- One JSON document per run. Each job and step, its return code, what it printed, and the fidelity of the run.
- Evidence
- Its readers are measured on every push against two public mainframe applications, AWS CardDemo and IBM's CICS GenApp, each pinned to a commit.
{
"report": 1, "mode": "decks", "status": "ok",
"jobs": [{
"name": "HELLOJOB", "status": "ok", "worst_rc": 0,
"steps": [{"name": "STEP01", "pgm": "HELLO", "kind": "cobol",
"status": "ran", "rc": 0,
"stdout": "HELLO FROM THE SANDBOX\n"}]
}],
"fidelity": {"status": "clean", "neutralized": [], "divergences": []},
"metrics": {"cpu_s": 0.013, "wall_s": 0.981, "max_rss_kb": 2480}
}03Task construction
- Hidden cases
- 338 (183 fail-to-pass, 155 pass-to-pass). Median 18.5 per task.
- Known-wrong
- 180 plausible wrong fixes, each a realistic mistake, that the verifier must reject. Median 10 per task. Every one is rejected.
- Known-right
- 43 correct fixes besides the reference, written differently, that the verifier must accept; 5 written blind from the statement alone. Every one is accepted.
| Mean per task | SWE-bench Verified1 | SWE-bench Pro2 | DeepSWE3 | MainframeGym Batch |
|---|---|---|---|---|
| Statement, characters | 1,700 | 4,614 | 2,158 | 1,012 |
| Reference lines added | 10 | 120 | 668 | 156 |
| Files the reference edits | 1 | 5 | 7 | 3.4 |
The three comparison columns are as DeepSWE reports them.3 Our reference is measured against the tree the agent starts from: the median task has a 1,016-character statement and a fix that adds 79 lines across 3 files.
Two of the tasks as the agent receives them: the task's id, a passage of its statement, and how many of each pair's trials passed.
Their calls placed from TIM mobile phones come back at the standard tariff with no plan discount. The rest of their long distance is priced as it should be. The commercial team registered the plans as they were negotiated, and this traffic grows every month.
It is the middle of March and the March bills have not gone out. These calls have to bill under the customer's plan, the same as the rest of their long distance. Everything else bills as it does today, closed months stay as billed, and the close still has to fit its window.
Reprocessing has to leave the history the way a single clean run would have left it, no matter how many times we run the period, and the run's control report, DDREDE, should tell us, for the daily history and for the monthly history, how many of the rows it wrote were already there.
Please note that current invoice calculations are accurate, so actual billing output must remain unchanged.
04Results by axis
Success rate averaged over each row's tasks; best pair in bold. Average rank ranks the pairs on each task by pass rate, ties shared.
| Tasks | Claude Opus 5.5Claude Code | Gemini 4 ArgonAntigravity | Gemini 3.8 FlashTerminus 2 |
|---|---|---|---|
| All tasks | |||
| Success rate, pass@1 | 61% | 30% | 13% |
| Ceiling, pass@4 | 75% | 31% | 13% |
| Reliability, pass^4 | 44% | 25% | 13% |
| Avg rank over tasks1 is best | 1.47 | 2.16 | 2.38 |
05Failure analysis
Claude Opus 5.5 on Claude Code passes 39 of 64 trials, Gemini 4 Argon on Antigravity 19 and Gemini 3.8 Flash on Terminus 2 8. Each pair gets two hours per trial.
- Claude Opus 5.5Claude Code64
- Gemini 4 ArgonAntigravity64
- Gemini 3.8 FlashTerminus 264
| Guards held, share of must-fix cases fixed | under 25% | 25 to 50% | 50 to 75% | 75% or more |
|---|---|---|---|---|
| Claude Opus 5.5 | 1 | 1 | 4 | 4 |
| Gemini 4 Argon | 0 | 4 | 3 | 4 |
| Gemini 3.8 Flash | 2 | 4 | 12 | 3 |
| Tool calls | Claude Opus 5.5Claude Code | Gemini 4 ArgonAntigravity | Gemini 3.8 FlashTerminus 2 |
|---|---|---|---|
| Calls per trial, median | 54 | 124 | 184 |
| Calls that failed | 3.6% | 6.7% | 3.0% |
| Failed calls followed by a working call on the same target within five calls | 46% | 65% | 52% |
| Replies the harness could not parse into a call, per trial, median | 0 | 0 | 108 |
Refused shell calls cost Argon one trial
Under Gemini CLI 0.63.0 the policy engine refused a call in all 64 Argon trials, 181 of 305 direct job submits among them; in 35 trials Argon re-ran the emulator through Python. Under Antigravity nothing was refused. Same model, same tasks: 18 passes then, 19 now, and the same 11 tasks at zero.
I will runharwell submit TST03600 --from ../opt/startusing a relative path to/opt/start.
The sample passes; the cases do not
The sample the task ships does not exercise the defect, so a clean diff on it proves nothing. Argon changed code and tested only on the sample in 44 trials and passed 14; it built its own input in 9 and passed 5. Of its 10 trials that called everything else unchanged, 4 broke a guard.
Every account in this sample was already correct, so the defect doesn't show in it.
Running the scaled test job (SIU04425) to verify execution with 400 0800 numbers, 400 discount tiers, and 20,000 localities.Agents copy the sibling program
The estate holds near-copies of each program. On mobile-network all 4 Flash and all 4 Argon trials copied the sibling's origin-and-destination check, re-rating calls to TIM phones as well as from them; all 4 Opus trials changed the origin check alone. On set-amount all 4 Argon trials gave SIU05770 its sibling's contract-end filter.
In SIU05420.cbl and SIU05110.cbl, 'OR '8'' was already added to TERORIG and TERDEST checks.
Flash fits the rule to the sample
On promotion-201 all 4 Flash trials read a sample call made after the enrolment ended as the complaint and made 201 enrolments open-ended. All 4 Opus and all 4 Argon trials kept that call on the base plan, fixed the load for every promotion, and passed.
So Call 6 MATCHES promotion 201!
Agents name the defect they leave
In 3 of 6 failed Opus and Flash rerun trials, and in 3 Argon trials, the agent states the case the verifier later fails, then leaves it. Opus files it in its hand-off as a limitation; Argon's summaries never mention it. Both passing Opus rerun trials count the existing rows, then delete and load.
I didn't add an automatic purge because I couldn't scope it safely.
Therefore, I must not modify this critical section.
Argon reads for two hours and edits nothing
In 11 of 64 trials Argon changed no file. 8 ran out the two hours decoding datasets and diffing program variants, 2 ended on a request over the model's 1,048,576-token input, which Antigravity does not compact, and 1 declared the code already correct.
06Pareto frontier
| Same tasks, same k | Claude Opus 5.5Claude Code | Gemini 4 ArgonAntigravity | Gemini 3.8 FlashTerminus 2 |
|---|---|---|---|
| Passing trials | 39 of 64 | 19 of 64 | 8 of 64 |
| Tasks solved at least once (pass@4) | 12 | 5 | 2 |
| Tasks solved in every trial (pass^4) | 7 | 4 | 2 |
| Tasks only this pair solves | 7 | 0 | 0 |
| Median steps | 53 | 110 | 269 |
| Median agent time | 10 min | 39 min | 40 min |
| Spend per trial | $3.88 | $13.45 | $10.13 |
| Spend per passing trial (cost of pass) | $6.37 | $45.29 | $81.08 |
2 tasks are solved by every pair, 4 by none.
Success rate against spend per trial
Mean dollars the model gateway billed per trial, log scale. Higher and further left is better.
Pareto frontierCheaper and more accurate than the median pair95% interval
Success rate against agent time per trial
Median minutes an agent ran per trial, log scale. Higher and further left is better.
Pareto frontierFaster and more accurate than the median pair95% interval
07Training signal
| Task | Claude Opus 5.5Claude Code · medium effort | Gemini 4 ArgonAntigravity · high effort | Gemini 3.8 FlashTerminus 2 · medium effort |
|---|---|---|---|
| 0800-staged-promotion-percentage | 4 of 4 | 4 of 4 | 4 of 4 |
| day-count-ceiling-999 | 4 of 4 | 3 of 4 | 4 of 4 |
| credit-ccm-field-rollout | 4 of 4 | 4 of 4 | 0 of 4 |
| promotion-201-eligibility | 4 of 4 | 4 of 4 | 0 of 4 |
| locality-terminal-capacity | 3 of 4 | 4 of 4 | 0 of 4 |
| mobile-network-plan-rating | 4 of 4 | 0 of 4 | 0 of 4 |
| nationwide-0800-contract-pricing | 4 of 4 | 0 of 4 | 0 of 4 |
| withdrawal-order-period-billing | 4 of 4 | 0 of 4 | 0 of 4 |
| 0800-promotion-month-count | 2 of 4 | 0 of 4 | 0 of 4 |
| basic-plan-0800-promotion-qualification | 2 of 4 | 0 of 4 | 0 of 4 |
| duplicate-0800-promotion-credits | 2 of 4 | 0 of 4 | 0 of 4 |
| rerun-history-doubling | 2 of 4 | 0 of 4 | 0 of 4 |
| 0800-promotion-version-credits | 0 of 4 | 0 of 4 | 0 of 4 |
| 0800-set-amount-promotion-credit | 0 of 4 | 0 of 4 | 0 of 4 |
| byvalue-promo-discounts | 0 of 4 | 0 of 4 | 0 of 4 |
| tcl-consumption-days-stale | 0 of 4 | 0 of 4 | 0 of 4 |
08Future work
- Online work: CICS transactions and BMS screens, graded screen by screen.
- Performance: CPU and elapsed time per job as a continuous reward.
- Modernization: COBOL rewritten as Java, graded against the original estate.
09References
- Chowdhury, N., Aung, J., Shern, C. J., et al. Introducing SWE-bench Verified. OpenAI, 2024.
- Deng, X., Da, J., Pan, E., et al. SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks? arXiv:2509.16941, 2025.
- Datacurve. DeepSWE. Datacurve blog.
- Kapoor, S., Stroebl, B., Siegel, Z. S., Nadgir, N., and Narayanan, A. AI Agents That Matter. arXiv:2407.01502, 2024.
- Kapoor, S., Stroebl, B., et al. Holistic Agent Leaderboard. Princeton University.
- Erol, M. H., El, B., Suzgun, M., Yuksekgonul, M., and Zou, J. Cost-of-Pass: An Economic Framework for Evaluating Language Models. arXiv:2504.13359, 2025.
- Yao, S., Shinn, N., Razavi, P., and Narasimhan, K. τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. arXiv:2406.12045, 2024.
Cite
@misc{metaphi2026mainframegymbatch,
title = {{MainframeGym Batch} v3.4.1},
author = {{Metaphi AI}},
year = {2026},
month = oct,
howpublished = {\url{https://metaphi.ai/benchmarks/mainframegym/batch}},
note = {Version v3.4.1}
}