FAILURE MAP
← Case archive

FA-78021 / Subtitle cue timing / Open access

Subtitle reading-speed check: line break exclusion · case 01

Two-line cues are flagged as too fast although the text is short.

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

ROOT CAUSE

Line breaks are counted as readable characters.

VERIFIED REPAIR

Remove line breaks before counting characters.

Unsuccessful approach: Replacing breaks with spaces still counts one character per break.

Case contract

For cues [start,end,text] return the 1-based indices whose reading speed exceeds max_cps. Tags <...> are removed, CRLF is treated as one line break, line breaks are not counted, all other characters (including spaces) count. The test is chars*1000 > max_cps*duration; a cue with duration <= 0 is flagged iff it has any counted character.

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
import re
N = 1
observations = []
def solve(cues, max_cps):
    flagged=[]
    for idx,(start,end,text) in enumerate(cues,1):
        visible=re.sub(r'<[^>]*>','',text)
        visible=visible.replace('\r\n','\n')
        chars=len(visible)
        dur=end-start
        if dur<=0:
            if chars>0: flagged.append(idx)
            continue
        if chars*1000>max_cps*dur:
            flagged.append(idx)
    return flagged
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: line break exclusion', [[[0, 500, 'a\r\nb']], 5], []), ('regression variant: line break exclusion', [[[7027, 7527, 'Two\nlines'], [1204, 1851, '<i>Italic</i> text'], [7529, 9059, 'Long line of dialogue here'], [3040, 3216, '<font color="red">Red</font>'], [5263, 5253, 'Two\r\nlines']], 17], [2, 4, 5]), ('partial repair probe: line break exclusion', [[[8781, 9781, 'x\ny\nz'], [6605, 6664, 'x\n'], [733, 723, '<font color="red">Red</font>'], [2157, 2147, 'a']], 17], [3, 4]), ('partial repair variant: line break exclusion', [[[8476, 8947, 'Hi there'], [6662, 7162, '<font color="red">Red</font>'], [6248, 6365, 'x\n'], [2603, 3103, 'x\n'], [4374, 4874, 'I']], 17], []), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('normal control', [[[0, 0, '']], 17], []), ('normal control', [[[839, 3839, 'I'], [4652, 6652, 'x\ny\nz']], 17], []), ('normal control', [[[2260, 3260, '  spaced  '], [770, 770, '<font color="red">Red</font>'], [4134, 4201, 'a'], [6488, 9488, '<c.yellow>Cue</c> text']], 15], [2])], [('regression: line break exclusion', [[[2569, 2769, 'A\r\nB\r\nC'], [1782, 1782, 'x\ny\nz']], 15], [2]), ('regression variant: line break exclusion', [[[6951, 7480, 'Two\nlines'], [5406, 5906, 'x\ny\nz'], [1631, 2101, 'Hi there'], [6704, 7234, 'Two\nlines']], 17], [3]), ('partial repair probe: line break exclusion', [[[5207, 5208, ''], [8379, 8879, '  spaced  '], [9114, 9365, 'x\ny\nz'], [2354, 2344, 'Hi there'], [3706, 3756, 'x\n']], 20], [4]), ('partial repair variant: line break exclusion', [[[1599, 1800, 'A\r\nB\r\nC'], [8401, 8401, '']], 15], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('boundary control', [[[0, 0, '']], 17], []), ('normal control', [[[9663, 11063, '<font color="red">Red</font>']], 20], []), ('normal control', [[[1285, 1285, '<c.yellow>Cue</c> text'], [4496, 4596, '<i>A</i>'], [6179, 6169, 'Hello']], 20], [1, 3]), ('normal control', [[[3439, 3939, 'a<b>b</b>c<i>d</i>'], [7218, 9218, '<c.yellow>Cue</c> text'], [9347, 11347, 'Two\r\nlines'], [1314, 1314, 'A\r\nB\r\nC'], [1557, 3557, 'x\ny\nz']], 10], [4])], [('regression: line break exclusion', [[[8781, 9781, 'x\ny\nz'], [6605, 6664, 'x\n'], [733, 723, '<font color="red">Red</font>'], [2157, 2147, 'a']], 17], [3, 4]), ('regression variant: line break exclusion', [[[4903, 5303, 'Two\r\nlines'], [7669, 7920, 'Hello'], [9175, 12175, 'Two\nlines']], 20], []), ('partial repair probe: line break exclusion', [[[4694, 5494, 'Two\nlines'], [3327, 3327, 'x\ny\nz'], [2373, 4573, '<c.yellow>Cue</c> text'], [1711, 1911, 'x\n'], [7573, 7573, '<c.yellow>Cue</c> text']], 10], [2, 5]), ('partial repair variant: line break exclusion', [[[936, 1137, 'A\r\nB\r\nC'], [5836, 7570, 'Long line of dialogue here'], [1739, 1739, '']], 15], []), ('boundary control', [[[0, 0, '']], 17], []), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('normal control', [[[8892, 9392, 'Two\nlines']], 10], [1]), ('normal control', [[[6012, 6112, 'Hi there']], 15], [1]), ('normal control', [[[893, 1893, '<c.yellow>Cue</c> text']], 10], [])], [('regression: line break exclusion', [[[5207, 5208, ''], [8379, 8879, '  spaced  '], [9114, 9365, 'x\ny\nz'], [2354, 2344, 'Hi there'], [3706, 3756, 'x\n']], 20], [4]), ('regression variant: line break exclusion', [[[8642, 8642, '<font color="red">Red</font>'], [5828, 5818, 'Two\r\nlines'], [3091, 3591, 'a'], [1539, 1839, 'x\ny\nz']], 10], [1, 2]), ('partial repair probe: line break exclusion', [[[7027, 7527, 'Two\nlines'], [1204, 1851, '<i>Italic</i> text'], [7529, 9059, 'Long line of dialogue here'], [3040, 3216, '<font color="red">Red</font>'], [5263, 5253, 'Two\r\nlines']], 17], [2, 4, 5]), ('partial repair variant: line break exclusion', [[[8878, 9378, 'a'], [1695, 1990, 'x\ny\nz'], [8649, 8649, '<c.yellow>Cue</c> text'], [4805, 5334, 'Two\nlines']], 17], [3]), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('normal control', [[[540, 607, 'a'], [5643, 7643, '<i>Italic</i> text']], 15], []), ('normal control', [[[959, 1459, 'Two\nlines'], [7727, 7727, 'x\ny\nz'], [3146, 3146, '<i>Italic</i> text'], [3843, 6843, 'Long line of dialogue here']], 20], [2, 3]), ('normal control', [[[5543, 5743, '<font color="red">Red</font>'], [3551, 4551, 'Two\nlines'], [4354, 4454, '<i>A</i>']], 15], [])], [('regression: line break exclusion', [[[4694, 5494, 'Two\nlines'], [3327, 3327, 'x\ny\nz'], [2373, 4573, '<c.yellow>Cue</c> text'], [1711, 1911, 'x\n'], [7573, 7573, '<c.yellow>Cue</c> text']], 10], [2, 5]), ('regression variant: line break exclusion', [[[8476, 8947, 'Hi there'], [6662, 7162, '<font color="red">Red</font>'], [6248, 6365, 'x\n'], [2603, 3103, 'x\n'], [4374, 4874, 'I']], 17], []), ('partial repair probe: line break exclusion', [[[6951, 7480, 'Two\nlines'], [5406, 5906, 'x\ny\nz'], [1631, 2101, 'Hi there'], [6704, 7234, 'Two\nlines']], 17], [3]), ('partial repair variant: line break exclusion', [[[2544, 2544, '  spaced  '], [4666, 4766, 'Hello'], [1260, 1250, ''], [1606, 1807, 'x\ny\nz']], 15], [1, 2]), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('boundary control', [[[0, 0, '']], 17], []), ('normal control', [[[7961, 7961, 'x\n'], [4865, 5399, 'Hi there'], [9675, 12675, ''], [2209, 3410, 'a<b>b</b>c<i>d</i>'], [4016, 4116, 'a<b>b</b>c<i>d</i>']], 15], [1, 5]), ('normal control', [[[4643, 7643, 'a']], 10], []), ('normal control', [[[4743, 5143, '<i>A</i>'], [1982, 2982, 'Hi there'], [5318, 5468, '<font color="red">Red</font>'], [4990, 5140, '<font color="red">Red</font>'], [1465, 1965, '<i>A</i>']], 20], [])]]
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: line break exclusion[1][]Failed
regression variant: line break exclusion[1, 2, 4, 5][2, 4, 5]Failed
partial repair probe: line break exclusion[2, 3, 4][3, 4]Failed
partial repair variant: line break exclusion[3][]Failed
boundary control[][]Passed
boundary control[1][1]Passed
normal control[][]Passed
normal control[][]Passed
normal control[2][2]Passed

