Editor’s introduction
Codoku introduces a renewable program-reasoning benchmark where agents must fill in partial code to satisfy static and dynamic constraints, such as control flow and execution paths. Unlike traditional benchmarks, the puzzles cannot be executed directly, and valid solutions are rare and interdependent, requiring genuine program reasoning rather than tool use or enumeration. Each puzzle is generated from semantic reification and includes a hidden witness solution to ensure solvability. The study evaluates five frontier models—Claude Opus 5, GPT 5.6 Sol, GLM 5.3, Kimi K3, and DeepSeek V4.1 Flash—on 300 synthesized puzzles, with each model attempting all puzzles under identical conditions. Small puzzles already challenge open-weight models, while even proprietary models solve only about half of the larger ones. The study’s boundary lies in its focus on reasoning under constraints, not on full program correctness or real-world applicability.
Introduction
The ability to reason about programs, which we refer to as program reasoning, is fundamental to large language models (LLMs) on coding tasks. A substantial line of benchmarks evaluates this ability through the relation among a program, its inputs, and its execution: given a complete program and a concrete input, an LLM is asked to predict outputs, intermediate states, branch outcomes, execution paths, or unexpected behaviors. These benchmarks have enabled meaningful comparisons among LLMs and have supported real progress in program reasoning. They were designed, however, for bare models. Today, LLMs increasingly operate inside coding agents, i.e., harnesses that equip them with shells, interpreters, compilers, debuggers, fuzzers, and other tools. Transplanting these benchmarks into this setting is more than a change of harness: it invalidates two critical assumptions on which they rest, one concerning their format and the other their supply.
Tool access decouples task success from program reasoning. Predicting what a program does serves as a proxy for reasoning about it only as long as the predictor cannot execute the program; an agent, however, can. Every quantity that these benchmarks measure, such as outputs and intermediate states, is recoverable by execution, instrumentation, or debugging, so a task can be solved with a few tool calls and without any understanding of the program or its semantics. Execution-prediction benchmarks such as CruxEval and REval remain valuable for evaluating bare models, but their task format is no longer suitable for coding agents.
Nonrenewable benchmarks cannot supply fresh challenges. All program-reasoning benchmarks that we are aware of draw their tasks from existing programs: textbook exercises, programming contests, and GitHub repositories. These tasks are either created by hand for quality or mined automatically for scale. Both strategies yield valuable tasks, yet both freeze a benchmark at publication time while the LLMs under evaluation keep evolving. Because the originating programs and their traces are public, each training cycle increases the likelihood that they have been absorbed. Web access aggravates the problem further, as an agent may simply retrieve the source program or even a published solution. The natural remedy, renewal, is costly: as LLMs become more capable, renewing these benchmarks at comparable quality and quantity requires substantial effort.
Codoku: renewable challenges for frontier coding agents. We introduce a new kind of program-reasoning challenge, codoku (short for code sudoku). Like sudoku, a codoku puzzle asks a solver to fill cells whose choices are linked by global constraints. Whereas sudoku constrains the digits in each row, column, and block, codoku constrains a program’s static structure and dynamic behavior.
Because puzzles are synthesized from scratch, they are independent of existing programs and renewable by construction, which addresses the supply problem: fresh instances can always be drawn after a model is trained, reducing the risk that the exact programs and solutions have been seen during training or can be retrieved from the web. The synthesizer exposes parameters that control puzzle complexity, including program size and the number of loop iterations. Based on these parameters, we define three generation profiles: a small codoku encodes a small straight-line function with a short execution path, a medium codoku a function with shallow loops and a moderately long execution path, and a large codoku a large branching function with nested loops. Rather than assuming that these profiles directly determine difficulty, we measure how they affect agent performance.
Evaluating frontier agents. Codokus are designed for both bare models and coding agents, and we do not restrict how an agent solves them: an agent may use any available tool to execute candidate fillings, invoke the solution checker, inspect failures, and implement its own search procedure in any programming language. We therefore measure whether an agent finds a valid solution within a fixed resource budget, regardless of the method it uses. We evaluate five frontier models with the Pi coding agent on 300 codoku puzzles, 100 from each generation profile. Codoku puzzles challenge coding agents: even on small puzzles, solve rates range from 39% to 77%, and the highest solve rate on large puzzles is 54%. Every model solves fewer large puzzles than small ones, and resource use grows with profile scale. Tool-use trajectories further show that agents combine multiple strategies to infer local program states to solve puzzles. These results establish our contribution: Codoku, a renewable testbed for program reasoning that can keep pace with rapidly improving coding agents.
Witness Synthesis
Most program generators are syntax-guided: they emit syntactically correct programs but offer no guarantees about runtime behavior on a specific input, so their output may raise unhandled exceptions, enter infinite loops, or consist largely of dead code. For example, Csmith guarantees semantic correctness, yet does not offer precise control over semantic properties such as loop behavior and execution length. Lacking such control, the resulting codoku puzzles would be too easy or too hard. We therefore build on semantic reification, which synthesizes programs that satisfy prescribed static and dynamic semantic specifications.
Solution Verification
Checker feedback. The checker stops at the first failed check and reports the violated constraint, for instance a missing or unexpected CFG edge, a mismatch in the execution path, or an incorrect constant count. Such feedback lets agents revise a candidate in response to a specific failure, yet it neither discloses the witness’s choices nor requires agents to reproduce them.
Generation Profiles
Section 3.2 reports each profile’s empirical complexity. A more complex puzzle is generally harder, but not always: a puzzle with a large search space may be easy if local constraints eliminate most choices. We therefore assess difficulty through agent success rates and solution costs (Section 3.3).
Evaluation Setup
We generate 100 puzzles per profile, 300 in total. Each puzzle comes with a witness solution, which is unavailable to agents. We evaluate Claude Opus 5, GPT 5.6 Sol, GLM 5.3, Kimi K3, and DeepSeek V4.1 Flash, each with its thinking effort set to high. All models run in the Pi coding agent under an identical configuration. The agent has access to the solution checker (Section 2.3) and all standard tools, and each agent is isolated in its own E2B micro VM with four CPU cores and 16 GB of memory. Every model attempts all 300 puzzles (1,500 runs in total).
RQ2: Challenge for Coding Agents
Compact puzzles pose substantial challenges. No evaluated agent saturates codoku. Claude Opus 5 reaches the highest overall solve rate, followed by GPT 5.6 Sol, yet even Claude Opus 5 leaves almost a quarter of the small puzzles unsolved, although these average fewer than 40 lines of code. No agent solves more than 54% of the large ones. Substantial headroom thus remains at every profile, even though the agents can execute code, validate candidates, and program their own search.
A gap exist between proprietary and open-weight models. The two proprietary models solve roughly twice as many puzzles as the three open-weight ones, and the separation holds within every profile: both proprietary models outperform all three open-weight models on small, medium, and large puzzles. Averaged within each group of models, the gap widens from 26% on small puzzles to 37% on large ones. Notably, both proprietary models solve at least 50% of the large puzzles, whereas none of the open-weight models solves more than 50% even of the small puzzles. Codoku thus sits at neither ceiling nor floor for current models: our puzzles resolve differences between them.
Larger profiles are generally harder. Every model solves fewer large puzzles than small ones, and the decline is monotonic for all models except GPT 5.6 Sol, which performs about equally on medium and large puzzles. Averaged over the five models, the solve rate falls from 56% (small) to 39% (medium) and 30% (large). The decline is steeper for open-weight models, which retain about 30% of their small-profile solve rate on large puzzles, against about 70% for proprietary ones.
Answer to RQ2. Codoku poses a substantial challenge to all five evaluated models under the Pi agent and our budgets: none approaches saturation on any profile, every model solves fewer large puzzles than small ones, and solved runs demand more resources as the profiles grow. The benchmark also separates proprietary from open-weight models, by a margin that widens with puzzle size.
Solving Strategies
Agents infer program states and confine their search. Direct appears in at most 5% of the runs of any model and profile, which suggests that agents treat the cells as interdependent. Instead of filling all cells at once, runs derive cell values from the program states that the constraints entail, either algebraically (Algebra, 14%–67% of runs) or with an SMT solver (SMT, up to 15%). Where agents search, in the trajectories we inspected, they confine the search to restricted domains, such as the constants in the table or values around a “pivot” inferred from a local program state; exhaustive enumeration is infeasible in any case, given the size of the search space (Section 3.2). When a candidate fails a check, agents also revise it and check it again (Repair, 3%–55% of runs). Together, these observations indicate that agents solve codokus by reasoning about program states and narrowing their search accordingly, rather than by exhaustively enumerating fillings.
Related Work
Execution and input prediction. CruxEval asks a model to predict the output of a short Python function on an input, or an input that yields a given output; CruxEval-X extends it to multiple programming languages. CodeI/O uses both directions as training tasks. REval extends prediction to intermediate states, statement coverage, and execution paths, CoRe asks about control and data dependencies, and further studies test prediction under code mutations and input perturbations. These benchmarks remain informative for bare models, but each task comes with a complete program that an agent can execute or instrument instead of reasoning about it (Section 1). In a pilot study, GLM 5.2 (OpenCode) solves all 1,600 CruxEval tasks, each within five minutes.
Program synthesis. Programming by example (PBE) asks a solver to construct a program consistent with given input-output examples. Cited researchers evaluate LLMs on classic PBE domains, including text-editing problems from SyGuS and PROSE, and CodeARC derives PBE tasks for LLM agents from 1,114 functions in HumanEval, MBPP, and APPS, allowing agents to query the hidden target function on new inputs. Because correctness is defined as agreement with the target on all inputs, a checker can only approximate it: comparison with a reference implementation rejects equivalent alternatives, whereas finite testing may accept incorrect programs. CodeARC checks candidates by differential testing with inputs generated by Pynguin and Mokav, yet with the same model and agent under a five-minute limit per task, its success rate ranges from 57.4% to 72.6% depending on the strictness of the checker. Codoku instead makes the specification explicit: correctness is defined by the global constraints of a puzzle alone, so the checker decides it exactly, accepting every filling that satisfies them, including fillings that differ from the witness, and rejecting all others.
Case Study
Overview. Claude solves the puzzle by inspecting the checker, deriving checksum constraints, and combining enumeration with randomized search. It then fills the remaining cells to satisfy the required control flow and constant table, assembles the solution, and passes the checker on its first attempt.
Phase 2: inspect the checker. The agent reads the checker and its helper module to establish the filling rules. Unary operators are allowed before constants, but and and or cannot fill OP cells; parameters and subscripts can fill ID cells; and the 18 CONST cells must reproduce the constant table exactly.
Phase 6: fill remaining cells. Claude then fills the control-flow cells so that the loop runs once, the b2 branch is not taken, and the CTRL cell preserves the declared CFG (Lines 3–6). It chooses assignments to v0 that satisfy the checksum sign constraints (according to Phase 3) and distributes the remaining constants among checksum-irrelevant cells to match the table.
Phase 7: assemble and check. The agent assembles the 80 possible fillings with a Python script and executes them to confirm the required execution path for all three calls. Then it checks them through the solution checker, which returns PASS for two fillings. Claude submits one of them.


