FA-75216 / CRDT convergence / Open access
Fractional position allocation: an open upper bound uses the largest digit instead of the base · case 01
Appending after a position ending in 8 or 9 goes deeper instead of using the free top digit.
ROOT CAUSE
An unconstrained upper digit is taken as BASE-1, excluding the top digit from the available room.
VERIFIED REPAIR
An unconstrained upper bound is BASE, one past the largest digit.
Unsuccessful approach: Using BASE+1 allocates the two-digit value 10 as a single digit, breaking the base-10 encoding.
Case contract
Starting from the given sorted positions, positions are digit lists in base 10 compared lexicographically and never ending in 0. Inserting at list index i allocates between the neighbours p (or [] at the start) and q (or [] at the end): walking depth d, lower digit a is p[d] or 0, upper digit b is q[d] while q still constrains (else 10); if b - a > 1 append (a+b)//2 and stop, else append a, and q stops constraining once a < b. Return positions as dotted strings in list order.
Why this case matters
Sequence CRDTs such as Logoot and LSEQ assign dense identifiers so that concurrent inserts never need renumbering.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(initial, inserts):
BASE = 10
lst = [list(p) for p in initial]
def between(p, q):
out = []
upper = True
d = 0
while True:
a = p[d] if d < len(p) else 0
b = q[d] if upper and d < len(q) else BASE - 1
if b - a > 1:
out.append((a + b) // 2)
return out
out.append(a)
if a < b:
upper = False
d += 1
for i in inserts:
p = lst[i - 1] if i > 0 else []
q = lst[i] if i < len(lst) else []
lst.insert(i, between(p, q))
return ['.'.join(str(x) for x in pos) for pos in lst]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {
1: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4]], ['5', '7', '8', '9', '9.5']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0]], ['0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2]], ['2', '5', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1]], ['1.2.9', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
2: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5]], ['5', '7', '8', '9', '9.5', '9.7']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0]], ['0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1]], ['2', '3', '5', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1]], ['1.2.9', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
3: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6]], ['5', '7', '8', '9', '9.5', '9.7', '9.8']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0]], ['0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3]], ['2', '3', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1]], ['1.2.9', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
4: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6, 7]], ['5', '7', '8', '9', '9.5', '9.7', '9.8', '9.9']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0, 0]], ['0.0.2', '0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3, 2]], ['2', '3', '4', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1, 1]], ['1.2.9', '1.2.9.5', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
5: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6, 7, 8]], ['5', '7', '8', '9', '9.5', '9.7', '9.8', '9.9', '9.9.5']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0, 0, 0]], ['0.0.1', '0.0.2', '0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3, 2, 1]], ['2', '2.5', '3', '4', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1, 1, 1]], ['1.2.9', '1.2.9.2', '1.2.9.5', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
}[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 |
|---|---|---|---|
| first insert | ['4'] | ['5'] | Failed |
| append repeatedly | ['4', '6', '7', '8', '8.4'] | ['5', '7', '8', '9', '9.5'] | Failed |
| prepend repeatedly | ['0.2', '0.4', '1', '2', '4'] | ['0.2', '0.5', '1', '2', '5'] | Failed |
| insert between adjacent digits | ['4', '4.2', '4.4', '5', '6'] | ['5', '5.2', '5.5', '6', '7'] | Failed |
| insert after a deep position | ['4', '4.4', '4.5', '4.6', '5', '6'] | ['5', '5.5', '5.6', '5.7', '6', '7'] | Failed |
| mixed positions | ['2', '4', '6'] | ['2', '5', '7'] | Failed |
| upper neighbour stops constraining after divergence | ['3.7', '3.8', '4.8'] | ['3.7', '3.8', '4.8'] | Passed |
| deep upper neighbour after a one-digit step | ['2', '2.2', '2.4', '3.1.4'] | ['2', '2.2', '2.5', '3.1.4'] | Failed |
| long lower neighbour below a deep upper neighbour | ['1.2.9', '1.5', '2.0.5'] | ['1.2.9', '1.6', '2.0.5'] | Failed |
| open end after high digits | ['8', '9.9', '9.9.4', '9.9.6'] | ['8', '9.9', '9.9.5', '9.9.7'] | Failed |
SHA-256 / bbbd58464e75abb40236a049502f3dc902086f140414b387363b85cddea1e6bd
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(initial, inserts):
BASE = 10
lst = [list(p) for p in initial]
def between(p, q):
out = []
upper = True
d = 0
while True:
a = p[d] if d < len(p) else 0
b = q[d] if upper and d < len(q) else BASE + 1
if b - a > 1:
out.append((a + b) // 2)
return out
out.append(a)
if a < b:
upper = False
d += 1
for i in inserts:
p = lst[i - 1] if i > 0 else []
q = lst[i] if i < len(lst) else []
lst.insert(i, between(p, q))
return ['.'.join(str(x) for x in pos) for pos in lst]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {
1: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4]], ['5', '7', '8', '9', '9.5']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0]], ['0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2]], ['2', '5', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1]], ['1.2.9', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
2: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5]], ['5', '7', '8', '9', '9.5', '9.7']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0]], ['0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1]], ['2', '3', '5', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1]], ['1.2.9', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
3: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6]], ['5', '7', '8', '9', '9.5', '9.7', '9.8']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0]], ['0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3]], ['2', '3', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1]], ['1.2.9', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
4: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6, 7]], ['5', '7', '8', '9', '9.5', '9.7', '9.8', '9.9']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0, 0]], ['0.0.2', '0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3, 2]], ['2', '3', '4', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1, 1]], ['1.2.9', '1.2.9.5', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
5: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6, 7, 8]], ['5', '7', '8', '9', '9.5', '9.7', '9.8', '9.9', '9.9.5']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0, 0, 0]], ['0.0.1', '0.0.2', '0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3, 2, 1]], ['2', '2.5', '3', '4', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1, 1, 1]], ['1.2.9', '1.2.9.2', '1.2.9.5', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
}[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 |
|---|---|---|---|
| first insert | ['5'] | ['5'] | Passed |
| append repeatedly | ['5', '8', '9', '10', '10.5'] | ['5', '7', '8', '9', '9.5'] | Failed |
| prepend repeatedly | ['0.2', '0.5', '1', '2', '5'] | ['0.2', '0.5', '1', '2', '5'] | Passed |
| insert between adjacent digits | ['5', '5.2', '5.5', '6', '8'] | ['5', '5.2', '5.5', '6', '7'] | Failed |
| insert after a deep position | ['5', '5.5', '5.6', '5.8', '6', '8'] | ['5', '5.5', '5.6', '5.7', '6', '7'] | Failed |
| mixed positions | ['2', '5', '8'] | ['2', '5', '7'] | Failed |
| upper neighbour stops constraining after divergence | ['3.7', '3.9', '4.8'] | ['3.7', '3.8', '4.8'] | Failed |
| deep upper neighbour after a one-digit step | ['2', '2.2', '2.5', '3.1.4'] | ['2', '2.2', '2.5', '3.1.4'] | Passed |
| long lower neighbour below a deep upper neighbour | ['1.2.9', '1.6', '2.0.5'] | ['1.2.9', '1.6', '2.0.5'] | Passed |
| open end after high digits | ['8', '9.9', '10', '10.5'] | ['8', '9.9', '9.9.5', '9.9.7'] | Failed |
SHA-256 / 11179a1c6f666ced678ebf84cdd00cbd3f31fc39fd2821fdcfdaf1411a45949e
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(initial, inserts):
BASE = 10
lst = [list(p) for p in initial]
def between(p, q):
out = []
upper = True
d = 0
while True:
a = p[d] if d < len(p) else 0
b = q[d] if upper and d < len(q) else BASE
if b - a > 1:
out.append((a + b) // 2)
return out
out.append(a)
if a < b:
upper = False
d += 1
for i in inserts:
p = lst[i - 1] if i > 0 else []
q = lst[i] if i < len(lst) else []
lst.insert(i, between(p, q))
return ['.'.join(str(x) for x in pos) for pos in lst]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {
1: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4]], ['5', '7', '8', '9', '9.5']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0]], ['0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2]], ['2', '5', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1]], ['1.2.9', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
2: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5]], ['5', '7', '8', '9', '9.5', '9.7']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0]], ['0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1]], ['2', '3', '5', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1]], ['1.2.9', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
3: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6]], ['5', '7', '8', '9', '9.5', '9.7', '9.8']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0]], ['0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3]], ['2', '3', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1]], ['1.2.9', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
4: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6, 7]], ['5', '7', '8', '9', '9.5', '9.7', '9.8', '9.9']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0, 0]], ['0.0.2', '0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3, 2]], ['2', '3', '4', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1, 1]], ['1.2.9', '1.2.9.5', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
5: [('first insert', [[], [0]], ['5']), ('append repeatedly', [[], [0, 1, 2, 3, 4, 5, 6, 7, 8]], ['5', '7', '8', '9', '9.5', '9.7', '9.8', '9.9', '9.9.5']), ('prepend repeatedly', [[], [0, 0, 0, 0, 0, 0, 0, 0, 0]], ['0.0.1', '0.0.2', '0.0.5', '0.1', '0.2', '0.5', '1', '2', '5']), ('insert between adjacent digits', [[], [0, 1, 1, 1, 1]], ['5', '5.2', '5.5', '6', '7']), ('insert after a deep position', [[], [0, 1, 1, 1, 2, 2]], ['5', '5.5', '5.6', '5.7', '6', '7']), ('mixed positions', [[], [0, 0, 2, 1, 3, 2, 1]], ['2', '2.5', '3', '4', '5', '6', '7']), ('upper neighbour stops constraining after divergence', [[[3, 7], [4, 8]], [1]], ['3.7', '3.8', '4.8']), ('deep upper neighbour after a one-digit step', [[[2], [3, 1, 4]], [1, 1]], ['2', '2.2', '2.5', '3.1.4']), ('long lower neighbour below a deep upper neighbour', [[[1, 2, 9], [2, 0, 5]], [1, 1, 1, 1, 1]], ['1.2.9', '1.2.9.2', '1.2.9.5', '1.3', '1.4', '1.6', '2.0.5']), ('open end after high digits', [[[8], [9, 9]], [2, 3]], ['8', '9.9', '9.9.5', '9.9.7'])],
}[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 |
|---|---|---|---|
| first insert | ['5'] | ['5'] | Passed |
| append repeatedly | ['5', '7', '8', '9', '9.5'] | ['5', '7', '8', '9', '9.5'] | Passed |
| prepend repeatedly | ['0.2', '0.5', '1', '2', '5'] | ['0.2', '0.5', '1', '2', '5'] | Passed |
| insert between adjacent digits | ['5', '5.2', '5.5', '6', '7'] | ['5', '5.2', '5.5', '6', '7'] | Passed |
| insert after a deep position | ['5', '5.5', '5.6', '5.7', '6', '7'] | ['5', '5.5', '5.6', '5.7', '6', '7'] | Passed |
| mixed positions | ['2', '5', '7'] | ['2', '5', '7'] | Passed |
| upper neighbour stops constraining after divergence | ['3.7', '3.8', '4.8'] | ['3.7', '3.8', '4.8'] | Passed |
| deep upper neighbour after a one-digit step | ['2', '2.2', '2.5', '3.1.4'] | ['2', '2.2', '2.5', '3.1.4'] | Passed |
| long lower neighbour below a deep upper neighbour | ['1.2.9', '1.6', '2.0.5'] | ['1.2.9', '1.6', '2.0.5'] | Passed |
| open end after high digits | ['8', '9.9', '9.9.5', '9.9.7'] | ['8', '9.9', '9.9.5', '9.9.7'] | Passed |
SHA-256 / bd37b7eca55f08422e58136c50140f65844f3d387bad6d401573033c75ecb949
Verification & scope
A deterministic, bounded teaching model of one replicated data type with stipulated operation and merge rules; it is not a production CRDT library and makes no claim of conformance to any specific published design. 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:04.161401+00:00.
Case digest / 466440f5fda2125dbb3b8abb8db85130347b39302f9cd8e0180e039cdee6a6bd