FA-78116 / Subtitle cue timing / Open access
Proportional cue splitting: part weight · case 01
Empty fragments become zero-length cues.
ROOT CAUSE
Part weights have no minimum of one.
VERIFIED REPAIR
Weight each part by max(1, trimmed length).
Unsuccessful approach: Weighting untrimmed parts gives padded fragments too much screen time.
Case contract
Split cue [start,end] into len(parts) consecutive cues. Each part weighs max(1, len(part.strip())). Boundary after part k is start + floor(dur * cumulative_weight_k / total_weight); pieces are contiguous and the last ends at end. Output [s,e,part.strip()].
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(cue, parts):
start,end=cue
w=[len(p.strip()) for p in parts]
total=sum(w)
dur=end-start
out=[]
acc=0
prev=start
for p,x in zip(parts,w):
acc+=x
b=start+dur*acc//total
out.append([prev,b,p.strip()])
prev=b
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: part weight', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('regression variant: part weight', [[12345, 12352], [' there ', ' there ', 'xyz', ' ']], [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12351, 'xyz'], [12351, 12352, '']]), ('partial repair probe: part weight', [[0, 3001], ['ok ', ' there ']], [[0, 857, 'ok'], [857, 3001, 'there']]), ('partial repair variant: part weight', [[1000, 1100], [' there ', 'friend']], [[1000, 1045, 'there'], [1045, 1100, 'friend']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[0, 2500], ['xyz']], [[0, 2500, 'xyz']]), ('normal control', [[1000, 1007], ['xyz']], [[1000, 1007, 'xyz']]), ('normal control', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']])], [('regression: part weight', [[1000, 1999], ['ok ', ' ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('regression variant: part weight', [[12345, 15346], ['a', '']], [[12345, 13845, 'a'], [13845, 15346, '']]), ('partial repair probe: part weight', [[1000, 1999], ['ok ', 'Hello']], [[1000, 1285, 'ok'], [1285, 1999, 'Hello']]), ('partial repair variant: part weight', [[0, 2500], [' there ', 'Longer chunk of text']], [[0, 500, 'there'], [500, 2500, 'Longer chunk of text']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[0, 7], [' there ']], [[0, 7, 'there']]), ('normal control', [[1000, 1999], ['friend']], [[1000, 1999, 'friend']]), ('normal control', [[1000, 1999], ['xyz', 'friend']], [[1000, 1333, 'xyz'], [1333, 1999, 'friend']])], [('regression: part weight', [[12345, 13344], ['ok ', 'ok ', ' ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('regression variant: part weight', [[0, 2500], ['', 'ok ', '']], [[0, 625, ''], [625, 1875, 'ok'], [1875, 2500, '']]), ('partial repair probe: part weight', [[1000, 1999], ['ok ', ' ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair variant: part weight', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[12345, 13345], ['Hello', 'friend', 'Hello']], [[12345, 12657, 'Hello'], [12657, 13032, 'friend'], [13032, 13345, 'Hello']]), ('normal control', [[12345, 15346], ['Hello']], [[12345, 15346, 'Hello']]), ('normal control', [[12345, 12352], ['xyz']], [[12345, 12352, 'xyz']])], [('regression: part weight', [[0, 7], [' ', 'ok ', ' ', 'ok ']], [[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]), ('regression variant: part weight', [[12345, 13345], [' ', 'ok ']], [[12345, 12678, ''], [12678, 13345, 'ok']]), ('partial repair probe: part weight', [[12345, 13344], ['ok ', 'ok ', ' ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('partial repair variant: part weight', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[12345, 12445], ['a']], [[12345, 12445, 'a']]), ('normal control', [[12345, 13345], ['xyz']], [[12345, 13345, 'xyz']]), ('normal control', [[12345, 12352], ['Longer chunk of text', 'a', 'xyz']], [[12345, 12350, 'Longer chunk of text'], [12350, 12351, 'a'], [12351, 12352, 'xyz']])], [('regression: part weight', [[1000, 2000], ['ok ', '', '']], [[1000, 1500, 'ok'], [1500, 1750, ''], [1750, 2000, '']]), ('regression variant: part weight', [[0, 100], ['', '', 'friend']], [[0, 12, ''], [12, 25, ''], [25, 100, 'friend']]), ('partial repair probe: part weight', [[1000, 1100], [' there ', 'ok ', 'Longer chunk of text']], [[1000, 1018, 'there'], [1018, 1025, 'ok'], [1025, 1100, 'Longer chunk of text']]), ('partial repair variant: part weight', [[12345, 13345], [' ', 'ok ']], [[12345, 12678, ''], [12678, 13345, 'ok']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[12345, 13344], ['Hello', 'friend', 'a']], [[12345, 12761, 'Hello'], [12761, 13260, 'friend'], [13260, 13344, 'a']]), ('normal control', [[12345, 13345], ['friend']], [[12345, 13345, 'friend']]), ('normal control', [[12345, 15346], ['xyz', 'Hello', 'a']], [[12345, 13345, 'xyz'], [13345, 15012, 'Hello'], [15012, 15346, 'a']])]]
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: part weight | [[0, 1000, 'a'], [1000, 1000, '']] | [[0, 500, 'a'], [500, 1000, '']] | Failed |
| regression variant: part weight | [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12352, 'xyz'], [12352, 12352, '']] | [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12351, 'xyz'], [12351, 12352, '']] | Failed |
| partial repair probe: part weight | [[0, 857, 'ok'], [857, 3001, 'there']] | [[0, 857, 'ok'], [857, 3001, 'there']] | Passed |
| partial repair variant: part weight | [[1000, 1045, 'there'], [1045, 1100, 'friend']] | [[1000, 1045, 'there'], [1045, 1100, 'friend']] | Passed |
| boundary control | [[0, 500, 'ab'], [500, 1000, 'cd']] | [[0, 500, 'ab'], [500, 1000, 'cd']] | Passed |
| boundary control | [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']] | [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']] | Passed |
| normal control | [[0, 2500, 'xyz']] | [[0, 2500, 'xyz']] | Passed |
| normal control | [[1000, 1007, 'xyz']] | [[1000, 1007, 'xyz']] | Passed |
| normal control | [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']] | [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']] | Passed |
SHA-256 / e2ec26f43e367721ccc1939b3a7e40acca02f892e90841403e7b34e080de02cf
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(cue, parts):
start,end=cue
w=[max(1,len(p)) for p in parts]
total=sum(w)
dur=end-start
out=[]
acc=0
prev=start
for p,x in zip(parts,w):
acc+=x
b=start+dur*acc//total
out.append([prev,b,p.strip()])
prev=b
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: part weight', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('regression variant: part weight', [[12345, 12352], [' there ', ' there ', 'xyz', ' ']], [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12351, 'xyz'], [12351, 12352, '']]), ('partial repair probe: part weight', [[0, 3001], ['ok ', ' there ']], [[0, 857, 'ok'], [857, 3001, 'there']]), ('partial repair variant: part weight', [[1000, 1100], [' there ', 'friend']], [[1000, 1045, 'there'], [1045, 1100, 'friend']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[0, 2500], ['xyz']], [[0, 2500, 'xyz']]), ('normal control', [[1000, 1007], ['xyz']], [[1000, 1007, 'xyz']]), ('normal control', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']])], [('regression: part weight', [[1000, 1999], ['ok ', ' ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('regression variant: part weight', [[12345, 15346], ['a', '']], [[12345, 13845, 'a'], [13845, 15346, '']]), ('partial repair probe: part weight', [[1000, 1999], ['ok ', 'Hello']], [[1000, 1285, 'ok'], [1285, 1999, 'Hello']]), ('partial repair variant: part weight', [[0, 2500], [' there ', 'Longer chunk of text']], [[0, 500, 'there'], [500, 2500, 'Longer chunk of text']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[0, 7], [' there ']], [[0, 7, 'there']]), ('normal control', [[1000, 1999], ['friend']], [[1000, 1999, 'friend']]), ('normal control', [[1000, 1999], ['xyz', 'friend']], [[1000, 1333, 'xyz'], [1333, 1999, 'friend']])], [('regression: part weight', [[12345, 13344], ['ok ', 'ok ', ' ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('regression variant: part weight', [[0, 2500], ['', 'ok ', '']], [[0, 625, ''], [625, 1875, 'ok'], [1875, 2500, '']]), ('partial repair probe: part weight', [[1000, 1999], ['ok ', ' ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair variant: part weight', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[12345, 13345], ['Hello', 'friend', 'Hello']], [[12345, 12657, 'Hello'], [12657, 13032, 'friend'], [13032, 13345, 'Hello']]), ('normal control', [[12345, 15346], ['Hello']], [[12345, 15346, 'Hello']]), ('normal control', [[12345, 12352], ['xyz']], [[12345, 12352, 'xyz']])], [('regression: part weight', [[0, 7], [' ', 'ok ', ' ', 'ok ']], [[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]), ('regression variant: part weight', [[12345, 13345], [' ', 'ok ']], [[12345, 12678, ''], [12678, 13345, 'ok']]), ('partial repair probe: part weight', [[12345, 13344], ['ok ', 'ok ', ' ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('partial repair variant: part weight', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[12345, 12445], ['a']], [[12345, 12445, 'a']]), ('normal control', [[12345, 13345], ['xyz']], [[12345, 13345, 'xyz']]), ('normal control', [[12345, 12352], ['Longer chunk of text', 'a', 'xyz']], [[12345, 12350, 'Longer chunk of text'], [12350, 12351, 'a'], [12351, 12352, 'xyz']])], [('regression: part weight', [[1000, 2000], ['ok ', '', '']], [[1000, 1500, 'ok'], [1500, 1750, ''], [1750, 2000, '']]), ('regression variant: part weight', [[0, 100], ['', '', 'friend']], [[0, 12, ''], [12, 25, ''], [25, 100, 'friend']]), ('partial repair probe: part weight', [[1000, 1100], [' there ', 'ok ', 'Longer chunk of text']], [[1000, 1018, 'there'], [1018, 1025, 'ok'], [1025, 1100, 'Longer chunk of text']]), ('partial repair variant: part weight', [[12345, 13345], [' ', 'ok ']], [[12345, 12678, ''], [12678, 13345, 'ok']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[12345, 13344], ['Hello', 'friend', 'a']], [[12345, 12761, 'Hello'], [12761, 13260, 'friend'], [13260, 13344, 'a']]), ('normal control', [[12345, 13345], ['friend']], [[12345, 13345, 'friend']]), ('normal control', [[12345, 15346], ['xyz', 'Hello', 'a']], [[12345, 13345, 'xyz'], [13345, 15012, 'Hello'], [15012, 15346, 'a']])]]
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: part weight | [[0, 500, 'a'], [500, 1000, '']] | [[0, 500, 'a'], [500, 1000, '']] | Passed |
| regression variant: part weight | [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12351, 'xyz'], [12351, 12352, '']] | [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12351, 'xyz'], [12351, 12352, '']] | Passed |
| partial repair probe: part weight | [[0, 900, 'ok'], [900, 3001, 'there']] | [[0, 857, 'ok'], [857, 3001, 'there']] | Failed |
| partial repair variant: part weight | [[1000, 1053, 'there'], [1053, 1100, 'friend']] | [[1000, 1045, 'there'], [1045, 1100, 'friend']] | Failed |
| boundary control | [[0, 500, 'ab'], [500, 1000, 'cd']] | [[0, 500, 'ab'], [500, 1000, 'cd']] | Passed |
| boundary control | [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']] | [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']] | Passed |
| normal control | [[0, 2500, 'xyz']] | [[0, 2500, 'xyz']] | Passed |
| normal control | [[1000, 1007, 'xyz']] | [[1000, 1007, 'xyz']] | Passed |
| normal control | [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']] | [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']] | Passed |
SHA-256 / c06ffc50cb0c8b1c773f34165fabe894a301c3ddb20ee89eb33a5423d413d629
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(cue, parts):
start,end=cue
w=[max(1,len(p.strip())) for p in parts]
total=sum(w)
dur=end-start
out=[]
acc=0
prev=start
for p,x in zip(parts,w):
acc+=x
b=start+dur*acc//total
out.append([prev,b,p.strip()])
prev=b
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: part weight', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('regression variant: part weight', [[12345, 12352], [' there ', ' there ', 'xyz', ' ']], [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12351, 'xyz'], [12351, 12352, '']]), ('partial repair probe: part weight', [[0, 3001], ['ok ', ' there ']], [[0, 857, 'ok'], [857, 3001, 'there']]), ('partial repair variant: part weight', [[1000, 1100], [' there ', 'friend']], [[1000, 1045, 'there'], [1045, 1100, 'friend']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[0, 2500], ['xyz']], [[0, 2500, 'xyz']]), ('normal control', [[1000, 1007], ['xyz']], [[1000, 1007, 'xyz']]), ('normal control', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']])], [('regression: part weight', [[1000, 1999], ['ok ', ' ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('regression variant: part weight', [[12345, 15346], ['a', '']], [[12345, 13845, 'a'], [13845, 15346, '']]), ('partial repair probe: part weight', [[1000, 1999], ['ok ', 'Hello']], [[1000, 1285, 'ok'], [1285, 1999, 'Hello']]), ('partial repair variant: part weight', [[0, 2500], [' there ', 'Longer chunk of text']], [[0, 500, 'there'], [500, 2500, 'Longer chunk of text']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[0, 7], [' there ']], [[0, 7, 'there']]), ('normal control', [[1000, 1999], ['friend']], [[1000, 1999, 'friend']]), ('normal control', [[1000, 1999], ['xyz', 'friend']], [[1000, 1333, 'xyz'], [1333, 1999, 'friend']])], [('regression: part weight', [[12345, 13344], ['ok ', 'ok ', ' ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('regression variant: part weight', [[0, 2500], ['', 'ok ', '']], [[0, 625, ''], [625, 1875, 'ok'], [1875, 2500, '']]), ('partial repair probe: part weight', [[1000, 1999], ['ok ', ' ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair variant: part weight', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[12345, 13345], ['Hello', 'friend', 'Hello']], [[12345, 12657, 'Hello'], [12657, 13032, 'friend'], [13032, 13345, 'Hello']]), ('normal control', [[12345, 15346], ['Hello']], [[12345, 15346, 'Hello']]), ('normal control', [[12345, 12352], ['xyz']], [[12345, 12352, 'xyz']])], [('regression: part weight', [[0, 7], [' ', 'ok ', ' ', 'ok ']], [[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]), ('regression variant: part weight', [[12345, 13345], [' ', 'ok ']], [[12345, 12678, ''], [12678, 13345, 'ok']]), ('partial repair probe: part weight', [[12345, 13344], ['ok ', 'ok ', ' ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('partial repair variant: part weight', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[12345, 12445], ['a']], [[12345, 12445, 'a']]), ('normal control', [[12345, 13345], ['xyz']], [[12345, 13345, 'xyz']]), ('normal control', [[12345, 12352], ['Longer chunk of text', 'a', 'xyz']], [[12345, 12350, 'Longer chunk of text'], [12350, 12351, 'a'], [12351, 12352, 'xyz']])], [('regression: part weight', [[1000, 2000], ['ok ', '', '']], [[1000, 1500, 'ok'], [1500, 1750, ''], [1750, 2000, '']]), ('regression variant: part weight', [[0, 100], ['', '', 'friend']], [[0, 12, ''], [12, 25, ''], [25, 100, 'friend']]), ('partial repair probe: part weight', [[1000, 1100], [' there ', 'ok ', 'Longer chunk of text']], [[1000, 1018, 'there'], [1018, 1025, 'ok'], [1025, 1100, 'Longer chunk of text']]), ('partial repair variant: part weight', [[12345, 13345], [' ', 'ok ']], [[12345, 12678, ''], [12678, 13345, 'ok']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('normal control', [[12345, 13344], ['Hello', 'friend', 'a']], [[12345, 12761, 'Hello'], [12761, 13260, 'friend'], [13260, 13344, 'a']]), ('normal control', [[12345, 13345], ['friend']], [[12345, 13345, 'friend']]), ('normal control', [[12345, 15346], ['xyz', 'Hello', 'a']], [[12345, 13345, 'xyz'], [13345, 15012, 'Hello'], [15012, 15346, 'a']])]]
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: part weight | [[0, 500, 'a'], [500, 1000, '']] | [[0, 500, 'a'], [500, 1000, '']] | Passed |
| regression variant: part weight | [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12351, 'xyz'], [12351, 12352, '']] | [[12345, 12347, 'there'], [12347, 12350, 'there'], [12350, 12351, 'xyz'], [12351, 12352, '']] | Passed |
| partial repair probe: part weight | [[0, 857, 'ok'], [857, 3001, 'there']] | [[0, 857, 'ok'], [857, 3001, 'there']] | Passed |
| partial repair variant: part weight | [[1000, 1045, 'there'], [1045, 1100, 'friend']] | [[1000, 1045, 'there'], [1045, 1100, 'friend']] | Passed |
| boundary control | [[0, 500, 'ab'], [500, 1000, 'cd']] | [[0, 500, 'ab'], [500, 1000, 'cd']] | Passed |
| boundary control | [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']] | [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']] | Passed |
| normal control | [[0, 2500, 'xyz']] | [[0, 2500, 'xyz']] | Passed |
| normal control | [[1000, 1007, 'xyz']] | [[1000, 1007, 'xyz']] | Passed |
| normal control | [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']] | [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']] | Passed |
SHA-256 / 40d9563b5b579dcc0d55702bde61399d231ad0e078f36f30b69404f61de6e4b0
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:32.102439+00:00.
Case digest / 6ea514facee874674c012986b4e23b653162f30fd5177198ff4950fa340a823f