FAILURE MAP
← Case archive

FA-77956 / Subtitle cue timing / Open access

Cue snapping to video frame grid: previous end tracking · case 01

Snapped cues overlap by several frames after a long cue.

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

ROOT CAUSE

The running boundary records the start frame of each cue rather than its end frame.

VERIFIED REPAIR

Record the end frame of each emitted cue as the next boundary.

Unsuccessful approach: Recording b-1 treats the end frame as inclusive and lets the next cue share one frame.

Case contract

For fps "N" or "N/D", frame k starts at k*1000*D/N ms. Each cue [start,end] (sorted) gets start frame floor(start*N/(1000*D)) and end frame ceil(end*N/(1000*D)), at least one frame long. A cue whose start frame precedes the previous cue end frame is pushed to that end frame (and kept at least one frame long). Output [a,b,ms(a),ms(b)] with ms(k)=floor(k*1000*D/N).

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, fps):
    num,den=(fps.split('/')+['1'])[:2]
    num,den=int(num),int(den)
    out=[]
    prev_end=None
    for start,end in cues:
        a=(start*num)//(1000*den)
        b=-((-end*num)//(1000*den))
        if b<=a:
            b=a+1
        if prev_end is not None and a<prev_end:
            a=prev_end
            b=max(b,a+1)
        prev_end=a
        out.append([a,b]+[(x*1000*den)//num for x in (a,b)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: previous end tracking', [[[10, 20], [15, 30]], '24'], [[0, 1, 0, 41], [1, 2, 41, 83]]), ('regression variant: previous end tracking', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: previous end tracking', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: previous end tracking', [[[3000, 3020], [1966, 1986], [2476, 2517]], '30'], [[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('normal control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('normal control', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]])], [('regression: previous end tracking', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: previous end tracking', [[[2500, 3940], [2660, 2680], [3360, 4360], [740, 4220]], '50'], [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]]), ('partial repair probe: previous end tracking', [[[3000, 3041], [2820, 2860], [3520, 3554], [3530, 3564]], '50'], [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]]), ('partial repair variant: previous end tracking', [[[540, 581], [384, 389]], '60000/1001'], [[32, 35, 533, 583], [35, 36, 583, 600]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[440, 474], [950, 951]], '25'], [[11, 12, 440, 480], [23, 24, 920, 960]]), ('normal control', [[[1168, 1169], [2368, 2373], [3068, 3073], [7340, 7360]], '24000/1001'], [[28, 29, 1167, 1209], [56, 57, 2335, 2377], [73, 74, 3044, 3086], [175, 177, 7298, 7382]]), ('normal control', [[[1000, 1005]], '50'], [[50, 51, 1000, 1020]])], [('regression: previous end tracking', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('regression variant: previous end tracking', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('partial repair probe: previous end tracking', [[[4666, 4667], [5866, 5900], [5899, 5919], [2400, 3401]], '30'], [[139, 141, 4633, 4700], [175, 177, 5833, 5900], [177, 178, 5900, 5933], [178, 179, 5933, 5966]]), ('partial repair variant: previous end tracking', [[[3500, 3540], [3471, 3472], [3481, 4004], [4181, 4215]], '24000/1001'], [[83, 85, 3461, 3545], [85, 86, 3545, 3586], [86, 96, 3586, 4004], [100, 102, 4170, 4254]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[1002, 1036], [2535, 2576]], '30000/1001'], [[30, 32, 1001, 1067], [75, 78, 2502, 2602]]), ('normal control', [[[1018, 1058], [5972, 5992], [6013, 7014]], '30000/1001'], [[30, 32, 1001, 1067], [178, 180, 5939, 6006], [180, 211, 6006, 7040]]), ('normal control', [[[3001, 3041]], '30'], [[90, 92, 3000, 3066]])], [('regression: previous end tracking', [[[3000, 3041], [2820, 2860], [3520, 3554], [3530, 3564]], '50'], [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]]), ('regression variant: previous end tracking', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]]), ('partial repair probe: previous end tracking', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair variant: previous end tracking', [[[1041, 1082], [1098, 1099], [1101, 1106]], '24'], [[24, 26, 1000, 1083], [26, 27, 1083, 1125], [27, 28, 1125, 1166]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('normal control', [[[1018, 1023]], '60000/1001'], [[61, 62, 1017, 1034]]), ('normal control', [[[40, 6440]], '25'], [[1, 161, 40, 6440]]), ('normal control', [[[1018, 1058]], '24000/1001'], [[24, 26, 1001, 1084]])], [('regression: previous end tracking', [[[4666, 4667], [5866, 5900], [5899, 5919], [2400, 3401]], '30'], [[139, 141, 4633, 4700], [175, 177, 5833, 5900], [177, 178, 5900, 5933], [178, 179, 5933, 5966]]), ('regression variant: previous end tracking', [[[3000, 3020], [1966, 1986], [2476, 2517]], '30'], [[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]), ('partial repair probe: previous end tracking', [[[2500, 3940], [2660, 2680], [3360, 4360], [740, 4220]], '50'], [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]]), ('partial repair variant: previous end tracking', [[[41, 61], [114, 119], [7500, 7520], [4541, 5542]], '24'], [[0, 2, 0, 83], [2, 3, 83, 125], [180, 181, 7500, 7541], [181, 182, 7541, 7583]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[500, 501]], '30000/1001'], [[14, 16, 467, 533]]), ('normal control', [[[1002, 1022]], '30000/1001'], [[30, 31, 1001, 1034]]), ('normal control', [[[40, 1041]], '24000/1001'], [[0, 25, 0, 1042]])]]
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: previous end tracking[[0, 1, 0, 41], [0, 1, 0, 41]][[0, 1, 0, 41], [1, 2, 41, 83]]Failed
regression variant: previous end tracking[[28, 29, 1167, 1209], [28, 29, 1167, 1209]][[28, 29, 1167, 1209], [29, 30, 1209, 1251]]Failed
partial repair probe: previous end tracking[[150, 153, 5005, 5105], [152, 153, 5071, 5105], [152, 153, 5071, 5105]][[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]Failed
partial repair variant: previous end tracking[[90, 91, 3000, 3033], [90, 91, 3000, 3033], [90, 91, 3000, 3033]][[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]Failed
boundary control[[0, 1, 0, 40], [1, 2, 40, 80]][[0, 1, 0, 40], [1, 2, 40, 80]]Passed
boundary control[[29, 30, 967, 1001]][[29, 30, 967, 1001]]Passed
normal control[[24, 48, 1001, 2002]][[24, 48, 1001, 2002]]Passed
normal control[[71, 73, 2961, 3044]][[71, 73, 2961, 3044]]Passed
normal control[[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]][[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]Passed

SHA-256 / 08048670441eff1538b74e86c35bed0613324f7d9951786046151f2c24f0e491

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(cues, fps):
    num,den=(fps.split('/')+['1'])[:2]
    num,den=int(num),int(den)
    out=[]
    prev_end=None
    for start,end in cues:
        a=(start*num)//(1000*den)
        b=-((-end*num)//(1000*den))
        if b<=a:
            b=a+1
        if prev_end is not None and a<prev_end:
            a=prev_end
            b=max(b,a+1)
        prev_end=b-1
        out.append([a,b]+[(x*1000*den)//num for x in (a,b)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: previous end tracking', [[[10, 20], [15, 30]], '24'], [[0, 1, 0, 41], [1, 2, 41, 83]]), ('regression variant: previous end tracking', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: previous end tracking', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: previous end tracking', [[[3000, 3020], [1966, 1986], [2476, 2517]], '30'], [[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('normal control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('normal control', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]])], [('regression: previous end tracking', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: previous end tracking', [[[2500, 3940], [2660, 2680], [3360, 4360], [740, 4220]], '50'], [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]]), ('partial repair probe: previous end tracking', [[[3000, 3041], [2820, 2860], [3520, 3554], [3530, 3564]], '50'], [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]]), ('partial repair variant: previous end tracking', [[[540, 581], [384, 389]], '60000/1001'], [[32, 35, 533, 583], [35, 36, 583, 600]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[440, 474], [950, 951]], '25'], [[11, 12, 440, 480], [23, 24, 920, 960]]), ('normal control', [[[1168, 1169], [2368, 2373], [3068, 3073], [7340, 7360]], '24000/1001'], [[28, 29, 1167, 1209], [56, 57, 2335, 2377], [73, 74, 3044, 3086], [175, 177, 7298, 7382]]), ('normal control', [[[1000, 1005]], '50'], [[50, 51, 1000, 1020]])], [('regression: previous end tracking', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('regression variant: previous end tracking', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('partial repair probe: previous end tracking', [[[4666, 4667], [5866, 5900], [5899, 5919], [2400, 3401]], '30'], [[139, 141, 4633, 4700], [175, 177, 5833, 5900], [177, 178, 5900, 5933], [178, 179, 5933, 5966]]), ('partial repair variant: previous end tracking', [[[3500, 3540], [3471, 3472], [3481, 4004], [4181, 4215]], '24000/1001'], [[83, 85, 3461, 3545], [85, 86, 3545, 3586], [86, 96, 3586, 4004], [100, 102, 4170, 4254]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[1002, 1036], [2535, 2576]], '30000/1001'], [[30, 32, 1001, 1067], [75, 78, 2502, 2602]]), ('normal control', [[[1018, 1058], [5972, 5992], [6013, 7014]], '30000/1001'], [[30, 32, 1001, 1067], [178, 180, 5939, 6006], [180, 211, 6006, 7040]]), ('normal control', [[[3001, 3041]], '30'], [[90, 92, 3000, 3066]])], [('regression: previous end tracking', [[[3000, 3041], [2820, 2860], [3520, 3554], [3530, 3564]], '50'], [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]]), ('regression variant: previous end tracking', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]]), ('partial repair probe: previous end tracking', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair variant: previous end tracking', [[[1041, 1082], [1098, 1099], [1101, 1106]], '24'], [[24, 26, 1000, 1083], [26, 27, 1083, 1125], [27, 28, 1125, 1166]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('normal control', [[[1018, 1023]], '60000/1001'], [[61, 62, 1017, 1034]]), ('normal control', [[[40, 6440]], '25'], [[1, 161, 40, 6440]]), ('normal control', [[[1018, 1058]], '24000/1001'], [[24, 26, 1001, 1084]])], [('regression: previous end tracking', [[[4666, 4667], [5866, 5900], [5899, 5919], [2400, 3401]], '30'], [[139, 141, 4633, 4700], [175, 177, 5833, 5900], [177, 178, 5900, 5933], [178, 179, 5933, 5966]]), ('regression variant: previous end tracking', [[[3000, 3020], [1966, 1986], [2476, 2517]], '30'], [[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]), ('partial repair probe: previous end tracking', [[[2500, 3940], [2660, 2680], [3360, 4360], [740, 4220]], '50'], [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]]), ('partial repair variant: previous end tracking', [[[41, 61], [114, 119], [7500, 7520], [4541, 5542]], '24'], [[0, 2, 0, 83], [2, 3, 83, 125], [180, 181, 7500, 7541], [181, 182, 7541, 7583]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[500, 501]], '30000/1001'], [[14, 16, 467, 533]]), ('normal control', [[[1002, 1022]], '30000/1001'], [[30, 31, 1001, 1034]]), ('normal control', [[[40, 1041]], '24000/1001'], [[0, 25, 0, 1042]])]]
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: previous end tracking[[0, 1, 0, 41], [0, 1, 0, 41]][[0, 1, 0, 41], [1, 2, 41, 83]]Failed
regression variant: previous end tracking[[28, 29, 1167, 1209], [28, 29, 1167, 1209]][[28, 29, 1167, 1209], [29, 30, 1209, 1251]]Failed
partial repair probe: previous end tracking[[150, 153, 5005, 5105], [152, 153, 5071, 5105], [152, 153, 5071, 5105]][[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]Failed
partial repair variant: previous end tracking[[90, 91, 3000, 3033], [90, 91, 3000, 3033], [90, 91, 3000, 3033]][[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]Failed
boundary control[[0, 1, 0, 40], [1, 2, 40, 80]][[0, 1, 0, 40], [1, 2, 40, 80]]Passed
boundary control[[29, 30, 967, 1001]][[29, 30, 967, 1001]]Passed
normal control[[24, 48, 1001, 2002]][[24, 48, 1001, 2002]]Passed
normal control[[71, 73, 2961, 3044]][[71, 73, 2961, 3044]]Passed
normal control[[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]][[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]Passed

SHA-256 / 7f63e8315c483ddd3240759a5cb7d2ae4e6eb406e003f99e3757def9365cc2db

3 / The verified repair

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

N = 1
observations = []
def solve(cues, fps):
    num,den=(fps.split('/')+['1'])[:2]
    num,den=int(num),int(den)
    out=[]
    prev_end=None
    for start,end in cues:
        a=(start*num)//(1000*den)
        b=-((-end*num)//(1000*den))
        if b<=a:
            b=a+1
        if prev_end is not None and a<prev_end:
            a=prev_end
            b=max(b,a+1)
        prev_end=b
        out.append([a,b]+[(x*1000*den)//num for x in (a,b)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: previous end tracking', [[[10, 20], [15, 30]], '24'], [[0, 1, 0, 41], [1, 2, 41, 83]]), ('regression variant: previous end tracking', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: previous end tracking', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: previous end tracking', [[[3000, 3020], [1966, 1986], [2476, 2517]], '30'], [[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('normal control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('normal control', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]])], [('regression: previous end tracking', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: previous end tracking', [[[2500, 3940], [2660, 2680], [3360, 4360], [740, 4220]], '50'], [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]]), ('partial repair probe: previous end tracking', [[[3000, 3041], [2820, 2860], [3520, 3554], [3530, 3564]], '50'], [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]]), ('partial repair variant: previous end tracking', [[[540, 581], [384, 389]], '60000/1001'], [[32, 35, 533, 583], [35, 36, 583, 600]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[440, 474], [950, 951]], '25'], [[11, 12, 440, 480], [23, 24, 920, 960]]), ('normal control', [[[1168, 1169], [2368, 2373], [3068, 3073], [7340, 7360]], '24000/1001'], [[28, 29, 1167, 1209], [56, 57, 2335, 2377], [73, 74, 3044, 3086], [175, 177, 7298, 7382]]), ('normal control', [[[1000, 1005]], '50'], [[50, 51, 1000, 1020]])], [('regression: previous end tracking', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('regression variant: previous end tracking', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('partial repair probe: previous end tracking', [[[4666, 4667], [5866, 5900], [5899, 5919], [2400, 3401]], '30'], [[139, 141, 4633, 4700], [175, 177, 5833, 5900], [177, 178, 5900, 5933], [178, 179, 5933, 5966]]), ('partial repair variant: previous end tracking', [[[3500, 3540], [3471, 3472], [3481, 4004], [4181, 4215]], '24000/1001'], [[83, 85, 3461, 3545], [85, 86, 3545, 3586], [86, 96, 3586, 4004], [100, 102, 4170, 4254]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[1002, 1036], [2535, 2576]], '30000/1001'], [[30, 32, 1001, 1067], [75, 78, 2502, 2602]]), ('normal control', [[[1018, 1058], [5972, 5992], [6013, 7014]], '30000/1001'], [[30, 32, 1001, 1067], [178, 180, 5939, 6006], [180, 211, 6006, 7040]]), ('normal control', [[[3001, 3041]], '30'], [[90, 92, 3000, 3066]])], [('regression: previous end tracking', [[[3000, 3041], [2820, 2860], [3520, 3554], [3530, 3564]], '50'], [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]]), ('regression variant: previous end tracking', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]]), ('partial repair probe: previous end tracking', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair variant: previous end tracking', [[[1041, 1082], [1098, 1099], [1101, 1106]], '24'], [[24, 26, 1000, 1083], [26, 27, 1083, 1125], [27, 28, 1125, 1166]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('normal control', [[[1018, 1023]], '60000/1001'], [[61, 62, 1017, 1034]]), ('normal control', [[[40, 6440]], '25'], [[1, 161, 40, 6440]]), ('normal control', [[[1018, 1058]], '24000/1001'], [[24, 26, 1001, 1084]])], [('regression: previous end tracking', [[[4666, 4667], [5866, 5900], [5899, 5919], [2400, 3401]], '30'], [[139, 141, 4633, 4700], [175, 177, 5833, 5900], [177, 178, 5900, 5933], [178, 179, 5933, 5966]]), ('regression variant: previous end tracking', [[[3000, 3020], [1966, 1986], [2476, 2517]], '30'], [[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]), ('partial repair probe: previous end tracking', [[[2500, 3940], [2660, 2680], [3360, 4360], [740, 4220]], '50'], [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]]), ('partial repair variant: previous end tracking', [[[41, 61], [114, 119], [7500, 7520], [4541, 5542]], '24'], [[0, 2, 0, 83], [2, 3, 83, 125], [180, 181, 7500, 7541], [181, 182, 7541, 7583]]), ('boundary control', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[500, 501]], '30000/1001'], [[14, 16, 467, 533]]), ('normal control', [[[1002, 1022]], '30000/1001'], [[30, 31, 1001, 1034]]), ('normal control', [[[40, 1041]], '24000/1001'], [[0, 25, 0, 1042]])]]
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: previous end tracking[[0, 1, 0, 41], [1, 2, 41, 83]][[0, 1, 0, 41], [1, 2, 41, 83]]Passed
regression variant: previous end tracking[[28, 29, 1167, 1209], [29, 30, 1209, 1251]][[28, 29, 1167, 1209], [29, 30, 1209, 1251]]Passed
partial repair probe: previous end tracking[[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]][[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]Passed
partial repair variant: previous end tracking[[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]][[90, 91, 3000, 3033], [91, 92, 3033, 3066], [92, 93, 3066, 3100]]Passed
boundary control[[0, 1, 0, 40], [1, 2, 40, 80]][[0, 1, 0, 40], [1, 2, 40, 80]]Passed
boundary control[[29, 30, 967, 1001]][[29, 30, 967, 1001]]Passed
normal control[[24, 48, 1001, 2002]][[24, 48, 1001, 2002]]Passed
normal control[[71, 73, 2961, 3044]][[71, 73, 2961, 3044]]Passed
normal control[[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]][[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]Passed

SHA-256 / 09a813f3cd042c1294e301b0d6328c0608bf9440a3472098b0cc5a8ad800daf9

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:30.713244+00:00.

Case digest / 85886234882005dd15b4fbbbfa535a9bd5963c05df8f1b39917ac7b17b9cdb20