FAILURE MAP
← Case archive

FA-78171 / Subtitle cue timing / Open access

WebVTT cue timing line parsing: fraction format · case 01

Timestamps with truncated fractions such as 00:01.5 are accepted as 5 ms.

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

ROOT CAUSE

The fraction group accepts one to three digits.

THE FAILURE

The fraction group accepts one to three digits.

Unsuccessful approach: Also accepting a comma lets SRT-style timestamps into a WebVTT file.

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{1,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: fraction format', ['59:09.5 --> 01:00:00.000 line:0 position:10%'], None), ('regression variant: fraction format', ['59:09.5 --> 01:00:00.000 align:start'], None), ('partial repair probe: fraction format', ['00:01:00,500 --> 100:59:59.000 align:start'], None), ('partial repair variant: fraction format', ['00:59,500 --> 59:00.999'], None), ('boundary control', ['00:01.000 --> 00:02.000'], [1000, 2000, '']), ('boundary control', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('normal control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['59:09.5 --> 00:02.000 align:start'], None), ('normal control', ['01:01:60,500 -> 01:01:60,500'], None)], [('regression: fraction format', ['00:01:09.5 --> 01:00:00.000'], None), ('regression variant: fraction format', ['59:09.5 --> 01:00:00.000 line:0 position:10%'], None), ('partial repair probe: fraction format', ['00:01:59,500 --> 01:00:00.000 size:50% align:end'], None), ('partial repair variant: fraction format', ['01:59:09,500 --> 100:00:00.000 line:0 position:10%'], None), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('boundary control', ['00:01.000 --> 00:02.000'], [1000, 2000, '']), ('normal control', ['100:60:00.5 --> 01:60:09.000 line:0 position:10%'], None), ('normal control', ['60:09.5 -> 60:09.5'], None), ('normal control', ['01:00:09,500 --> 00:00.001'], None)], [('regression: fraction format', ['59:59.5 --> 01:00:00.000'], None), ('regression variant: fraction format', ['00:01:09.5 --> 01:00:00.000'], None), ('partial repair probe: fraction format', ['59:59,500 --> 100:00:00.000 line:0 position:10%'], None), ('partial repair variant: fraction format', ['00:00,500 --> 00:02.000 align:start'], None), ('boundary control', ['100:00:00.000 --> 100:00:01.000 align:start'], [360000000, 360001000, 'align:start']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['01:09,500 --> 01:09,500'], None), ('normal control', ['01:5:09.000 --> 00:00.001'], None), ('normal control', ['5:60.500 --> 5:60.500 align:start'], None)], [('regression: fraction format', ['59:59.5 --> 100:00:00.500 align:start'], None), ('regression variant: fraction format', ['59:59.5 --> 01:00:00.000'], None), ('partial repair probe: fraction format', ['01:09,500 --> 01:00:00.000'], None), ('partial repair variant: fraction format', ['00:01:00,500 --> 100:59:59.000 align:start'], None), ('boundary control', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('boundary control', ['100:00:00.000 --> 100:00:01.000 align:start'], [360000000, 360001000, 'align:start']), ('normal control', ['100:5:00.5 --> 100:5:00.5 size:50% align:end'], None), ('normal control', ['1:00:60.000 -> 59:09,500'], None), ('normal control', ['100:59:59,500 --> 00:60:09.000'], None)], [('regression: fraction format', ['01:00.5 --> 100:00:00.000'], None), ('regression variant: fraction format', ['59:59.5 --> 100:00:00.500 align:start'], None), ('partial repair probe: fraction format', ['00:59,500 --> 01:09.999 size:50% align:end'], None), ('partial repair variant: fraction format', ['00:01:59,500 --> 01:00:00.000 size:50% align:end'], None), ('boundary control', ['00:01.000 --> 00:02.000'], [1000, 2000, '']), ('boundary control', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('normal control', ['60:59.000 --> 60:59.000'], None), ('normal control', ['100:60:00.5 -> 100:00:00.000'], None), ('normal control', ['00:00:60.5 --> 60:59.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: fraction format[3549005, 3600000, 'line:0 position:10%']NoneFailed
regression variant: fraction format[3549005, 3600000, 'align:start']NoneFailed
partial repair probe: fraction formatNoneNonePassed
partial repair variant: fraction formatNoneNonePassed
boundary control[1000, 2000, ''][1000, 2000, '']Passed
boundary control[59999, 60000, 'line:0 size:50%'][59999, 60000, 'line:0 size:50%']Passed
normal controlNoneNonePassed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 007cb8086e77f27051fea561c29f02ace6b989d1b3778f5c6d4e8750eb9f0f5e

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[3:])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: fraction format', ['59:09.5 --> 01:00:00.000 line:0 position:10%'], None), ('regression variant: fraction format', ['59:09.5 --> 01:00:00.000 align:start'], None), ('partial repair probe: fraction format', ['00:01:00,500 --> 100:59:59.000 align:start'], None), ('partial repair variant: fraction format', ['00:59,500 --> 59:00.999'], None), ('boundary control', ['00:01.000 --> 00:02.000'], [1000, 2000, '']), ('boundary control', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('normal control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['59:09.5 --> 00:02.000 align:start'], None), ('normal control', ['01:01:60,500 -> 01:01:60,500'], None)], [('regression: fraction format', ['00:01:09.5 --> 01:00:00.000'], None), ('regression variant: fraction format', ['59:09.5 --> 01:00:00.000 line:0 position:10%'], None), ('partial repair probe: fraction format', ['00:01:59,500 --> 01:00:00.000 size:50% align:end'], None), ('partial repair variant: fraction format', ['01:59:09,500 --> 100:00:00.000 line:0 position:10%'], None), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('boundary control', ['00:01.000 --> 00:02.000'], [1000, 2000, '']), ('normal control', ['100:60:00.5 --> 01:60:09.000 line:0 position:10%'], None), ('normal control', ['60:09.5 -> 60:09.5'], None), ('normal control', ['01:00:09,500 --> 00:00.001'], None)], [('regression: fraction format', ['59:59.5 --> 01:00:00.000'], None), ('regression variant: fraction format', ['00:01:09.5 --> 01:00:00.000'], None), ('partial repair probe: fraction format', ['59:59,500 --> 100:00:00.000 line:0 position:10%'], None), ('partial repair variant: fraction format', ['00:00,500 --> 00:02.000 align:start'], None), ('boundary control', ['100:00:00.000 --> 100:00:01.000 align:start'], [360000000, 360001000, 'align:start']), ('boundary control', ['00:01.000 --> 00:01.000'], None), ('normal control', ['01:09,500 --> 01:09,500'], None), ('normal control', ['01:5:09.000 --> 00:00.001'], None), ('normal control', ['5:60.500 --> 5:60.500 align:start'], None)], [('regression: fraction format', ['59:59.5 --> 100:00:00.500 align:start'], None), ('regression variant: fraction format', ['59:59.5 --> 01:00:00.000'], None), ('partial repair probe: fraction format', ['01:09,500 --> 01:00:00.000'], None), ('partial repair variant: fraction format', ['00:01:00,500 --> 100:59:59.000 align:start'], None), ('boundary control', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('boundary control', ['100:00:00.000 --> 100:00:01.000 align:start'], [360000000, 360001000, 'align:start']), ('normal control', ['100:5:00.5 --> 100:5:00.5 size:50% align:end'], None), ('normal control', ['1:00:60.000 -> 59:09,500'], None), ('normal control', ['100:59:59,500 --> 00:60:09.000'], None)], [('regression: fraction format', ['01:00.5 --> 100:00:00.000'], None), ('regression variant: fraction format', ['59:59.5 --> 100:00:00.500 align:start'], None), ('partial repair probe: fraction format', ['00:59,500 --> 01:09.999 size:50% align:end'], None), ('partial repair variant: fraction format', ['00:01:59,500 --> 01:00:00.000 size:50% align:end'], None), ('boundary control', ['00:01.000 --> 00:02.000'], [1000, 2000, '']), ('boundary control', ['00:59.999 --> 01:00.000 line:0 size:50%'], [59999, 60000, 'line:0 size:50%']), ('normal control', ['60:59.000 --> 60:59.000'], None), ('normal control', ['100:60:00.5 -> 100:00:00.000'], None), ('normal control', ['00:00:60.5 --> 60:59.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: fraction formatNoneNonePassed
regression variant: fraction formatNoneNonePassed
partial repair probe: fraction format[60500, 363599000, 'align:start']NoneFailed
partial repair variant: fraction format[59500, 3540999, '']NoneFailed
boundary control[1000, 2000, ''][1000, 2000, '']Passed
boundary control[59999, 60000, 'line:0 size:50%'][59999, 60000, 'line:0 size:50%']Passed
normal controlNoneNonePassed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 6734dab6a461c28c70b4e8f65c7ac2648e70c4554d178788a908cc1aa1acae5a

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 9 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / ef832843cfa02d93aa4d8b5b5ea713bb461688f6a81a148af55c2c07eceb3b10