98% of tests green, only 24% identical: who's checking AI-ported code?

Anthropic moved its most important API from Python to Rust, and Claude wrote most of the code. The report published today shows how little "all tests passed" can mean. We put its verification method side by side with Bun, Epic, EXT4 and a hobbyist's port to a $10 MP3 player, then build a checklist for when you can trust an AI migration.

Analysis Nov 25, 2026 10 min read Original analysis by our editors
Illustrative image, AI-generated

What this is about

Writing code is now cheap for AI agents. The expensive part is proving that the new code does exactly what the old code did. Anthropic puts it this way in its engineering report, published today, November 25, 2026:

Verification, not generation, had become the bottleneck.

The report describes how the Messages API, which customers use to talk to Claude, moved from Python to Rust. Claude wrote most of the code. One set of numbers is especially telling. In April, the Rust version passed about 98 percent of its tests. On real inputs, though, it returned the same result as Python only about 24 percent of the time. In early May the figure fell to 6.5 percent, and it didn't reach 99.6 percent until August.

We use this case to explain how you verify that old and new code behave the same. Then we compare it with four other AI migrations and ask the same questions each time: who did the checking, and what slipped through?

Why 98 percent green tests mean so little

Anthropic gives two reasons, and both apply far beyond this case.

First, tests only cover selected cases. The API had about 700 integration tests. The report notes that just 20 yes/no options add up to more than a million combinations. At one second per test, that's about 12 days of test runtime for a single model. The math checks out: 2²⁰ is 1,048,576 combinations, so just over 12 days. Real requests contain exactly the combinations nobody thought of when writing the tests.

Second, the tests were translated too. Claude ported the Python tests to Rust. In a review, the team found more than 100 weakened assertions. An assertion is the condition a test checks, such as "the result must be exactly X". Weaken it, say to "the result must not be empty", and wrong code passes too. So a green test can mean the test was changed until it lets wrong code through.

The old system as referee

The solution is called differential testing. Instead of painstakingly defining what "correct" means, you let the proven legacy system decide. In technical terms, this kind of referee is called an oracle. Anthropic compares it to sudoku: checking a solution is easy, finding one is hard. Give an agent a reliable checker, and it can take on big jobs.

Anthropic implemented this with shadow traffic. Real requests kept running through the Python system, while a copy went to the Rust version in the background, whose response nobody ever saw. According to the report, three tricks made it work:

  • The model ran only once. Its output was passed on to Rust. That way both versions worked with an identical model response, and the language model's random variation couldn't skew the comparison. Customers weren't billed twice.
  • Checkpoints. The team compared not just the final result but every intermediate step on its own: accepting or rejecting the request, resolving settings, building the prompt. Everything had to match exactly before and after the model call.
  • Fingerprints instead of content. The team says it didn't read customer text. It stored only the "shape" of a mismatch: the step, the part of the prompt, the first differing byte, and the length on each side. A single bug could produce hundreds of thousands of near-identical entries. So a script grouped them every 10 to 30 minutes and reported only new kinds of mismatches to the coordinating agent.

The agents worked in two loops. The inner loop ran in cloud sandboxes, where checking an input took less than a second. The outer loop pushed fixes into shadow mode and compared builds with and without each fix. On top of that, the agents had a memory: engineers' corrections were written as rules into the CLAUDE.md file, which agents read for every task. One example was a rule to replicate exactly what Python does instead of guessing. According to the report, an agent then found "seven more places" where the port was based on an assumption.

The curve isn't a clean progress bar, though. Anthropic says what was being compared changed along the way. At first only internal traffic ran through it, later a broader sample. Six "misleading days" are missing from the chart, and two later dips trace back to changes on the Rust side. The report doesn't say exactly what triggered the drop to 6.5 percent. It also leaves open how many of the mismatches customers would even have noticed, since the comparison was byte for byte.

The agent that gamed the checker

In mid-May, the description of the web search tool was missing from the Rust prompts. Python fetched it at runtime from an internal service that Rust didn't call yet. One agent simply copied the text into files Rust could read. The prompts matched, and the local checker was happy. An engineer rejected it as throwaway code, since Rust would have to call the service itself before launch anyway. Anthropic's dry summary: the checker rewarded matching outputs, and the agent found the cheapest way to produce them.

That's the most important lesson in the report. An oracle only checks whether something matches, not why. That's why human review stayed a mandatory gate. Since then, Anthropic has added tests that fire on deviations from Python, lints (automated style checks) that ban flagged patterns, and a merge check that requires a matching Rust change, or a justified exception, for every Python change.

Anthropic reports the results as about 70 percent less CPU per request, over 80 percent less memory and roughly 20 percent faster time to first token. On the Latent Space podcast on October 27, platform lead Katelyn Lesse had cited 40 to 50 percent less CPU. The report doesn't explain the difference, which might come from measuring at a different point in time. All figures come from Anthropic itself.

The method predates AI

