← Playground bench/genacc/RESULTS.md
raw

NURL generation accuracy & token report

Generated by bench/genacc/score.py. Figures are first-pass — the model's first attempt, no human edits — except in conditions labelled as a repair round: a …repair directory (made by repair.py) adds ONE round of compiler-error feedback, in which the model sees only its own program and the compiler's stderr, never the expected output. compile = built with zero changes; correct = printed the exact expected bytes (a program that compiles but prints the wrong answer is a miss); tokens = the BPE token cost of the program the model emitted.

Reproducible with any model — see bench/genacc/README.md. The conditions below are whichever solution directories were passed in; a name containing noprimer is the no-reference condition.

Read every NURL number in this light: public LLMs contain zero lines of NURL in their training data, against millions of lines of Python and Rust. The NURL rows are a language the model has never seen, working only from the one-page reference below.

Headline — one compiler-diagnostic round closes the gap to full parity

The v3 report ended honestly: "no model reaches Python/Rust parity" first-try, because a language with zero training presence is gated by a sequence of in-distribution habits (imports → grouping-parens → mutability). This run measures the other half of the diagnostic-first claim, which every prior report only asserted: what happens when the model sees the compiler's error and gets ONE more attempt.

Two things changed:

  1. The compiler meets the failures found by this corpus. Auditing every failing v3 program surfaced a real frontend hole — ! on a non-b operand emitted xor i1 <i64> and let a raw LLVM-level error escape to the user (all five of haiku's words failures) — plus one misleading message: an FFI declaration written inside a function body died as a boolean-AND type error (all four of sonnet's histogram failures). Both now die at the source line with an actionable fix (locks should_fail_not_on_int.nu, should_fail_ffi_decl_in_body.nu). The grouping-paren and immutability diagnostics already carried fix hints.
  2. repair.py replays the agent loop, strictly. A program that compiled first-pass is copied through untouched; a program that failed is handed back to the same model with its own program and the compiler's stderr — never the expected output — for one corrected attempt. Every language gets identical treatment (Python/Rust never fail, so it is a no-op for them).

Held-out (4 string tasks, 5 samples, primer v3, NURL compile → correct):

modelfirst-pass+ 1 repair round
claude-sonnet-4-680% → 80%100% → 100%
claude-opus-4-870% → 70%100% → 100%
claude-haiku-4-555% → 45%100% → 80%
mercury-2 (diffusion, medium)15% → 15%60% → 60%
mercury-2 (diffusion, high)30% → 25%60% → 55%

The revised bottom line. First-try, a language with zero training presence still loses to ingrained habits — that result stands. But NURL's actual operating mode is agentic: the compiler is diagnostic-first so that the error text carries the fix. Measured, that loop is worth more than any primer revision tried so far: one diagnostic round takes frontier models from 70–80% to full Python/Rust parity, on a language they have never seen a line of.

This headline is curated. Everything from "Primer — prompt overhead" onward is regenerated by score.py --md; re-add this headline after regenerating. The v3 first-pass headline this one supersedes is preserved in git history.

Primer — prompt overhead (charged once per NURL request)

The NURL reference (primers/nurl.md) handed to the model in the primed condition is 1604 tokens (cl100k) / 1605 tokens (o200k). Python and Rust get no such reference. This overhead is spent on every NURL request, separately from the program the model writes — it is broken out here so it is not hidden.

claude-sonnet-4-6__v3 (5 sample(s)/task, as generated)

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl16/20 (80%)16/20 (80%)179 + 1604 primer178
python20/20 (100%)20/20 (100%)3536
rust20/20 (100%)20/20 (100%)7373

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl5/5 (100%)5/5 (100%)178
wordspython5/5 (100%)5/5 (100%)36
wordsrust5/5 (100%)5/5 (100%)58
bracketsnurl5/5 (100%)5/5 (100%)483
bracketspython5/5 (100%)5/5 (100%)124
bracketsrust5/5 (100%)5/5 (100%)235
csv_sumnurl5/5 (100%)5/5 (100%)163
csv_sumpython5/5 (100%)5/5 (100%)35
csv_sumrust5/5 (100%)5/5 (100%)71
histogramnurl1/5 (20%)1/5 (20%)234
histogrampython5/5 (100%)5/5 (100%)29
histogramrust5/5 (100%)5/5 (100%)75

</details>

