FA-77941 / Subtitle cue timing / Open access
Cue snapping to video frame grid: start frame floor · case 01
Cues appear a frame after the dialogue begins.
ROOT CAUSE
The start frame is rounded up with a ceiling instead of floored.
VERIFIED REPAIR
Floor the start onto the frame that contains it.
Unsuccessful approach: Rounding the start to the nearest frame still moves starts in the second half of a frame one frame late.
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*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: start frame floor', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('regression variant: start frame floor', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair probe: start frame floor', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('partial repair variant: start frame floor', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('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', [[[1000, 1005]], '50'], [[50, 51, 1000, 1020]])], [('regression: start frame floor', [[[10, 20], [15, 30]], '24'], [[0, 1, 0, 41], [1, 2, 41, 83]]), ('regression variant: start frame floor', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair probe: start frame floor', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('partial repair variant: start frame floor', [[[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', [[[3640, 3645], [2380, 3160], [3960, 4961], [3947, 3952]], '50'], [[182, 183, 3640, 3660], [183, 184, 3660, 3680], [198, 249, 3960, 4980], [249, 250, 4980, 5000]]), ('normal control', [[[80, 1081]], '25'], [[2, 28, 80, 1120]]), ('normal control', [[[0, 1001], [701, 735]], '30'], [[0, 31, 0, 1033], [31, 32, 1033, 1066]])], [('regression: start frame floor', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('regression variant: start frame floor', [[[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 probe: start frame floor', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: start frame floor', [[[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]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[6960, 7000]], '25'], [[174, 175, 6960, 7000]]), ('normal control', [[[4560, 4561]], '25'], [[114, 115, 4560, 4600]]), ('normal control', [[[500, 1500], [511, 552], [568, 573], [440, 481]], '50'], [[25, 75, 500, 1500], [75, 76, 1500, 1520], [76, 77, 1520, 1540], [77, 78, 1540, 1560]])], [('regression: start frame floor', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: start frame floor', [[[3001, 3006]], '50'], [[150, 151, 3000, 3020]]), ('partial repair probe: start frame floor', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair variant: start frame floor', [[[1041, 1082], [1098, 1099], [1101, 1106]], '24'], [[24, 26, 1000, 1083], [26, 27, 1083, 1125], [27, 28, 1125, 1166]]), ('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', [[[3560, 3880]], '25'], [[89, 97, 3560, 3880]]), ('normal control', [[[4004, 4009], [2919, 2960]], '24000/1001'], [[96, 97, 4004, 4045], [97, 98, 4045, 4087]]), ('normal control', [[[0, 40], [5125, 5165]], '24'], [[0, 1, 0, 41], [123, 124, 5125, 5166]])], [('regression: start frame floor', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('regression variant: start frame floor', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: start frame floor', [[[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: start frame floor', [[[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', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[1360, 1394], [1900, 2901], [3100, 3141], [2160, 3160]], '50'], [[68, 70, 1360, 1400], [95, 146, 1900, 2920], [155, 158, 3100, 3160], [158, 159, 3160, 3180]]), ('normal control', [[[1040, 1120]], '25'], [[26, 28, 1040, 1120]]), ('normal control', [[[3700, 3720]], '30'], [[111, 112, 3700, 3733]])]]
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: start frame floor | [[30, 31, 1001, 1034]] | [[29, 30, 967, 1001]] | Failed |
| regression variant: start frame floor | [[151, 153, 5038, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]] | [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]] | Failed |
| partial repair probe: start frame floor | [[2, 5, 33, 83], [81, 83, 1351, 1384], [83, 84, 1384, 1401]] | [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]] | Failed |
| partial repair variant: start frame floor | [[1, 51, 20, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | Failed |
| boundary control | [[0, 1, 0, 40], [1, 2, 40, 80]] | [[0, 1, 0, 40], [1, 2, 40, 80]] | Passed |
| boundary control | [[24, 48, 1001, 2002]] | [[24, 48, 1001, 2002]] | 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 | [[50, 51, 1000, 1020]] | [[50, 51, 1000, 1020]] | Passed |
SHA-256 / 836da7c144ab1b97bc974ff04a91d3609a80e41074131c0cbf1912444b2c4dc3
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+500*den)//(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: start frame floor', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('regression variant: start frame floor', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair probe: start frame floor', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('partial repair variant: start frame floor', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('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', [[[1000, 1005]], '50'], [[50, 51, 1000, 1020]])], [('regression: start frame floor', [[[10, 20], [15, 30]], '24'], [[0, 1, 0, 41], [1, 2, 41, 83]]), ('regression variant: start frame floor', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair probe: start frame floor', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('partial repair variant: start frame floor', [[[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', [[[3640, 3645], [2380, 3160], [3960, 4961], [3947, 3952]], '50'], [[182, 183, 3640, 3660], [183, 184, 3660, 3680], [198, 249, 3960, 4980], [249, 250, 4980, 5000]]), ('normal control', [[[80, 1081]], '25'], [[2, 28, 80, 1120]]), ('normal control', [[[0, 1001], [701, 735]], '30'], [[0, 31, 0, 1033], [31, 32, 1033, 1066]])], [('regression: start frame floor', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('regression variant: start frame floor', [[[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 probe: start frame floor', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: start frame floor', [[[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]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[6960, 7000]], '25'], [[174, 175, 6960, 7000]]), ('normal control', [[[4560, 4561]], '25'], [[114, 115, 4560, 4600]]), ('normal control', [[[500, 1500], [511, 552], [568, 573], [440, 481]], '50'], [[25, 75, 500, 1500], [75, 76, 1500, 1520], [76, 77, 1520, 1540], [77, 78, 1540, 1560]])], [('regression: start frame floor', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: start frame floor', [[[3001, 3006]], '50'], [[150, 151, 3000, 3020]]), ('partial repair probe: start frame floor', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair variant: start frame floor', [[[1041, 1082], [1098, 1099], [1101, 1106]], '24'], [[24, 26, 1000, 1083], [26, 27, 1083, 1125], [27, 28, 1125, 1166]]), ('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', [[[3560, 3880]], '25'], [[89, 97, 3560, 3880]]), ('normal control', [[[4004, 4009], [2919, 2960]], '24000/1001'], [[96, 97, 4004, 4045], [97, 98, 4045, 4087]]), ('normal control', [[[0, 40], [5125, 5165]], '24'], [[0, 1, 0, 41], [123, 124, 5125, 5166]])], [('regression: start frame floor', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('regression variant: start frame floor', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: start frame floor', [[[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: start frame floor', [[[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', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[1360, 1394], [1900, 2901], [3100, 3141], [2160, 3160]], '50'], [[68, 70, 1360, 1400], [95, 146, 1900, 2920], [155, 158, 3100, 3160], [158, 159, 3160, 3180]]), ('normal control', [[[1040, 1120]], '25'], [[26, 28, 1040, 1120]]), ('normal control', [[[3700, 3720]], '30'], [[111, 112, 3700, 3733]])]]
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: start frame floor | [[30, 31, 1001, 1034]] | [[29, 30, 967, 1001]] | Failed |
| regression variant: start frame floor | [[151, 153, 5038, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]] | [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]] | Failed |
| partial repair probe: start frame floor | [[2, 5, 33, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]] | [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]] | Failed |
| partial repair variant: start frame floor | [[1, 51, 20, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]] | Failed |
| boundary control | [[0, 1, 0, 40], [1, 2, 40, 80]] | [[0, 1, 0, 40], [1, 2, 40, 80]] | Passed |
| boundary control | [[24, 48, 1001, 2002]] | [[24, 48, 1001, 2002]] | 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 | [[50, 51, 1000, 1020]] | [[50, 51, 1000, 1020]] | Passed |
SHA-256 / e599dd19b7495e5a9eb3c3cac97699a08354ef8ab6edb05f38ab09d632955d6b
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: start frame floor', [[[1000, 1001]], '30000/1001'], [[29, 30, 967, 1001]]), ('regression variant: start frame floor', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair probe: start frame floor', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('partial repair variant: start frame floor', [[[17, 1018], [527, 547], [1720, 1740]], '50'], [[0, 51, 0, 1020], [51, 52, 1020, 1040], [86, 87, 1720, 1740]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('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', [[[1000, 1005]], '50'], [[50, 51, 1000, 1020]])], [('regression: start frame floor', [[[10, 20], [15, 30]], '24'], [[0, 1, 0, 41], [1, 2, 41, 83]]), ('regression variant: start frame floor', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair probe: start frame floor', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('partial repair variant: start frame floor', [[[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', [[[3640, 3645], [2380, 3160], [3960, 4961], [3947, 3952]], '50'], [[182, 183, 3640, 3660], [183, 184, 3660, 3680], [198, 249, 3960, 4980], [249, 250, 4980, 5000]]), ('normal control', [[[80, 1081]], '25'], [[2, 28, 80, 1120]]), ('normal control', [[[0, 1001], [701, 735]], '30'], [[0, 31, 0, 1033], [31, 32, 1033, 1066]])], [('regression: start frame floor', [[[3001, 3042]], '24000/1001'], [[71, 73, 2961, 3044]]), ('regression variant: start frame floor', [[[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 probe: start frame floor', [[[5038, 5072], [5088, 5089], [2570, 2575]], '30000/1001'], [[150, 153, 5005, 5105], [153, 154, 5105, 5138], [154, 155, 5138, 5171]]), ('partial repair variant: start frame floor', [[[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]]), ('boundary control', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[6960, 7000]], '25'], [[174, 175, 6960, 7000]]), ('normal control', [[[4560, 4561]], '25'], [[114, 115, 4560, 4600]]), ('normal control', [[[500, 1500], [511, 552], [568, 573], [440, 481]], '50'], [[25, 75, 500, 1500], [75, 76, 1500, 1520], [76, 77, 1520, 1540], [77, 78, 1540, 1560]])], [('regression: start frame floor', [[[33, 74], [1335, 1369], [1378, 1379]], '60000/1001'], [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]]), ('regression variant: start frame floor', [[[3001, 3006]], '50'], [[150, 151, 3000, 3020]]), ('partial repair probe: start frame floor', [[[1501, 1542], [2503, 3503], [5714, 5734]], '24000/1001'], [[35, 37, 1459, 1543], [60, 84, 2502, 3503], [136, 138, 5672, 5755]]), ('partial repair variant: start frame floor', [[[1041, 1082], [1098, 1099], [1101, 1106]], '24'], [[24, 26, 1000, 1083], [26, 27, 1083, 1125], [27, 28, 1125, 1166]]), ('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', [[[3560, 3880]], '25'], [[89, 97, 3560, 3880]]), ('normal control', [[[4004, 4009], [2919, 2960]], '24000/1001'], [[96, 97, 4004, 4045], [97, 98, 4045, 4087]]), ('normal control', [[[0, 40], [5125, 5165]], '24'], [[0, 1, 0, 41], [123, 124, 5125, 5166]])], [('regression: start frame floor', [[[17, 58], [4771, 5772]], '30000/1001'], [[0, 2, 0, 66], [142, 173, 4738, 5772]]), ('regression variant: start frame floor', [[[1168, 1173], [1155, 1189]], '24000/1001'], [[28, 29, 1167, 1209], [29, 30, 1209, 1251]]), ('partial repair probe: start frame floor', [[[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: start frame floor', [[[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', [[[0, 40], [40, 80]], '25'], [[0, 1, 0, 40], [1, 2, 40, 80]]), ('boundary control', [[[1001, 2002]], '24000/1001'], [[24, 48, 1001, 2002]]), ('normal control', [[[1360, 1394], [1900, 2901], [3100, 3141], [2160, 3160]], '50'], [[68, 70, 1360, 1400], [95, 146, 1900, 2920], [155, 158, 3100, 3160], [158, 159, 3160, 3180]]), ('normal control', [[[1040, 1120]], '25'], [[26, 28, 1040, 1120]]), ('normal control', [[[3700, 3720]], '30'], [[111, 112, 3700, 3733]])]]
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: start frame floor | [[29, 30, 967, 1001]] | [[29, 30, 967, 1001]] | Passed |
| regression variant: start frame floor | [[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: start frame floor | [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]] | [[1, 5, 16, 83], [80, 83, 1334, 1384], [83, 84, 1384, 1401]] | Passed |
| partial repair variant: start frame floor | [[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 |
| boundary control | [[0, 1, 0, 40], [1, 2, 40, 80]] | [[0, 1, 0, 40], [1, 2, 40, 80]] | Passed |
| boundary control | [[24, 48, 1001, 2002]] | [[24, 48, 1001, 2002]] | 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 | [[50, 51, 1000, 1020]] | [[50, 51, 1000, 1020]] | Passed |
SHA-256 / 7cb8f72399a09d136b40255e8c1fed2588a39e97f1978af76dc123ba2f81c469
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.638134+00:00.
Case digest / 1058fc8739fa88d21e0f7005f2c47d85241dab18d53858d96537262661c1ff1a