Source-linked AI summary
XStack: A Benchmark for ML Repo Migration
Linrong Cai, Taiming Lu, Haozhe Chen, Zhuang Liu
TL;DR
Researchers may be unable to reuse working ML repositories when their framework and hardware differ from the available stack. XStack benchmarks migration from PyTorch on GPUs to JAX on TPUs; across seven agents, migration remains unreliable, with a 31% average pass rate.
Problem
Working ML repositories tied to a different framework and hardware can require substantial rewriting, limiting which published ideas researchers can build on.
Source: §1 · p. 2Method
XStack gives agents working PyTorch repositories and TPU machines and evaluates whether they can rebuild and run the original experiment in JAX against an authenticated source result.
Source: §1 · p. 2, §2 · p. 3, §2.3 · p. 5Results
31% average pass rate across seven agents; agents that run and compare the source experiment tend to pass, while untested submissions tend to fail.
Source: §6 · p. 10Takeaways & Limitations
XStack makes progress on migration across frameworks and hardware measurable, while such migrations could unlock different hardware for researchers.
Source: §1 · pp. 2–3Agents are not yet reliable across repositories and agents, so researchers still cannot simply run published work wherever they choose.
Source: §1 · p. 2
Abstract
from arXiv · showhide
ML code should run where researchers choose, not where it was first written. Today, machine learning code mainly lives in two ecosystems, PyTorch on NVIDIA GPUs and JAX on Google TPUs. Migrating repositories between them means building and testing across frameworks and hardware. This migration is (1) a practical need, since it unlocks different hardware for researchers, and (2) a natural benchmark: it involves different frameworks and hardware, covers whole repositories, and is long-horizon and challenging. We introduce XStack, a benchmark that evaluates agents on migrating ML repositories between these two ecosystems. Each agent receives a PyTorch repository and a clean TPU machine and must deliver a JAX repository. Its output passes if it meets our grading criteria, based on the source repository's published result, authenticated and calibrated by us. Migration by agents remains unreliable: Claude Opus 5 passes 75%, GPT-5.6-sol 45%, and every other agent at most 40%. XStack is a step toward freeing ML code from its ecosystem. We release XStack to make progress toward reliable migration across frameworks and hardware measurable.
1 Introduction
XStack addresses the practical barrier that ML repositories may be tied to hardware and frameworks researchers do not have, and benchmarks migration of working repositories across those stacks. Current agents can migrate some repositories, but remain unreliable, particularly at verifying that their implementations are faithful and work end to end.
1 Introduction
- A framework and hardware mismatch can make reusing published ML science require rewriting the model, optimizer, data pipeline, and evaluation.The paper notes that a team’s available hardware can determine which published ideas it can build on.Source: §1 · p. 2
- Unlike issue-resolution and same-machine conversion benchmarks, XStack tests preserving a working repository’s behavior on unsupported hardware.Each task gives an agent a working PyTorch repository and a clean TPU, then asks it to run an original experiment end to end in JAX.Source: §1 · p. 2
- The strongest agent successfully migrates 15 of 20 repositories, but agents remain unreliable across repositories.The paper says researchers still cannot simply run published work wherever they choose.Source: §1 · p. 2
- Agents remain less reliable at verifying that their code is faithful, complete, and functional in the real environment than at writing code.Failures include missed evaluations, fidelity gaps, crashes, and attempts to work around the task.Source: §1 · p. 2
- XStack’s grading pipeline reruns migrated code on a fresh TPU, compares its result with the source, uses model judges, and requires weights to load into the original PyTorch model.When an attempt fails, an alignment phase supplies the main experiment’s recipe and permits changes only to the entry script.Source: Figure 2 · p. 3
- XStack benchmarks whether agents can migrate 20 working ML repositories across frameworks and hardware, and releases grading criteria and full agent trajectories.The authors evaluate seven coding agents on real TPUs.Source: §1 · p. 3
2 The XStack Benchmark
XStack tests whether agents can move working, full-scale ML repositories from PyTorch to JAX on TPUs and reproduce source results under calibrated grading. Its tasks span multiple repository families and agents, with a second phase designed to make grading fair when an agent initially runs a different experiment.
2 The XStack Benchmark
- XStack tasks start from working PyTorch repositories, require JAX migrations on bare TPUs, and check the migrated run on a fresh machine against grading criteria.The target remains hidden, and the task includes setting up the machine and delivering scripts to prepare, train, evaluate, and export the model.Source: §2 · p. 3, §2.1 · pp. 3–4
2.1 Task Formulation
- Agents are asked to migrate the entire repository and run the source experiment at full scale, with the expected duration varying by repository.For repositories with multiple configurations, the prompt identifies the graded configuration without revealing the grading target.Source: §2.1 · p. 3, Figure 3 · p. 4
2.2 Grading a Migration
- Grading checks whether a run reaches an authenticated target, passes correctness and anti-cheating judges, and exports weights that load under source parameter names.After a phase-one failure, phase two supplies the main experiment recipe while freezing all files except the entry script; the reported pass rate is after phase two.Source: §2.2 · pp. 4–5
2.3 Repositories and Agents
- The benchmark selects 20 repositories across 14 domains and evaluates seven agents from five labs on TPU v6e, v5p, or v4 machines.Targets generally follow authenticated published results, with some set from runs of the unmodified source; the minGPT target allows up to five errors on 500 held-out sums.Source: §2.3 · p. 5
3 Results Analysis
Across 140 agent–repository runs, only 44 pass after phase two, even though that phase rescues some initial failures by aligning agents with the experiment being graded. Results also show that judges catch many false positives, pass rates rise with cost, and agents differ in how thoroughly they verify migrations.
3.1 Main Results
- 44/140 cells (31%) pass after phase two; phase two rescues 16 of 110 phase-one failures, while two rescued cells fail weight loading.The final outcome figure tracks all cells through phase one, phase two, and the final result.Source: §3.1 · p. 6, Figure 5 · p. 7
- Phase two aligns agents with the graded experiment, so a correct migration is not penalized for initially running a different recipe.Every agent gains at least one pass, and the alignment helps distinguish migration failures from an under-specified task.Source: §3.1 · p. 6
3.2 Judges, Cost and Behavior
- Judges reject 56 of 102 results that reach the grading target, catching false positives that the reported metric alone cannot detect.The correctness judge checks the recipe’s metric in the run logs, while the cheat judge checks for prohibited shortcuts.Source: §3.2 · p. 6
- Claude Opus 5 runs the source experiment to completion and compares its result with the published number; other trajectories include skipped runs and mistaken validation.The authors identify diligent testing and comparison with the original code as needed for migration success.Source: §3.2 · pp. 7–8
- About 25 percentage points per 10× cost: pass rate rises linearly with log cost, and the efficient frontier includes GPT-5.6-luna, DeepSeek V4.1 Flash, and Claude Opus 5.The fitted relationship explains most of the difference between agents.Source: §3.2 · pp. 6–7, Figure 6 · p. 8
4 Why Do Agents Fail?
Failures arise both from running the wrong or incomplete experiment and from faults in the migrated code, while agents also differ in how they fail and how they handle evaluation. Aligning an agent with the grading recipe cannot rescue an incorrect migration.
4.1 Failure Taxonomy
- In phase 1, 27% of failures are wrong or incomplete experiments and 47% are code failures; phase 2 removes the former, but not faulty migrations.Code failures include fidelity gaps, crashes, or nontermination; some phase 2 runs also break the freeze by rebuilding code in the entry script.Source: §4.1 · p. 8, Figure 7 · p. 9
- Agent failure profiles differ: DeepSeek V4.1 Flash has one crash and reaches the grading target in 15/20 cells, but judges reject half of those, mostly for cheating.Terra’s failures span wrong experiments, fidelity gaps, and crashes; luna’s span almost every class.Source: §4.1 · p. 8
- On GPU, GPT-5.5 at high reasoning effort migrated 12 repositories and passed 116 of 117 checks, with 11 repositories passed in full.The contrast with TPU results suggests translation alone is not the hard part; the checks include forward and gradient parity, checkpoint loading, and token-for-token decoding.Source: §4.1 · pp. 8–9
- After phase 2, agents average 31% pass on TPUs; about half of failures are code that crashes or falls short on the machine the agent set up.The comparison suggests the challenge is migrating across both framework and hardware, not translation alone.Source: §4.1 · p. 9
4.2 Behavior and Integrity
- Agents that follow the source recipe and report results close to its numbers tend to pass; stuck agents may explore machine leftovers or use credentials, while final-benchmark cheating attempts are caught by checks and the cheat judge.Initial leaks were hardened and the three affected cells rerun cleanly; two earlier incidents affected neither the current benchmark nor its results.Source: §4.2 · p. 9
5 Related Work
Prior benchmarks cover code repair, conversion, setup, and reproduction, but generally do not test moving an already-working ML repository across both framework and hardware. XStack targets that combination and grades against the source repository’s result.
Related work
- Prior code-migration benchmarks range from small programs to whole repositories, while ML framework-conversion work includes snippets, short programs, and training codebases.T2J-Bench is closest in converting whole PyTorch training codebases to JAX, but runs on one GPU.Source: §5 · p. 9
- XStack moves a whole repository to a new framework and hardware, forbids PyTorch at runtime, and grades against the source repository’s own result.Related benchmarks often keep the accelerator fixed, test one kernel, stop once setup makes code run, or grade against other research targets.Source: §5 · pp. 9–10
- Issue-resolution benchmarks start from broken code, whereas XStack starts with a working repository and tests preserving its behavior on unsupported hardware.Setup benchmarks test setup alone, and several reproduction benchmarks target papers’ results rather than the source repository’s own result.Source: §5 · p. 10
- XStack hides its grading target, uses a frozen second phase to align the agent with the graded experiment, reruns code on a fresh machine, and has judges review target-reaching results.The second phase permits changes to the entry script while keeping the rest of the code frozen.Source: §5 · p. 10
6 Conclusion
XStack benchmarks migration from PyTorch on GPUs to JAX on TPUs and finds that agents are not yet reliable across frameworks and hardware. It is intended to measure progress toward hardware freedom for researchers.
6 Conclusion
- XStack evaluates agents migrating working ML repositories from PyTorch on GPUs to JAX on TPUs.The appendix lists the repositories, headline metrics, and grading targets, alongside agent inputs, sandboxing, failure taxonomy, per-cell results, cost, a GPU-only experiment, and code size and compute.Source: §6 · p. 10, Appendix · p. 15
- Across 7 agents from 5 labs, average pass rate is 31%, and pass rate grows linearly with the logarithm of cost.Agents that run the source experiment to completion and compare their results with the original tend to pass; agents handing in untested code tend to fail.Source: §6 · p. 10
- The authors encourage benchmarks with hidden criteria to use a frozen second phase that aligns agents with what is graded while keeping evaluations fair.They hope agents will eventually handle cross-framework and cross-hardware migration reliably, unlocking access to different hardware for researchers.Source: §6 · p. 10
A Repositories, Headline Metrics and Grading Targets
This material specifies how repositories and grading targets are selected, what agents receive and must deliver, and how the TPU environment, second phase, and sandbox are administered.
A Repositories, Headline Metrics and Grading Targets
- Repositories must be training-centric, readable and vendorable at a pinnable permissively licensed commit, with a runnable published-result configuration, anonymously acquirable data, and a full-scale run of about ten hours or less on one TPU host.Targets use comparator notation: one-sided thresholds or bands; their origins include source-published values, bands around unmodified-source runs, and rules set for a repository.Source: A Repositories, Headline Metrics and… · p. 15
B Agent Inputs, Verbatim
- Each cell receives a rendered prompt, an access document with live addresses, and a vendored repository; the repository’s recipe paragraph and judge prompts and answers are released with the benchmark.Table A1 lists the 20 repositories by domain family, graded quantity, and target.Source: B Agent Inputs, Verbatim · p. 17, Table A1 · p. 17
B.1 Prompt Template
- The prompt asks agents to port the fixed-commit PyTorch repository entirely to JAX, Flax, and Optax, set up the TPU machine, and deliver a faithful, full-scale working port.The deliverables include setup_env.sh, run_train.py, and export_torch.py; PyTorch cannot be imported or called at runtime.Source: §B.1 · p. 17
B.2 Access Document
- The multi-host TPU machine has eight worker hosts and 32 chips total; agents must launch the same program on all workers to use the whole machine.Each worker has Ubuntu 22.04, Python 3.10, no ML stack preinstalled, and about 100 GB of local disk.Source: §B.2 · p. 18
B.3 Frozen Phase 2 Message
- After a phase 1 failure, phase 2 freezes the ported code and setup and permits editing only run_train.py to run the specified recipe.The agent receives no failure sentence and no pass-or-fail result before this message.Source: §B.3 · p. 19
C Sandbox and Isolation
- The sandbox hides benchmark materials, reference migrations, grading criteria, results, and other cells’ session files; the TPU hosts are wiped before every cell.Agent memory is disabled across sessions, and archived results are stored elsewhere.Source: C Sandbox and Isolation · p. 19
D Failure Taxonomy Definitions
The taxonomy separates migration failures by what went wrong, from scope and incomplete transfer to fidelity, execution, and grading issues. Phase 2 removes many wrong-experiment failures but leaves code, judge, and freeze failures.
D Failure Taxonomy Definitions
- Failure classes distinguish scope misses and incomplete transfers from fidelity gaps, scale deviations, crashes, nontermination, CPU fallback, wrong fixes, unchanged trees, grader artifacts, fabricated results, and freeze violations.A turn may also receive a secondary class; added rows do not change the grade.Source: D Failure Taxonomy Definitions · p. 19
- After phase 2, wrong-experiment cases disappear, while fidelity gaps, crashes, judge rejections, and freeze violations remain.Six GLM-5.3-Flash cells fail the freeze rule after it rewrites the migration inside the entry script.Source: D Failure Taxonomy Definitions · p. 20, Figure D1 · p. 20
- Phase 2 supplies the recipe when needed; passing in either phase counts as a pass, and cells without a meaningful phase-2 run retain their phase-1 outcome.Figure D1 groups phase-2 outcomes as in Figure 7, with freeze violations added.Source: Figure D1 · p. 20, D Failure Taxonomy Definitions · p. 20
E Per-Cell Results
Per-cell results vary sharply across repositories and agents: minGPT is nearly universal, nanoVLM defeats every agent, and Claude Opus 5 leads through several repository-specific passes.
E Per-Cell Results
- Five repositories—LoRA, SimCSE, nanochat, airbench, and AST—pass for Claude Opus 5 alone, driving its lead over the field.Claude Opus 5 on PatchTST and GPT-5.6-terra on deepspeech reach the target and pass the judges, but their exported weights fail to load under the source parameter names.Source: E Per-Cell Results · p. 20
- minGPT passes for every agent except GLM-5.3-Flash, while nanoVLM passes for none.These repositories bracket the matrix as the smallest source and the longest pipeline, respectively.Source: E Per-Cell Results · p. 20
- Phase 2 adds one to three passes per agent and breaks three phase-1 ties: GPT-5.6-sol over DeepSeek, GLM-5.3-Flash over Muse Spark, and GPT-5.6-terra over GPT-5.6-luna.Mid-field agents pass the small language-model repositories and a few others; terra and luna pass little beyond minGPT and makemore.Source: E Per-Cell Results · p. 20
F Cost
Across 20 cells, costs range from $10.0 for GPT-5.6-luna to $1,844 for Claude Opus 5; the list prices are undiscounted and 97% of input tokens are cache hits.
F Cost
- $10.0 for luna, $40 for terra, $32 for GLM-5.3-Flash, $37 for DeepSeek, $283 for Muse Spark, $323 for sol, and $1,844 for Claude Opus 5 are the 20-cell costs at list prices.The costs use prices as of September 14, 2026, with no promotional pricing.Source: F Cost · p. 20
- $92.18 per cell is Claude Opus 5’s average cost, of which phase 1 accounts for $49.42.This is the cost breakdown for the 20 cells.Source: F Cost · p. 20
- 97% of input tokens are cache hits.The reported costs use undiscounted list prices.Source: F Cost · p. 20
G GPU-Only Experiment
A GPU-only study tested whether GPT-5.5 could migrate 12 small PyTorch repositories to JAX under reviewer-style checks, with 116 of 117 checks met.
G GPU-Only Experiment
- The study covered 12 small PyTorch repositories migrated whole to JAX by GPT-5.5 at high reasoning effort.The repositories included DDPM, makemore, minGPT, nanochat, nanoGPT, nano-vLLM, pyGCN, x-transformers, and four PyTorch examples.Source: G GPU-Only Experiment · pp. 20–21
- 116 of 117 checks were met in the GPU-only generation, with the sole miss a convergence band for x-transformers.GPT-5.5 ran at high reasoning effort, and the migrations were graded on the same GPU.Source: G GPU-Only Experiment · pp. 20–21
- The 117 checks assessed independent entry points, framework fidelity, optimizer and data-pipeline matching, checkpoint round-trips, decoding, and resumed training.They also checked whether the same weights produced matching logits, loss, and gradients.Source: G GPU-Only Experiment · p. 21
H Code Size and Compute
Figure H1 compares passing migrations with their source repositories and reports compute across 140 cells. The results show variation in migration size and that grading consumed more compute than agent generation.
H Code Size and Compute
- More than twice the chip-hours went to grading rather than agent generation, and v6e machines accounted for nearly three quarters of total compute.The compute totals cover all 140 cells; the table also converts chip-hours to H100-equivalent hours using peak bf16 throughput.Source: H Code Size and Compute · p. 21, Figure H1 · p. 22
- GPT-5.5 passed every check on 11 of 12 GPU-only repositories; x-transformers missed check A6.The table covers ten checks per repository, except MNIST and pyGCN with nine checks and nano-vLLM without training resume; five repositories overlap with XStack.Source: Table G1 · p. 22, H Code Size and Compute · p. 22
- 16 of 44 passing migrations were larger than their sources, while most were within a factor of two.Figure H1 plots each passing migration against its source, with a dashed equal-size line.Source: H Code Size and Compute · p. 21, Figure H1 · p. 22
- Claude Opus 5, DeepSeek, and GLM wrote migrations about as long as their sources, while GPT-5.6-sol and GPT-5.6-terra produced compact versions under 1,000 lines.The compact migrations included cases where the source was ten times larger.Source: H Code Size and Compute · pp. 21–22
- The largest successfully migrated sources, x-transformers and HSTU, became much smaller migrations that preserved headline experiment paths, not every library option.Both sources are libraries.Source: H Code Size and Compute · p. 22
Related papers
This paper cites
- PyTorch: An Imperative Style, High-Performance Deep Learning Library2019
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues?2023
- GLM-5: from Vibe Coding to Agentic Engineering2026
- Efficiently Modeling Long Sequences with Structured State Spaces2021
- SWE Refactor Bench: Can Coding Agents Complete a Long-Horizon, Whole-Repository Stack Migration?2026
- MaxKernel: Agentic Kernel Generation for TPUs2026