FAILURE MAP
← Case archive

FA-78006 / Subtitle cue timing / Open access

Minimum cue duration extension: neighbour ordering · case 01

In files with out-of-order cues the extension is limited by the wrong neighbour.

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

ROOT CAUSE

Neighbours are ordered by end time instead of start time.

VERIFIED REPAIR

Order neighbours by start time, then input index.

Unsuccessful approach: Using input order assumes the file is already sorted, which the contract does not guarantee.

Case contract

Cues [start,end] may be unsorted; the neighbour of a cue is the next cue in (start, input index) order. A cue shorter than min_dur has its end extended to start+min_dur, limited to neighbour_start - min_gap; an end is never shortened. Output keeps input order.

Why this case matters

Subtitle timing defects shift, hide or overlap captions that viewers depend on for comprehension and accessibility.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cues, min_dur, min_gap):
    out=[list(c) for c in cues]
    order=sorted(range(len(out)),key=lambda k:(out[k][1],k))
    for pos,i in enumerate(order):
        c=out[i]
        if c[1]-c[0]>=min_dur:
            continue
        target=c[0]+min_dur
        if pos+1<len(order):
            target=min(target,out[order[pos+1]][0]-min_gap)
        c[1]=max(c[1],target)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: neighbour ordering', [[[1000, 1960], [2000, 2300], [3000, 3999], [3000, 3001]], 1000, 40], [[1000, 1960], [2000, 2960], [3000, 3999], [3000, 4000]]), ('regression variant: neighbour ordering', [[[0, 2000], [200, 500]], 700, 80], [[0, 2000], [200, 900]]), ('partial repair probe: neighbour ordering', [[[2000, 2001], [800, 1100]], 1000, 80], [[2000, 3000], [800, 1800]]), ('partial repair variant: neighbour ordering', [[[500, 501], [200, 1160], [0, 1], [500, 1460]], 1000, 40], [[500, 501], [200, 1160], [0, 160], [500, 1500]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('normal control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[0, 1], [200, 900], [2000, 4000]], 700, 0], [[0, 200], [200, 900], [2000, 4000]]), ('normal control', [[[1500, 2700], [1500, 2700]], 1200, 0], [[1500, 2700], [1500, 2700]])], [('regression: neighbour ordering', [[[200, 500], [500, 800], [1500, 3500], [1500, 2699], [2000, 2001]], 1200, 40], [[200, 500], [500, 1460], [1500, 3500], [1500, 2699], [2000, 3200]]), ('regression variant: neighbour ordering', [[[800, 2800], [800, 900], [1500, 1501], [1000, 1700], [3000, 3300]], 700, 0], [[800, 2800], [800, 1000], [1500, 2200], [1000, 1700], [3000, 3700]]), ('partial repair probe: neighbour ordering', [[[0, 1001], [1500, 2500], [3000, 3999], [800, 2800], [0, 1]], 1000, 0], [[0, 1001], [1500, 2500], [3000, 4000], [800, 2800], [0, 800]]), ('partial repair variant: neighbour ordering', [[[200, 900], [0, 699], [800, 2800]], 700, 0], [[200, 900], [0, 699], [800, 2800]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[0, 700], [1000, 1001], [2000, 2699]], 700, 80], [[0, 700], [1000, 1700], [2000, 2700]]), ('normal control', [[[2000, 2100], [3000, 3001]], 700, 0], [[2000, 2700], [3000, 3700]]), ('normal control', [[[200, 1201], [2000, 3001], [1000, 2000], [800, 1800]], 1000, 0], [[200, 1201], [2000, 3001], [1000, 2000], [800, 1800]])], [('regression: neighbour ordering', [[[0, 1001], [1500, 2500], [3000, 3999], [800, 2800], [0, 1]], 1000, 0], [[0, 1001], [1500, 2500], [3000, 4000], [800, 2800], [0, 800]]), ('regression variant: neighbour ordering', [[[3000, 3100], [500, 2500], [2000, 2700], [1131, 1831], [0, 100]], 700, 0], [[3000, 3700], [500, 2500], [2000, 2700], [1131, 1831], [0, 500]]), ('partial repair probe: neighbour ordering', [[[479, 2479], [2000, 2300], [1000, 2120], [800, 2001]], 1200, 80], [[479, 2479], [2000, 3200], [1000, 2120], [800, 2001]]), ('partial repair variant: neighbour ordering', [[[500, 1701], [200, 201], [1000, 1001]], 1200, 0], [[500, 1701], [200, 500], [1000, 2200]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('normal control', [[[500, 501]], 1200, 40], [[500, 1700]]), ('normal control', [[[500, 1200], [1000, 1699]], 700, 0], [[500, 1200], [1000, 1700]]), ('normal control', [[[1500, 3500]], 700, 0], [[1500, 3500]])], [('regression: neighbour ordering', [[[500, 800], [500, 2500], [800, 1799], [1000, 1001], [1000, 3000]], 1000, 40], [[500, 800], [500, 2500], [800, 1799], [1000, 1001], [1000, 3000]]), ('regression variant: neighbour ordering', [[[0, 2000], [200, 1160], [500, 1499], [1186, 1187], [2429, 3430]], 1000, 40], [[0, 2000], [200, 1160], [500, 1499], [1186, 2186], [2429, 3430]]), ('partial repair probe: neighbour ordering', [[[2000, 2999], [500, 1501]], 1000, 80], [[2000, 3000], [500, 1501]]), ('partial repair variant: neighbour ordering', [[[1000, 2000], [0, 1000], [3000, 3999], [2000, 2300], [500, 1500]], 1000, 0], [[1000, 2000], [0, 1000], [3000, 4000], [2000, 3000], [500, 1500]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('normal control', [[[1500, 1600], [1500, 1600], [2000, 3200], [3000, 5000]], 1200, 0], [[1500, 1600], [1500, 2000], [2000, 3200], [3000, 5000]]), ('normal control', [[[1000, 1701], [1500, 2200]], 700, 80], [[1000, 1701], [1500, 2200]]), ('normal control', [[[200, 300], [800, 801]], 1000, 80], [[200, 720], [800, 1800]])], [('regression: neighbour ordering', [[[479, 2479], [2000, 2300], [1000, 2120], [800, 2001]], 1200, 80], [[479, 2479], [2000, 3200], [1000, 2120], [800, 2001]]), ('regression variant: neighbour ordering', [[[500, 2500], [500, 1120], [1000, 1699], [2000, 2701], [2766, 3465]], 700, 80], [[500, 2500], [500, 1120], [1000, 1700], [2000, 2701], [2766, 3466]]), ('partial repair probe: neighbour ordering', [[[800, 2800], [800, 900], [1500, 1501], [1000, 1700], [3000, 3300]], 700, 0], [[800, 2800], [800, 1000], [1500, 2200], [1000, 1700], [3000, 3700]]), ('partial repair variant: neighbour ordering', [[[1000, 3000], [3955, 4055], [208, 1207], [1500, 2420]], 1000, 80], [[1000, 3000], [3955, 4955], [208, 1207], [1500, 2500]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[209, 1409], [800, 2001], [1500, 2620]], 1200, 80], [[209, 1409], [800, 2001], [1500, 2700]]), ('normal control', [[[0, 701], [800, 1460], [800, 2800], [4594, 4894]], 700, 40], [[0, 701], [800, 1460], [800, 2800], [4594, 5294]]), ('normal control', [[[200, 500], [1394, 2593], [3000, 3300]], 1200, 80], [[200, 1314], [1394, 2594], [3000, 4200]])]]
for label, args, expected in fixtures[N-1]:
    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
regression: neighbour ordering[[1000, 1960], [2000, 2960], [3000, 4000], [3000, 3001]][[1000, 1960], [2000, 2960], [3000, 3999], [3000, 4000]]Failed
regression variant: neighbour ordering[[0, 2000], [200, 500]][[0, 2000], [200, 900]]Failed
partial repair probe: neighbour ordering[[2000, 3000], [800, 1800]][[2000, 3000], [800, 1800]]Passed
partial repair variant: neighbour ordering[[500, 501], [200, 1160], [0, 460], [500, 1500]][[500, 501], [200, 1160], [0, 160], [500, 1500]]Failed
boundary control[[0, 1000], [2000, 3000]][[0, 1000], [2000, 3000]]Passed
boundary control[[0, 420], [500, 3000]][[0, 420], [500, 3000]]Passed
normal control[[0, 1000]][[0, 1000]]Passed
normal control[[0, 200], [200, 900], [2000, 4000]][[0, 200], [200, 900], [2000, 4000]]Passed
normal control[[1500, 2700], [1500, 2700]][[1500, 2700], [1500, 2700]]Passed

SHA-256 / 95826cb2917c4f91c0e6c14e4705155e00b94a260462be1240286fabd1bd1c11

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cues, min_dur, min_gap):
    out=[list(c) for c in cues]
    order=list(range(len(out)))
    for pos,i in enumerate(order):
        c=out[i]
        if c[1]-c[0]>=min_dur:
            continue
        target=c[0]+min_dur
        if pos+1<len(order):
            target=min(target,out[order[pos+1]][0]-min_gap)
        c[1]=max(c[1],target)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: neighbour ordering', [[[1000, 1960], [2000, 2300], [3000, 3999], [3000, 3001]], 1000, 40], [[1000, 1960], [2000, 2960], [3000, 3999], [3000, 4000]]), ('regression variant: neighbour ordering', [[[0, 2000], [200, 500]], 700, 80], [[0, 2000], [200, 900]]), ('partial repair probe: neighbour ordering', [[[2000, 2001], [800, 1100]], 1000, 80], [[2000, 3000], [800, 1800]]), ('partial repair variant: neighbour ordering', [[[500, 501], [200, 1160], [0, 1], [500, 1460]], 1000, 40], [[500, 501], [200, 1160], [0, 160], [500, 1500]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('normal control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[0, 1], [200, 900], [2000, 4000]], 700, 0], [[0, 200], [200, 900], [2000, 4000]]), ('normal control', [[[1500, 2700], [1500, 2700]], 1200, 0], [[1500, 2700], [1500, 2700]])], [('regression: neighbour ordering', [[[200, 500], [500, 800], [1500, 3500], [1500, 2699], [2000, 2001]], 1200, 40], [[200, 500], [500, 1460], [1500, 3500], [1500, 2699], [2000, 3200]]), ('regression variant: neighbour ordering', [[[800, 2800], [800, 900], [1500, 1501], [1000, 1700], [3000, 3300]], 700, 0], [[800, 2800], [800, 1000], [1500, 2200], [1000, 1700], [3000, 3700]]), ('partial repair probe: neighbour ordering', [[[0, 1001], [1500, 2500], [3000, 3999], [800, 2800], [0, 1]], 1000, 0], [[0, 1001], [1500, 2500], [3000, 4000], [800, 2800], [0, 800]]), ('partial repair variant: neighbour ordering', [[[200, 900], [0, 699], [800, 2800]], 700, 0], [[200, 900], [0, 699], [800, 2800]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[0, 700], [1000, 1001], [2000, 2699]], 700, 80], [[0, 700], [1000, 1700], [2000, 2700]]), ('normal control', [[[2000, 2100], [3000, 3001]], 700, 0], [[2000, 2700], [3000, 3700]]), ('normal control', [[[200, 1201], [2000, 3001], [1000, 2000], [800, 1800]], 1000, 0], [[200, 1201], [2000, 3001], [1000, 2000], [800, 1800]])], [('regression: neighbour ordering', [[[0, 1001], [1500, 2500], [3000, 3999], [800, 2800], [0, 1]], 1000, 0], [[0, 1001], [1500, 2500], [3000, 4000], [800, 2800], [0, 800]]), ('regression variant: neighbour ordering', [[[3000, 3100], [500, 2500], [2000, 2700], [1131, 1831], [0, 100]], 700, 0], [[3000, 3700], [500, 2500], [2000, 2700], [1131, 1831], [0, 500]]), ('partial repair probe: neighbour ordering', [[[479, 2479], [2000, 2300], [1000, 2120], [800, 2001]], 1200, 80], [[479, 2479], [2000, 3200], [1000, 2120], [800, 2001]]), ('partial repair variant: neighbour ordering', [[[500, 1701], [200, 201], [1000, 1001]], 1200, 0], [[500, 1701], [200, 500], [1000, 2200]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('normal control', [[[500, 501]], 1200, 40], [[500, 1700]]), ('normal control', [[[500, 1200], [1000, 1699]], 700, 0], [[500, 1200], [1000, 1700]]), ('normal control', [[[1500, 3500]], 700, 0], [[1500, 3500]])], [('regression: neighbour ordering', [[[500, 800], [500, 2500], [800, 1799], [1000, 1001], [1000, 3000]], 1000, 40], [[500, 800], [500, 2500], [800, 1799], [1000, 1001], [1000, 3000]]), ('regression variant: neighbour ordering', [[[0, 2000], [200, 1160], [500, 1499], [1186, 1187], [2429, 3430]], 1000, 40], [[0, 2000], [200, 1160], [500, 1499], [1186, 2186], [2429, 3430]]), ('partial repair probe: neighbour ordering', [[[2000, 2999], [500, 1501]], 1000, 80], [[2000, 3000], [500, 1501]]), ('partial repair variant: neighbour ordering', [[[1000, 2000], [0, 1000], [3000, 3999], [2000, 2300], [500, 1500]], 1000, 0], [[1000, 2000], [0, 1000], [3000, 4000], [2000, 3000], [500, 1500]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('normal control', [[[1500, 1600], [1500, 1600], [2000, 3200], [3000, 5000]], 1200, 0], [[1500, 1600], [1500, 2000], [2000, 3200], [3000, 5000]]), ('normal control', [[[1000, 1701], [1500, 2200]], 700, 80], [[1000, 1701], [1500, 2200]]), ('normal control', [[[200, 300], [800, 801]], 1000, 80], [[200, 720], [800, 1800]])], [('regression: neighbour ordering', [[[479, 2479], [2000, 2300], [1000, 2120], [800, 2001]], 1200, 80], [[479, 2479], [2000, 3200], [1000, 2120], [800, 2001]]), ('regression variant: neighbour ordering', [[[500, 2500], [500, 1120], [1000, 1699], [2000, 2701], [2766, 3465]], 700, 80], [[500, 2500], [500, 1120], [1000, 1700], [2000, 2701], [2766, 3466]]), ('partial repair probe: neighbour ordering', [[[800, 2800], [800, 900], [1500, 1501], [1000, 1700], [3000, 3300]], 700, 0], [[800, 2800], [800, 1000], [1500, 2200], [1000, 1700], [3000, 3700]]), ('partial repair variant: neighbour ordering', [[[1000, 3000], [3955, 4055], [208, 1207], [1500, 2420]], 1000, 80], [[1000, 3000], [3955, 4955], [208, 1207], [1500, 2500]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[209, 1409], [800, 2001], [1500, 2620]], 1200, 80], [[209, 1409], [800, 2001], [1500, 2700]]), ('normal control', [[[0, 701], [800, 1460], [800, 2800], [4594, 4894]], 700, 40], [[0, 701], [800, 1460], [800, 2800], [4594, 5294]]), ('normal control', [[[200, 500], [1394, 2593], [3000, 3300]], 1200, 80], [[200, 1314], [1394, 2594], [3000, 4200]])]]
for label, args, expected in fixtures[N-1]:
    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
regression: neighbour ordering[[1000, 1960], [2000, 2960], [3000, 3999], [3000, 4000]][[1000, 1960], [2000, 2960], [3000, 3999], [3000, 4000]]Passed
regression variant: neighbour ordering[[0, 2000], [200, 900]][[0, 2000], [200, 900]]Passed
partial repair probe: neighbour ordering[[2000, 2001], [800, 1800]][[2000, 3000], [800, 1800]]Failed
partial repair variant: neighbour ordering[[500, 501], [200, 1160], [0, 460], [500, 1500]][[500, 501], [200, 1160], [0, 160], [500, 1500]]Failed
boundary control[[0, 1000], [2000, 3000]][[0, 1000], [2000, 3000]]Passed
boundary control[[0, 420], [500, 3000]][[0, 420], [500, 3000]]Passed
normal control[[0, 1000]][[0, 1000]]Passed
normal control[[0, 200], [200, 900], [2000, 4000]][[0, 200], [200, 900], [2000, 4000]]Passed
normal control[[1500, 2700], [1500, 2700]][[1500, 2700], [1500, 2700]]Passed

SHA-256 / e04d853d822847f4eb422f6b4debf10854a6c6a061b35f60e24311f58ee6eab0

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cues, min_dur, min_gap):
    out=[list(c) for c in cues]
    order=sorted(range(len(out)),key=lambda k:(out[k][0],k))
    for pos,i in enumerate(order):
        c=out[i]
        if c[1]-c[0]>=min_dur:
            continue
        target=c[0]+min_dur
        if pos+1<len(order):
            target=min(target,out[order[pos+1]][0]-min_gap)
        c[1]=max(c[1],target)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: neighbour ordering', [[[1000, 1960], [2000, 2300], [3000, 3999], [3000, 3001]], 1000, 40], [[1000, 1960], [2000, 2960], [3000, 3999], [3000, 4000]]), ('regression variant: neighbour ordering', [[[0, 2000], [200, 500]], 700, 80], [[0, 2000], [200, 900]]), ('partial repair probe: neighbour ordering', [[[2000, 2001], [800, 1100]], 1000, 80], [[2000, 3000], [800, 1800]]), ('partial repair variant: neighbour ordering', [[[500, 501], [200, 1160], [0, 1], [500, 1460]], 1000, 40], [[500, 501], [200, 1160], [0, 160], [500, 1500]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('normal control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[0, 1], [200, 900], [2000, 4000]], 700, 0], [[0, 200], [200, 900], [2000, 4000]]), ('normal control', [[[1500, 2700], [1500, 2700]], 1200, 0], [[1500, 2700], [1500, 2700]])], [('regression: neighbour ordering', [[[200, 500], [500, 800], [1500, 3500], [1500, 2699], [2000, 2001]], 1200, 40], [[200, 500], [500, 1460], [1500, 3500], [1500, 2699], [2000, 3200]]), ('regression variant: neighbour ordering', [[[800, 2800], [800, 900], [1500, 1501], [1000, 1700], [3000, 3300]], 700, 0], [[800, 2800], [800, 1000], [1500, 2200], [1000, 1700], [3000, 3700]]), ('partial repair probe: neighbour ordering', [[[0, 1001], [1500, 2500], [3000, 3999], [800, 2800], [0, 1]], 1000, 0], [[0, 1001], [1500, 2500], [3000, 4000], [800, 2800], [0, 800]]), ('partial repair variant: neighbour ordering', [[[200, 900], [0, 699], [800, 2800]], 700, 0], [[200, 900], [0, 699], [800, 2800]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[0, 700], [1000, 1001], [2000, 2699]], 700, 80], [[0, 700], [1000, 1700], [2000, 2700]]), ('normal control', [[[2000, 2100], [3000, 3001]], 700, 0], [[2000, 2700], [3000, 3700]]), ('normal control', [[[200, 1201], [2000, 3001], [1000, 2000], [800, 1800]], 1000, 0], [[200, 1201], [2000, 3001], [1000, 2000], [800, 1800]])], [('regression: neighbour ordering', [[[0, 1001], [1500, 2500], [3000, 3999], [800, 2800], [0, 1]], 1000, 0], [[0, 1001], [1500, 2500], [3000, 4000], [800, 2800], [0, 800]]), ('regression variant: neighbour ordering', [[[3000, 3100], [500, 2500], [2000, 2700], [1131, 1831], [0, 100]], 700, 0], [[3000, 3700], [500, 2500], [2000, 2700], [1131, 1831], [0, 500]]), ('partial repair probe: neighbour ordering', [[[479, 2479], [2000, 2300], [1000, 2120], [800, 2001]], 1200, 80], [[479, 2479], [2000, 3200], [1000, 2120], [800, 2001]]), ('partial repair variant: neighbour ordering', [[[500, 1701], [200, 201], [1000, 1001]], 1200, 0], [[500, 1701], [200, 500], [1000, 2200]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('normal control', [[[500, 501]], 1200, 40], [[500, 1700]]), ('normal control', [[[500, 1200], [1000, 1699]], 700, 0], [[500, 1200], [1000, 1700]]), ('normal control', [[[1500, 3500]], 700, 0], [[1500, 3500]])], [('regression: neighbour ordering', [[[500, 800], [500, 2500], [800, 1799], [1000, 1001], [1000, 3000]], 1000, 40], [[500, 800], [500, 2500], [800, 1799], [1000, 1001], [1000, 3000]]), ('regression variant: neighbour ordering', [[[0, 2000], [200, 1160], [500, 1499], [1186, 1187], [2429, 3430]], 1000, 40], [[0, 2000], [200, 1160], [500, 1499], [1186, 2186], [2429, 3430]]), ('partial repair probe: neighbour ordering', [[[2000, 2999], [500, 1501]], 1000, 80], [[2000, 3000], [500, 1501]]), ('partial repair variant: neighbour ordering', [[[1000, 2000], [0, 1000], [3000, 3999], [2000, 2300], [500, 1500]], 1000, 0], [[1000, 2000], [0, 1000], [3000, 4000], [2000, 3000], [500, 1500]]), ('boundary control', [[[0, 300], [2000, 3000]], 1000, 80], [[0, 1000], [2000, 3000]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('normal control', [[[1500, 1600], [1500, 1600], [2000, 3200], [3000, 5000]], 1200, 0], [[1500, 1600], [1500, 2000], [2000, 3200], [3000, 5000]]), ('normal control', [[[1000, 1701], [1500, 2200]], 700, 80], [[1000, 1701], [1500, 2200]]), ('normal control', [[[200, 300], [800, 801]], 1000, 80], [[200, 720], [800, 1800]])], [('regression: neighbour ordering', [[[479, 2479], [2000, 2300], [1000, 2120], [800, 2001]], 1200, 80], [[479, 2479], [2000, 3200], [1000, 2120], [800, 2001]]), ('regression variant: neighbour ordering', [[[500, 2500], [500, 1120], [1000, 1699], [2000, 2701], [2766, 3465]], 700, 80], [[500, 2500], [500, 1120], [1000, 1700], [2000, 2701], [2766, 3466]]), ('partial repair probe: neighbour ordering', [[[800, 2800], [800, 900], [1500, 1501], [1000, 1700], [3000, 3300]], 700, 0], [[800, 2800], [800, 1000], [1500, 2200], [1000, 1700], [3000, 3700]]), ('partial repair variant: neighbour ordering', [[[1000, 3000], [3955, 4055], [208, 1207], [1500, 2420]], 1000, 80], [[1000, 3000], [3955, 4955], [208, 1207], [1500, 2500]]), ('boundary control', [[[0, 300], [500, 3000]], 1000, 80], [[0, 420], [500, 3000]]), ('boundary control', [[[0, 1000]], 1000, 0], [[0, 1000]]), ('normal control', [[[209, 1409], [800, 2001], [1500, 2620]], 1200, 80], [[209, 1409], [800, 2001], [1500, 2700]]), ('normal control', [[[0, 701], [800, 1460], [800, 2800], [4594, 4894]], 700, 40], [[0, 701], [800, 1460], [800, 2800], [4594, 5294]]), ('normal control', [[[200, 500], [1394, 2593], [3000, 3300]], 1200, 80], [[200, 1314], [1394, 2594], [3000, 4200]])]]
for label, args, expected in fixtures[N-1]:
    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
regression: neighbour ordering[[1000, 1960], [2000, 2960], [3000, 3999], [3000, 4000]][[1000, 1960], [2000, 2960], [3000, 3999], [3000, 4000]]Passed
regression variant: neighbour ordering[[0, 2000], [200, 900]][[0, 2000], [200, 900]]Passed
partial repair probe: neighbour ordering[[2000, 3000], [800, 1800]][[2000, 3000], [800, 1800]]Passed
partial repair variant: neighbour ordering[[500, 501], [200, 1160], [0, 160], [500, 1500]][[500, 501], [200, 1160], [0, 160], [500, 1500]]Passed
boundary control[[0, 1000], [2000, 3000]][[0, 1000], [2000, 3000]]Passed
boundary control[[0, 420], [500, 3000]][[0, 420], [500, 3000]]Passed
normal control[[0, 1000]][[0, 1000]]Passed
normal control[[0, 200], [200, 900], [2000, 4000]][[0, 200], [200, 900], [2000, 4000]]Passed
normal control[[1500, 2700], [1500, 2700]][[1500, 2700], [1500, 2700]]Passed

SHA-256 / 79b6880c09949fe5607c9765236032f91288f7103d1ec0938ed4ee04f24638c5

Verification & scope

A deterministic bounded teaching model with a stipulated toy contract; it does not claim conformance to any subtitle standard. 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:31.300989+00:00.

Case digest / c187d9616c38449e19594c931f55ea2abc4ad02a4ff5d65d66a687f3c76bae11