· Timo Kilpilehto · 6 min read
Eight ways my AI coding benchmark lied to me
Eight times my benchmark gave a clean, plausible, wrong answer, and how each one was caught.
Draft. Part 3 of 3 in the series Does the language still matter when the AI writes the code? The numbers are final; the wording is not.
I spent two weeks building a benchmark that asks one question: when an AI agent writes the code, does the programming language still matter? The agent builds the same REST API — a Google Keep–style notes service with auth, checklists, sharing and a sync feed — in Python, Ruby, TypeScript, Java and Rust, with and without a framework, and then grows it twice.
The results are in parts 1 and 2. This post is about the part I didn’t expect to write: how many times the benchmark gave me a clean, plausible, wrong answer. Eight times, by my count. Each one would have survived a casual review. Several pointed in exactly the direction I was hoping for.
1. “Rust is 10× faster” — on 8 cores against 1
The first version of the benchmark found Rust serving 5–10× more requests per second than Python or Ruby. It was the result everyone expects, so it was easy to believe.
It was mostly a measurement of CPU cores. The Python server ran as one process; the Ruby server put every request behind one lock; the Rust server used tokio’s multi-threaded runtime on all 8 cores — and the load generator was competing for those same cores. The fix: the spec now requires every server to use all the CPUs it is given, and the bench pins server, database and load generator to separate CPU sets and records how busy each one is.
Lesson: a performance gap that matches your prior is the one to check hardest.
2. Every agent stored its data in a dictionary
The spec left storage open, so every implementation kept its data in memory. That quietly removed
the database — where most of the latency, memory and a good share of the code in a real service
live. v2 requires PostgreSQL and checks that every acknowledged write survives a kill -9.
Lesson: whatever the spec leaves open, the agent will pick the cheapest option, in every language. That makes “open” a design decision, not a neutral default.
3. A test that every implementation passes measures nothing
In the pilot, every build scored 99.5–100 % on conformance. I nearly wrote “correctness doesn’t depend on the language”. But a test everyone passes can’t tell anyone apart: that’s a ceiling, not a finding. v2 adds two growth steps — sharing and a sync feed — designed to cut across every endpoint and to fail under concurrency. (It still ends up near the ceiling; more on that in part 1. At this size, the current models simply get it right.)
4. My own config leaked into the experiment
The builder sessions ran on a machine with my personal Claude Code setup, and they loaded my
global CLAUDE.md — my reporting style, my glossary rules, my tool restrictions. Same for every
language, so it didn’t bias the comparison, but it changed how the agents worked and what they
cost. v2 runs each builder with no user settings, hooks or MCP servers, and only the run’s own
instructions.
Lesson: an AI agent’s environment is part of the experiment. Log exactly what it loaded.
5. A file-naming convention reversed a conclusion
Halfway through the analysis I had a nice, counter-intuitive finding: Django made the Python code 30 % bigger. I had already told someone about it.
Django keeps its tests in <app>/tests.py. My size script recognised tests/ and test_*.py,
not tests.py, so Django’s whole test suite was counted as application code. Fixed, Django’s
code is about 17 % smaller than hand-written Python. The bug only affected one framework —
which is exactly why it looked like a framework effect.
Two more of these turned up when I asked a separate agent to classify every file by hand: Rails’
generated structure.sql schema dump counted as source, and builds that wrote their API
description as a separate file had it excluded while builds that generated it in code had it
counted. The size measure in the final analysis is “everything the builder wrote and would have
to maintain”, wherever it lives.
Lesson: when a result only shows up for one stack, suspect your tooling’s assumptions about that stack before you suspect the stack.
6. The bench’s own HTTP client was the flaky one
The load tests failed twice, both times on Python servers, with “Server disconnected”. It looked like a server bug under load. It was a keep-alive race in the load generator: the Python HTTP client keeps idle connections for 5 seconds — exactly as long as uvicorn does — so a reused connection could be closed by the server at the moment the next request went out. Then the seeding phase failed on Django with 401s: seeding took longer than the 15-minute access token the spec mandates.
Lesson: when the harness fails, find out whose bug it is before you count it against anyone.
7. “Migration failures” that were a deployment artefact
Two framework builds failed 20–30 % of the checks that upgrade a database from one step to the next — old tokens stopped working. It looked like the frameworks made upgrades harder. In fact both stored their signing key in a file created on first start, and my bench started the next version from a fresh checkout without it. A real upgrade keeps that file. With the file carried over, every one of the 20 upgrades passed.
8. One test, two questions — a false alarm and a hidden bug
The sync feed’s stress test asked two things at once: did the server stay up under concurrent writes, and did the feed deliver every change? A single 500 failed the test exactly like a lost change would. So two Python builds looked like they had broken sync feeds — they hadn’t; they had thrown one error under contention, which then didn’t reproduce. Split into separate results, the test found the one implementation that really did lose changes: TypeScript with NestJS and Prisma, whose agent had named the out-of-order-commit trap in its own README and built a fix that didn’t hold.
Lesson: a pass/fail that bundles a nuisance with a disaster reports the nuisance.
What survived
After all that, the noise floor matters as much as the bugs. I built one cell three times: the cost varied by about 20 %, driven mostly by how long the model “thought” before writing the first line. Code size varied by about 5 %. So in parts 1 and 2 I only claim size differences above ~10 % and cost differences that hold across all five languages — and I say “not tested” for the hypothesis this design can’t reach (whether less code lets the agent take a system further before it breaks down: at 20–55k tokens of code, nothing broke down).
The useful habit: for every result, ask what else would produce the same number. Most of the time the answer was “my benchmark”. And get a second reader who hasn’t seen your conclusions: the size-bucket problems and the migration artefact were found by a separate agent asked only to break the methodology.
The code, specs, raw transcripts and results are on GitHub (link to come).