Algebraic Merge Queues: bounding Git rebase conflicts without reading blobs
Correction in version 1.3 (26 Nov 2026). The disjoint-support theorem was one condition short. Version 1.2 wrote that a three-way merge with a single common base "cannot conflict between change sets on disjoint files"; a file dw on one branch and a file dw/inner.txt on the other share no path at all and still collide, because both want incompatible names for the same prefix — git merge-tree returns RC 1 with CONFLICT (file/directory) and dw displaced to dw~<oid> (measured on a synthetic repository, 2026-11-28). Until v0.8.0 the shortcut decided TEOREMA (commutes) on exactly that pair: a green verdict where the merge is red. Since v0.9.0 the shortcut requires disjoint support and no crossed prefix, publishes prefijo[] when it had to measure for that reason, and --lotes uses the same edge, so a promised CI batch cannot contain a d / d/x pair. On the real queue it costs nothing: 0 of 190 pairs carry a prefix collision and the matrix is identical. The same version makes the pairwise matrix usable outside a lab: ≈0.63 s per pair, 190 pairs in 114.6 s serially, 46.4 s with --jobs 8 and 43.8 s with 16, with all 190 rows identical field by field (the cost is spawning git, not computing). Correction in version 1.2 (26 Nov 2026). Version 1.1 stated that REBASAR_LIBRE is a proof because "no commit to replay means no path to see". That sentence is one condition short, and we falsified it on three subjects we do not own: 210 branches with work, each rebased for real in throwaway clones with --rebase-merges and rerere disabled. Of the 23 branches the bound declared free, the 22 with linear history rebased cleanly and the single one carrying an internal merge stopped on 3 conflicts (psf/requests pr/7065, merge fe0853c6). That merge is an evil merge: the merge-tree of its own two parents conflicts on the same three paths, so the resolution lived only in the merge's tree and the replay re-executes the conflict. With a merge inside base..ref the effective base of the replayed commits is older than the merge-base. The bound therefore requires linear history, not just disjoint classes; v0.8.0 of the software publishes that case as REBASAR_CON_MERGE_INTERNO and claims no proof for it. The bound itself does not move: 235 conflict paths across the three subjects, 233 inside the path-level bound, 234 inside a class. Raw artifacts that recompute this section are attached (coverage tables and the 23 verdicts). The attached nota-tecnica-en.md is the version-1.1 file including the new §6.1; its inline header still cites the 1.1 DOI, which this record supersedes — files of a published record are immutable here, so the correction travels in this description rather than in a rewrite of the file. Technical note + reproducible evidence (version 1.1). A merge queue is usually treated as a scheduling problem — in what order do we land these branches? This note shows that the expensive part is decidable before any merge, from tree metadata alone, by comparing rename classes instead of file names. The law. Group every path by its rename class: for a diff T..B, two names are in the same class iff git diff -M reports a rename (or copy) between them, transitively. Let C(B) be the set of classes whose paths the branch changes and whose paths the trunk also changed. Then C(B) = ∅ ⇒ rebase of B onto T produces no textual conflict. It is a bound, not an equality. Measured. On a live queue of 62 branches against a real trunk, the prescription produced 9/9 correct "no risk" verdicts, zero false safes, and its 46 predicted conflicts materialised on 109 paths of which 1 (0.9%) fell outside the declared classes. The name-based version of the same predicate is false: on the ten oldest open PRs of psf/requests, comparing names let 11 of 17 real rebase conflicts fall outside the prediction; comparing classes: 0 of 17. Totals after the correction: 27 branches, 27 conflicts, 0 escapes. Three ways the same measurement lied while looking healthy. (1) A denominator that named a dead population: of 309 origin/worker/* refs, 218 were already ancestors of the trunk, and "safe to rebase" was true of them only because a dead branch is safe — the live queue is 62. (2) An instrument: git rebase without --rebase-merges flattens merge commits and fabricates conflicts the repository does not have; git rebase --rebase-merges is required for the verdict to be about the repository. (3) New in 1.1 — a bound and an act that were not functions of the same object: the prescription is computed over the net diff base..ref while the act replays the commit graph, so paths created and deleted inside a branch, and conflicts living inside a replayed merge, are invisible to it by construction. New in 1.1: the cost of a flag, measured to zero coverage. Over 155 live branches the census took 561 s; the profile named one flag, --find-copies-harder, at 3 283 ms per diff against 101 ms without it. Removing it: 561 s → 40 s, 0 of 137 verdicts changed, and only 22 of 137 class lists narrowed. Rebasing those 22 for real produced 67 conflict paths: 3 inside the wide bound, the same 3 inside the narrow one, 0 covered only by the wide one. A second displacement paid down too: two git rev-list --count calls replaced by one --left-right --count, 57 ms against 228 ms. The note is written in English, 10 sections, with the exact commands to reproduce every figure on a disposable clone. Companion software (MIT): merge-lattice-governor — prefix-solvent merge planner and rebase prescription (v0.7.0, 138 tests, zero dependencies) composicion-core — pairwise AST/text lattice oracle py-test-shadow-guard — AST method-shadowing guard Files: nota-tecnica-en.md (the note, 11 777 B, md5 c4da36e061e9a03e94f35d3fe0164544) and evidencia_lotes_20261128.json (machine-readable evidence, 17 keys: both population frames, the 62-ref census, the instrument trap, the conflict mass, the cost of the copies flag and the coverage of the narrow bound). Source of this version: commit 838048a.
Authors
- Jose Alexis Roman Martinez (ORCID: https://orcid.org/0009-0001-9116-075X)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-26
- DOI
- https://doi.org/10.5281/zenodo.24548463
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00