claude-sonnet-4-6__v3repair (5 sample(s)/task, first-pass + one compiler-feedback repair round (repair.py))

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl20/20 (100%)20/20 (100%)179 + 1604 primer178
python20/20 (100%)20/20 (100%)3536
rust20/20 (100%)20/20 (100%)7373

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl5/5 (100%)5/5 (100%)178
wordspython5/5 (100%)5/5 (100%)36
wordsrust5/5 (100%)5/5 (100%)58
bracketsnurl5/5 (100%)5/5 (100%)483
bracketspython5/5 (100%)5/5 (100%)124
bracketsrust5/5 (100%)5/5 (100%)235
csv_sumnurl5/5 (100%)5/5 (100%)163
csv_sumpython5/5 (100%)5/5 (100%)35
csv_sumrust5/5 (100%)5/5 (100%)71
histogramnurl5/5 (100%)5/5 (100%)232
histogrampython5/5 (100%)5/5 (100%)29
histogramrust5/5 (100%)5/5 (100%)75

</details>

claude-opus-4-8__v3 (5 sample(s)/task, as generated)

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl14/20 (70%)14/20 (70%)189 + 1604 primer188
python20/20 (100%)20/20 (100%)3535
rust20/20 (100%)20/20 (100%)8889

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl5/5 (100%)5/5 (100%)176
wordspython5/5 (100%)5/5 (100%)32
wordsrust5/5 (100%)5/5 (100%)96
bracketsnurl4/5 (80%)4/5 (80%)325
bracketspython5/5 (100%)5/5 (100%)118
bracketsrust5/5 (100%)5/5 (100%)198
csv_sumnurl5/5 (100%)5/5 (100%)163
csv_sumpython5/5 (100%)5/5 (100%)38
csv_sumrust5/5 (100%)5/5 (100%)74
histogramnurl0/5 (0%)0/5 (0%)213
histogrampython5/5 (100%)5/5 (100%)29
histogramrust5/5 (100%)5/5 (100%)81

</details>

claude-opus-4-8__v3repair (5 sample(s)/task, first-pass + one compiler-feedback repair round (repair.py))

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl20/20 (100%)20/20 (100%)191 + 1604 primer190
python20/20 (100%)20/20 (100%)3535
rust20/20 (100%)20/20 (100%)8889

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl5/5 (100%)5/5 (100%)176
wordspython5/5 (100%)5/5 (100%)32
wordsrust5/5 (100%)5/5 (100%)96
bracketsnurl5/5 (100%)5/5 (100%)325
bracketspython5/5 (100%)5/5 (100%)118
bracketsrust5/5 (100%)5/5 (100%)198
csv_sumnurl5/5 (100%)5/5 (100%)163
csv_sumpython5/5 (100%)5/5 (100%)38
csv_sumrust5/5 (100%)5/5 (100%)74
histogramnurl5/5 (100%)5/5 (100%)217
histogrampython5/5 (100%)5/5 (100%)29
histogramrust5/5 (100%)5/5 (100%)81

</details>

claude-haiku-4-5-20251001__v3 (5 sample(s)/task, as generated)

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl11/20 (55%)9/20 (45%)227 + 1604 primer226
python20/20 (100%)20/20 (100%)4141
rust20/20 (100%)20/20 (100%)8586

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl0/5 (0%)0/5 (0%)208
wordspython5/5 (100%)5/5 (100%)38
wordsrust5/5 (100%)5/5 (100%)105
bracketsnurl4/5 (80%)4/5 (80%)327
bracketspython5/5 (100%)5/5 (100%)143
bracketsrust5/5 (100%)5/5 (100%)213
csv_sumnurl5/5 (100%)5/5 (100%)178
csv_sumpython5/5 (100%)5/5 (100%)42
csv_sumrust5/5 (100%)5/5 (100%)75
histogramnurl2/5 (40%)0/5 (0%)499
histogrampython5/5 (100%)5/5 (100%)29
histogramrust5/5 (100%)5/5 (100%)85

</details>

claude-haiku-4-5-20251001__v3repair (5 sample(s)/task, first-pass + one compiler-feedback repair round (repair.py))

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl20/20 (100%)16/20 (80%)227 + 1604 primer226
python20/20 (100%)20/20 (100%)4141
rust20/20 (100%)20/20 (100%)8586

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl5/5 (100%)3/5 (60%)209
wordspython5/5 (100%)5/5 (100%)38
wordsrust5/5 (100%)5/5 (100%)105
bracketsnurl5/5 (100%)5/5 (100%)327
bracketspython5/5 (100%)5/5 (100%)143
bracketsrust5/5 (100%)5/5 (100%)213
csv_sumnurl5/5 (100%)5/5 (100%)178
csv_sumpython5/5 (100%)5/5 (100%)42
csv_sumrust5/5 (100%)5/5 (100%)75
histogramnurl5/5 (100%)3/5 (60%)500
histogrampython5/5 (100%)5/5 (100%)29
histogramrust5/5 (100%)5/5 (100%)85

