FAILURE MAP
← Case archive

FA-75511 / Text diff and three-way merge / Open access

Patience diff anchors: piles are keyed by old index instead of new index · case 01

Crossing unique lines are all kept as anchors, producing an inconsistent alignment.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The pile search bisects on old indices, which are always increasing, so every candidate extends the chain.

VERIFIED REPAIR

Bisect pile tops by the candidate's new-side index.

Unsuccessful approach: Searching old-index pile tops with the new index mixes coordinates and still misplaces candidates.

Case contract

Candidates are lines occurring exactly once in the old side and exactly once in the new side, as (old index, new index) pairs in old order. Keep the longest chain with increasing new index, found with patience piles (bisect on pile tops by new index, back pointers to the previous pile top) and reconstructed from the top of the last pile. Return the anchor pairs.

Why this case matters

Patience diff anchors on unique lines to produce readable diffs of code with many repeated braces and blank lines.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import bisect
import collections
N = 1
observations = []
def solve(a, b):
    ca = collections.Counter(a)
    cb = collections.Counter(b)
    posb = {x: j for j, x in enumerate(b)}
    cand = [(i, posb[x]) for i, x in enumerate(a) if ca[x] == 1 and cb.get(x, 0) == 1]
    tails = []
    back = {}
    for idx, (i, j) in enumerate(cand):
        lo = bisect.bisect_left([cand[t][0] for t in tails], i)
        if lo == len(tails):
            tails.append(idx)
        else:
            tails[lo] = idx
        back[idx] = tails[lo - 1] if lo > 0 else None
    res = []
    t = tails[-1] if tails else None
    while t is not None:
        res.append(list(cand[t]))
        t = back[t]
    return res[::-1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {
    1: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'k'], ['k', 'm0', 'm1', 'm2']], [[0, 1], [1, 2], [2, 3]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    2: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['u', 'v', 'w', 'p']], [[0, 0], [1, 1], [2, 2], [3, 3]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'k'], ['k', 'm0', 'm1', 'm2', 'm3']], [[0, 1], [1, 2], [2, 3], [3, 4]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    3: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    4: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['u', 'v', 'w', 'p']], [[0, 0], [1, 1], [2, 2], [3, 3]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'm5', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4', 'm5']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    5: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
}[N]
for label, args, expected in cases:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
unique lines in order[[0, 0], [2, 2], [3, 3]][[0, 0], [2, 2], [3, 3]]Passed
crossing unique lines keep the longest chain[[0, 2], [1, 0], [2, 1], [3, 3]][[1, 0], [2, 1], [3, 3]]Failed
duplicated in new side are not anchors[[0, 1], [2, 3]][[0, 1], [2, 3]]Passed
duplicated in old side are not anchors[[1, 2], [3, 1]][[3, 1]]Failed
no unique common lines[][]Passed
chain ends before the last candidate[[0, 3], [1, 0], [2, 1], [3, 2]][[1, 0], [2, 1], [3, 2]]Failed
later short chain[[0, 1], [1, 2], [2, 3], [3, 0]][[0, 1], [1, 2], [2, 3]]Failed
single candidate[[1, 0]][[1, 0]]Passed

SHA-256 / f3e4e22fe8df4306977da6e3b39cbf30765ccb06a3a043c3bf51bedeef3e9d3c

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import bisect
import collections
N = 1
observations = []
def solve(a, b):
    ca = collections.Counter(a)
    cb = collections.Counter(b)
    posb = {x: j for j, x in enumerate(b)}
    cand = [(i, posb[x]) for i, x in enumerate(a) if ca[x] == 1 and cb.get(x, 0) == 1]
    tails = []
    back = {}
    for idx, (i, j) in enumerate(cand):
        lo = bisect.bisect_left([cand[t][0] for t in tails], j)
        if lo == len(tails):
            tails.append(idx)
        else:
            tails[lo] = idx
        back[idx] = tails[lo - 1] if lo > 0 else None
    res = []
    t = tails[-1] if tails else None
    while t is not None:
        res.append(list(cand[t]))
        t = back[t]
    return res[::-1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {
    1: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'k'], ['k', 'm0', 'm1', 'm2']], [[0, 1], [1, 2], [2, 3]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    2: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['u', 'v', 'w', 'p']], [[0, 0], [1, 1], [2, 2], [3, 3]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'k'], ['k', 'm0', 'm1', 'm2', 'm3']], [[0, 1], [1, 2], [2, 3], [3, 4]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    3: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    4: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['u', 'v', 'w', 'p']], [[0, 0], [1, 1], [2, 2], [3, 3]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'm5', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4', 'm5']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    5: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
}[N]
for label, args, expected in cases:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
unique lines in order[[0, 0], [2, 2], [3, 3]][[0, 0], [2, 2], [3, 3]]Passed
crossing unique lines keep the longest chain[[2, 1], [3, 3]][[1, 0], [2, 1], [3, 3]]Failed
duplicated in new side are not anchors[[0, 1], [2, 3]][[0, 1], [2, 3]]Passed
duplicated in old side are not anchors[[3, 1]][[3, 1]]Passed
no unique common lines[][]Passed
chain ends before the last candidate[[3, 2]][[1, 0], [2, 1], [3, 2]]Failed
later short chain[[0, 1], [1, 2], [2, 3]][[0, 1], [1, 2], [2, 3]]Passed
single candidate[[1, 0]][[1, 0]]Passed