SHA-256 / a3a3550a72fcfbdf177b19cbd8bc67b59ec7e33804fe94a20a110609f5808d40

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(cues, max_cps):
    flagged=[]
    for idx,(start,end,text) in enumerate(cues,1):
        visible=re.sub(r'<[^>]*>','',text)
        visible=visible.replace('\r\n','\n')
        chars=len(visible.replace('\n',' '))
        dur=end-start
        if dur<=0:
            if chars>0: flagged.append(idx)
            continue
        if chars*1000>max_cps*dur:
            flagged.append(idx)
    return flagged
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: line break exclusion', [[[0, 500, 'a\r\nb']], 5], []), ('regression variant: line break exclusion', [[[7027, 7527, 'Two\nlines'], [1204, 1851, '<i>Italic</i> text'], [7529, 9059, 'Long line of dialogue here'], [3040, 3216, '<font color="red">Red</font>'], [5263, 5253, 'Two\r\nlines']], 17], [2, 4, 5]), ('partial repair probe: line break exclusion', [[[8781, 9781, 'x\ny\nz'], [6605, 6664, 'x\n'], [733, 723, '<font color="red">Red</font>'], [2157, 2147, 'a']], 17], [3, 4]), ('partial repair variant: line break exclusion', [[[8476, 8947, 'Hi there'], [6662, 7162, '<font color="red">Red</font>'], [6248, 6365, 'x\n'], [2603, 3103, 'x\n'], [4374, 4874, 'I']], 17], []), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('normal control', [[[0, 0, '']], 17], []), ('normal control', [[[839, 3839, 'I'], [4652, 6652, 'x\ny\nz']], 17], []), ('normal control', [[[2260, 3260, '  spaced  '], [770, 770, '<font color="red">Red</font>'], [4134, 4201, 'a'], [6488, 9488, '<c.yellow>Cue</c> text']], 15], [2])], [('regression: line break exclusion', [[[2569, 2769, 'A\r\nB\r\nC'], [1782, 1782, 'x\ny\nz']], 15], [2]), ('regression variant: line break exclusion', [[[6951, 7480, 'Two\nlines'], [5406, 5906, 'x\ny\nz'], [1631, 2101, 'Hi there'], [6704, 7234, 'Two\nlines']], 17], [3]), ('partial repair probe: line break exclusion', [[[5207, 5208, ''], [8379, 8879, '  spaced  '], [9114, 9365, 'x\ny\nz'], [2354, 2344, 'Hi there'], [3706, 3756, 'x\n']], 20], [4]), ('partial repair variant: line break exclusion', [[[1599, 1800, 'A\r\nB\r\nC'], [8401, 8401, '']], 15], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('boundary control', [[[0, 0, '']], 17], []), ('normal control', [[[9663, 11063, '<font color="red">Red</font>']], 20], []), ('normal control', [[[1285, 1285, '<c.yellow>Cue</c> text'], [4496, 4596, '<i>A</i>'], [6179, 6169, 'Hello']], 20], [1, 3]), ('normal control', [[[3439, 3939, 'a<b>b</b>c<i>d</i>'], [7218, 9218, '<c.yellow>Cue</c> text'], [9347, 11347, 'Two\r\nlines'], [1314, 1314, 'A\r\nB\r\nC'], [1557, 3557, 'x\ny\nz']], 10], [4])], [('regression: line break exclusion', [[[8781, 9781, 'x\ny\nz'], [6605, 6664, 'x\n'], [733, 723, '<font color="red">Red</font>'], [2157, 2147, 'a']], 17], [3, 4]), ('regression variant: line break exclusion', [[[4903, 5303, 'Two\r\nlines'], [7669, 7920, 'Hello'], [9175, 12175, 'Two\nlines']], 20], []), ('partial repair probe: line break exclusion', [[[4694, 5494, 'Two\nlines'], [3327, 3327, 'x\ny\nz'], [2373, 4573, '<c.yellow>Cue</c> text'], [1711, 1911, 'x\n'], [7573, 7573, '<c.yellow>Cue</c> text']], 10], [2, 5]), ('partial repair variant: line break exclusion', [[[936, 1137, 'A\r\nB\r\nC'], [5836, 7570, 'Long line of dialogue here'], [1739, 1739, '']], 15], []), ('boundary control', [[[0, 0, '']], 17], []), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('normal control', [[[8892, 9392, 'Two\nlines']], 10], [1]), ('normal control', [[[6012, 6112, 'Hi there']], 15], [1]), ('normal control', [[[893, 1893, '<c.yellow>Cue</c> text']], 10], [])], [('regression: line break exclusion', [[[5207, 5208, ''], [8379, 8879, '  spaced  '], [9114, 9365, 'x\ny\nz'], [2354, 2344, 'Hi there'], [3706, 3756, 'x\n']], 20], [4]), ('regression variant: line break exclusion', [[[8642, 8642, '<font color="red">Red</font>'], [5828, 5818, 'Two\r\nlines'], [3091, 3591, 'a'], [1539, 1839, 'x\ny\nz']], 10], [1, 2]), ('partial repair probe: line break exclusion', [[[7027, 7527, 'Two\nlines'], [1204, 1851, '<i>Italic</i> text'], [7529, 9059, 'Long line of dialogue here'], [3040, 3216, '<font color="red">Red</font>'], [5263, 5253, 'Two\r\nlines']], 17], [2, 4, 5]), ('partial repair variant: line break exclusion', [[[8878, 9378, 'a'], [1695, 1990, 'x\ny\nz'], [8649, 8649, '<c.yellow>Cue</c> text'], [4805, 5334, 'Two\nlines']], 17], [3]), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('normal control', [[[540, 607, 'a'], [5643, 7643, '<i>Italic</i> text']], 15], []), ('normal control', [[[959, 1459, 'Two\nlines'], [7727, 7727, 'x\ny\nz'], [3146, 3146, '<i>Italic</i> text'], [3843, 6843, 'Long line of dialogue here']], 20], [2, 3]), ('normal control', [[[5543, 5743, '<font color="red">Red</font>'], [3551, 4551, 'Two\nlines'], [4354, 4454, '<i>A</i>']], 15], [])], [('regression: line break exclusion', [[[4694, 5494, 'Two\nlines'], [3327, 3327, 'x\ny\nz'], [2373, 4573, '<c.yellow>Cue</c> text'], [1711, 1911, 'x\n'], [7573, 7573, '<c.yellow>Cue</c> text']], 10], [2, 5]), ('regression variant: line break exclusion', [[[8476, 8947, 'Hi there'], [6662, 7162, '<font color="red">Red</font>'], [6248, 6365, 'x\n'], [2603, 3103, 'x\n'], [4374, 4874, 'I']], 17], []), ('partial repair probe: line break exclusion', [[[6951, 7480, 'Two\nlines'], [5406, 5906, 'x\ny\nz'], [1631, 2101, 'Hi there'], [6704, 7234, 'Two\nlines']], 17], [3]), ('partial repair variant: line break exclusion', [[[2544, 2544, '  spaced  '], [4666, 4766, 'Hello'], [1260, 1250, ''], [1606, 1807, 'x\ny\nz']], 15], [1, 2]), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('boundary control', [[[0, 0, '']], 17], []), ('normal control', [[[7961, 7961, 'x\n'], [4865, 5399, 'Hi there'], [9675, 12675, ''], [2209, 3410, 'a<b>b</b>c<i>d</i>'], [4016, 4116, 'a<b>b</b>c<i>d</i>']], 15], [1, 5]), ('normal control', [[[4643, 7643, 'a']], 10], []), ('normal control', [[[4743, 5143, '<i>A</i>'], [1982, 2982, 'Hi there'], [5318, 5468, '<font color="red">Red</font>'], [4990, 5140, '<font color="red">Red</font>'], [1465, 1965, '<i>A</i>']], 20], [])]]
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: line break exclusion[1][]Failed
regression variant: line break exclusion[1, 2, 4, 5][2, 4, 5]Failed
partial repair probe: line break exclusion[2, 3, 4][3, 4]Failed
partial repair variant: line break exclusion[3][]Failed
boundary control[][]Passed
boundary control[1][1]Passed
normal control[][]Passed
normal control[][]Passed
normal control[2][2]Passed

