FA-75506 / Text diff and three-way merge / Open access
Patience diff anchors: lines repeated in the new side become anchors · case 01
A line duplicated in the new file anchors to its last copy and misaligns the diff.
ROOT CAUSE
Candidates require uniqueness only in the old side.
VERIFIED REPAIR
Anchor only lines that occur exactly once on both sides.
Unsuccessful approach: Requiring uniqueness only in the new side admits lines repeated in the old side.
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 x in cb]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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], [1, 2], [2, 3]] | [[0, 1], [2, 3]] | Failed |
| 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 / 71ccc77f62652bcac3468b7915523534b824c82a8b62791a032a2402e70d8ccf
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 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 | [[2, 0], [3, 1]] | [[3, 1]] | Failed |
| 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 / d4c8255e277d46b105f5bebdf23e715b42e4d570f7b27d5caae2d309a041bff6
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.324765+00:00.
Case digest / 49ab4666ce64bba2f4a9b8bb095b7e171b6dc1b73a9d626e4ba2671f70fd329a