SHA-256 / b25897d93e8b3901e81589a39b219651c2b4d299c3456a46bf5f2d9de9157587

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import bisect
import collections
N = 1
observations = []
def solve(a, b):
    ca = collections.Counter(a)
    cb = collections.Counter(b)
    posb = {x: j for j, x in enumerate(b)}
    cand = [(i, posb[x]) for i, x in enumerate(a) if ca[x] == 1 and cb.get(x, 0) == 1]
    tails = []
    back = {}
    for idx, (i, j) in enumerate(cand):
        lo = bisect.bisect_left([cand[t][1] for t in tails], j)
        if lo == len(tails):
            tails.append(idx)
        else:
            tails[lo] = idx
        back[idx] = tails[lo - 1] if lo > 0 else None
    res = []
    t = tails[-1] if tails else None
    while t is not None:
        res.append(list(cand[t]))
        t = back[t]
    return res[::-1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {
    1: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'k'], ['k', 'm0', 'm1', 'm2']], [[0, 1], [1, 2], [2, 3]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    2: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['u', 'v', 'w', 'p']], [[0, 0], [1, 1], [2, 2], [3, 3]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'k'], ['k', 'm0', 'm1', 'm2', 'm3']], [[0, 1], [1, 2], [2, 3], [3, 4]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    3: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    4: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['u', 'v', 'w', 'p']], [[0, 0], [1, 1], [2, 2], [3, 3]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'm5', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4', 'm5']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
    5: [('unique lines in order', [['a', 'b', 'c', 'd'], ['a', 'x', 'c', 'd']], [[0, 0], [2, 2], [3, 3]]), ('crossing unique lines keep the longest chain', [['f1', 'f2', 'f3', 'g'], ['f2', 'f3', 'f1', 'g']], [[1, 0], [2, 1], [3, 3]]), ('duplicated in new side are not anchors', [['x', 'y', 'z'], ['y', 'x', 'y', 'z']], [[0, 1], [2, 3]]), ('duplicated in old side are not anchors', [['}', 'a', '}', 'b'], ['}', 'b', 'a']], [[3, 1]]), ('no unique common lines', [['r', 'r'], ['s', 's']], []), ('chain ends before the last candidate', [['u', 'v', 'w', 'p'], ['v', 'w', 'p', 'u']], [[1, 0], [2, 1], [3, 2]]), ('later short chain', [['m0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'k'], ['k', 'm0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6']], [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7]]), ('single candidate', [['q', 'z'], ['z', 'q', 'q']], [[1, 0]])],
}[N]
for label, args, expected in cases:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
unique lines in order[[0, 0], [2, 2], [3, 3]][[0, 0], [2, 2], [3, 3]]Passed
crossing unique lines keep the longest chain[[1, 0], [2, 1], [3, 3]][[1, 0], [2, 1], [3, 3]]Passed
duplicated in new side are not anchors[[0, 1], [2, 3]][[0, 1], [2, 3]]Passed
duplicated in old side are not anchors[[3, 1]][[3, 1]]Passed
no unique common lines[][]Passed
chain ends before the last candidate[[1, 0], [2, 1], [3, 2]][[1, 0], [2, 1], [3, 2]]Passed
later short chain[[0, 1], [1, 2], [2, 3]][[0, 1], [1, 2], [2, 3]]Passed
single candidate[[1, 0]][[1, 0]]Passed

SHA-256 / a4ca7ad5760d347b3246a7a4dd5466be1f11bce1a8b13acf73db996373b0bb00

Verification & scope

A deterministic, bounded teaching model of one diff, patch or merge rule with stipulated conventions; it is not a production diff or version-control implementation and makes no claim of conformance to any specific tool. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:49:07.355372+00:00.

Case digest / 53c0d41e952efcf83a4930cc6cf6c9307c8aa18fcef12f061bab7e8769a92989