GPT-6.2 Astra is the first model to beat Googlers' code golf records
About
TL;DR: I brought back 32 problems from a code-golf contest we played at Google in 2015 to see how frontier models compare with our old records. Each model gets 30 minutes per problem in each of eight languages to make its solution as short as it can. The leaderboard scores the byte counts, not just whether the code works.
Where the problems come from: go/codegolf
In 2015, when I was at Google, I spent a lot of time on an internal site called go/codegolf. There was one problem a week, and we competed to write the shortest program that solved it. Most of the regulars were code-golf enthusiasts.
Each problem went through three phases:
| Phase | What happens |
|---|---|
| 1. Candidate | Any Googler could propose a problem by posting a statement and a full test suite. Everyone could read the tests and suggest fixes. Votes were called LGTMs; the candidate with the most LGTMs became the next week's problem. |
| 2. Competition (7 days) | You could see your own submissions, but nobody else's. Only your shortest passing solution in each language counted. The per-language scoreboards showed sizes, not code. The problem's author could compete too. |
| 3. Challenge (forever after) | After seven days, the rankings froze and every submission became visible to everyone on the site. You could still submit a challenge, but it had to be strictly shorter than both the winning solution and every earlier challenge entry in that language. A passing challenge got its own slot on the scoreboard, with its code visible too. |
The rule was simple: the shortest program that passed every test case won. Undefined behavior, compiler quirks, non-standard library features, even hardcoding every test case were all allowed. Apart from passing the tests, the program only had to be deterministic.
The site supported JavaScript, Python, Go, C++ and Haskell in 2015. Rust was added after I left.
From a weekly contest to a benchmark
I kept a collection of problems from the 2015 contest and chose 32 of them for this benchmark. I wrote about half under the name @binjin. The Problems page credits the original author of each of the others.
I also archived the scoreboards, statements and test cases. For JavaScript, Python, C++ and Haskell, those scoreboards record the shortest solution any Googler submitted, including improvements made during the challenge phase. Those byte counts are the human records used here. The human solutions themselves are never shown on this site.
Eleven years later, I wanted to see how frontier models would do against the people I used to golf with.
The eight languages
| Language | Why it's here | Human record |
|---|---|---|
| JavaScript | Original 2015 language | β |
| Python | Original 2015 language | β |
| C++ | Original 2015 language | β |
| Haskell | Original 2015 language | β |
| Ruby | A popular golfing language with plenty of ways to save a byte | - |
| Raku (Perl 6) | Another golfing favorite, with a different programming style and just as much room to explore | - |
| Racket | A Lisp: what does golfing look like in prefix notation? | - |
| GolfScript | An esoteric, stack-based golfing language with very little public training data | - |
There are no 2015 human records for the last four languages. I used an oracle run to get a reference size for each cell, though models have beaten those sizes in some cells. Later, I ran the oracle on the original four languages as well, this time starting from the human records. See Known Best and the oracle.
Haskell has human records too, but they are much weaker than the other three, so the humans' main score, JS/PY/C++, leaves Haskell out. See Overall and JS/PY/C++.
How models play
A cell is one problem in one language. Each gets a fresh session with a 30-minute wall-clock limit. The model receives the statement, the I/O specification, all the test cases and a short guide to the language. For GolfScript, it also gets the full language reference, since the language is small and not widely known.
There are two tools, and both work in all eight languages:
submitruns a solution against all the test cases in the replicated sandbox.- A passing solution is saved only if it is strictly shorter than the model's previous best.
- Wrong answers, runtime errors, timeouts and compile errors are returned with stderr.
- Every response includes the current best known size. I want the model to know when someone has done better; without a target, it's easy to decide a solution is short enough and stop.
playgroundruns a program in the same sandbox as submissions, with mostly the same environment: the same compiler or interpreter, compiler options and libraries.- It can preload the test cases as
inputsandoutputs, so the model can try itsgon every case, compare the results with the expected outputs, or just examine the data. - It's useful for trying a language feature or checking what the interpreter does with an edge case.
- It also lets the model write search programs: for example, to brute-force a magic number or find the shortest expression for a small formula. Human golfers do this all the time.
- It can preload the test cases as
That's all the model gets. There is no internet, shell or access to other files.
For the four original languages, the sandbox reproduces the 2015 environment, down to the compiler or interpreter version, flags and quirks. A trick that worked in the old contest should work here; a feature added since then won't. The full runtime list is in Technical details.
Known Best and the oracle
Without human records for Ruby, Raku, Racket and GolfScript, I needed another way to set a target for the models and a reference for scoring. For that I run an oracle: a model with internet access, no time or request limits and every JavaScript, Python, C++ and Haskell solution in the benchmark to learn from, including the shortest human solution for each cell and all the models' solutions.
The first oracle was GPT-6 Astra. I ran it on the four added languages to set their reference sizes, then on the original four, where it could work directly from the human records and try to improve them. Later I ran the oracle with other models as well.
- The oracle is unranked; it only supplies best-known sizes.
- When it beats every competitor in a cell, the Problems page shows its byte count as Known Best, but never its code.
- In 126 of the 256 cells, the oracle's solution is shorter than every competitor's. The oracle had much more time and information to work with.
Scoring
Each cell is scored by comparing its byte count with the best known: score = (best known size Γ· your size)Β²
- Match the best known size and you get 100%. A solution 10% longer gets 82.6%; twice as long gets 25%.
- An unsolved cell gets 0.
- Overall averages all 256 cells, in all eight languages. JS/PY/C++ averages the 96 cells in JavaScript, Python and C++. See Overall and JS/PY/C++ for why JS/PY/C++ leaves out Haskell.
- The best known size can come from a human, a model or the oracle. If anyone finds a shorter solution, everyone else's score for that cell goes down.
- To score 100% across a whole run, you have to match the best known size in every cell. A gold mark on a problem's scoreboard means that solution matches the best known size. A filled mark means no other competitor has matched it; an outlined mark means a tie. Humans count as competitors, but the oracle doesn't. If the oracle's Known Best is shorter than every competitor's solution, nobody gets a gold mark.
Overall and JS/PY/C++
The leaderboard has two summary scores:
- Overall averages all 256 cells: JavaScript, Python, C++, Haskell, Ruby, Raku, Racket and GolfScript.
- JS/PY/C++ averages the 96 cells in JavaScript, Python and C++.
JS/PY/C++ covers only the languages where the human records make a strong reference. In 2015, JavaScript, Python and C++ were the languages most go/codegolf regulars golfed in. Each of those scoreboards had a crowd of enthusiasts competing on it for a week, and the challenge phase kept the best of them improving it long after. Eleven years later, those records are still competitive with frontier models: see What the results show so far.
Haskell is different. The site supported it and every problem here has a human Haskell record, but only a few regulars golfed in it. I suspect that mostly reflects how few Haskell users there were at Google in 2015, not how golfable the language is. With so few people competing, many Haskell records never got the attention the others did, and models have already beaten 31 of the 32.
Counting Haskell in the human score would measure how few of us wrote Haskell, not how good the people who golfed were, so JS/PY/C++ leaves it out. Haskell still counts like any other language everywhere else. The human Haskell records still set best-known sizes, appear on the problem scoreboards and count in each model's Overall score.
Humans have no Overall score, because they have no entries in Ruby, Raku, Racket or GolfScript. By default the leaderboard lists the models that beat Humans on JS/PY/C++ first, ranked by Overall, then Humans, then every other model, also ranked by Overall. Sorting it by Overall instead ranks the models by Overall and puts Humans just above the first model they match or beat on JS/PY/C++.
Each problem's full scoreboard ranks models by their combined score in all eight languages on that problem, and puts Humans just above the first model they match or beat in JavaScript, Python, C++ and Haskell combined.
On the leaderboard, runs still in progress go below every complete one in any order, the earliest-released model first, with their partial scores dimmed.
Technical details
| Language | Runtime | Time limit |
|---|---|---|
| JavaScript | Rhino 1.7R4, JavaScript 1.7 (problems 01-19) / Rhino 1.7.7, partial ES6 (20-32) | 20 s |
| Python | PyPy 2.3.1 (Python 2.7.6) in the RPython sandbox, no JIT, restricted imports | 10 s |
| C++ | PNaCl clang 3.5.0 (Pepper 41), -std=gnu++11 -stdlib=libc++ -O2 -w -Werror=c++1z-extensions | 10 s |
| Haskell | GHC 7.8.4, evaluated through mueval 0.9.1.1.1 (hint 0.4.2.2) | 10 s |
| Ruby | MRI/CRuby 3.4.10 with the Prism parser and YJIT enabled | 10 s |
| Raku | Rakudo / MoarVM 2026.08 | 10 s |
| Racket | Racket CS 9.3 | 10 s |
| GolfScript | Reference interpreter (darrenks/golfscript cded542), with the Ruby-eval string interpolation removed | 20 s |
- Function, not program. You define a function
g. A wrapper calls it on every test case and prints the results; the wrapper doesn't count towards your size. For Haskell, it also suppliesg's type signature. The solution is the body of aletbinding, and mueval evaluates the whole thing as one expression. - State between test cases. JavaScript, Python, Raku and Racket run every test case in one process, so global state persists from one case to the next (Haskell is pure). C++ compiles the solution inside a struct that is created fresh for each test case, so its "global" variables start at zero every time; only static ones persist. Ruby runs each test case in its own fresh environment. GolfScript runs the program's top level once and then each test case in a fresh copy of that state, so precomputed values are shared but nothing a case changes carries over.
- Bytes, not characters. The score uses the raw file size. Spaces, newlines and every byte of a multi-byte UTF-8 character count.
- Deterministic. Each submission runs twice, independently. Both stdout and stderr must match exactly before the output is judged.
- Shuffled inputs. Each run gets its own random ordering of the test cases. The judge puts the results back in the original order before checking them, so a solution can't rely on the order of the inputs.
- One time limit per run. Compilation and the full batch of test cases must fit within the same time limit.
- JavaScript. Problems 01-19 run on Rhino 1.7R4 (JavaScript 1.7, interpreted mode at optimization level -1, stack depth 4096). Problems 20-32 run on Rhino 1.7.7 (partial ES6, optimization level 9, stack depth 65535); on a stack overflow or an unknown exception it retries in interpreted mode within the same 20 s limit.
- No prime builtins. Primality and factorization builtins are withdrawn in C++, Ruby, Raku and Racket, so prime-flavored problems stay non-trivial. Modular exponentiation, gcd/lcm, factorials and the rest of the standard libraries remain available.
- C++ quirk. Clang 3.5 accepted the C++1z range-for shorthand
for(x:a)(a proposal later dropped from the standard). The original site rejected it with-Werror=c++1z-extensions, and so does this replica;for(auto x:a)still works. An AI model found a way to switch that error off from inside its own solution and use the shorthand anyway. No Googler ever did. - Isolation. Every execution starts fresh processes in an isolated container with no network access, and everything it started is cleaned up afterwards.
Thinking effort and the 30-minute limit
Most models let you choose a thinking effort: roughly, how long they reason before they answer or act. More thinking can crack a hard problem, but here it shares the same 30 minutes with everything else. Golfing is a loop of trying an idea, testing it and submitting whatever passes, and only submitted solutions count. An idea still being thought through when time runs out scores nothing.
So the highest setting isn't automatically the best one for this contest. I ran Claude Haiku 5.5 at both max and xhigh (βextra highβ, one step down), and it shows both sides. Its max solution was the shorter of the two in 160 cells and the longer in 52, and max scored higher overall. But in some cells it spent so long thinking that it ran out of time with little more than its first, ungolfed working solution. In Game of Life, its Racket solution is still indented over six lines, at 329 bytes against 2
Comments
No comments yet. Start the discussion.