Metaphi AI
Contents
  1. Leaderboard
  2. Environment
  3. Runtime: Harwell
  4. Task construction
  5. Results by axis
  6. Failure analysis
  7. Pareto frontier
  8. Training signal
  9. Future work
  10. References
← Benchmarks
Benchmark · Mainframe engineering

MainframeGym

We evaluate frontier agents in private production mainframe systems.

Evaluate your agent

MainframeGym Batchn = 16 taskspass@1
  1. 1Claude Opus 5.5Claude Code · medium effort60.9%16 tasks × 4 trials · $3.88 per trial · 2026-10-14
  2. 1Gemini 4 ArgonAntigravity · high effort29.7%16 tasks × 4 trials · $13 per trial · 2026-10-14
  3. 2Gemini 3.8 FlashTerminus 2 · medium effort12.5%16 tasks × 4 trials · $10 per trial · 2026-10-14

Takeaways

  1. The shipped sample never shows the defect. Agents test on it and report everything else unchanged.
  2. Agents that build their own test input pass more often than agents that trust the sample.
  3. 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

One rollout. Only the changed tree reaches the grader.
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}
}
A Harwell run report, trimmed, for a one-step job. The agent reads the same document for every job it submits.

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 taskSWE-bench Verified1SWE-bench Pro2DeepSWE3MainframeGym Batch
Statement, characters1,7004,6142,1581,012
Reference lines added10120668156
Files the reference edits1573.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.

mobile-network-plan-ratingClaude Opus 5.5 4 of 4Gemini 4 Argon 0 of 4Gemini 3.8 Flash 0 of 4

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.

rerun-history-doublingClaude Opus 5.5 2 of 4Gemini 4 Argon 0 of 4Gemini 3.8 Flash 0 of 4

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.

TasksClaude Opus 5.5Claude CodeGemini 4 ArgonAntigravityGemini 3.8 FlashTerminus 2
All tasks
Success rate, pass@161%30%13%
Ceiling, pass@475%31%13%
Reliability, pass^444%25%13%
Avg rank over tasks1 is best1.472.162.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.

  1. Claude Opus 5.5Claude Code39101364
  2. Gemini 4 ArgonAntigravity191126864
  3. Gemini 3.8 FlashTerminus 282129664
Guards held, share of must-fix cases fixedunder 25%25 to 50%50 to 75%75% or more
Claude Opus 5.51144
Gemini 4 Argon0434
Gemini 3.8 Flash24123
How each scored trial ended, from per-case results. A guard is a pass-to-pass case. The table bins failures that kept every guard by the share of must-fix cases fixed.
Tool callsClaude Opus 5.5Claude CodeGemini 4 ArgonAntigravityGemini 3.8 FlashTerminus 2
Calls per trial, median54124184
Calls that failed3.6%6.7%3.0%
Failed calls followed by a working call on the same target within five calls46%65%52%
Replies the harness could not parse into a call, per trial, median00108
Read from each trial's trajectory. A failed call is a refusal, a tool error or a nonzero exit; its target is the command, file or emulator verb it acted on. 2 Claude Opus 5.5 trials stopped at the time limit without a trajectory.

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 run harwell submit TST03600 --from ../opt/start using a relative path to /opt/start.
day-count-ceiling-999 · trial tDaUF6N · step 336

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.
tcl-consumption-days-stale · trial ssqv96c · step 28
Running the scaled test job (SIU04425) to verify execution with 400 0800 numbers, 400 discount tiers, and 20,000 localities.
locality-terminal-capacity · trial rk5HYqf · step 172

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.
mobile-network-plan-rating · trial xCB7v7R · step 83

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!
promotion-201-eligibility · trial PMgPEiE · step 182

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.
rerun-history-doubling · trial RRxgGbq · step 31
Therefore, I must not modify this critical section.
duplicate-0800-promotion-credits · trial 3Br98pT · step 147

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 kClaude Opus 5.5Claude CodeGemini 4 ArgonAntigravityGemini 3.8 FlashTerminus 2
Passing trials39 of 6419 of 648 of 64
Tasks solved at least once (pass@4)1252
Tasks solved in every trial (pass^4)742
Tasks only this pair solves700
Median steps53110269
Median agent time10 min39 min40 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.

0%20%40%60%80%100%$5$10$20Success rateDollars per trial, log scaleClaude Opus 5.5 (Claude Code · medium) Success rate: 61% (95% interval 41% to 80%) Dollars per trial: $3.88 On the Pareto frontierClaude Opus 5.561% · $3.88 · Claude Code · mediumGemini 4 Argon (Antigravity · high) Success rate: 30% (95% interval 11% to 53%) Dollars per trial: $13Gemini 4 Argon30% · $13 · Antigravity · highGemini 3.8 Flash (Terminus 2 · medium) Success rate: 13% (95% interval 0% to 31%) Dollars per trial: $10Gemini 3.8 Flash13% · $10 · Terminus 2 · medium
0%20%40%60%80%100%$5$10$20Success rateDollars per trial, log scaleClaude Opus 5.5 (Claude Code · medium) Success rate: 61% (95% interval 41% to 80%) Dollars per trial: $3.88 On the Pareto frontierClaude Opus 5.561% · $3.88Gemini 4 Argon (Antigravity · high) Success rate: 30% (95% interval 11% to 53%) Dollars per trial: $13Gemini 4 Argon30% · $13Gemini 3.8 Flash (Terminus 2 · medium) Success rate: 13% (95% interval 0% to 31%) Dollars per trial: $10Gemini 3.8 Flash13% · $10

