Repository navigation
rust-anything 5.0: the old program is the judge, now with sharper eyes #642
erkamyaman
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone 🦀
rust-anything 5.0 is out. First, a big thank you: since 4.1 we've merged nearly 100 pull requests, and we're about to cross 10,000 stars. That's you. Thank you.
Where 5.0 came from
This week Anthropic published how they moved their Messages API from Python to Rust, mostly with Claude writing the code: https://www.anthropic.com/research/migrating-api-to-rust
It's worth reading. The headline numbers are great (about 70% less CPU and over 80% less memory per request), but the part that stuck with me was this: their Rust passed about 98% of its tests while only about a quarter of real requests matched the Python. Writing the code took about a week. Proving it behaved the same took months. Their answer was to make the old system the judge.
That's been rust-anything's core idea from day one: record what the original does, then check every piece of the port against it. Reading how they did it at that scale showed exactly where we could get sharper, so 5.0 adds seven things.
What's new
Mismatches say where they start.
diffandapp replayname the exact spot each mismatch begins: which output, the JSON path, the line and character, with the difference marked.Failures grouped into bugs. 40 failing cases from one bug now read as one line, ranked by how many cases each one hits. The
goagent gets one example per distinct bug instead of a wall of raw JSON.--redact.diff --redactandapp replay --redactshow mismatches as shapes only (where, types, lengths, hashes), never your data. Safe to paste into an issue or hand to another agent.app shadow. For HTTP servers: a proxy answers every live request with the original, sends a copy to the Rust build and compares. The build's outgoing HTTP, mail and file writes go to stand-ins, so nothing happens twice.app drift. For CI after a lift: checks that the recording still describes the original and the port still matches, and reports what changed upstream, port regressions and new examples nobody recorded. There's a GitHub Actions snippet in docs/whole-apps.md.gatecatches cheating. Agents sometimes "fix" a mismatch by copying the expected answer into the port.gatenow fails ports that contain values from the recording the original never spells out, ports that read the recording files, ports whose tests or asserts went down, and recordings that were edited.rules.rust-anything rules --add "Tabs never count as spaces"saves a correction torust/RULES.md, and every agent prompt includes it from then on. Same mistakes stop coming back.Upgrading
replay-report.mdwill differ once (new "Distinct differences" section). Replay and commit it again.gatecan now fail ports that passed before. A constant the original really takes from a library can stay with// recorded-literal: <reason>. Full notes are in the CHANGELOG.Thank you
To everyone who sent code, docs, translations and tests this cycle: @Lewandox, @alvaroalonsoparrondo-a11y, @ardazeybek, @XiaoBinGan, @Papito084, @hkhkkh, @matavanary, @AyhamJo7, @isnaenihidayat, @SPD-RYUK, @aloneangel45 and @puretechteam. And to everyone who opened an issue, asked a question here or on Discord, or just tried it on their own code.
The new features are fresh, so if you point them at a real project and something trips, please open an issue. That's the fastest way they get better.
Install or update:
npm install -g rust-anythingorcargo install rust-anythingRelease: https://github.com/erkamyaman/rust-anything/releases/tag/v5.0.0
Discord: https://discord.gg/FXhUEA8eBR
erKam
All reactions