{"abstract":"Replicas that receive the same formatting operations in different orders render different bold spans.","category":"CRDT convergence","checks":10,"contract":"A text of `length` characters receives [\"bold\"|\"unbold\", start, end, stamp] operations over half-open ranges clamped to the text. Each character takes the operation with the largest stamp (counter, replica) covering it; it is bold when that operation is \"bold\". Return maximal bold spans as [start, end) pairs in order.","evaluation_group":"w2-crdt-convergence-formatting-mark-spans","failed_approach":"Comparing only counters leaves equal-counter operations from different replicas in arrival order.","family":"w2-crdt-convergence-formatting-mark-spans-stamp-precedence","id":"FA-75146","implementations":{"attempt":{"sha256":"c36a8f083a2fcddaf2b286e81369bb87ab250f302f22ccc3eaa305bb1636ecd1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(length, ops):\n    best = [None] * length\n    for kind, start, end, stamp in ops:\n        st = tuple(stamp)\n        for i in range(max(start, 0), min(end, length)):\n            if best[i] is None or st[0] > best[i][0][0]:\n                best[i] = (st, kind)\n    spans = []\n    for i, b in enumerate(best):\n        if b is not None and b[1] == 'bold':\n            if spans and spans[-1][1] == i:\n                spans[-1][1] = i + 1\n            else:\n                spans.append([i, i + 1])\n    return spans\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = {\n    1: [('later unbold wins inside a bold range', [9, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [9, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [9, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [9, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [9, [['bold', 6, 9, [1, 'a']]]], [[6, 9]]), ('range end is exclusive', [9, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [9, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [9, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [9, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [9, [['bold', 8, 10, [1, 'a']], ['unbold', -1, 1, [2, 'a']]]], [[8, 9]])],\n    2: [('later unbold wins inside a bold range', [10, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [10, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [10, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [10, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [10, [['bold', 7, 10, [1, 'a']]]], [[7, 10]]), ('range end is exclusive', [10, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [10, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [10, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [10, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [10, [['bold', 9, 12, [1, 'a']], ['unbold', -2, 1, [2, 'a']]]], [[9, 10]])],\n    3: [('later unbold wins inside a bold range', [11, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [11, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [11, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [11, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [11, [['bold', 8, 11, [1, 'a']]]], [[8, 11]]), ('range end is exclusive', [11, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [11, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [11, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [11, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [11, [['bold', 10, 14, [1, 'a']], ['unbold', -3, 1, [2, 'a']]]], [[10, 11]])],\n    4: [('later unbold wins inside a bold range', [12, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [12, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [12, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [12, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [12, [['bold', 9, 12, [1, 'a']]]], [[9, 12]]), ('range end is exclusive', [12, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [12, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [12, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [12, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [12, [['bold', 11, 16, [1, 'a']], ['unbold', -4, 1, [2, 'a']]]], [[11, 12]])],\n    5: [('later unbold wins inside a bold range', [13, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [13, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [13, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [13, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [13, [['bold', 10, 13, [1, 'a']]]], [[10, 13]]), ('range end is exclusive', [13, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [13, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [13, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [13, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [13, [['bold', 12, 18, [1, 'a']], ['unbold', -5, 1, [2, 'a']]]], [[12, 13]])],\n}[N]\nfor label, args, expected in cases:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"cbcb06944c543548e5abf383e75e9e34908883072861cde0aae76adad6936cf3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(length, ops):\n    best = [None] * length\n    for kind, start, end, stamp in ops:\n        st = tuple(stamp)\n        for i in range(max(start, 0), min(end, length)):\n            best[i] = (st, kind)\n    spans = []\n    for i, b in enumerate(best):\n        if b is not None and b[1] == 'bold':\n            if spans and spans[-1][1] == i:\n                spans[-1][1] = i + 1\n            else:\n                spans.append([i, i + 1])\n    return spans\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = {\n    1: [('later unbold wins inside a bold range', [9, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [9, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [9, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [9, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [9, [['bold', 6, 9, [1, 'a']]]], [[6, 9]]), ('range end is exclusive', [9, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [9, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [9, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [9, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [9, [['bold', 8, 10, [1, 'a']], ['unbold', -1, 1, [2, 'a']]]], [[8, 9]])],\n    2: [('later unbold wins inside a bold range', [10, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [10, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [10, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [10, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [10, [['bold', 7, 10, [1, 'a']]]], [[7, 10]]), ('range end is exclusive', [10, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [10, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [10, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [10, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [10, [['bold', 9, 12, [1, 'a']], ['unbold', -2, 1, [2, 'a']]]], [[9, 10]])],\n    3: [('later unbold wins inside a bold range', [11, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [11, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [11, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [11, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [11, [['bold', 8, 11, [1, 'a']]]], [[8, 11]]), ('range end is exclusive', [11, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [11, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [11, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [11, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [11, [['bold', 10, 14, [1, 'a']], ['unbold', -3, 1, [2, 'a']]]], [[10, 11]])],\n    4: [('later unbold wins inside a bold range', [12, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [12, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [12, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [12, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [12, [['bold', 9, 12, [1, 'a']]]], [[9, 12]]), ('range end is exclusive', [12, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [12, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [12, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [12, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [12, [['bold', 11, 16, [1, 'a']], ['unbold', -4, 1, [2, 'a']]]], [[11, 12]])],\n    5: [('later unbold wins inside a bold range', [13, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [13, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [13, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [13, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [13, [['bold', 10, 13, [1, 'a']]]], [[10, 13]]), ('range end is exclusive', [13, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [13, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [13, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [13, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [13, [['bold', 12, 18, [1, 'a']], ['unbold', -5, 1, [2, 'a']]]], [[12, 13]])],\n}[N]\nfor label, args, expected in cases:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"21c8eaa45830efc45a72b6b5b3a268b3a1405e8bbf2c11fe819a0647666b0375","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(length, ops):\n    best = [None] * length\n    for kind, start, end, stamp in ops:\n        st = tuple(stamp)\n        for i in range(max(start, 0), min(end, length)):\n            if best[i] is None or st > best[i][0]:\n                best[i] = (st, kind)\n    spans = []\n    for i, b in enumerate(best):\n        if b is not None and b[1] == 'bold':\n            if spans and spans[-1][1] == i:\n                spans[-1][1] = i + 1\n            else:\n                spans.append([i, i + 1])\n    return spans\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = {\n    1: [('later unbold wins inside a bold range', [9, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [9, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [9, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [9, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [9, [['bold', 6, 9, [1, 'a']]]], [[6, 9]]), ('range end is exclusive', [9, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [9, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [9, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [9, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [9, [['bold', 8, 10, [1, 'a']], ['unbold', -1, 1, [2, 'a']]]], [[8, 9]])],\n    2: [('later unbold wins inside a bold range', [10, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [10, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [10, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [10, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [10, [['bold', 7, 10, [1, 'a']]]], [[7, 10]]), ('range end is exclusive', [10, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [10, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [10, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [10, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [10, [['bold', 9, 12, [1, 'a']], ['unbold', -2, 1, [2, 'a']]]], [[9, 10]])],\n    3: [('later unbold wins inside a bold range', [11, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [11, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [11, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [11, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [11, [['bold', 8, 11, [1, 'a']]]], [[8, 11]]), ('range end is exclusive', [11, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [11, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [11, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [11, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [11, [['bold', 10, 14, [1, 'a']], ['unbold', -3, 1, [2, 'a']]]], [[10, 11]])],\n    4: [('later unbold wins inside a bold range', [12, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [12, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [12, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [12, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [12, [['bold', 9, 12, [1, 'a']]]], [[9, 12]]), ('range end is exclusive', [12, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [12, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [12, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [12, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [12, [['bold', 11, 16, [1, 'a']], ['unbold', -4, 1, [2, 'a']]]], [[11, 12]])],\n    5: [('later unbold wins inside a bold range', [13, [['bold', 0, 6, [1, 'a']], ['unbold', 2, 4, [2, 'b']]]], [[0, 2], [4, 6]]), ('arrival order does not matter', [13, [['unbold', 2, 4, [2, 'b']], ['bold', 0, 6, [1, 'a']]]], [[0, 2], [4, 6]]), ('equal counters break by replica', [13, [['bold', 1, 5, [3, 'b']], ['unbold', 3, 7, [3, 'a']]]], [[1, 5]]), ('equal counters other arrival', [13, [['unbold', 3, 7, [3, 'a']], ['bold', 1, 5, [3, 'b']]]], [[1, 5]]), ('mark reaching the end of text', [13, [['bold', 10, 13, [1, 'a']]]], [[10, 13]]), ('range end is exclusive', [13, [['bold', 2, 3, [1, 'a']], ['bold', 5, 6, [2, 'a']]]], [[2, 3], [5, 6]]), ('adjacent ranges join', [13, [['bold', 0, 2, [1, 'a']], ['bold', 2, 4, [1, 'b']]]], [[0, 4]]), ('one-character gap stays split', [13, [['bold', 0, 2, [1, 'a']], ['bold', 3, 5, [1, 'b']]]], [[0, 2], [3, 5]]), ('range starting before the text is clamped', [13, [['bold', -2, 2, [1, 'a']]]], [[0, 2]]), ('range past the end is clamped', [13, [['bold', 12, 18, [1, 'a']], ['unbold', -5, 1, [2, 'a']]]], [[12, 13]])],\n}[N]\nfor label, args, expected in cases:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-crdt-convergence-formatting-mark-spans-stamp-precedence","generated_at":"2026-09-29T14:49:03.514527+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Rich-text CRDTs must resolve overlapping formatting operations identically regardless of arrival order.","repair":"Keep, per character, the operation with the largest (counter, replica) stamp.","root_cause":"Each covered character takes whichever operation was applied last instead of the one with the largest stamp.","sha256":"98b8bec197e9527f9c560ca63680cf6bcf81d55de1fb6eb16ae0d1603af3942e","title":"Formatting mark spans: the last delivered operation wins · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.321,"exit_code":1,"observations":[{"actual":[[0,2],[4,6]],"check":"later unbold wins inside a bold range","expected":[[0,2],[4,6]],"passed":true},{"actual":[[0,2],[4,6]],"check":"arrival order does not matter","expected":[[0,2],[4,6]],"passed":true},{"actual":[[1,5]],"check":"equal counters break by replica","expected":[[1,5]],"passed":true},{"actual":[[1,3]],"check":"equal counters other arrival","expected":[[1,5]],"passed":false},{"actual":[[6,9]],"check":"mark reaching the end of text","expected":[[6,9]],"passed":true},{"actual":[[2,3],[5,6]],"check":"range end is exclusive","expected":[[2,3],[5,6]],"passed":true},{"actual":[[0,4]],"check":"adjacent ranges join","expected":[[0,4]],"passed":true},{"actual":[[0,2],[3,5]],"check":"one-character gap stays split","expected":[[0,2],[3,5]],"passed":true},{"actual":[[0,2]],"check":"range starting before the text is clamped","expected":[[0,2]],"passed":true},{"actual":[[8,9]],"check":"range past the end is clamped","expected":[[8,9]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"later unbold wins inside a bold range\", \"actual\": [[0, 2], [4, 6]], \"expected\": [[0, 2], [4, 6]], \"passed\": true}, {\"check\": \"arrival order does not matter\", \"actual\": [[0, 2], [4, 6]], \"expected\": [[0, 2], [4, 6]], \"passed\": true}, {\"check\": \"equal counters break by replica\", \"actual\": [[1, 5]], \"expected\": [[1, 5]], \"passed\": true}, {\"check\": \"equal counters other arrival\", \"actual\": [[1, 3]], \"expected\": [[1, 5]], \"passed\": false}, {\"check\": \"mark reaching the end of text\", \"actual\": [[6, 9]], \"expected\": [[6, 9]], \"passed\": true}, {\"check\": \"range end is exclusive\", \"actual\": [[2, 3], [5, 6]], \"expected\": [[2, 3], [5, 6]], \"passed\": true}, {\"check\": \"adjacent ranges join\", \"actual\": [[0, 4]], \"expected\": [[0, 4]], \"passed\": true}, {\"check\": \"one-character gap stays split\", \"actual\": [[0, 2], [3, 5]], \"expected\": [[0, 2], [3, 5]], \"passed\": true}, {\"check\": \"range starting before the text is clamped\", \"actual\": [[0, 2]], \"expected\": [[0, 2]], \"passed\": true}, {\"check\": \"range past the end is clamped\", \"actual\": [[8, 9]], \"expected\": [[8, 9]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.308,"exit_code":1,"observations":[{"actual":[[0,2],[4,6]],"check":"later unbold wins inside a bold range","expected":[[0,2],[4,6]],"passed":true},{"actual":[[0,6]],"check":"arrival order does not matter","expected":[[0,2],[4,6]],"passed":false},{"actual":[[1,3]],"check":"equal counters break by replica","expected":[[1,5]],"passed":false},{"actual":[[1,5]],"check":"equal counters other arrival","expected":[[1,5]],"passed":true},{"actual":[[6,9]],"check":"mark reaching the end of text","expected":[[6,9]],"passed":true},{"actual":[[2,3],[5,6]],"check":"range end is exclusive","expected":[[2,3],[5,6]],"passed":true},{"actual":[[0,4]],"check":"adjacent ranges join","expected":[[0,4]],"passed":true},{"actual":[[0,2],[3,5]],"check":"one-character gap stays split","expected":[[0,2],[3,5]],"passed":true},{"actual":[[0,2]],"check":"range starting before the text is clamped","expected":[[0,2]],"passed":true},{"actual":[[8,9]],"check":"range past the end is clamped","expected":[[8,9]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"later unbold wins inside a bold range\", \"actual\": [[0, 2], [4, 6]], \"expected\": [[0, 2], [4, 6]], \"passed\": true}, {\"check\": \"arrival order does not matter\", \"actual\": [[0, 6]], \"expected\": [[0, 2], [4, 6]], \"passed\": false}, {\"check\": \"equal counters break by replica\", \"actual\": [[1, 3]], \"expected\": [[1, 5]], \"passed\": false}, {\"check\": \"equal counters other arrival\", \"actual\": [[1, 5]], \"expected\": [[1, 5]], \"passed\": true}, {\"check\": \"mark reaching the end of text\", \"actual\": [[6, 9]], \"expected\": [[6, 9]], \"passed\": true}, {\"check\": \"range end is exclusive\", \"actual\": [[2, 3], [5, 6]], \"expected\": [[2, 3], [5, 6]], \"passed\": true}, {\"check\": \"adjacent ranges join\", \"actual\": [[0, 4]], \"expected\": [[0, 4]], \"passed\": true}, {\"check\": \"one-character gap stays split\", \"actual\": [[0, 2], [3, 5]], \"expected\": [[0, 2], [3, 5]], \"passed\": true}, {\"check\": \"range starting before the text is clamped\", \"actual\": [[0, 2]], \"expected\": [[0, 2]], \"passed\": true}, {\"check\": \"range past the end is clamped\", \"actual\": [[8, 9]], \"expected\": [[8, 9]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.394,"exit_code":0,"observations":[{"actual":[[0,2],[4,6]],"check":"later unbold wins inside a bold range","expected":[[0,2],[4,6]],"passed":true},{"actual":[[0,2],[4,6]],"check":"arrival order does not matter","expected":[[0,2],[4,6]],"passed":true},{"actual":[[1,5]],"check":"equal counters break by replica","expected":[[1,5]],"passed":true},{"actual":[[1,5]],"check":"equal counters other arrival","expected":[[1,5]],"passed":true},{"actual":[[6,9]],"check":"mark reaching the end of text","expected":[[6,9]],"passed":true},{"actual":[[2,3],[5,6]],"check":"range end is exclusive","expected":[[2,3],[5,6]],"passed":true},{"actual":[[0,4]],"check":"adjacent ranges join","expected":[[0,4]],"passed":true},{"actual":[[0,2],[3,5]],"check":"one-character gap stays split","expected":[[0,2],[3,5]],"passed":true},{"actual":[[0,2]],"check":"range starting before the text is clamped","expected":[[0,2]],"passed":true},{"actual":[[8,9]],"check":"range past the end is clamped","expected":[[8,9]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"later unbold wins inside a bold range\", \"actual\": [[0, 2], [4, 6]], \"expected\": [[0, 2], [4, 6]], \"passed\": true}, {\"check\": \"arrival order does not matter\", \"actual\": [[0, 2], [4, 6]], \"expected\": [[0, 2], [4, 6]], \"passed\": true}, {\"check\": \"equal counters break by replica\", \"actual\": [[1, 5]], \"expected\": [[1, 5]], \"passed\": true}, {\"check\": \"equal counters other arrival\", \"actual\": [[1, 5]], \"expected\": [[1, 5]], \"passed\": true}, {\"check\": \"mark reaching the end of text\", \"actual\": [[6, 9]], \"expected\": [[6, 9]], \"passed\": true}, {\"check\": \"range end is exclusive\", \"actual\": [[2, 3], [5, 6]], \"expected\": [[2, 3], [5, 6]], \"passed\": true}, {\"check\": \"adjacent ranges join\", \"actual\": [[0, 4]], \"expected\": [[0, 4]], \"passed\": true}, {\"check\": \"one-character gap stays split\", \"actual\": [[0, 2], [3, 5]], \"expected\": [[0, 2], [3, 5]], \"passed\": true}, {\"check\": \"range starting before the text is clamped\", \"actual\": [[0, 2]], \"expected\": [[0, 2]], \"passed\": true}, {\"check\": \"range past the end is clamped\", \"actual\": [[8, 9]], \"expected\": [[8, 9]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}