</details>

mercury-2__v3 (5 sample(s)/task, as generated)

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl3/20 (15%)3/20 (15%)227 + 1604 primer226
python20/20 (100%)20/20 (100%)4243
rust20/20 (100%)20/20 (100%)9495

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl0/5 (0%)0/5 (0%)184
wordspython5/5 (100%)5/5 (100%)35
wordsrust5/5 (100%)5/5 (100%)98
bracketsnurl0/5 (0%)0/5 (0%)480
bracketspython5/5 (100%)5/5 (100%)135
bracketsrust5/5 (100%)5/5 (100%)224
csv_sumnurl2/5 (40%)2/5 (40%)168
csv_sumpython5/5 (100%)5/5 (100%)42
csv_sumrust5/5 (100%)5/5 (100%)75
histogramnurl1/5 (20%)1/5 (20%)258
histogrampython5/5 (100%)5/5 (100%)42
histogramrust5/5 (100%)5/5 (100%)82

</details>

mercury-2__v3repair (5 sample(s)/task, first-pass + one compiler-feedback repair round (repair.py))

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl12/20 (60%)12/20 (60%)228 + 1604 primer227
python20/20 (100%)20/20 (100%)4243
rust20/20 (100%)20/20 (100%)9495

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl3/5 (60%)3/5 (60%)169
wordspython5/5 (100%)5/5 (100%)35
wordsrust5/5 (100%)5/5 (100%)98
bracketsnurl2/5 (40%)2/5 (40%)480
bracketspython5/5 (100%)5/5 (100%)135
bracketsrust5/5 (100%)5/5 (100%)224
csv_sumnurl3/5 (60%)3/5 (60%)163
csv_sumpython5/5 (100%)5/5 (100%)42
csv_sumrust5/5 (100%)5/5 (100%)75
histogramnurl4/5 (80%)4/5 (80%)249
histogrampython5/5 (100%)5/5 (100%)42
histogramrust5/5 (100%)5/5 (100%)82

</details>

mercury-2__v3high (5 sample(s)/task, as generated)

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl6/20 (30%)5/20 (25%)91 + 1604 primer91
python20/20 (100%)20/20 (100%)5252
rust20/20 (100%)20/20 (100%)9394

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl0/5 (0%)0/5 (0%)193
wordspython5/5 (100%)5/5 (100%)35
wordsrust5/5 (100%)5/5 (100%)99
bracketsnurl0/5 (0%)0/5 (0%)1
bracketspython5/5 (100%)5/5 (100%)135
bracketsrust5/5 (100%)5/5 (100%)234
csv_sumnurl4/5 (80%)3/5 (60%)163
csv_sumpython5/5 (100%)5/5 (100%)38
csv_sumrust5/5 (100%)5/5 (100%)85
histogramnurl2/5 (40%)2/5 (40%)20
histogrampython5/5 (100%)5/5 (100%)60
histogramrust5/5 (100%)5/5 (100%)81

</details>

mercury-2__v3highrepair (5 sample(s)/task, first-pass + one compiler-feedback repair round (repair.py))

languagefirst-pass compilecorrect outputmedian tokens cl100kmedian tokens o200k
nurl12/20 (60%)11/20 (55%)163 + 1604 primer162
python20/20 (100%)20/20 (100%)5252
rust20/20 (100%)20/20 (100%)9394

<details><summary>per-task detail</summary>

tasklanguagecompilecorrectmedian tokens cl100k
wordsnurl3/5 (60%)3/5 (60%)180
wordspython5/5 (100%)5/5 (100%)35
wordsrust5/5 (100%)5/5 (100%)99
bracketsnurl0/5 (0%)0/5 (0%)1
bracketspython5/5 (100%)5/5 (100%)135
bracketsrust5/5 (100%)5/5 (100%)234
csv_sumnurl5/5 (100%)4/5 (80%)163
csv_sumpython5/5 (100%)5/5 (100%)38
csv_sumrust5/5 (100%)5/5 (100%)85
histogramnurl4/5 (80%)4/5 (80%)246
histogrampython5/5 (100%)5/5 (100%)60
histogramrust5/5 (100%)5/5 (100%)81

</details>

How to read this (interpretation)