arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

MergirafSemi:一种与语言无关的半结构化合并工具

MergirafSemi: A Language-Agnostic Semistructured Merge Tool

Pedro Lopes, Paulo Borba, Paola Accioly, Guilherme Cavalcanti

arXiv 2608.11345首次发表:更新:

AI 中文总结

针对现有合并工具的局限,提出与语言无关的半结构化合并工具MergirafSemi,利用轻量级具体语法树平衡合并的准确性与效率,在真实场景中表现优于多数同类工具。

AI 中文摘要

开发者在整合并发变更时频繁面临合并冲突。多数合并工具依赖非结构化的行级比较,常产生虚假冲突且遗漏实际冲突。为解决这些局限,人们提出了感知结构的合并工具,其利用句法表示提升合并准确性。但全结构化工具可能产生更高的计算成本,而特定语言工具则需要大量开发与维护工作。为平衡这些权衡,我们提出了MergirafSemi,这是一种与语言无关的半结构化合并工具,它在无需完整结构建模或特定语言实现的情况下捕获结构信息,并在特定程序区域(如Java中的方法体)内应用行级合并。我们的工具利用轻量级具体语法树(Concrete Syntax Trees)指导合并决策,同时保持跨语言的灵活性与效率。我们通过对多种编程语言的真实合并场景进行实证研究来评估该工具,将其与非结构化、半结构化及结构化工具进行对比。结果显示,提升结构粒度可改善自动冲突解决,但也会导致更激进的合并决策,增加遗漏实际冲突的数量。相比之下,MergirafSemi实现了更平衡的权衡,减少了虚假冲突,同时在大多数常见场景中保持了有竞争力的准确性和更优的运行时性能。与非结构化工具相比,它大幅减少了虚假冲突;而与特定语言的半结构化工具相比,它达到了相当的有效性,同时表现出更稳健的执行行为且运行时开销显著更低。

英文摘要

Developers frequently face merge conflicts when integrating concurrent changes. Most merge tools rely on unstructured, line-based comparisons, often producing spurious conflicts and missing actual conflicts. To address these limitations, structure-aware merge tools have been proposed, which leverage syntactic representations to improve merge accuracy. However, fully structured tools may incur higher computational cost, and language-specific tools require significant development and maintenance effort. To balance these trade-offs, we propose MergirafSemi, a language-agnostic semistructured merge tool that captures structural information without requiring full structural modeling or language-specific implementations, and applies line-based merging within specific program regions, such as method bodies in Java. Our tool leverages lightweight Concrete Syntax Trees to guide merging decisions while preserving flexibility and efficiency across languages. We evaluate our tool through an empirical study on real-world merge scenarios across multiple programming languages, comparing it with unstructured, semistructured, and structured tools. Our results show that increasing structural granularity improves automatic conflict resolution but can also lead to more aggressive merge decisions, increasing the number of missed actual conflicts. In contrast, MergirafSemi achieves a more balanced trade-off, reducing spurious conflicts while maintaining competitive accuracy and better runtime performance in most common scenarios. Compared to an unstructured tool, it substantially reduces spurious conflicts, and when compared to a semistructured language-specific tool, it achieves comparable effectiveness while exhibiting more robust execution behavior and significantly lower runtime overhead.

Comments11 pages, 4 tables, and 5 figures

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