SHA-256 / 83fc21215d1a18cf329abf0aeffca79cf1a6b0a0eaf25a81b686820ef27ab6db

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(cues, max_cps):
    flagged=[]
    for idx,(start,end,text) in enumerate(cues,1):
        visible=re.sub(r'<[^>]*>','',text)
        visible=visible.replace('\r\n','\n')
        chars=len(visible.replace('\n',''))
        dur=end-start
        if dur<=0:
            if chars>0: flagged.append(idx)
            continue
        if chars*1000>max_cps*dur:
            flagged.append(idx)
    return flagged
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: line break exclusion', [[[0, 500, 'a\r\nb']], 5], []), ('regression variant: line break exclusion', [[[7027, 7527, 'Two\nlines'], [1204, 1851, '<i>Italic</i> text'], [7529, 9059, 'Long line of dialogue here'], [3040, 3216, '<font color="red">Red</font>'], [5263, 5253, 'Two\r\nlines']], 17], [2, 4, 5]), ('partial repair probe: line break exclusion', [[[8781, 9781, 'x\ny\nz'], [6605, 6664, 'x\n'], [733, 723, '<font color="red">Red</font>'], [2157, 2147, 'a']], 17], [3, 4]), ('partial repair variant: line break exclusion', [[[8476, 8947, 'Hi there'], [6662, 7162, '<font color="red">Red</font>'], [6248, 6365, 'x\n'], [2603, 3103, 'x\n'], [4374, 4874, 'I']], 17], []), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('normal control', [[[0, 0, '']], 17], []), ('normal control', [[[839, 3839, 'I'], [4652, 6652, 'x\ny\nz']], 17], []), ('normal control', [[[2260, 3260, '  spaced  '], [770, 770, '<font color="red">Red</font>'], [4134, 4201, 'a'], [6488, 9488, '<c.yellow>Cue</c> text']], 15], [2])], [('regression: line break exclusion', [[[2569, 2769, 'A\r\nB\r\nC'], [1782, 1782, 'x\ny\nz']], 15], [2]), ('regression variant: line break exclusion', [[[6951, 7480, 'Two\nlines'], [5406, 5906, 'x\ny\nz'], [1631, 2101, 'Hi there'], [6704, 7234, 'Two\nlines']], 17], [3]), ('partial repair probe: line break exclusion', [[[5207, 5208, ''], [8379, 8879, '  spaced  '], [9114, 9365, 'x\ny\nz'], [2354, 2344, 'Hi there'], [3706, 3756, 'x\n']], 20], [4]), ('partial repair variant: line break exclusion', [[[1599, 1800, 'A\r\nB\r\nC'], [8401, 8401, '']], 15], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('boundary control', [[[0, 0, '']], 17], []), ('normal control', [[[9663, 11063, '<font color="red">Red</font>']], 20], []), ('normal control', [[[1285, 1285, '<c.yellow>Cue</c> text'], [4496, 4596, '<i>A</i>'], [6179, 6169, 'Hello']], 20], [1, 3]), ('normal control', [[[3439, 3939, 'a<b>b</b>c<i>d</i>'], [7218, 9218, '<c.yellow>Cue</c> text'], [9347, 11347, 'Two\r\nlines'], [1314, 1314, 'A\r\nB\r\nC'], [1557, 3557, 'x\ny\nz']], 10], [4])], [('regression: line break exclusion', [[[8781, 9781, 'x\ny\nz'], [6605, 6664, 'x\n'], [733, 723, '<font color="red">Red</font>'], [2157, 2147, 'a']], 17], [3, 4]), ('regression variant: line break exclusion', [[[4903, 5303, 'Two\r\nlines'], [7669, 7920, 'Hello'], [9175, 12175, 'Two\nlines']], 20], []), ('partial repair probe: line break exclusion', [[[4694, 5494, 'Two\nlines'], [3327, 3327, 'x\ny\nz'], [2373, 4573, '<c.yellow>Cue</c> text'], [1711, 1911, 'x\n'], [7573, 7573, '<c.yellow>Cue</c> text']], 10], [2, 5]), ('partial repair variant: line break exclusion', [[[936, 1137, 'A\r\nB\r\nC'], [5836, 7570, 'Long line of dialogue here'], [1739, 1739, '']], 15], []), ('boundary control', [[[0, 0, '']], 17], []), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('normal control', [[[8892, 9392, 'Two\nlines']], 10], [1]), ('normal control', [[[6012, 6112, 'Hi there']], 15], [1]), ('normal control', [[[893, 1893, '<c.yellow>Cue</c> text']], 10], [])], [('regression: line break exclusion', [[[5207, 5208, ''], [8379, 8879, '  spaced  '], [9114, 9365, 'x\ny\nz'], [2354, 2344, 'Hi there'], [3706, 3756, 'x\n']], 20], [4]), ('regression variant: line break exclusion', [[[8642, 8642, '<font color="red">Red</font>'], [5828, 5818, 'Two\r\nlines'], [3091, 3591, 'a'], [1539, 1839, 'x\ny\nz']], 10], [1, 2]), ('partial repair probe: line break exclusion', [[[7027, 7527, 'Two\nlines'], [1204, 1851, '<i>Italic</i> text'], [7529, 9059, 'Long line of dialogue here'], [3040, 3216, '<font color="red">Red</font>'], [5263, 5253, 'Two\r\nlines']], 17], [2, 4, 5]), ('partial repair variant: line break exclusion', [[[8878, 9378, 'a'], [1695, 1990, 'x\ny\nz'], [8649, 8649, '<c.yellow>Cue</c> text'], [4805, 5334, 'Two\nlines']], 17], [3]), ('boundary control', [[[0, 1000, 'abcdefghij']], 10], []), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('normal control', [[[540, 607, 'a'], [5643, 7643, '<i>Italic</i> text']], 15], []), ('normal control', [[[959, 1459, 'Two\nlines'], [7727, 7727, 'x\ny\nz'], [3146, 3146, '<i>Italic</i> text'], [3843, 6843, 'Long line of dialogue here']], 20], [2, 3]), ('normal control', [[[5543, 5743, '<font color="red">Red</font>'], [3551, 4551, 'Two\nlines'], [4354, 4454, '<i>A</i>']], 15], [])], [('regression: line break exclusion', [[[4694, 5494, 'Two\nlines'], [3327, 3327, 'x\ny\nz'], [2373, 4573, '<c.yellow>Cue</c> text'], [1711, 1911, 'x\n'], [7573, 7573, '<c.yellow>Cue</c> text']], 10], [2, 5]), ('regression variant: line break exclusion', [[[8476, 8947, 'Hi there'], [6662, 7162, '<font color="red">Red</font>'], [6248, 6365, 'x\n'], [2603, 3103, 'x\n'], [4374, 4874, 'I']], 17], []), ('partial repair probe: line break exclusion', [[[6951, 7480, 'Two\nlines'], [5406, 5906, 'x\ny\nz'], [1631, 2101, 'Hi there'], [6704, 7234, 'Two\nlines']], 17], [3]), ('partial repair variant: line break exclusion', [[[2544, 2544, '  spaced  '], [4666, 4766, 'Hello'], [1260, 1250, ''], [1606, 1807, 'x\ny\nz']], 15], [1, 2]), ('boundary control', [[[0, 0, 'a']], 17], [1]), ('boundary control', [[[0, 0, '']], 17], []), ('normal control', [[[7961, 7961, 'x\n'], [4865, 5399, 'Hi there'], [9675, 12675, ''], [2209, 3410, 'a<b>b</b>c<i>d</i>'], [4016, 4116, 'a<b>b</b>c<i>d</i>']], 15], [1, 5]), ('normal control', [[[4643, 7643, 'a']], 10], []), ('normal control', [[[4743, 5143, '<i>A</i>'], [1982, 2982, 'Hi there'], [5318, 5468, '<font color="red">Red</font>'], [4990, 5140, '<font color="red">Red</font>'], [1465, 1965, '<i>A</i>']], 20], [])]]
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: line break exclusion[][]Passed
regression variant: line break exclusion[2, 4, 5][2, 4, 5]Passed
partial repair probe: line break exclusion[3, 4][3, 4]Passed
partial repair variant: line break exclusion[][]Passed
boundary control[][]Passed
boundary control[1][1]Passed
normal control[][]Passed
normal control[][]Passed
normal control[2][2]Passed

SHA-256 / 6b2a8c4b787aab4073dbe4cb8893e04731d7df2ee0f3d12cce2d141c81726cd6

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

Case digest / a555099e0977605725fd09cdf604b10e7393a1c7904192a813415bc751940fd8