SWE-Git-Bench: A Worktree-Level Benchmark for Real Merge Conflict Resolution

Wei Zhang, Jian Yang, Jiajun Wu, Zidan Tang, Siwei WuNeurIPS 2026 Evaluations and Datasets Track Poster 2026

TL;DR

When two developers edit the same lines of code, git throws up its hands and leaves conflict markers in the file, waiting for a human to reconcile them. SWE-Git-Bench turns this everyday, commit-gating chore into a reproducible benchmark for large language models (LLMs). Evaluating 36 frontier models reveals a sobering gap: the best model reproduces the maintainer's exact merge only 26.5% of the time, and even "near-miss" edits that look 99% identical to the ground truth are unsafe half the time.

What Problem Does This Paper Address?

Most coding benchmarks test whether an AI can write a standalone function from scratch (like HumanEval) or fix a bug given an issue description and a test suite (like SWE-bench). Neither isolates a specific, high-stakes primitive that software engineers—and coding agents—face daily: merge conflict resolution.

When git encounters incompatible edits from two branches, it pauses and writes conflict markers (<<<<<<<, =======, >>>>>>>) into the worktree. There is no planning loop, no test oracle to lean on, and no license to rewrite unrelated code. The resolver just has to leave a single, valid file ready to commit. SWE-Git-Bench isolates this exact handoff point to see if LLMs actually understand how to reconcile divergent code.

Methods

To build a realistic testbed without synthetic shortcuts, the authors mined real two-parent merge commits from public GitHub repositories. For each merge triple—parent A ($P_A$), parent B ($P_B$), and the final maintainer-committed merge ($M$)—they replayed git merge --no-commit --no-ff locally and kept only the files where git actually produced conflict markers. The human-resolved file at $M$ serves as the ground truth.

Figure 1: SWE-Git-Bench construction and evaluation pipeline.

They evaluate models under two distinct prompt scopes:

  • WHOLE-FILE (WF): The primary task. The model receives the entire conflicted file and must output the full resolved file, testing both conflict resolution and context preservation.
  • CONFLICT-BLOCK (CB): An interface ablation. The model receives only the conflict block plus surrounding context and outputs a replacement block, which is then stitched back into the file.
Figure 2: Prompt-scope comparison. WHOLE-FILE is the primary file-artifact task; CONFLICT- BLOCK is an interface ablation.

Models are scored primarily on Exact Match (EM) against the normalized maintainer file, alongside diagnostic metrics like Edit Similarity (ES), Line Similarity (LS), and Block Accuracy (BA).

Datasets

SWE-Git-Bench is built from four existing SWE-bench-family source pools: Lite, Verified, Multilingual, and Multimodal. After replaying merges and auditing the outputs, the release contains 135 slice-counted conflicts and 185 conflicted-file examples spanning 23 repositories and 16 file types/extensions. (Collapsing overlap between Lite and Verified yields 129 unique merge commits and 179 unique conflicted files.) The authors also release canonical JSONL artifacts, scoring harnesses, model predictions, and Croissant/Responsible-AI metadata.

Key Insights and Ideas

  • An easier interface doesn't solve merge intent: Switching from WHOLE-FILE to CONFLICT-BLOCK prompting boosts average Edit Similarity by +19.2 percentage points (pp), because models no longer have to reproduce untouched surrounding code. Yet Exact Match barely budges (-0.1 pp). Localizing the prompt makes outputs look closer to the target, but doesn't help the model figure out which side's logic to keep.
  • High similarity is not a safety guarantee: Across all predictions, 62.8% are "near misses" (non-EM, but $\text{ES} \ge 0.90$). When the authors ran a human-checked audit on 80 whole-file predictions with $\text{ES} \ge 0.99$, 40 out of 80 (50%) were labeled likely unsafe. A single wrong character or dropped line can break behavior while barely denting edit similarity.
  • Top models fail on the same hard files: Using cross-model consensus to band file difficulty, 127 of the 185 files (68.6%) are "hard" (solved by $\le 10\%$ of models). Top-ranked models mostly overlap on the same easier/discriminative subset rather than solving distinct hard cases.

Key Results

In an April 19–22, 2026 snapshot of 36 LLM endpoints (33 with paired CONFLICT-BLOCK runs):

  • Low Exact Match: The top WHOLE-FILE model (Gemini-3-Pro) achieves 26.5% EM, followed closely by Kimi-K2.5 (25.7%) and GPT-5.4 (25.3%). The median across all 36 models is just 11.8%.
  • Oracle Ceiling: Combining the exact solutions of all 36 models in an oracle union still covers only 41.6% of the files.
  • Failure Modes: An automated taxonomy of 1,800 non-EM failures (using DeepSeek-V3.2 as a judge) attributes 34.3% to picking the wrong side, 31.8% to equivalent variants, 13.8% to format errors, 12.9% to truncation, and 7.2% to hallucinations.

Limitations and Future Work

The authors note that SWE-Git-Bench is a replayed SWE-bench-derived slice rather than a representative sample of all GitHub merge conflicts. Furthermore, Exact Match is a conservative metric: the maintainer's commit is a reproducible target, not a claim that no other valid resolution exists (as reflected by the ~17.5% equivalent/acceptable rate in the near-miss audit and ~31.8% in the automated taxonomy). They recommend that practitioners report Exact Match stratified by difficulty bands alongside similarity diagnostics rather than relying on aggregate scores alone.

Summary updated

BibTeX
@inproceedings{zhang2026swe,
  author = {Wei Zhang and Jian Yang and Jiajun Wu and Zidan Tang and Siwei Wu},
  title = {{SWE-Git-Bench: A Worktree-Level Benchmark for Real Merge Conflict Resolution}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=37pMYoL9Iz},
}
Figure