Characterizing Multi-Hunk Patches: Divergence, Proximity, and LLM Repair Challenges
Not on the map. Why?
Abstract (arXiv)
Multi-hunk bugs, where fixes span disjoint regions of code, are common in practice, yet remain underrepresented in automated repair. Existing techniques and benchmarks pre-dominantly target single-hunk scenarios, overlooking the added complexity of coordinating semantically related changes across the codebase. In this work, we characterize HUNK4J, a dataset of multi-hunk patches derived from 372 real-world defects. We propose hunk divergence, a metric that quantifies the variation among edits in a patch by capturing lexical, structural, and file-level differences, while incorporating the number of hunks involved. We further define spatial proximity, a classification that models how hunks are spatially distributed across the program hierarchy. Our empirical study spanning six LLMs reveals that model success rates decline with increased divergence and spatial dispersion. Notably, when using the LLM alone, no model succeeds in the most dispersed Fragment class. These findings highlight a critical gap in LLM capabilities and motivate divergence-aware repair strategies.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). First posted on arXiv 4 Jun 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 2; 2026: 5.
7 papers.
- 2026Where Do AI Coding Agents Fail? An Empirical Study of Failed Agentic Pull Requests in GitHubcited by 13
- 2025HAFixAgent: History-Aware Program Repair Agentcited by 3
- 2025Beyond Accuracy: Behavioral Dynamics of Agentic Multi-Hunk Repaircited by 2
- 2026MultiFixer: A Coordinator-Proposer Based Multi-Agent Framework For Fixing Multi-Hunk Bugscited by 0
- 2026Does Fault Localization Beat a Fresh Attempt? A Placebo-Controlled Study of Test-Guided Code Repaircited by 0
- 2026What Does an Agentic Software Engineering Benchmark Measure? Profiling Task Demands and Agent Behaviour Beyond What Category Labels Revealcited by 0
- 2026Diagnosing Generalization Boundaries in AI-Based Vulnerability Detection via Calibrated Embedding Distancescited by 0
- 2026Diagnosing Generalization Boundaries in AI-Based Vulnerability Detection via Calibrated Embedding Distances9 Oct 2026
- 2026What Does an Agentic Software Engineering Benchmark Measure? Profiling Task Demands and Agent Behaviour Beyond What Category Labels Reveal1 Sep 2026
- 2026Does Fault Localization Beat a Fresh Attempt? A Placebo-Controlled Study of Test-Guided Code Repair1 Sep 2026
- 2026MultiFixer: A Coordinator-Proposer Based Multi-Agent Framework For Fixing Multi-Hunk Bugs29 Jul 2026
- 2026Where Do AI Coding Agents Fail? An Empirical Study of Failed Agentic Pull Requests in GitHub21 Jan 2026
- 2025Beyond Accuracy: Behavioral Dynamics of Agentic Multi-Hunk Repair14 Nov 2025
- 2025HAFixAgent: History-Aware Program Repair Agent2 Nov 2025