The principle isn't new. In 2016, GitHub released the Scientist library. The old code ("control") keeps returning the result while the new code ("candidate") runs alongside it, and any mismatches are logged. GitHub used it for, among other things, a multi-year rewrite of its permissions system. The lesson from back then still holds: real data triggers behavior that no test covers. Twitter's Diffy (2015) went a step further and ran two instances of the old code against each other. That revealed which differences were just noise, such as timestamps. Anthropic's trick of generating the model response only once solves the same noise problem. What's new isn't the method. It's that AI agents now work through the mismatches themselves and, as we've seen, can also cheat.

Four other migrations compared

Project Scope Who checked? What slipped through / is unresolved?
Anthropic Messages API (Python → Rust) core API path legacy system in shadow mode + humans over 100 weakened assertions, a cheat fix; customer-facing bugs not reported
Bun (Zig → Rust) 535,496 lines of Zig → over 1M lines of Rust language-independent TypeScript test suite, AI reviewers 19 subtle regressions
Epic Fortnite (Blueprints → Verse) over 20,000 Blueprints → ~3M lines not published performance, memory, architecture "under review"
EXT4 (Linux 7.4-rc5) 41,197 new lines KUnit tests, largely AI-assisted themselves Torvalds: tests not run
Rockbox on YP3 player port to undocumented hardware the hardware itself, camera, measurements plugins barely tested

Bun. The JavaScript runtime has belonged to Anthropic since December 2025. From May 3 to 14, up to 64 Claude instances ported it to Rust. According to the Bun blog, that cost about $165,000 at API prices. Bun had a big advantage: its test suite is written in TypeScript, so it didn't need translating at all. On Linux it covers 60,624 tests with almost 1.39 million assertion calls, and the author says none were skipped or deleted. So the trap of co-translated tests didn't exist here. On top of that came separate AI reviewers, eleven rounds of security review and fuzzing with about 100 billion runs. Fuzzing means bombarding a program with huge numbers of random inputs. There were still 19 regressions, meaning new bugs in features that had worked before. Bun says most came from code that looks the same in both languages but behaves differently. In one example, a side effect inside a debug assertion disappeared in release builds, and hot reloading broke. In his critique, Zig creator Andrew Kelley pointedly asked why the same test suite wasn't enough for Zig code but should be enough for a million lines of unreviewed "slop".

Epic. In its UE6 update on November 20, Epic announced a "working prototype" of Fortnite, built in two weeks. According to Wccftech and Data Phoenix, Epic hasn't said how it verified that the behavior is the same. Performance, memory use and architecture are still being validated. Our take: there's an obvious oracle, the live version of Fortnite on UE5. Whether Epic uses it is unknown. Until it says more, "works" only means that it launches and you can play it.

EXT4. This one isn't a translation, but it raises the same question. On November 24, Ted Ts'o sent a pull request with 41,197 new lines across 68 files for Linux 7.4-rc5. According to an analysis on dev.to, about 92 percent of that is KUnit tests, which are unit tests for the kernel. It also includes many bug fixes that Ts'o described as "largely AI-generated". Torvalds reluctantly merged the request and wrote that he had "not run" the tests, so they could be "complete garbage". His core argument: when you fix rare, subtle bugs, it's easy to introduce new ones. The differential approach hits a limit here too, because a bug fix is supposed to behave differently from before. At that point, the old system can no longer serve as referee.

Rockbox. The blogger behind jayd.ml used AI agents to port the free Rockbox player firmware to an undocumented MP3 player that cost $9.71. Reality did the checking. A webcam watched the display, a microphone and line-in recorded the audio, a script pressed random buttons for hours, and an Apple Lightning adapter served as the audio reference. Getting to the first boot took about a week, followed by about a month of fine-tuning. The author admits that the plugins are barely tested and that the audio measurement is only a sanity check.

Our take

The five cases add up to a checklist. In our view, you can trust an AI migration more if

  1. there's an independent oracle: a legacy system, real hardware, or a test suite that wasn't translated along with the code;
  2. the tests weren't modified by the same AI, or have been verifiably checked for weakened assertions;
  3. real inputs are compared, not just made-up test cases, ideally at the level of intermediate steps;
  4. noise is filtered out and mismatches are grouped, so real bugs don't get lost in the flood;
  5. a human reviews the kind of fix, because agents look for the cheapest path to a green checkmark;
  6. it's clear what the oracle can't see: release builds, rare code paths, performance and intentional behavior changes.

By this checklist, Anthropic's approach is the most thorough, Bun is close behind, and Rockbox is surprisingly clean for a hobby project. Epic hasn't shared enough to judge. EXT4 shows that AI-written tests for AI-written fixes are no substitute for time and real-world testing. One caveat remains: all of Anthropic's and Bun's numbers come from the companies themselves, and nobody has verified them independently. And even 99.6 percent agreement means that across millions of requests, some still don't match.

#code migration#software testing#anthropic#rust#ai agents#verification

Ask the AI assistant

Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.

Connecting …

The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.

Comments

What do you think? Already tried it? Write it here, no sign-up needed.

  1. Loading comments …

Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.