Anthropic's Rust Rewrite: My Python to JavaScript Port Test
from 500x Engineer Hosted by Elon Zito
Anthropic's Rust Rewrite: My Python to JavaScript Port Test Anthropic's November 25, 2026 post describes its Python-to-Rust Messages API migration. Anthropic says that in April, Rust passed about 98% of its tests, but only about a quarter of inputs matched on production traffic. Replies were compared separately; the comparisons changed over time and six misleading days were omitted from the input-match figure. Public traffic moved to Rust in September 2026. Anthropic says an audit found more than 100 weakened assertions. It ran the model once and replayed its output to Rust, counting each request once for limits and billing. An engineer rejected a web search shortcut that passed the local verifier because Rust still needed the service call before launch. Anthropic reports about 70% less CPU per request, measured in one region, and about 20% lower median time to first token on customers' Claude Code requests. On November 28, I tested two Codex ports of my caption core from Python to JavaScript. Both passed 24/24 ported tests and matched Python byte for byte on 357/357 real timing files: 99,068 words and 19,593 Python caption cues. Dub segment files used a one-line adapter. Of 16 separately planted bugs, tests caught 14 and real files caught 11. Both missed 2; tests alone caught 3, real files alone caught 0. A 0.0625-second start and five rocket emoji near the 42-character limit exposed the missed rounding and UTF-16-length mutations. Both original ports matched Python on those probes. A separate dotless-i probe found a difference in the plain port; the careful port matched. The real files lacked that letter. One function, one machine, one night, one model. These rates describe my bugs and suite only; matching my files establishes parity on those files only. My opinion: freeze tests, audit translated assertions, compare real inputs, probe missing cases, plant known bugs, and keep human review before shipping. Full write-up: https://www.500xengineer.com/blog/ai-port-shadow-test CHAPTERS: 0:00 Intro 0:57 What Anthropic moved 1:57 Anthropic Says Rust Passed About 98% of Tests in April 2026 3:17 Shadow the real traffic 5:41 My port test 7:21 I planted 16 bugs 9:19 How I'd check an AI port SOURCES: Anthropic, November 25, 2026: https://www.anthropic.com/research/migrating-api-to-rust Python round(): https://docs.python.org/3/library/functions.html#round Python re.IGNORECASE: https://docs.python.org/3/library/re.html#re.IGNORECASE MDN Math.round(): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round MDN String length: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length My firsthand measurements: November 28, 2026; lab/RESULTS.md in the episode working files. DISCLOSURE: The narration is AI-generated with ElevenLabs, using a clone of my own voice. The short opening clip of me is an AI-generated avatar (made with Wan 3.0 Prime from a still of my likeness, lip-synced to that voice). The thumbnail photos are AI-generated from my likeness.
Embed this episode
No transcript yet.