arXiv:2611.09212cs.SENov 2026

Manuscript Offprint

arXiv:2611.09212

On the Limits of Execution Traces for Repairing Assertion Failures in LLM-Generated Code

Muntasir Adnan, Carlos C. N. Kuhn

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Muntasir Adnan*

Open Source Institute Faculty of Science and Technology University of Canberra Canberra, Australia

Carlos C. N. Kuhn

Open Source Institute Faculty of Science and Technology University of Canberra Canberra, Australia

Abstract—Iterative repair returns a failed program's error to a large language model (LLM) and asks it to fix it. After iterative repair, the remaining failures are mostly assertion failures: with four Qwen2.5 models, they make up 79% of residual failures on BigCodeBench, all on HumanEval and 93% on LiveCodeBench. We argue, through an information view of the feedback, that an assertion failure says little about where the fault lies. We propose Breakpoint Debugging (BPD), which returns the failed program annotated inline with its variables' runtime values. We take the tasks that iterative repair failed to fix with five repair attempts and compare two ways of spending five further generations on them: BPD, and resampling. On BigCodeBench, BPD repairs 26.7% of these tasks against 22.4%, and its advantage grows with model size. On HumanEval, BPD outperforms resampling but only slightly, and on LiveCodeBench, fresh sampling repairs more (6.5% against 4.9%). Furthermore, BPD reduces unchanged-code resubmissions from 28% to 8% on BigCodeBench. Using only the first failing test's trace, it outperforms tracing all failing tests while using fewer tokens than both all-trace BPD and plain iterative repair. On LiveCodeBench, BPD gives no gain even on the public tests, so a visible failing input is not enough for a trace to help. These results match the information view: a trace helps only when the test exposes a failing input, and the fault is an implementation slip; otherwise, a repair loop should resample rather than trace.

Index Terms—code generation, large language models, self-debugging, program repair, execution traces, assertion errors

I. INTRODUCTION

Programs written by large language models (LLMs) often fail their tests, and on benchmarks such as BigCodeBench and LiveCodeBench, even strong models solve only part of the tasks on the first attempt [1–3]. Iterative self-debugging executes the program, returns the error to the model and asks for a corrected version [4–6], and the quality of this feedback is widely seen as its bottleneck [7].

Previous studies take opposite positions on how rich the feedback should be. LDB [6] segments the program into basic blocks, records intermediate variable values and asks the model to verify each block for every type of failure. PyCapsule [5], MapCoder [8] return a lightly processed error message that keeps the relevant traceback frames, including expected and actual values for assertion failures. With the same LLM, PyCapsule reported 85.2% against LDB's 82.9% on HumanEval and 78.5% against 76.0% on MBPP [9]. These figures are not a controlled comparison, but recent studies point the same way: execution traces in repair prompts beat trace-free prompts in only two of six configurations in one study [10] and were of limited use in another [11], while trace-driven agents report gains [12, 13]. What is missing is an account of when a trace should help and when it cannot.

We start from the failures that a structured-error loop leaves behind, and find that they are almost all assertion failures. Unlike crashes, which often indicate where execution first goes wrong, assertion failures identify only where an incorrect result is detected, offering little information about the underlying fault [14]. We formalise this information gap in bits and derive five hypotheses (Section III). We then propose BPD, which targets assertion failures and returns the program with the values from the failing run written as inline comments,

This work is funded under the agreement with the ACT Government, Future Jobs Fund - Open Source Institute(OpenSI) - R01553; and NetApp Technology Alliance Agreement with OpenSI - R01657. Additionally, the Australian Government supported this research through the Department of Education's National Industry PhD Program (project 36337). The views expressed herein are those of the authors and are not necessarily those of the Australian Government or the Department of Education.

*Corresponding author: Adnan.adnan@canberra.edu.au similar to the inline traces of NExT [15] but used at inference time without training.

This paper makes three contributions. We show that assertion failures make up 79–100% of the failures left by iterative repair, and explain with an information view why they resist repair. We propose BPD, which adds inline state traces only to assertion failures, and compare it with fresh sampling across four model sizes, measuring repairs, repair behaviour, and token cost. We identify, from LiveCodeBench, when traces cannot help, and turn this into practical rules for when a repair loop should trace or resample.

We organise the evaluation around five research questions. RQ1: Which failures remain after iterative repair? RQ2: Do traces repair assertion failures better than fresh sampling? RQ3: How do traces change repair behaviour? RQ4: Is one trace enough, and what do traces cost?

References (28)