cs.SEOct 15, 2026

Poison Valleys: Diagnosing Path-Dependent Failure in LLM Code Repair

Authors: Veljko Skarich

Abstract

When code-repair agents fail, final tests reveal that a patch is wrong but not which earlier commitment caused it or which software obligation failed. Poison Valleys traces this path in 1,844 model requests on two synthetic Python cases: PersistQueue adds atomic batch claiming to a disk-backed queue, while Dijkstra adds source-sensitive filtering to shortest-path search. We define plausible but incorrect software mechanisms, place each in a model's hypothesis, implementation plan, or both, and evaluate the generated code with an Oracle and targeted diagnostic coordinates. Moving the misconception from hypothesis to plan increased failure by 32.2% in PersistQueue and 28.9% in Dijkstra after matching the experimental mix. Different misconceptions produced distinct, model-dependent patterns of violated obligations, although several could converge on the same behavior. This creates a measured connection from upstream misconception to code mechanism and failure form. Code, data, and demo: https://poisonvalleys.org.

Figures & tables

Appendix figures & tables5 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repair

    Oct 11, 2026Elad Sharony, Ido Greenberg, Jialin Song +3Automated Program Repair

  2. Obey, Diverge, Collapse: Blind Obedience to Incorrect Instructions Drives Code LLMs to Irrecoverable Code Semantic Collapse

    Jul 5, 2026Raj Jaiswal, Anany Singh Divy, Savar Bhasin +3LLM Self-CorrectionAutomated Program Repair

  3. Coherence Collapse: Diagnosing Why Code Agents Fail After Reaching the Right Code

    Mar 25, 2026Myeongsoo Kim, Dingmin Wang, Siwei Cui +6Agent Failure AnalysisAI Coding Agents