Manuscript Offprint

arXiv:2611.08472

XStack: A Benchmark for ML Repo Migration

Linrong Cai, Taiming Lu, Haozhe Chen, Zhuang Liu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Linrong Cai Taiming Lu Haozhe Chen Zhuang Liu

Princeton University

Dataset Code Website

XStack

Figure

Figure 1. Overview of XStack. Top: in our benchmark, the agent explores a PyTorch repository built for GPUs, reads its code and runs the source, then builds and tests a JAX version on TPUs. Bottom left: pass rates of the 5 best-performing agents among the 7 we evaluate. Bottom right: the pass rates against total cost on a log scale; the dashed line is a linear fit, and the shaded steps are the Pareto frontier, the best pass rate reached at or below each cost.

Abstract

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

Suppose you find a repository that does exactly what you need. Its paper reports strong results, the code is public, and the experiment has already been shown to work. There is only one problem: it was built for the wrong machine. Your lab has TPUs, but the repository assumes GPUs and PyTorch. Although, in principle, nothing about the scientific idea depends on this choice, in practice you are trapped. Using it means rewriting the model, optimizer, data pipeline, and evaluation in JAX, since that is the stack TPUs run, then making everything work under a different compiler, memory hierarchy, and distributed execution model. What looks like an implementation detail becomes a barrier to reusing the science. The hardware a team happens to have can determine which published ideas it can build on.

This is exactly the kind of barrier that coding agents should make disappear. Much published ML code is written in PyTorch for GPUs, while, for example, people also use TPUs, which are commonly programmed through JAX¹. By the end of 2025, TPUs made up nearly a fifth (18.2%) of the world's AI compute: 3.81 million of 20.93 million H100-equivalents (Epoch AI, 2026). Yet only 4.2% of the framework-based code released with ML papers in 2024 used JAX (Papers with Code, 2025). This creates a growing need to move working systems across software and hardware stacks, a real-world task that researchers care about because it unlocks access to different hardware. Doing so means crossing not only code-level framework boundaries, but also machine-level differences. This is exactly the problem we want agents to solve; we want to bring pure science back to researchers, and provide a measurement for this progress.

PyTorch on GPUsJAX on TPUs
chips made byNVIDIA and othersGoogle
where to get themmost clusters and cloudsGoogle Cloud or buyers' own sites
how the code runsone step at a timecompiled by XLA before execution
how a model is writtenobjects that hold their weightsfunctions that take the weights

Table 1. PyTorch on GPUs versus JAX on TPUs. A migration changes the hardware as well as the code, so the agent must do more than translate code (Bradbury et al., 2018; Paszke et al., 2019).

We ask the following question directly:

Can an agent migrate a working ML repository to a new framework and new hardware correctly?

Existing benchmarks do not quite test this. Issue-resolution benchmarks (Jimenez et al., 2024; Zan et al., 2025) start from broken code and ask agents to fix it, while conversion benchmarks (Wang et al., 2026c; Song et al., 2026; Hong et al., 2026) compare translated code with the original on the same machine. In our case, the repository already works on the original machines. The challenge is to preserve that behavior while moving the entire system onto hardware the original code does not support. We introduce XStack (XStack stands for Cross-Stack Benchmark) to test this directly. Each task gives an agent a working PyTorch repository and a clean TPU machine, then asks it to rebuild the code on TPU with JAX and make an original experiment run end to end and reach its published result.

The answer to our question above is currently no: agents are not fully reliable for this task. Our results show that this barrier is beginning to break, but has not disappeared. The strongest agent successfully migrates 15 of 20 repositories. Agents can therefore already carry some ML systems across framework and hardware boundaries at repository scale. Yet this capability is far from reliable across agents and repositories. Agents are beginning to loosen the link between scientific code and the stack it was written for, but we are still not at a point where researchers can simply run published work wherever they choose.

A broader pattern emerges from the failures: agents can write a great deal of code, but they are still much less reliable at verifying that what they built is faithful, complete, and actually works in the real environment. This shows up across models as missed evaluations, fidelity gaps, crashes, and even attempts to work around the task when they get stuck.

¹JAX is Google's Python library for array computation; it compiles NumPy-style code with the XLA compiler to run on TPUs and GPUs (Bradbury et al., 2018).

Figure

Figure 2. Pipeline of XStack. Top: the agent migrates a PyTorch repository to JAX on a bare TPU. Bottom: we rerun the output on a fresh TPU and check its number against the source's result and with two model judges. If they fail, the alignment step (phase 2, pink) gives the agent the main experiment's recipe, lets it change only the entry script, and regrades the result. A pass also needs the weights to load into the original PyTorch model.

Overall, our contributions are:

  • We introduce XStack, a benchmark of 20 real repositories for testing whether agents can migrate working ML systems across frameworks and hardware.
  • We evaluate seven coding agents on real TPUs and release the grading criteria and full agent trajectories, so progress on this capability is measurable.
  • We find that agents can sometimes complete these migrations, but still struggle to reliably verify that what they built is faithful, complete, and actually works end to end. We also observe that pass rate grows linearly with the log of an agent's cost (Figure 6).

References (55)