FAILURE MAP
← Case archive

FA-78126 / Subtitle cue timing / Open access

Proportional cue splitting: boundary arithmetic · case 01

The last split piece ends before the original cue end.

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

ROOT CAUSE

Integer division by the total happens before multiplying by the cumulative weight.

VERIFIED REPAIR

Multiply before the single floor division.

Unsuccessful approach: Rounding to nearest instead of flooring moves boundaries one millisecond late.

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=[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//total*acc
        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: boundary arithmetic', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['Longer chunk of text', 'xyz']], [[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]), ('partial repair probe: boundary arithmetic', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']]), ('partial repair variant: boundary arithmetic', [[0, 7], ['  ', 'ok ', '  ', 'ok ']], [[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('normal control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[0, 100], ['friend', 'ok ', 'ok ']], [[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']]), ('normal control', [[12345, 12352], ['  ']], [[12345, 12352, '']])], [('regression: boundary arithmetic', [[0, 2500], ['xyz']], [[0, 2500, 'xyz']]), ('regression variant: boundary arithmetic', [[0, 7], [' there ']], [[0, 7, 'there']]), ('partial repair probe: boundary arithmetic', [[1000, 1999], ['Longer chunk of text', 'xyz']], [[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]), ('partial repair variant: boundary arithmetic', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[1000, 2000], ['ok ', '', '']], [[1000, 1500, 'ok'], [1500, 1750, ''], [1750, 2000, '']]), ('normal control', [[0, 2500], ['', 'ok ', '']], [[0, 625, ''], [625, 1875, 'ok'], [1875, 2500, '']]), ('normal control', [[1000, 1999], ['xyz', 'friend']], [[1000, 1333, 'xyz'], [1333, 1999, 'friend']])], [('regression: boundary arithmetic', [[1000, 1007], ['xyz']], [[1000, 1007, 'xyz']]), ('regression variant: boundary arithmetic', [[0, 3001], ['ok ', ' there ']], [[0, 857, 'ok'], [857, 3001, 'there']]), ('partial repair probe: boundary arithmetic', [[1000, 1999], ['ok ', '  ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair variant: boundary arithmetic', [[1000, 4001], ['a', ' there ', ' there ', 'a']], [[1000, 1250, 'a'], [1250, 2500, 'there'], [2500, 3750, 'there'], [3750, 4001, 'a']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[1000, 3500], ['Hello']], [[1000, 3500, 'Hello']]), ('normal control', [[12345, 12352], ['']], [[12345, 12352, '']]), ('normal control', [[12345, 12445], ['a']], [[12345, 12445, 'a']])], [('regression: boundary arithmetic', [[0, 7], ['friend', 'Hello', 'ok ']], [[0, 3, 'friend'], [3, 5, 'Hello'], [5, 7, 'ok']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['ok ', 'Hello']], [[1000, 1285, 'ok'], [1285, 1999, 'Hello']]), ('partial repair probe: boundary arithmetic', [[12345, 13344], ['ok ', 'ok ', '  ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('partial repair variant: boundary arithmetic', [[12345, 14845], ['  ', '  ', '  ']], [[12345, 13178, ''], [13178, 14011, ''], [14011, 14845, '']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('normal control', [[12345, 12445], ['xyz', '  ']], [[12345, 12420, 'xyz'], [12420, 12445, '']]), ('normal control', [[0, 7], ['xyz', 'xyz', '  ']], [[0, 3, 'xyz'], [3, 6, 'xyz'], [6, 7, '']]), ('normal control', [[1000, 1999], ['ok ', '  ']], [[1000, 1666, 'ok'], [1666, 1999, '']])], [('regression: boundary arithmetic', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['ok ', '  ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair probe: boundary arithmetic', [[1000, 1100], [' there ', 'ok ', 'Longer chunk of text']], [[1000, 1018, 'there'], [1018, 1025, 'ok'], [1025, 1100, 'Longer chunk of text']]), ('partial repair variant: boundary arithmetic', [[12345, 12445], ['xyz', 'xyz', ' there ', '']], [[12345, 12370, 'xyz'], [12370, 12395, 'xyz'], [12395, 12436, 'there'], [12436, 12445, '']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[12345, 13345], ['  ']], [[12345, 13345, '']]), ('normal control', [[12345, 12352], ['Hello', 'ok ']], [[12345, 12350, 'Hello'], [12350, 12352, 'ok']]), ('normal control', [[0, 1000], ['Longer chunk of text', 'Longer chunk of text']], [[0, 500, 'Longer chunk of text'], [500, 1000, 'Longer chunk of text']])]]
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: boundary arithmetic[[0, 3, 'abc'], [3, 5, 'de'], [5, 6, 'f']][[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]Failed
regression variant: boundary arithmetic[[1000, 1860, 'Longer chunk of text'], [1860, 1989, 'xyz']][[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]Failed
partial repair probe: boundary arithmetic[[1000, 1000, 'a'], [1000, 1000, 'xyz'], [1000, 1000, 'friend'], [1000, 1000, 'a']][[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']]Failed
partial repair variant: boundary arithmetic[[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 6, 'ok']][[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]Failed
boundary control[[0, 500, 'ab'], [500, 1000, 'cd']][[0, 500, 'ab'], [500, 1000, 'cd']]Passed
boundary control[[0, 500, 'a'], [500, 1000, '']][[0, 500, 'a'], [500, 1000, '']]Passed
normal control[[100, 600, 'x'], [600, 1100, 'y']][[100, 600, 'x'], [600, 1100, 'y']]Passed
normal control[[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']][[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']]Passed
normal control[[12345, 12352, '']][[12345, 12352, '']]Passed

SHA-256 / 35ee7ce1258c58cd79c26e70f295c99faf83d538873f68081ffb9926881f65b6

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.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+round(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: boundary arithmetic', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['Longer chunk of text', 'xyz']], [[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]), ('partial repair probe: boundary arithmetic', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']]), ('partial repair variant: boundary arithmetic', [[0, 7], ['  ', 'ok ', '  ', 'ok ']], [[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('normal control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[0, 100], ['friend', 'ok ', 'ok ']], [[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']]), ('normal control', [[12345, 12352], ['  ']], [[12345, 12352, '']])], [('regression: boundary arithmetic', [[0, 2500], ['xyz']], [[0, 2500, 'xyz']]), ('regression variant: boundary arithmetic', [[0, 7], [' there ']], [[0, 7, 'there']]), ('partial repair probe: boundary arithmetic', [[1000, 1999], ['Longer chunk of text', 'xyz']], [[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]), ('partial repair variant: boundary arithmetic', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[1000, 2000], ['ok ', '', '']], [[1000, 1500, 'ok'], [1500, 1750, ''], [1750, 2000, '']]), ('normal control', [[0, 2500], ['', 'ok ', '']], [[0, 625, ''], [625, 1875, 'ok'], [1875, 2500, '']]), ('normal control', [[1000, 1999], ['xyz', 'friend']], [[1000, 1333, 'xyz'], [1333, 1999, 'friend']])], [('regression: boundary arithmetic', [[1000, 1007], ['xyz']], [[1000, 1007, 'xyz']]), ('regression variant: boundary arithmetic', [[0, 3001], ['ok ', ' there ']], [[0, 857, 'ok'], [857, 3001, 'there']]), ('partial repair probe: boundary arithmetic', [[1000, 1999], ['ok ', '  ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair variant: boundary arithmetic', [[1000, 4001], ['a', ' there ', ' there ', 'a']], [[1000, 1250, 'a'], [1250, 2500, 'there'], [2500, 3750, 'there'], [3750, 4001, 'a']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[1000, 3500], ['Hello']], [[1000, 3500, 'Hello']]), ('normal control', [[12345, 12352], ['']], [[12345, 12352, '']]), ('normal control', [[12345, 12445], ['a']], [[12345, 12445, 'a']])], [('regression: boundary arithmetic', [[0, 7], ['friend', 'Hello', 'ok ']], [[0, 3, 'friend'], [3, 5, 'Hello'], [5, 7, 'ok']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['ok ', 'Hello']], [[1000, 1285, 'ok'], [1285, 1999, 'Hello']]), ('partial repair probe: boundary arithmetic', [[12345, 13344], ['ok ', 'ok ', '  ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('partial repair variant: boundary arithmetic', [[12345, 14845], ['  ', '  ', '  ']], [[12345, 13178, ''], [13178, 14011, ''], [14011, 14845, '']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('normal control', [[12345, 12445], ['xyz', '  ']], [[12345, 12420, 'xyz'], [12420, 12445, '']]), ('normal control', [[0, 7], ['xyz', 'xyz', '  ']], [[0, 3, 'xyz'], [3, 6, 'xyz'], [6, 7, '']]), ('normal control', [[1000, 1999], ['ok ', '  ']], [[1000, 1666, 'ok'], [1666, 1999, '']])], [('regression: boundary arithmetic', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['ok ', '  ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair probe: boundary arithmetic', [[1000, 1100], [' there ', 'ok ', 'Longer chunk of text']], [[1000, 1018, 'there'], [1018, 1025, 'ok'], [1025, 1100, 'Longer chunk of text']]), ('partial repair variant: boundary arithmetic', [[12345, 12445], ['xyz', 'xyz', ' there ', '']], [[12345, 12370, 'xyz'], [12370, 12395, 'xyz'], [12395, 12436, 'there'], [12436, 12445, '']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[12345, 13345], ['  ']], [[12345, 13345, '']]), ('normal control', [[12345, 12352], ['Hello', 'ok ']], [[12345, 12350, 'Hello'], [12350, 12352, 'ok']]), ('normal control', [[0, 1000], ['Longer chunk of text', 'Longer chunk of text']], [[0, 500, 'Longer chunk of text'], [500, 1000, 'Longer chunk of text']])]]
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: boundary arithmetic[[0, 4, 'abc'], [4, 6, 'de'], [6, 7, 'f']][[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]Failed
regression variant: boundary arithmetic[[1000, 1869, 'Longer chunk of text'], [1869, 1999, 'xyz']][[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]Failed
partial repair probe: boundary arithmetic[[1000, 1001, 'a'], [1001, 1003, 'xyz'], [1003, 1006, 'friend'], [1006, 1007, 'a']][[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']]Failed
partial repair variant: boundary arithmetic[[0, 1, ''], [1, 4, 'ok'], [4, 5, ''], [5, 7, 'ok']][[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]Failed
boundary control[[0, 500, 'ab'], [500, 1000, 'cd']][[0, 500, 'ab'], [500, 1000, 'cd']]Passed
boundary control[[0, 500, 'a'], [500, 1000, '']][[0, 500, 'a'], [500, 1000, '']]Passed
normal control[[100, 600, 'x'], [600, 1100, 'y']][[100, 600, 'x'], [600, 1100, 'y']]Passed
normal control[[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']][[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']]Passed
normal control[[12345, 12352, '']][[12345, 12352, '']]Passed

SHA-256 / 96648911546e1207dae8aded2a83550efdcf72a700dc548132d685c7dedf402e

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: boundary arithmetic', [[0, 7], ['abc', 'de', 'f']], [[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['Longer chunk of text', 'xyz']], [[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]), ('partial repair probe: boundary arithmetic', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']]), ('partial repair variant: boundary arithmetic', [[0, 7], ['  ', 'ok ', '  ', 'ok ']], [[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('normal control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[0, 100], ['friend', 'ok ', 'ok ']], [[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']]), ('normal control', [[12345, 12352], ['  ']], [[12345, 12352, '']])], [('regression: boundary arithmetic', [[0, 2500], ['xyz']], [[0, 2500, 'xyz']]), ('regression variant: boundary arithmetic', [[0, 7], [' there ']], [[0, 7, 'there']]), ('partial repair probe: boundary arithmetic', [[1000, 1999], ['Longer chunk of text', 'xyz']], [[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]), ('partial repair variant: boundary arithmetic', [[1000, 3500], ['a', 'ok ', 'Longer chunk of text']], [[1000, 1108, 'a'], [1108, 1326, 'ok'], [1326, 3500, 'Longer chunk of text']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[1000, 2000], ['ok ', '', '']], [[1000, 1500, 'ok'], [1500, 1750, ''], [1750, 2000, '']]), ('normal control', [[0, 2500], ['', 'ok ', '']], [[0, 625, ''], [625, 1875, 'ok'], [1875, 2500, '']]), ('normal control', [[1000, 1999], ['xyz', 'friend']], [[1000, 1333, 'xyz'], [1333, 1999, 'friend']])], [('regression: boundary arithmetic', [[1000, 1007], ['xyz']], [[1000, 1007, 'xyz']]), ('regression variant: boundary arithmetic', [[0, 3001], ['ok ', ' there ']], [[0, 857, 'ok'], [857, 3001, 'there']]), ('partial repair probe: boundary arithmetic', [[1000, 1999], ['ok ', '  ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair variant: boundary arithmetic', [[1000, 4001], ['a', ' there ', ' there ', 'a']], [[1000, 1250, 'a'], [1250, 2500, 'there'], [2500, 3750, 'there'], [3750, 4001, 'a']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('normal control', [[1000, 3500], ['Hello']], [[1000, 3500, 'Hello']]), ('normal control', [[12345, 12352], ['']], [[12345, 12352, '']]), ('normal control', [[12345, 12445], ['a']], [[12345, 12445, 'a']])], [('regression: boundary arithmetic', [[0, 7], ['friend', 'Hello', 'ok ']], [[0, 3, 'friend'], [3, 5, 'Hello'], [5, 7, 'ok']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['ok ', 'Hello']], [[1000, 1285, 'ok'], [1285, 1999, 'Hello']]), ('partial repair probe: boundary arithmetic', [[12345, 13344], ['ok ', 'ok ', '  ']], [[12345, 12744, 'ok'], [12744, 13144, 'ok'], [13144, 13344, '']]), ('partial repair variant: boundary arithmetic', [[12345, 14845], ['  ', '  ', '  ']], [[12345, 13178, ''], [13178, 14011, ''], [14011, 14845, '']]), ('boundary control', [[0, 1000], ['ab', 'cd']], [[0, 500, 'ab'], [500, 1000, 'cd']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('normal control', [[12345, 12445], ['xyz', '  ']], [[12345, 12420, 'xyz'], [12420, 12445, '']]), ('normal control', [[0, 7], ['xyz', 'xyz', '  ']], [[0, 3, 'xyz'], [3, 6, 'xyz'], [6, 7, '']]), ('normal control', [[1000, 1999], ['ok ', '  ']], [[1000, 1666, 'ok'], [1666, 1999, '']])], [('regression: boundary arithmetic', [[1000, 1007], ['a', 'xyz', 'friend', 'a']], [[1000, 1000, 'a'], [1000, 1002, 'xyz'], [1002, 1006, 'friend'], [1006, 1007, 'a']]), ('regression variant: boundary arithmetic', [[1000, 1999], ['ok ', '  ', 'friend', 'ok ']], [[1000, 1181, 'ok'], [1181, 1272, ''], [1272, 1817, 'friend'], [1817, 1999, 'ok']]), ('partial repair probe: boundary arithmetic', [[1000, 1100], [' there ', 'ok ', 'Longer chunk of text']], [[1000, 1018, 'there'], [1018, 1025, 'ok'], [1025, 1100, 'Longer chunk of text']]), ('partial repair variant: boundary arithmetic', [[12345, 12445], ['xyz', 'xyz', ' there ', '']], [[12345, 12370, 'xyz'], [12370, 12395, 'xyz'], [12395, 12436, 'there'], [12436, 12445, '']]), ('boundary control', [[0, 1000], ['a', '']], [[0, 500, 'a'], [500, 1000, '']]), ('boundary control', [[100, 1100], [' x ', 'y']], [[100, 600, 'x'], [600, 1100, 'y']]), ('normal control', [[12345, 13345], ['  ']], [[12345, 13345, '']]), ('normal control', [[12345, 12352], ['Hello', 'ok ']], [[12345, 12350, 'Hello'], [12350, 12352, 'ok']]), ('normal control', [[0, 1000], ['Longer chunk of text', 'Longer chunk of text']], [[0, 500, 'Longer chunk of text'], [500, 1000, 'Longer chunk of text']])]]
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: boundary arithmetic[[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']][[0, 3, 'abc'], [3, 5, 'de'], [5, 7, 'f']]Passed
regression variant: boundary arithmetic[[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']][[1000, 1868, 'Longer chunk of text'], [1868, 1999, 'xyz']]Passed
partial repair probe: boundary arithmetic[[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
partial repair variant: boundary arithmetic[[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']][[0, 1, ''], [1, 3, 'ok'], [3, 4, ''], [4, 7, 'ok']]Passed
boundary control[[0, 500, 'ab'], [500, 1000, 'cd']][[0, 500, 'ab'], [500, 1000, 'cd']]Passed
boundary control[[0, 500, 'a'], [500, 1000, '']][[0, 500, 'a'], [500, 1000, '']]Passed
normal control[[100, 600, 'x'], [600, 1100, 'y']][[100, 600, 'x'], [600, 1100, 'y']]Passed
normal control[[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']][[0, 60, 'friend'], [60, 80, 'ok'], [80, 100, 'ok']]Passed
normal control[[12345, 12352, '']][[12345, 12352, '']]Passed

SHA-256 / 5787d378fa4c1535f16539f38241fe46dc8da66851a8d7dbeefafb733fd7b660

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

Case digest / 0347904bb80b38d552f4ed5657de57eb99eae59dbcb4862cc18e8e5eb4486b6a