Mitigating Implicit Inconsistencies in Patch Porting

📅 2026-04-02
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing patch transplantation methods struggle to address implicit inconsistencies across code repositories—such as branches and forks—due to their reliance on global code semantics rather than local context. This work proposes MIP, the first framework to systematically tackle this challenge by synergistically integrating large language models, compiler diagnostics, and static analysis. MIP dynamically selects between compiler feedback–driven repair or cross-repository semantic matching, depending on whether source identifiers are present in the target code, thereby enabling automatic resolution of implicit inconsistencies. Experimental results demonstrate that MIP successfully transplants more than twice as many patches as the best-performing baseline in both cross-branch and cross-fork scenarios, with its practical efficacy further validated through an industrial user study.
📝 Abstract
Promptly porting patches from a source codebase to its variants (e.g., forks and branches) is essential for mitigating propagated defects and vulnerabilities. Recent studies have explored automated patch porting to reduce manual effort and delay, but existing approaches mainly handle inconsistencies visible in a patch's local context and struggle with those requiring global mapping knowledge between codebases. We refer to such non-local inconsistencies as implicit inconsistencies. Implicit inconsistencies pose greater challenges for developers to resolve due to their non-local nature. To address them, we propose MIP, which enables collaboration among an LLM, a compiler, and code analysis utilities. MIP adopts different strategies for different cases: when source identifiers exist in the target codebase, it leverages compiler diagnostics; otherwise, it retrieves matched code segment pairs from the two codebases as mapping knowledge for mitigation. Experiments on two representative scenarios, cross-fork and cross-branch patch porting, show that MIP successfully resolves more than twice as many patches as the best-performing baseline in both settings. A user study with our industry partner further demonstrates its practical effectiveness.
Problem

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

patch porting
implicit inconsistencies
codebase variants
global mapping knowledge
non-local inconsistencies
Innovation

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

implicit inconsistencies
patch porting
large language model
compiler diagnostics
codebase mapping
🔎 Similar Papers
No similar papers found.