TL;DR
TimeMachine-bench is a new, fully automated benchmark designed to test how well Large Language Models (LLMs) handle "software migration"—the real-world headache of fixing code that breaks when dependencies are updated. While top-tier models like Claude 4 Sonnet achieve high success rates, the benchmark reveals a "reliability gap" where models often resort to redundant edits or "spurious" fixes that pass tests without truly solving the underlying architectural shift.
What Problem Does This Paper Address?
Most software engineering benchmarks (like the popular SWE-bench) treat coding as a static activity: here is a bug, please fix it in this specific environment. In reality, software is a living organism. A codebase that worked perfectly yesterday might fail today simply because a library it depends on (like NumPy or Flask) released a breaking update.
This process of adapting code to an evolving environment is called software migration. It is a massive part of a developer's "to-do" list, yet it has been largely overlooked in AI evaluation. Current benchmarks don't capture the dynamic nature of dependency rot, and they often focus on single-file snippets rather than complex, repository-level changes.
Methods
The authors introduce a novel "Date-based Environment Control" strategy. Instead of manually curating a list of library versions, they use a tool called pypi-timemachine to "time travel" the package index. By setting a specific cutoff date, they can force a dependency solver (like pip) to see the world exactly as it existed at that moment.
To evaluate models, they built a ReAct-based agent equipped with 10 tools, including file searching, editing, and test execution. They introduced two specific metrics:
- Sufficiency (pass@1): Can the model make enough changes to pass the tests?
- Necessity (prec@1): Are the model's edits actually necessary, or is it just "spraying and praying" code changes?
Datasets
The paper introduces two versions of the benchmark:
- TimeMachine-bench-Full: A massive, automatically generated set of 1,145 repositories where tests pass in an "old" environment but fail in a "new" one. Because it's automated, it can be updated "live" to prevent models from training on the evaluation data.
- TimeMachine-bench-Verified: A high-quality subset of 100 repositories manually verified by a human expert (with 8+ years of Python experience). This set ensures every problem is actually solvable and provides "gold" minimal edits for comparison.
The benchmark covers a wide array of Python libraries, from heavy hitters like NumPy and Pandas to niche domain-specific tools.
Key Insights and Ideas
- The "Spurious Solution" Trap: Models sometimes "cheat" to pass tests. For example, if an import fails because a constant moved to a different package, a model might just define a dummy constant locally. The tests pass, but the code is now technically worse and potentially buggy in untested areas.
- Evolution-Aware Reasoning: The researchers found that flagship models (like Claude 4 Sonnet) can actually explain the history of a library. In one case, the model correctly noted that
asyncorewas replaced byasyncioin a specific version of a library and migrated the code accordingly. - The Precision Gap: There is a massive difference between passing tests and writing good code. While GPT-5 had a high pass rate, its precision was low (54.2%), often because it struggled with "line boundary recognition"—accidentally duplicating lines or adding redundant return statements.
- Open-Weight Progress: The gap between proprietary and open-weight models is closing fast. Qwen3-Coder-480B achieved a 90% pass rate, rivaling older versions of GPT-4 and Claude.
Key Results
The evaluation of 11 different models on the Verified subset showed:
- Top Performers: Claude 4 Sonnet led the pack with a near-perfect 99.0% pass rate, followed by GPT-5 at 91.0% and Qwen3-Coder-480B at 90.0%.
- Edit Quality: Even the best models struggled with efficiency. Claude 4 Sonnet’s precision (
prec@1) was 78.0%, meaning over 20% of its edits were redundant or unnecessary. - Cost-Efficiency: When looking at "success per dollar," open-weight models like the Qwen3 series were significantly more efficient than proprietary flagships, which often required many more tokens to reach a solution.
Limitations and Future Work
- Python-Centric: Currently, the benchmark only supports Python. While the logic is language-agnostic, the implementation relies on Python’s ecosystem.
- Test Coverage Dependency: The benchmark is only as good as the repository's existing tests. If a repo has poor test coverage, a model can provide a "spurious" fix that passes the tests but breaks the actual logic.
- Future Directions: The authors suggest integrating automated unit test generation to catch these spurious fixes and expanding the benchmark to other languages like Java or Rust. They also emphasize the need for models to develop "meta-cognitive" abilities—knowing when to revert a bad edit rather than just piling more code on top of it.
Summary updated