Every time I read a benchmark score, I end up asking two questions. Did the model see these items during training? And who, or what, decided that an answer was correct?
For most evaluation sets neither question has a clean answer. A fixed public set can leak into training data, and after that a high score may measure memory. Free-form answers are often graded by another model or by a rubric, so the score carries the grader's uncertainty too. I wanted to see how far I could get by removing both problems at the source, in one deliberately narrow domain. The result is benchfck, a Rust tool that generates machine-state tasks and grades every answer by execution.
The most important sentence first: no model has been run on these tasks, and there is no leaderboard. benchfck is a v0.4.0-alpha engineering project. This post is about the instrument and the engineering problems inside it, not about any model.
Pinning the semantics so there is exactly one right answer
The programs are Brainfuck: eight instructions, a tape and a pointer. That is small enough to pin every edge case, which is the whole point. The harness fixes:
- 8-bit unsigned cells that wrap;
- a 30,000-cell tape where moving left of cell 0 or right of cell 29,999 is a hard error;
- reading past the end of the input yields 0;
- a run that exceeds 8,000,000 steps is classified as non-terminating.
Every task prompt prints these semantics (the left-edge error included), and the interpreter enforces all of them, including a hard error at the right edge. The step cap is not arbitrary: across 600 candidates the largest tier-9 program needed 5,678,676 steps, so 8M leaves a 40.9% margin. The interpreter checks the cap before every instruction, and wrapping is explicit in the code rather than left to overflow behavior:
while s.ip < self.code.len() && stop_after.is_none_or(|target| s.steps < target) { if s.steps >= step_cap { return Err(BfError::NonTerminating); } ... b'+' => { s.tape[s.pointer] = s.tape[s.pointer].wrapping_add(1); s.ip += 1; } b'<' => { if s.pointer == 0 { return Err(BfError::PointerUnderflow); } Brackets are matched once at parse time into a jump table, and the same interpreter can stop after an exact number of steps. That second ability is what produces the ground truth for "what is the machine state at step N" questions.
Generating programs instead of shipping a dataset
A seed and a constructor produce a typed intermediate representation with ten statement kinds (set, copy, add, sub, scaled drain, input, output, while, if, and a drain-if-nonzero). A compiler then turns the IR into Brainfuck. Two choices in the compiler matter for evaluation:
- Equivalent templates. For each statement a seeded ChaCha20 RNG picks one of three equivalent code templates, so the same IR can become different surface code.
- Cell layouts. Scratch cells are placed with a contiguous, interleaved or strided layout, with a fourth layout held out.
An adjacent-statement swap is also applied, but only when the two statements' read and write sets are disjoint and neither has side effects, so the reordering cannot change behavior.
Four encodings that must agree on every input
The same program is rendered four ways:
| Encoding | What it looks like |
|---|---|
| E0 | canonical Brainfuck |
| E1 | per-item random permutation of the 8 symbols, with a legend |
| E2 | compact explicit operations, e.g. M23*18 |
| E3 | verbose explicit operations, e.g. MOVE cell 23 count 18 |
The point is to change surface form while keeping behavior fixed, so that a future difference in model behavior can be attributed to representation rather than to the task. That only works if the encodings are truly equivalent, so equivalence is a gate, not an assumption:
- E0 Brainfuck is the reference. The typed IR, E2 and E3 must produce the same output on all 256 inputs.
- E2 and E3 are parsed back by independent decoders. Reusing the in-memory bytecode that produced them would test the same executor twice.
- The full input/output table is hashed into a semantic fingerprint, which later drives duplicate detection.
- E1 is a pure symbol permutation of E0, so it is equivalent by construction.
The property suite pushes this further: a release-build run over 10,000 deterministic IR programs and 2,560,000 complete-domain bindings checks IR, E0, E2 and E3 against each other. In CI a 500-program shard runs on every push, and the full 10,000 run is split into four shards on pull requests and a weekly schedule. (These property programs use their own 1,000,000-step cap and are synthetic IR programs, not generator items.)
Two limits on the encodings: E2 prompts are rendered only for size tiers 0–5 and E3 only for tiers 0–3, because longer programs become impractically long in the explicit forms. And encodings are not free of confounds. In one engineering diagnostic on 2026-08-11 (a private smoke test of a single constructor, cl100k_base tokenizer, before a later compiler compaction), the E3 prompt was about 7.07 times as long as E0 and the E2 prompt about 3.36 times. That is a diagnostic, not release evidence. Raw encodings therefore cannot be compared directly; more on that below.
Gates that reject trivial or degenerate items
Most generated programs should not become test items. A candidate is accepted only if it passes a chain of gates, each designed against a specific failure:
- Avalanche ≥ 0.60. At least 64 executed positions holding data or I/O instructions (
+ - , .) are sampled, and each is replaced by each of the three other symbols in that group. A mutant counts as "changed" if its output differs, it fails differently, or it no longer terminates. Pointer moves and brackets are excluded so that broken syntax cannot inflate the score. A program where most single-character edits change nothing is not testing state tracking. - Per-argument sensitivity. Each input is perturbed by +1, +17, +63, +127 and +255 (wrapping); at least one perturbation must change the output. An input the program ignores is a free answer.
- Off-idiom rate < 0.08. The five canonical idioms (
[-],[->+<],[->+>+<<],[<+>-],[->++<]) are counted, weighted by length. A program made of textbook idioms can be pattern-matched instead of traced. - Trace semantic density ≥ 0.30. At least 30% of executed steps must be something other than pointer movement.
- Worst-case preflight. The program is run on input 255 against the step cap before it is admitted.
- T2 nontriviality, the most involved gate. T2 asks for an arithmetic formula equivalent to the program, so the formula must not be trivially short.
- Layer 1 enumerates parser-valid expression trees bottom-up by observational equivalence, within a budget of 1,000,000 semantics and 1,000,000 operator applications. It targets depth 7, requires at least depth 3 to be proven exhaustively, and records the depth reached.
- Layer 2 tries named analytical families: polynomials via Newton interpolation, exact and additive periods, minimal affine pieces by dynamic programming, and bitwise-pointwise functions. It rejects an item only if it can synthesize an actual witness expression under 25 grammar tokens.
In a 500-candidate probe with seed 42, 376 candidates were accepted (75.2%). Each rejection is attributed to its first failing gate only: the off-idiom rate rejected 82 candidates and duplicate semantics 42, and the other 16 gate categories were never the first failure in that sample. The smallest size tier is the hardest to fill: 8 of 50 tier-0 candidates were accepted, against 44 to 46 of 50 from tier 4 up.
Gates can be wrong too. The repository keeps a ledger of gates that were demoted to recorded covariates, each because of a measurement:
- A maximum E2/E0 prompt-length ratio of 3.5 was biasing the accepted items against larger programs: of 7 items accepted after its removal, 6 had ratios between 3.55 and 3.94 and would have been rejected.
- A minimum text density of 0.35 was worse. Density falls from 0.463 at tier 0 to 0.076 at tier 7, so the floor admitted only tiers 0–1. Their E0 prompts (226 to 466 tokens) did not overlap the E2 prompts (1,102 to 2,182 tokens) at all, so no matched pair could exist and the main hypothesis became unanswerable.
The rule that came out of it: any gate defined as a ratio over program length selects on length, so it must be calibrated per tier, reformulated, or demoted. The ledger also says that a further demotion should be read as a sign that the acceptance design, not a single gate, needs review. The off-idiom gate is also a length-normalized rate and is still active, so it is exactly the kind of gate that rule tells me to watch.
Three task families, all graded by execution
- T1, state tracking. Given a program, an input and an interior step, return the requested machine-state fields. Three probes per item sit at roughly 1/4, 2/4 and 3/4 of the execution trace, with the order rotated by seed. The truth comes from the interpreter stopping at that exact step.
- T2, computation compression. Return a formula that matches the program over its whole input domain.
- T3, causal mutation. Predict what happens after one specified instruction is replaced. The mutation position is drawn from an early, middle or late region of the program, and the answer is one of
OUTPUT,IDENTICAL,NON_TERMINATINGorERROR, compared by exact JSON equality.
T2 is where safe grading is hardest, because the model writes code. benchfck never executes it. The response must have the exact shape def solve(inputs): return [ ... ], and each list element goes through a hand-written recursive-descent parser into a small expression tree. The only variable is inputs[N], literals are limited to 0–256, and calls, attributes and names do not exist in the grammar. Constant subtrees are folded before the length cap is applied, so equivalent spellings are not penalized. Evaluation uses checked arithmetic and returns nothing on overflow or division by zero:
Expr::FloorDiv(a, b) => { let divisor = b.eval(input)?; if divisor == 0 { None } else { Some(a.eval(input)?.div_euclid(divisor)) } } Expr::Binary(op, a, b) => { let (a, b) = (a.eval(input)?, b.eval(input)?); match op { '+' => a.checked_add(b), '*' => a.checked_mul(b), '%' if b != 0 => Some(a.rem_euclid(b)), The parsed formula is then evaluated on all 256 inputs, every value must fit in a byte, and each is compared with the Brainfuck run under the pinned step cap.
Each item also carries its own T2 and T3 answer-token budgets, derived from structure (nesting, working set, trace length) and shared by all four encodings, so no encoding gets a larger budget.
Duplicates and leaks
Near-duplicates. The protocol is written as a markdown block embedded in the binary, and its SHA-256 is part of the output, so the definition cannot drift after results are seen. Two items are flagged only when they are semantically close (they disagree on at most 4 of 256 inputs) and close in either their IR features (Sørensen-Dice distance ≤ 0.10) or their reference expressions (normalized Levenshtein ≤ 0.10). Over all 4,950 pairs of a 100-item batch: zero exact-semantic pairs and zero flagged pairs. The IR and expression axes alone each matched about 1,350 pairs, which is exactly why neither is used alone; the closest pair semantically still disagreed on 205 of 256 inputs.
Leaks. The public files must not contain anything that reveals an answer. The scanner reads every raw JSONL line as untyped JSON and walks every object and array recursively, counting any of 28 forbidden keys (seed, ir, e0, trace, expected_answer, reference_solution and others). It does this before typed deserialization, so an extra field cannot slip past a schema. Result on the public batch: 1,610 records (100 metadata, 1,510 tasks), no private records, no forbidden keys.
Comparing encodings without comparing lengths
Because E3 prompts are several times longer than E0, a raw E0-versus-E3 comparison would mostly measure prompt length. benchfck builds token-matched pairs instead:
- token counts use
cl100k_baseon the full T2 prompt; - two prompts may pair only if their relative gap, |a − b| / max(a, b), is at most 10%;
- the E0 side must come from a strictly larger size tier, so that the shorter encoding has a longer program to match;
- pairs are chosen greedily by smallest gap and never reuse an item.
The public batch yields 39 E0–E2 pairs and 31 E0–E3 pairs, all within the 10% limit. The design has an honest cost: matched pairs are two different programs from different tiers, not the same program in two encodings. The preregistration says so explicitly and adjusts for prompt length, trace length, tier, nesting depth, working set and density in a sensitivity model.
A preregistration frozen before any model call
The model pilot was written down and frozen on 2026-08-16, before any provider response existed:
- Systems: three model families, one each from OpenAI, Anthropic and Google, with reasoning settings and model snapshots fixed. Substituting a model requires an amendment.
- One confirmatory hypothesis (H1): at roughly equal total prompt length, compact explicit operations (E2) give a higher exact-T2 rate than Brainfuck (E0). It is tested on 34 matched pairs from a separate private item set, not the public pairs above. The estimate is a paired cluster bootstrap with 10,000 draws, and H1 counts as supported only if the whole 95% interval is above zero.
- Secondary contrasts (E0–E3, E0–E1 and a per-family E2–E0) use a Holm correction.
- Operational rules: task order is fixed by a hash; there is no outcome-based early stopping; a system with more than 2% operationally missing cells is invalidated, not selectively refilled; parse failures, refusals and truncations count as wrong.
- Budget: 2,160 calls with a $40 ceiling (the local token estimate is $25.78).
Amendments are allowed but must record the old hash, new hash and reason, and an amendment motivated by outcomes invalidates confirmatory status. Freezing the plan does not authorize a single call, and none has been made.
The runner that will eventually execute this is already built and tested offline. It turns an answer-stripped task packet into request records and hashes each one:
- every request is serialized and hashed;
- each run gets an ID derived from the system, repeat and task;
- loading a plan re-derives all of those hashes and rejects any mismatch;
- the resume log rejects a changed request, a duplicate or non-contiguous attempt, a retry after delivery, and a delivered response without a provider request ID, model snapshot, finish reason, token usage and cost.
Running it twice on the same inputs must produce byte-identical JSONL. It has no provider client and needs no credentials.
The open-generator problem
If the generator is public, anyone can study the constructor family and train on it. benchfck's answer is a scoring epoch: official scores are meant to come from a separate, unpublished set of constructors plugged in through a narrow provider interface, which cannot bypass the acceptance gates. Each epoch is committed in advance with a salted hash of its exact bytes. That commitment detects later substitution, though it does not prove the gates passed. Epochs move one way (planned, active, closed, retired), a disclosed constructor is never reused, and the epoch record validator is fail-closed. The first private epoch is recorded as planned, not active.
How I keep this honest in CI
- formatting and
clippy -D warningson every push; - unit tests, then a script that checks every evidence file against its SHA-256 manifest and re-verifies the Phase 2 package;
- the 500-program property shard on every push and the full 10,000-program run on pull requests and weekly;
- CodeQL for the Rust code, with all CI actions pinned by commit SHA.
You can try the local path with Rust only, no API key:
cargo build --release cargo run --release -- generate --seed 42 --count 1 --difficulty hard --arity 1 --output target/benchfck-public.jsonl cargo run --release -- validate --input target/benchfck-public.jsonl What is not done
- No model has been evaluated. No leaderboard or aggregate score exists.
- The official scope is one-input programs. Two-input programs are a deferred research path.
- The public items come from four structural families. That is a narrow development subset.
- The private constructor epoch is planned, not active.
- Human review, the statistical analysis and an independent clean-checkout reproduction are all still outstanding.
Where I would like feedback
- Is exact, execution-graded state tracking a useful complement to the benchmarks you already use, or is the domain too narrow to say anything?
- Is a private constructor set with one-way rotation and published commitments a credible answer to the open-generator problem?
- Cross-item, length-matched pairs trade one confound for another. Is there a better control for encoding length?
- What would you need to see in the preregistration before you trusted a first result?
I built this, so read my framing with that in mind. The code, the evidence files and the preregistration are at https://github.com/muend/benchfck. Criticism of the design is welcome in the comments or as an issue.