Pareto frontierCheaper and more accurate than the median pair95% interval

Source: MainframeGym Batch v3.4.1, 192 trials · metaphi.aiData (CSV)

Success rate against agent time per trial

Median minutes an agent ran per trial, log scale. Higher and further left is better.

0%20%40%60%80%100%10 min20 min50 minSuccess rateAgent minutes per trial, log scaleClaude Opus 5.5 (Claude Code · medium) Success rate: 61% (95% interval 41% to 80%) Agent minutes per trial: 10 min On the Pareto frontierClaude Opus 5.561% · 10 min · Claude Code · mediumGemini 4 Argon (Antigravity · high) Success rate: 30% (95% interval 11% to 53%) Agent minutes per trial: 39 minGemini 4 Argon30% · 39 min · Antigravity · highGemini 3.8 Flash (Terminus 2 · medium) Success rate: 13% (95% interval 0% to 31%) Agent minutes per trial: 40 minGemini 3.8 Flash13% · 40 min · Terminus 2 · medium
0%20%40%60%80%100%10 min20 min50 minSuccess rateAgent minutes per trial, log scaleClaude Opus 5.5 (Claude Code · medium) Success rate: 61% (95% interval 41% to 80%) Agent minutes per trial: 10 min On the Pareto frontierClaude Opus 5.561% · 10 minGemini 4 Argon (Antigravity · high) Success rate: 30% (95% interval 11% to 53%) Agent minutes per trial: 39 minGemini 4 Argon30% · 39 minGemini 3.8 Flash (Terminus 2 · medium) Success rate: 13% (95% interval 0% to 31%) Agent minutes per trial: 40 minGemini 3.8 Flash13% · 40 min

Pareto frontierFaster and more accurate than the median pair95% interval

Source: MainframeGym Batch v3.4.1, 192 trials · metaphi.ai
The ringed pairs are the Pareto frontier:4,5 no other pair beats them on both axes. Cost of pass is spend per trial over success rate.6

07Training signal

TaskClaude Opus 5.5Claude Code · medium effortGemini 4 ArgonAntigravity · high effortGemini 3.8 FlashTerminus 2 · medium effort
0800-staged-promotion-percentage4 of 44 of 44 of 4
day-count-ceiling-9994 of 43 of 44 of 4
credit-ccm-field-rollout4 of 44 of 40 of 4
promotion-201-eligibility4 of 44 of 40 of 4
locality-terminal-capacity3 of 44 of 40 of 4
mobile-network-plan-rating4 of 40 of 40 of 4
nationwide-0800-contract-pricing4 of 40 of 40 of 4
withdrawal-order-period-billing4 of 40 of 40 of 4
0800-promotion-month-count2 of 40 of 40 of 4
basic-plan-0800-promotion-qualification2 of 40 of 40 of 4
duplicate-0800-promotion-credits2 of 40 of 40 of 4
rerun-history-doubling2 of 40 of 40 of 4
0800-promotion-version-credits0 of 40 of 40 of 4
0800-set-amount-promotion-credit0 of 40 of 40 of 4
byvalue-promo-discounts0 of 40 of 40 of 4
tcl-consumption-days-stale0 of 40 of 40 of 4
Each row is a task, each cell the trials that passed out of 4, shaded by that share. Tasks run from most solved to least.
0%25%50%75%100%k = 1k = 2k = 3k = 4Claude Opus 5.5, pass@1: 60.9%Claude Opus 5.5, pass@2: 70.8%Claude Opus 5.5, pass@3: 75.0%Claude Opus 5.5, pass@4: 75.0%pass@4 75.0%Claude Opus 5.5, pass^1: 60.9%Claude Opus 5.5, pass^2: 51.0%Claude Opus 5.5, pass^3: 45.3%Claude Opus 5.5, pass^4: 43.8%pass^4 43.8%Gemini 4 Argon, pass@1: 29.7%Gemini 4 Argon, pass@2: 31.3%Gemini 4 Argon, pass@3: 31.3%Gemini 4 Argon, pass@4: 31.3%Gemini 4 Argon, pass^1: 29.7%Gemini 4 Argon, pass^2: 28.1%Gemini 4 Argon, pass^3: 26.6%Gemini 4 Argon, pass^4: 25.0%Gemini 3.8 Flash, pass@1: 12.5%Gemini 3.8 Flash, pass@2: 12.5%Gemini 3.8 Flash, pass@3: 12.5%Gemini 3.8 Flash, pass@4: 12.5%Gemini 3.8 Flash, pass^1: 12.5%Gemini 3.8 Flash, pass^2: 12.5%Gemini 3.8 Flash, pass^3: 12.5%Gemini 3.8 Flash, pass^4: 12.5%
pass@k (any of k passes, solid) and pass^k (all k pass, dashed)7. Claude Opus 5.5 in gold, Gemini 4 Argon, Gemini 3.8 Flash in grey; the gap between a pair's lines is run-to-run variance.

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

  1. Chowdhury, N., Aung, J., Shern, C. J., et al. Introducing SWE-bench Verified. OpenAI, 2024.
  2. Deng, X., Da, J., Pan, E., et al. SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks? arXiv:2509.16941, 2025.
  3. Datacurve. DeepSWE. Datacurve blog.
  4. Kapoor, S., Stroebl, B., Siegel, Z. S., Nadgir, N., and Narayanan, A. AI Agents That Matter. arXiv:2407.01502, 2024.
  5. Kapoor, S., Stroebl, B., et al. Holistic Agent Leaderboard. Princeton University.
  6. 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.
  7. 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}
}