A Single Patch Is Not Enough: Deterministic Fusion of Repair Candidates

📅 2026-07-01
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing automated program repair approaches struggle to deterministically select a single optimal patch from a pool of candidates, resulting in a significant performance gap between pass@k and pass@1. This work proposes PatchFusion, the first method to introduce a deterministic, edit-atom-based fusion mechanism that synthesizes high-quality patches by integrating shared effective edit units from multiple candidate sources without requiring test feedback. PatchFusion constructs a repair neighborhood, selects auditable representatives, and applies Evidence-Constrained Fusion (ECF) to combine edits coherently. Evaluated on PatchFuseBench, it successfully repairs 426 out of 500 bugs on SWE-bench Verified and 236 out of 300 on the Multilingual benchmark, while generating 87 plausible patches on Defects4J—substantially outperforming existing selectors and approaching the theoretical upper bound of the candidate pool at minimal cost.
📝 Abstract
Modern LLM coding agents are commonly evaluated using pass@k, but developers typically apply a single final patch in real-world settings. This pass@k-to-pass@1 gap is a post-generation problem: a candidate patch pool may contain a correct patch, but the system must decide which one to suggest to developers. Existing post-generation approaches mainly rank whole candidates, filter them with tests, or query an LLM judge, but none deterministically reuse shared edit-atom evidence to both select and construct the final patch. Thus, we propose PatchFusion, a deterministic atomic evidence fusion approach for candidate patches that consults no test outcome at decision time. PatchFusion first fuses whole-diff agreement into a repair neighborhood, selects an auditable representative, and then applies evidence-constrained fusion (ECF) to retain repeated edit atoms and prune unsupported parts. To evaluate this setting, we build PatchFuseBench, a fixed-pool benchmark covering SWE-bench Verified, SWE-bench Multilingual, and Defects4J candidate patches. On PatchFuseBench, PatchFusion solves 426/500 bugs on SWE-bench Verified and 236/300 on SWE-bench Multilingual, and reaches 87/371 plausible patches on Defects4J, outperforming every matched candidate-pool selector on all three. PatchFusion recovers 41 and 27 bugs that no single source solves (30 and 18 more over the best single source). Ablation studies show that ECF adds +5/+6/+9 solved bugs by recovering in-pool repairs that selection misses, with no observed regression, and that PatchFusion's gains remain stable as candidate pools are resampled. On these complementary multi-source pools, cross-candidate evidence recovers more correct patches than the test-based and LLM-based selectors we evaluate, at orders-of-magnitude lower cost, reaching within 96.2% and 89.7% of the candidate-reachable ceiling on the two SWE-bench benchmarks.
Problem

Research questions and friction points this paper is trying to address.

automatic program repair
patch selection
edit atoms
deterministic fusion
candidate patches
Innovation

Methods, ideas, or system contributions that make the work stand out.

PatchFusion
evidence-constrained fusion
edit atoms
deterministic patch selection
multi-source repair