FA-77961 / Subtitle cue timing / Open access
Cue snapping to video frame grid: frame to millisecond conversion · case 01
Millisecond boundaries of NTSC-rate cues are about 0.1 percent early.
ROOT CAUSE
The frame-to-ms conversion ignores the rate denominator.
VERIFIED REPAIR
Convert frames with floor(k*1000*D/N).
Unsuccessful approach: Rounding to the nearest millisecond disagrees with the floor convention at many NTSC frames.
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=b
out.append([a,b]+[(x*1000)//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: frame to millisecond conversion', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('regression variant: frame to millisecond conversion', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair probe: frame to millisecond conversion', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('partial repair variant: frame to millisecond conversion', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[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]]), ('normal control', [[[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]]), ('normal control', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]])], [('regression: frame to millisecond conversion', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('regression variant: frame to millisecond conversion', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair probe: frame to millisecond conversion', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('partial repair variant: frame to millisecond conversion', [[[1041, 1042]], '30000/1001'], [[31, 32, 1034, 1067]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[3033, 3120], [3180, 3200], [3690, 3724]], '50'], [[151, 156, 3020, 3120], [159, 160, 3180, 3200], [184, 187, 3680, 3740]]), ('normal control', [[[3840, 3845], [4557, 4562]], '50'], [[192, 193, 3840, 3860], [227, 229, 4540, 4580]]), ('normal control', [[[40, 6440]], '25'], [[1, 161, 40, 6440]])], [('regression: frame to millisecond conversion', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('regression variant: frame to millisecond conversion', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: frame to millisecond conversion', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('partial repair variant: frame to millisecond conversion', [[[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]]), ('normal control', [[[80, 1081]], '25'], [[2, 28, 80, 1120]]), ('normal control', [[[680, 685], [280, 320], [1013, 1400]], '25'], [[17, 18, 680, 720], [18, 19, 720, 760], [25, 35, 1000, 1400]]), ('normal control', [[[3017, 3018], [3090, 3130]], '25'], [[75, 76, 3000, 3040], [77, 79, 3080, 3160]])], [('regression: frame to millisecond conversion', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: frame to millisecond conversion', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('partial repair probe: frame to millisecond conversion', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: frame to millisecond conversion', [[[540, 581], [384, 389]], '60000/1001'], [[32, 35, 533, 583], [35, 36, 583, 600]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[3400, 3401], [7640, 7641], [7697, 8697]], '25'], [[85, 86, 3400, 3440], [191, 192, 7640, 7680], [192, 218, 7680, 8720]]), ('normal control', [[[80, 81], [3980, 3985], [4490, 4531], [2040, 4420]], '50'], [[4, 5, 80, 100], [199, 200, 3980, 4000], [224, 227, 4480, 4540], [227, 228, 4540, 4560]]), ('normal control', [[[6960, 7000]], '25'], [[174, 175, 6960, 7000]])], [('regression: frame to millisecond conversion', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('regression variant: frame to millisecond conversion', [[[1041, 1042]], '30000/1001'], [[31, 32, 1034, 1067]]), ('partial repair probe: frame to millisecond conversion', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair variant: frame to millisecond conversion', [[[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', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[80, 100]], '50'], [[4, 5, 80, 100]]), ('normal control', [[[4560, 4561]], '25'], [[114, 115, 4560, 4600]]), ('normal control', [[[3017, 3022], [3557, 3591]], '25'], [[75, 76, 3000, 3040], [88, 90, 3520, 3600]])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: frame to millisecond conversion | [[29, 30, 0, 1]] | [[29, 30, 967, 1001]] | Failed |
| regression variant: frame to millisecond conversion | [[150, 153, 5, 5], [153, 154, 5, 5], [154, 155, 5, 5]] | [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]] | Failed |
| partial repair probe: frame to millisecond conversion | [[71, 73, 2, 3]] | [[71, 73, 2961, 3044]] | Failed |
| partial repair variant: frame to millisecond conversion | [[209, 213, 3, 3], [213, 214, 3, 3], [214, 215, 3, 3]] | [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]] | Failed |
| boundary control | [[0, 1, 0, 40], [1, 2, 40, 80]] | [[0, 1, 0, 40], [1, 2, 40, 80]] | Passed |
| normal control | [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]] | [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]] | Passed |
| normal control | [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]] | [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]] | Passed |
| normal control | [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | Passed |
SHA-256 / e87c1039c7ffc1650d7dc1f39694d842b1180f534827ddd6a85c5f009ba6fed6
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
out.append([a,b]+[round(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: frame to millisecond conversion', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('regression variant: frame to millisecond conversion', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair probe: frame to millisecond conversion', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('partial repair variant: frame to millisecond conversion', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[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]]), ('normal control', [[[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]]), ('normal control', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]])], [('regression: frame to millisecond conversion', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('regression variant: frame to millisecond conversion', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair probe: frame to millisecond conversion', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('partial repair variant: frame to millisecond conversion', [[[1041, 1042]], '30000/1001'], [[31, 32, 1034, 1067]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[3033, 3120], [3180, 3200], [3690, 3724]], '50'], [[151, 156, 3020, 3120], [159, 160, 3180, 3200], [184, 187, 3680, 3740]]), ('normal control', [[[3840, 3845], [4557, 4562]], '50'], [[192, 193, 3840, 3860], [227, 229, 4540, 4580]]), ('normal control', [[[40, 6440]], '25'], [[1, 161, 40, 6440]])], [('regression: frame to millisecond conversion', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('regression variant: frame to millisecond conversion', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: frame to millisecond conversion', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('partial repair variant: frame to millisecond conversion', [[[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]]), ('normal control', [[[80, 1081]], '25'], [[2, 28, 80, 1120]]), ('normal control', [[[680, 685], [280, 320], [1013, 1400]], '25'], [[17, 18, 680, 720], [18, 19, 720, 760], [25, 35, 1000, 1400]]), ('normal control', [[[3017, 3018], [3090, 3130]], '25'], [[75, 76, 3000, 3040], [77, 79, 3080, 3160]])], [('regression: frame to millisecond conversion', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: frame to millisecond conversion', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('partial repair probe: frame to millisecond conversion', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: frame to millisecond conversion', [[[540, 581], [384, 389]], '60000/1001'], [[32, 35, 533, 583], [35, 36, 583, 600]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[3400, 3401], [7640, 7641], [7697, 8697]], '25'], [[85, 86, 3400, 3440], [191, 192, 7640, 7680], [192, 218, 7680, 8720]]), ('normal control', [[[80, 81], [3980, 3985], [4490, 4531], [2040, 4420]], '50'], [[4, 5, 80, 100], [199, 200, 3980, 4000], [224, 227, 4480, 4540], [227, 228, 4540, 4560]]), ('normal control', [[[6960, 7000]], '25'], [[174, 175, 6960, 7000]])], [('regression: frame to millisecond conversion', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('regression variant: frame to millisecond conversion', [[[1041, 1042]], '30000/1001'], [[31, 32, 1034, 1067]]), ('partial repair probe: frame to millisecond conversion', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair variant: frame to millisecond conversion', [[[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', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[80, 100]], '50'], [[4, 5, 80, 100]]), ('normal control', [[[4560, 4561]], '25'], [[114, 115, 4560, 4600]]), ('normal control', [[[3017, 3022], [3557, 3591]], '25'], [[75, 76, 3000, 3040], [88, 90, 3520, 3600]])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: frame to millisecond conversion | [[29, 30, 968, 1001]] | [[29, 30, 967, 1001]] | Failed |
| regression variant: frame to millisecond conversion | [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5172]] | [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]] | Failed |
| partial repair probe: frame to millisecond conversion | [[71, 73, 2961, 3045]] | [[71, 73, 2961, 3044]] | Failed |
| partial repair variant: frame to millisecond conversion | [[209, 213, 3487, 3554], [213, 214, 3554, 3570], [214, 215, 3570, 3587]] | [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]] | Failed |
| boundary control | [[0, 1, 0, 40], [1, 2, 40, 80]] | [[0, 1, 0, 40], [1, 2, 40, 80]] | Passed |
| normal control | [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]] | [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]] | Passed |
| normal control | [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]] | [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]] | Passed |
| normal control | [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | Passed |
SHA-256 / 4a4317064e01cb419f975c410c21a96a1c005d51658ad2612860c3e41c1ee572
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: frame to millisecond conversion', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('regression variant: frame to millisecond conversion', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair probe: frame to millisecond conversion', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('partial repair variant: frame to millisecond conversion', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[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]]), ('normal control', [[[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]]), ('normal control', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]])], [('regression: frame to millisecond conversion', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('regression variant: frame to millisecond conversion', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair probe: frame to millisecond conversion', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('partial repair variant: frame to millisecond conversion', [[[1041, 1042]], '30000/1001'], [[31, 32, 1034, 1067]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[3033, 3120], [3180, 3200], [3690, 3724]], '50'], [[151, 156, 3020, 3120], [159, 160, 3180, 3200], [184, 187, 3680, 3740]]), ('normal control', [[[3840, 3845], [4557, 4562]], '50'], [[192, 193, 3840, 3860], [227, 229, 4540, 4580]]), ('normal control', [[[40, 6440]], '25'], [[1, 161, 40, 6440]])], [('regression: frame to millisecond conversion', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('regression variant: frame to millisecond conversion', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: frame to millisecond conversion', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('partial repair variant: frame to millisecond conversion', [[[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]]), ('normal control', [[[80, 1081]], '25'], [[2, 28, 80, 1120]]), ('normal control', [[[680, 685], [280, 320], [1013, 1400]], '25'], [[17, 18, 680, 720], [18, 19, 720, 760], [25, 35, 1000, 1400]]), ('normal control', [[[3017, 3018], [3090, 3130]], '25'], [[75, 76, 3000, 3040], [77, 79, 3080, 3160]])], [('regression: frame to millisecond conversion', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: frame to millisecond conversion', [[[3500, 3541], [3487, 3527], [1651, 2652]], '60000/1001'], [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]]), ('partial repair probe: frame to millisecond conversion', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: frame to millisecond conversion', [[[540, 581], [384, 389]], '60000/1001'], [[32, 35, 533, 583], [35, 36, 583, 600]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[3400, 3401], [7640, 7641], [7697, 8697]], '25'], [[85, 86, 3400, 3440], [191, 192, 7640, 7680], [192, 218, 7680, 8720]]), ('normal control', [[[80, 81], [3980, 3985], [4490, 4531], [2040, 4420]], '50'], [[4, 5, 80, 100], [199, 200, 3980, 4000], [224, 227, 4480, 4540], [227, 228, 4540, 4560]]), ('normal control', [[[6960, 7000]], '25'], [[174, 175, 6960, 7000]])], [('regression: frame to millisecond conversion', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('regression variant: frame to millisecond conversion', [[[1041, 1042]], '30000/1001'], [[31, 32, 1034, 1067]]), ('partial repair probe: frame to millisecond conversion', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair variant: frame to millisecond conversion', [[[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', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('normal control', [[[80, 100]], '50'], [[4, 5, 80, 100]]), ('normal control', [[[4560, 4561]], '25'], [[114, 115, 4560, 4600]]), ('normal control', [[[3017, 3022], [3557, 3591]], '25'], [[75, 76, 3000, 3040], [88, 90, 3520, 3600]])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: frame to millisecond conversion | [[29, 30, 967, 1001]] | [[29, 30, 967, 1001]] | Passed |
| regression variant: frame to millisecond conversion | [[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 probe: frame to millisecond conversion | [[71, 73, 2961, 3044]] | [[71, 73, 2961, 3044]] | Passed |
| partial repair variant: frame to millisecond conversion | [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]] | [[209, 213, 3486, 3553], [213, 214, 3553, 3570], [214, 215, 3570, 3586]] | Passed |
| boundary control | [[0, 1, 0, 40], [1, 2, 40, 80]] | [[0, 1, 0, 40], [1, 2, 40, 80]] | Passed |
| normal control | [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]] | [[150, 153, 3000, 3060], [153, 154, 3060, 3080], [176, 178, 3520, 3560], [178, 179, 3560, 3580]] | Passed |
| normal control | [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]] | [[125, 197, 2500, 3940], [197, 198, 3940, 3960], [198, 218, 3960, 4360], [218, 219, 4360, 4380]] | Passed |
| normal control | [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | Passed |
SHA-256 / 00d0b0020f00c860526f6aecc70830b16356a7d538e8dc5c732b9303e795ea68
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.729655+00:00.
Case digest / 768416a2b4225c5f200b966a125993e37b21f406c15314d542876fe495e715e8