FAILURE MAP
← Case archive

FA-78186 / Subtitle cue timing / Open access

WebVTT cue timing line parsing: settings capture · case 01

Only the first cue setting survives; later settings such as size are lost.

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

ROOT CAUSE

The settings list keeps just the first token after the end timestamp.

VERIFIED REPAIR

Join every token after the end timestamp.

Unsuccessful approach: Joining from index 2 includes the end timestamp among the settings.

Case contract

Parse "START --> END [settings...]" (whitespace separated). Timestamps are [hh:]mm:ss.ttt with hours of two or more digits, minutes and seconds exactly two digits below 60, and exactly three fraction digits after a period. END must be after START. Return [start_ms,end_ms,settings joined by single spaces] or None.

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(line):
    parts=line.split()
    if len(parts)<3 or parts[1]!='-->':
        return None
    def ts(x):
        m=re.fullmatch(r'(?:(\d{2,}):)?(\d{2}):(\d{2})\.(\d{3})',x)
        if not m:
            return None
        h,mi,se,f=m.groups()
        if int(mi)>59 or int(se)>59:
            return None
        return int(h or 0)*3600000+int(mi)*60000+int(se)*1000+int(f)
    a=ts(parts[0]); b=ts(parts[2])
    if a is None or b is None or b<=a:
        return None
    return [a,b,parts[3] if len(parts)>3 else '']
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: settings capture', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('regression variant: settings capture', ['01:09.500 --> 01:00:00.000 line:0 position:10%'], [69500, 3600000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:00.999 --> 00:00:09.999 line:0 position:10%'], [999, 9999, 'line:0 position:10%']), ('partial repair variant: settings capture', ['00:59:59.000 --> 01:01:00.999 line:0 position:10%'], [3599000, 3660999, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['59:09.5 --> 00:02.000 align:start'], None), ('normal control', ['100:01:60,500 --> 00:00:60.5 align:start'], None), ('normal control', ['00:5:00.000 -> 00:5:00.000'], None)], [('regression: settings capture', ['00:00.999 --> 00:00:09.999 line:0 position:10%'], [999, 9999, 'line:0 position:10%']), ('regression variant: settings capture', ['00:00:09.000 --> 01:00:00.000 line:0 position:10%'], [9000, 3600000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['01:00:00.999 --> 100:00:00.000 size:50% align:end'], [3600999, 360000000, 'size:50% align:end']), ('partial repair variant: settings capture', ['01:09.500 --> 01:00:00.000 line:0 position:10%'], [69500, 3600000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['60:09.5 -> 60:09.5'], None), ('normal control', ['01:60:59.999 --> 00:00.001 line:0 position:10%'], None), ('normal control', ['01:60:00.500 --> 5:60,500 line:0 position:10%'], None)], [('regression: settings capture', ['01:00:00.999 --> 100:00:00.000 size:50% align:end'], [3600999, 360000000, 'size:50% align:end']), ('regression variant: settings capture', ['00:01:09.500 --> 100:00:00.000 line:0 position:10%'], [69500, 360000000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:00.000 --> 01:00:00.000'], [0, 3600000, '']), ('partial repair variant: settings capture', ['00:00:09.000 --> 01:00:00.000 line:0 position:10%'], [9000, 3600000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['01:5:09.000 --> 00:00.001'], None), ('normal control', ['60:59.500 --> 100:00:00.000'], None), ('normal control', ['60:60.999 --> 00:00.001'], None)], [('regression: settings capture', ['00:59.000 --> 01:00:00.999 line:0 position:10%'], [59000, 3600999, 'line:0 position:10%']), ('regression variant: settings capture', ['59:59.999 --> 100:00:59.999 size:50% align:end'], [3599999, 360059999, 'size:50% align:end']), ('partial repair probe: settings capture', ['00:00.000 --> 01:00:00.000'], [0, 3600000, '']), ('partial repair variant: settings capture', ['00:01:09.500 --> 100:00:00.000 line:0 position:10%'], [69500, 360000000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['1:00:60.000 -> 59:09,500'], None), ('normal control', ['59:60.5 --> 100:00:00.000 line:0 position:10%'], None), ('normal control', ['01:5:60.500 --> 00:00.001 size:50% align:end'], None)], [('regression: settings capture', ['00:59:59.000 --> 01:01:00.999 line:0 position:10%'], [3599000, 3660999, 'line:0 position:10%']), ('regression variant: settings capture', ['00:59.500 --> 100:00:00.000 line:0 position:10%'], [59500, 360000000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:59.000 --> 01:00:00.999 line:0 position:10%'], [59000, 3600999, 'line:0 position:10%']), ('partial repair variant: settings capture', ['00:01:09.500 --> 01:00:00.000 align:start'], [69500, 3600000, 'align:start']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['100:60:00.5 -> 100:00:00.000'], None), ('normal control', ['100:59:09.000 --> 100:59:09.000'], None), ('normal control', ['5:00.999 --> 5:00.999'], None)]]
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: settings capture[59999, 60000, 'line:0'][59999, 60000, 'line:0 size:50%']Failed
regression variant: settings capture[69500, 3600000, 'line:0'][69500, 3600000, 'line:0 position:10%']Failed
partial repair probe: settings capture[999, 9999, 'line:0'][999, 9999, 'line:0 position:10%']Failed
partial repair variant: settings capture[3599000, 3660999, 'line:0'][3599000, 3660999, 'line:0 position:10%']Failed
boundary controlNoneNonePassed
normal controlNoneNonePassed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / ebc0f2ebfa33d689f8c3421af8316b93d12c5bc10c1376e56b02c8af47b76ae8

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(line):
    parts=line.split()
    if len(parts)<3 or parts[1]!='-->':
        return None
    def ts(x):
        m=re.fullmatch(r'(?:(\d{2,}):)?(\d{2}):(\d{2})\.(\d{3})',x)
        if not m:
            return None
        h,mi,se,f=m.groups()
        if int(mi)>59 or int(se)>59:
            return None
        return int(h or 0)*3600000+int(mi)*60000+int(se)*1000+int(f)
    a=ts(parts[0]); b=ts(parts[2])
    if a is None or b is None or b<=a:
        return None
    return [a,b,' '.join(parts[2:])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: settings capture', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('regression variant: settings capture', ['01:09.500 --> 01:00:00.000 line:0 position:10%'], [69500, 3600000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:00.999 --> 00:00:09.999 line:0 position:10%'], [999, 9999, 'line:0 position:10%']), ('partial repair variant: settings capture', ['00:59:59.000 --> 01:01:00.999 line:0 position:10%'], [3599000, 3660999, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['59:09.5 --> 00:02.000 align:start'], None), ('normal control', ['100:01:60,500 --> 00:00:60.5 align:start'], None), ('normal control', ['00:5:00.000 -> 00:5:00.000'], None)], [('regression: settings capture', ['00:00.999 --> 00:00:09.999 line:0 position:10%'], [999, 9999, 'line:0 position:10%']), ('regression variant: settings capture', ['00:00:09.000 --> 01:00:00.000 line:0 position:10%'], [9000, 3600000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['01:00:00.999 --> 100:00:00.000 size:50% align:end'], [3600999, 360000000, 'size:50% align:end']), ('partial repair variant: settings capture', ['01:09.500 --> 01:00:00.000 line:0 position:10%'], [69500, 3600000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['60:09.5 -> 60:09.5'], None), ('normal control', ['01:60:59.999 --> 00:00.001 line:0 position:10%'], None), ('normal control', ['01:60:00.500 --> 5:60,500 line:0 position:10%'], None)], [('regression: settings capture', ['01:00:00.999 --> 100:00:00.000 size:50% align:end'], [3600999, 360000000, 'size:50% align:end']), ('regression variant: settings capture', ['00:01:09.500 --> 100:00:00.000 line:0 position:10%'], [69500, 360000000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:00.000 --> 01:00:00.000'], [0, 3600000, '']), ('partial repair variant: settings capture', ['00:00:09.000 --> 01:00:00.000 line:0 position:10%'], [9000, 3600000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['01:5:09.000 --> 00:00.001'], None), ('normal control', ['60:59.500 --> 100:00:00.000'], None), ('normal control', ['60:60.999 --> 00:00.001'], None)], [('regression: settings capture', ['00:59.000 --> 01:00:00.999 line:0 position:10%'], [59000, 3600999, 'line:0 position:10%']), ('regression variant: settings capture', ['59:59.999 --> 100:00:59.999 size:50% align:end'], [3599999, 360059999, 'size:50% align:end']), ('partial repair probe: settings capture', ['00:00.000 --> 01:00:00.000'], [0, 3600000, '']), ('partial repair variant: settings capture', ['00:01:09.500 --> 100:00:00.000 line:0 position:10%'], [69500, 360000000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['1:00:60.000 -> 59:09,500'], None), ('normal control', ['59:60.5 --> 100:00:00.000 line:0 position:10%'], None), ('normal control', ['01:5:60.500 --> 00:00.001 size:50% align:end'], None)], [('regression: settings capture', ['00:59:59.000 --> 01:01:00.999 line:0 position:10%'], [3599000, 3660999, 'line:0 position:10%']), ('regression variant: settings capture', ['00:59.500 --> 100:00:00.000 line:0 position:10%'], [59500, 360000000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:59.000 --> 01:00:00.999 line:0 position:10%'], [59000, 3600999, 'line:0 position:10%']), ('partial repair variant: settings capture', ['00:01:09.500 --> 01:00:00.000 align:start'], [69500, 3600000, 'align:start']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['100:60:00.5 -> 100:00:00.000'], None), ('normal control', ['100:59:09.000 --> 100:59:09.000'], None), ('normal control', ['5:00.999 --> 5:00.999'], None)]]
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: settings capture[59999, 60000, '01:00.000 line:0 size:50%'][59999, 60000, 'line:0 size:50%']Failed
regression variant: settings capture[69500, 3600000, '01:00:00.000 line:0 position:10%'][69500, 3600000, 'line:0 position:10%']Failed
partial repair probe: settings capture[999, 9999, '00:00:09.999 line:0 position:10%'][999, 9999, 'line:0 position:10%']Failed
partial repair variant: settings capture[3599000, 3660999, '01:01:00.999 line:0 position:10%'][3599000, 3660999, 'line:0 position:10%']Failed
boundary controlNoneNonePassed
normal controlNoneNonePassed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 8a4282f68e512eadcbbd79da7a8dad9cf0bf88877b48be914f6564f32c8cdb66

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(line):
    parts=line.split()
    if len(parts)<3 or parts[1]!='-->':
        return None
    def ts(x):
        m=re.fullmatch(r'(?:(\d{2,}):)?(\d{2}):(\d{2})\.(\d{3})',x)
        if not m:
            return None
        h,mi,se,f=m.groups()
        if int(mi)>59 or int(se)>59:
            return None
        return int(h or 0)*3600000+int(mi)*60000+int(se)*1000+int(f)
    a=ts(parts[0]); b=ts(parts[2])
    if a is None or b is None or b<=a:
        return None
    return [a,b,' '.join(parts[3:])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: settings capture', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('regression variant: settings capture', ['01:09.500 --> 01:00:00.000 line:0 position:10%'], [69500, 3600000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:00.999 --> 00:00:09.999 line:0 position:10%'], [999, 9999, 'line:0 position:10%']), ('partial repair variant: settings capture', ['00:59:59.000 --> 01:01:00.999 line:0 position:10%'], [3599000, 3660999, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['59:09.5 --> 00:02.000 align:start'], None), ('normal control', ['100:01:60,500 --> 00:00:60.5 align:start'], None), ('normal control', ['00:5:00.000 -> 00:5:00.000'], None)], [('regression: settings capture', ['00:00.999 --> 00:00:09.999 line:0 position:10%'], [999, 9999, 'line:0 position:10%']), ('regression variant: settings capture', ['00:00:09.000 --> 01:00:00.000 line:0 position:10%'], [9000, 3600000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['01:00:00.999 --> 100:00:00.000 size:50% align:end'], [3600999, 360000000, 'size:50% align:end']), ('partial repair variant: settings capture', ['01:09.500 --> 01:00:00.000 line:0 position:10%'], [69500, 3600000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['60:09.5 -> 60:09.5'], None), ('normal control', ['01:60:59.999 --> 00:00.001 line:0 position:10%'], None), ('normal control', ['01:60:00.500 --> 5:60,500 line:0 position:10%'], None)], [('regression: settings capture', ['01:00:00.999 --> 100:00:00.000 size:50% align:end'], [3600999, 360000000, 'size:50% align:end']), ('regression variant: settings capture', ['00:01:09.500 --> 100:00:00.000 line:0 position:10%'], [69500, 360000000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:00.000 --> 01:00:00.000'], [0, 3600000, '']), ('partial repair variant: settings capture', ['00:00:09.000 --> 01:00:00.000 line:0 position:10%'], [9000, 3600000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['01:5:09.000 --> 00:00.001'], None), ('normal control', ['60:59.500 --> 100:00:00.000'], None), ('normal control', ['60:60.999 --> 00:00.001'], None)], [('regression: settings capture', ['00:59.000 --> 01:00:00.999 line:0 position:10%'], [59000, 3600999, 'line:0 position:10%']), ('regression variant: settings capture', ['59:59.999 --> 100:00:59.999 size:50% align:end'], [3599999, 360059999, 'size:50% align:end']), ('partial repair probe: settings capture', ['00:00.000 --> 01:00:00.000'], [0, 3600000, '']), ('partial repair variant: settings capture', ['00:01:09.500 --> 100:00:00.000 line:0 position:10%'], [69500, 360000000, 'line:0 position:10%']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['1:00:60.000 -> 59:09,500'], None), ('normal control', ['59:60.5 --> 100:00:00.000 line:0 position:10%'], None), ('normal control', ['01:5:60.500 --> 00:00.001 size:50% align:end'], None)], [('regression: settings capture', ['00:59:59.000 --> 01:01:00.999 line:0 position:10%'], [3599000, 3660999, 'line:0 position:10%']), ('regression variant: settings capture', ['00:59.500 --> 100:00:00.000 line:0 position:10%'], [59500, 360000000, 'line:0 position:10%']), ('partial repair probe: settings capture', ['00:59.000 --> 01:00:00.999 line:0 position:10%'], [59000, 3600999, 'line:0 position:10%']), ('partial repair variant: settings capture', ['00:01:09.500 --> 01:00:00.000 align:start'], [69500, 3600000, 'align:start']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['100:60:00.5 -> 100:00:00.000'], None), ('normal control', ['100:59:09.000 --> 100:59:09.000'], None), ('normal control', ['5:00.999 --> 5:00.999'], None)]]
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: settings capture[59999, 60000, 'line:0 size:50%'][59999, 60000, 'line:0 size:50%']Passed
regression variant: settings capture[69500, 3600000, 'line:0 position:10%'][69500, 3600000, 'line:0 position:10%']Passed
partial repair probe: settings capture[999, 9999, 'line:0 position:10%'][999, 9999, 'line:0 position:10%']Passed
partial repair variant: settings capture[3599000, 3660999, 'line:0 position:10%'][3599000, 3660999, 'line:0 position:10%']Passed
boundary controlNoneNonePassed
normal controlNoneNonePassed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 29a8d423544b5d24574f02119098487cec20593bc671907df381dfb0f93b7a12

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

Case digest / 4d64f4c585e07ed0208bbfacbbc864d84bd3df2bb2fb4e5f84b06658321c1af7