Manuscript Offprint

arXiv:2610.11889

Evaluating Exact Output and Checkpoint-State Prediction in Real Programs

Xiaohong Chen, David Bucur, Chenglong Ma, Yi Zhang, Lingming Zhang, Sriram Vishwanath, Grigore Rosu

Abstract

We present a benchmark for predicting final output and checkpoint state from source and input alone. It extends CRUXEval-style output prediction with paired shorter- and longer-trace inputs and checkpoints inside and after a loop. The benchmark contains 400 cases from 371 Python and C++ programs, evaluated under seven settings from four model families without tools or code execution. Of 11,200 planned predictions, 11,151 produced gradable responses. Reasoning-enabled settings outperform their off counterparts by 33.1 to 55.2 percentage points on completed responses. The strongest setting scores 93.0% on shorter-trace final output, 77.0% on longer-trace final output, and 65.5% and 63.5% on the two state tasks; these scores also hold when missing responses count as wrong. Across 2,397 matched Python comparisons with identical source, changing to the longer-trace input yields 528 correct-to-wrong changes and 147 reversals. Source-clustered analyses preserve this accuracy gap, while adjusted Python models give no evidence of a positive incremental association between cumulative state load and error. Changed inputs and checkpoint tasks alter several factors together, so the gaps do not isolate trace length or an internal state-tracking mechanism. The benchmark exposes errors hidden by short-output scores alone.

1 Introduction

Coding agents combine a language model with a system that supplies context, runs code, exposes feedback, and organizes retries. SWE-agent, OpenHands, and Agentless show how these choices shape performance on software-engineering tasks [4–6]. Their end-to-end scores measure the resulting model–harness combination. A complementary capability is the model’s ability to determine program behavior directly from source and input. Measuring this capability helps identify which execution questions a model can answer before runtime feedback enters the workflow.

Direct execution reasoning remains less extensively benchmarked than code generation. A recent review of 142 papers identifies 156 code benchmarks across 32 tasks, with 86 devoted to code generation [7]. CRUXEval-X identifies the same imbalance [2]. We focus on model-only evaluation, in which a served endpoint receives source and input with tools, retrieval, and code execution disabled. This interface isolates the prediction task while retaining the endpoint’s requested reasoning mode.

CRUXEval gives this question a clean form [1]. Its 800 generated Python functions are 3–13 lines long, and each supports output prediction from an input and input prediction from an output. The benchmark separates code execution reasoning from program synthesis. Meta’s Code World Model (CWM) approaches the same capability from training [3]. CWM is mid-trained on Python interpreter traces and trajectories from agentic execution environments, then evaluated on trace

Preprint.

prediction and coding tasks. In the reported 8B ablation, adding Python traces raises CRUXEval output prediction from 44.6% to 73.9% after mid-training, while SWE-bench Verified changes from 18.6% to 18.4% after subsequent supervised fine-tuning. The different responses to trace supervision support measuring execution prediction separately from end-to-end agent performance.

We follow CRUXEval's output-prediction task and extend it to longer executions and intermediate state. Each case produces four related questions. Two show byte-identical clean source and request final output under inputs selected to induce shorter and longer native traces. Two use the longer input and instrumented source, stopping at a declared checkpoint inside a loop or immediately after the loop exits. Figure 1 shows an admitted case from the Python LiveCodeBench study.

Clean core loop input parsing omitted

cnt0 = cnt1 = 0 ans = 0 for ch in S: if ch == '0': dp0 = 1 dp1 = cnt0 + cnt1 else: dp0 = cnt1 dp1 = cnt0 + 1 ans += dp1 cnt0, cnt1 = (dp0, dp1) print(ans)

short-trace-final N=5, S=00110 -> 9 long-trace-final N=1002, S=(01)^501 -> 251502 inside-loop-state before iteration 502 -> {"ans":63250,"cnt1":500,"dp1":500} post-loop-state after the loop -> {"ans":251502,"cnt1":2,"dp1":2}

Figure 1: The four benchmark arms for the real abc310_e case. The notation (01)501(01)^{501} abbreviates the literal 1,002-character input. The inside checkpoint fires after 501 iterations have completed. Both state arms emit canonical JSON from instrumented copies of the clean source.

The recurrence tracks how many substrings ending at the current position have iterative NAND value zero or one, and ans accumulates the one-valued count. The short-input arm in Figure 1 requires five loop iterations, while the long-input arm applies the same recurrence 1,002 times. The state arms ask for the same three fields midway through and after that execution. These related questions separate success on a short final-output task from success on a longer execution, including the prediction of its intermediate values.

We construct 400 such cases from 371 distinct Python and C++ programs, spanning contest solutions, textbook algorithms, and a library routine. Execution checks establish a stable ordering between the two trace lengths, reachable and deterministic checkpoints, and preservation of the clean program's normal output under instrumentation. Seven model settings answer the resulting tasks in fresh sessions. The benchmark provides paired execution scales and shared state projections per case. We report the collection and grading protocol, aggregate results, source-clustered analyses, and a worked example in this paper.

The central result is that reasoning substantially improves execution prediction, yet longer-input and checkpoint tasks remain difficult. Reasoning-enabled settings exceed their off counterparts by 33.1 to 55.2 percentage points overall. Even the strongest setting falls from 93.0% on short final-output tasks to 77.0% on long final-output tasks and below 66% on both state tasks. In 2,397 paired Python comparisons, the longer input changes 528 correct answers to wrong ones and 147 wrong answers to correct ones, with source held byte-identical.

We then examine how errors relate to static source structure and dynamic measurements. Cumulative state load L=∑t∣St∣L = \sum_t |S_t| combines observed steps with reachable state at each step. Original pooled associations weaken within individual task conditions. We add analyses that account for shared source programs and adjust for task, study, model setting, trace length, and peak state size. These provide no evidence of a positive incremental state-load association. Cyclomatic complexity has no consistent positive association with error under our within-arm directional tests. Appendix F separately reports a small invariant-guidance pilot; this pilot does not establish either an accuracy benefit or an efficiency benefit.

This diagnostic is relevant to verifier-facing work because counterexample replay, symbolic-execution guidance, invariant assessment, and diagnosis of failed proof obligations involve values at specific program points. The benchmark evaluates a model's ability to recover those values from code. It measures one component of these workflows. Software correctness still requires a specification and independent verification.

References (20)