FAILURE MAP
← Case archive

FA-77881 / Subtitle cue timing / Open access

SRT and WebVTT timestamp formatting: vtt hour omission · case 01

WebVTT cues between one and sixty minutes are written with a redundant 00: hour prefix.

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

ROOT CAUSE

The short form is only chosen when both hours and minutes are zero.

VERIFIED REPAIR

Choose the MM:SS.mmm form whenever the hour field alone is zero.

Unsuccessful approach: Conditioning the short form on the seconds field still picks the long form for most sub-hour cues.

Case contract

Format integer milliseconds as a cue timestamp. Negative values clamp to 0. style "srt" gives HH:MM:SS,mmm (hours at least two digits, never wrapped); style "vtt" gives MM:SS.mmm when the hour field is zero and HH:MM:SS.mmm otherwise.

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(ms, style):
    if ms<0: ms=0
    h=ms//3600000
    m=(ms-h*3600000)//60000
    s=ms//1000%60
    f=ms%1000
    if style=='srt':
        return '%02d:%02d:%02d,%03d'%(h,m,s,f)
    if h==0 and m==0:
        return '%02d:%02d.%03d'%(m,s,f)
    return '%02d:%02d:%02d.%03d'%(h,m,s,f)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: vtt hour omission', [3599999, 'vtt'], '59:59.999'), ('regression variant: vtt hour omission', [61977, 'vtt'], '01:01.977'), ('partial repair probe: vtt hour omission', [3192469, 'vtt'], '53:12.469'), ('partial repair variant: vtt hour omission', [3189669, 'vtt'], '53:09.669'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [0, 'vtt'], '00:00.000'), ('normal control', [7834, 'srt'], '00:00:07,834'), ('normal control', [3664439, 'srt'], '01:01:04,439')], [('regression: vtt hour omission', [61001, 'vtt'], '01:01.001'), ('regression variant: vtt hour omission', [153727, 'vtt'], '02:33.727'), ('partial repair probe: vtt hour omission', [353272, 'vtt'], '05:53.272'), ('partial repair variant: vtt hour omission', [37938, 'vtt'], '00:37.938'), ('boundary control', [0, 'vtt'], '00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('normal control', [4082731, 'srt'], '01:08:02,731'), ('normal control', [3541034, 'srt'], '00:59:01,034'), ('normal control', [334598, 'srt'], '00:05:34,598')], [('regression: vtt hour omission', [3192469, 'vtt'], '53:12.469'), ('regression variant: vtt hour omission', [3189669, 'vtt'], '53:09.669'), ('partial repair probe: vtt hour omission', [55880, 'vtt'], '00:55.880'), ('partial repair variant: vtt hour omission', [1976232, 'vtt'], '32:56.232'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('boundary control', [0, 'vtt'], '00:00.000'), ('normal control', [60000, 'srt'], '00:01:00,000'), ('normal control', [5, 'srt'], '00:00:00,005'), ('normal control', [3849665, 'vtt'], '01:04:09.665')], [('regression: vtt hour omission', [353272, 'vtt'], '05:53.272'), ('regression variant: vtt hour omission', [1976232, 'vtt'], '32:56.232'), ('partial repair probe: vtt hour omission', [11761, 'vtt'], '00:11.761'), ('partial repair variant: vtt hour omission', [37617, 'vtt'], '00:37.617'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('normal control', [76782995, 'vtt'], '21:19:42.995'), ('normal control', [3509491, 'srt'], '00:58:29,491'), ('normal control', [175213793, 'vtt'], '48:40:13.793')], [('regression: vtt hour omission', [60000, 'vtt'], '01:00.000'), ('regression variant: vtt hour omission', [3328850, 'vtt'], '55:28.850'), ('partial repair probe: vtt hour omission', [59999, 'vtt'], '00:59.999'), ('partial repair variant: vtt hour omission', [33430, 'vtt'], '00:33.430'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [3689889, 'srt'], '01:01:29,889'), ('normal control', [3673366, 'srt'], '01:01:13,366'), ('normal control', [290743422, 'vtt'], '80:45:43.422')]]
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: vtt hour omission00:59:59.99959:59.999Failed
regression variant: vtt hour omission00:01:01.97701:01.977Failed
partial repair probe: vtt hour omission00:53:12.46953:12.469Failed
partial repair variant: vtt hour omission00:53:09.66953:09.669Failed
boundary control00:00:00,00000:00:00,000Passed
boundary control01:00:00.00001:00:00.000Passed
normal control00:00.00000:00.000Passed
normal control00:00:07,83400:00:07,834Passed
normal control01:01:04,43901:01:04,439Passed

SHA-256 / a0b5f122205069837afa3f50b7e03e5a13c0fe00a7af34729b0b75dd0f4df6fd

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(ms, style):
    if ms<0: ms=0
    h=ms//3600000
    m=(ms-h*3600000)//60000
    s=ms//1000%60
    f=ms%1000
    if style=='srt':
        return '%02d:%02d:%02d,%03d'%(h,m,s,f)
    if h==0 and s==0:
        return '%02d:%02d.%03d'%(m,s,f)
    return '%02d:%02d:%02d.%03d'%(h,m,s,f)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: vtt hour omission', [3599999, 'vtt'], '59:59.999'), ('regression variant: vtt hour omission', [61977, 'vtt'], '01:01.977'), ('partial repair probe: vtt hour omission', [3192469, 'vtt'], '53:12.469'), ('partial repair variant: vtt hour omission', [3189669, 'vtt'], '53:09.669'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [0, 'vtt'], '00:00.000'), ('normal control', [7834, 'srt'], '00:00:07,834'), ('normal control', [3664439, 'srt'], '01:01:04,439')], [('regression: vtt hour omission', [61001, 'vtt'], '01:01.001'), ('regression variant: vtt hour omission', [153727, 'vtt'], '02:33.727'), ('partial repair probe: vtt hour omission', [353272, 'vtt'], '05:53.272'), ('partial repair variant: vtt hour omission', [37938, 'vtt'], '00:37.938'), ('boundary control', [0, 'vtt'], '00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('normal control', [4082731, 'srt'], '01:08:02,731'), ('normal control', [3541034, 'srt'], '00:59:01,034'), ('normal control', [334598, 'srt'], '00:05:34,598')], [('regression: vtt hour omission', [3192469, 'vtt'], '53:12.469'), ('regression variant: vtt hour omission', [3189669, 'vtt'], '53:09.669'), ('partial repair probe: vtt hour omission', [55880, 'vtt'], '00:55.880'), ('partial repair variant: vtt hour omission', [1976232, 'vtt'], '32:56.232'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('boundary control', [0, 'vtt'], '00:00.000'), ('normal control', [60000, 'srt'], '00:01:00,000'), ('normal control', [5, 'srt'], '00:00:00,005'), ('normal control', [3849665, 'vtt'], '01:04:09.665')], [('regression: vtt hour omission', [353272, 'vtt'], '05:53.272'), ('regression variant: vtt hour omission', [1976232, 'vtt'], '32:56.232'), ('partial repair probe: vtt hour omission', [11761, 'vtt'], '00:11.761'), ('partial repair variant: vtt hour omission', [37617, 'vtt'], '00:37.617'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('normal control', [76782995, 'vtt'], '21:19:42.995'), ('normal control', [3509491, 'srt'], '00:58:29,491'), ('normal control', [175213793, 'vtt'], '48:40:13.793')], [('regression: vtt hour omission', [60000, 'vtt'], '01:00.000'), ('regression variant: vtt hour omission', [3328850, 'vtt'], '55:28.850'), ('partial repair probe: vtt hour omission', [59999, 'vtt'], '00:59.999'), ('partial repair variant: vtt hour omission', [33430, 'vtt'], '00:33.430'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [3689889, 'srt'], '01:01:29,889'), ('normal control', [3673366, 'srt'], '01:01:13,366'), ('normal control', [290743422, 'vtt'], '80:45:43.422')]]
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: vtt hour omission00:59:59.99959:59.999Failed
regression variant: vtt hour omission00:01:01.97701:01.977Failed
partial repair probe: vtt hour omission00:53:12.46953:12.469Failed
partial repair variant: vtt hour omission00:53:09.66953:09.669Failed
boundary control00:00:00,00000:00:00,000Passed
boundary control01:00:00.00001:00:00.000Passed
normal control00:00.00000:00.000Passed
normal control00:00:07,83400:00:07,834Passed
normal control01:01:04,43901:01:04,439Passed

SHA-256 / 1f130b81df00404f0244711c601856cfc8e671a3463a7353ccf1add3365ea676

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(ms, style):
    if ms<0: ms=0
    h=ms//3600000
    m=(ms-h*3600000)//60000
    s=ms//1000%60
    f=ms%1000
    if style=='srt':
        return '%02d:%02d:%02d,%03d'%(h,m,s,f)
    if h==0:
        return '%02d:%02d.%03d'%(m,s,f)
    return '%02d:%02d:%02d.%03d'%(h,m,s,f)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: vtt hour omission', [3599999, 'vtt'], '59:59.999'), ('regression variant: vtt hour omission', [61977, 'vtt'], '01:01.977'), ('partial repair probe: vtt hour omission', [3192469, 'vtt'], '53:12.469'), ('partial repair variant: vtt hour omission', [3189669, 'vtt'], '53:09.669'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [0, 'vtt'], '00:00.000'), ('normal control', [7834, 'srt'], '00:00:07,834'), ('normal control', [3664439, 'srt'], '01:01:04,439')], [('regression: vtt hour omission', [61001, 'vtt'], '01:01.001'), ('regression variant: vtt hour omission', [153727, 'vtt'], '02:33.727'), ('partial repair probe: vtt hour omission', [353272, 'vtt'], '05:53.272'), ('partial repair variant: vtt hour omission', [37938, 'vtt'], '00:37.938'), ('boundary control', [0, 'vtt'], '00:00.000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('normal control', [4082731, 'srt'], '01:08:02,731'), ('normal control', [3541034, 'srt'], '00:59:01,034'), ('normal control', [334598, 'srt'], '00:05:34,598')], [('regression: vtt hour omission', [3192469, 'vtt'], '53:12.469'), ('regression variant: vtt hour omission', [3189669, 'vtt'], '53:09.669'), ('partial repair probe: vtt hour omission', [55880, 'vtt'], '00:55.880'), ('partial repair variant: vtt hour omission', [1976232, 'vtt'], '32:56.232'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('boundary control', [0, 'vtt'], '00:00.000'), ('normal control', [60000, 'srt'], '00:01:00,000'), ('normal control', [5, 'srt'], '00:00:00,005'), ('normal control', [3849665, 'vtt'], '01:04:09.665')], [('regression: vtt hour omission', [353272, 'vtt'], '05:53.272'), ('regression variant: vtt hour omission', [1976232, 'vtt'], '32:56.232'), ('partial repair probe: vtt hour omission', [11761, 'vtt'], '00:11.761'), ('partial repair variant: vtt hour omission', [37617, 'vtt'], '00:37.617'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('normal control', [76782995, 'vtt'], '21:19:42.995'), ('normal control', [3509491, 'srt'], '00:58:29,491'), ('normal control', [175213793, 'vtt'], '48:40:13.793')], [('regression: vtt hour omission', [60000, 'vtt'], '01:00.000'), ('regression variant: vtt hour omission', [3328850, 'vtt'], '55:28.850'), ('partial repair probe: vtt hour omission', [59999, 'vtt'], '00:59.999'), ('partial repair variant: vtt hour omission', [33430, 'vtt'], '00:33.430'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3600000, 'vtt'], '01:00:00.000'), ('normal control', [3689889, 'srt'], '01:01:29,889'), ('normal control', [3673366, 'srt'], '01:01:13,366'), ('normal control', [290743422, 'vtt'], '80:45:43.422')]]
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: vtt hour omission59:59.99959:59.999Passed
regression variant: vtt hour omission01:01.97701:01.977Passed
partial repair probe: vtt hour omission53:12.46953:12.469Passed
partial repair variant: vtt hour omission53:09.66953:09.669Passed
boundary control00:00:00,00000:00:00,000Passed
boundary control01:00:00.00001:00:00.000Passed
normal control00:00.00000:00.000Passed
normal control00:00:07,83400:00:07,834Passed
normal control01:01:04,43901:01:04,439Passed

SHA-256 / f925c54a22619738c1d30fe6a4ce4b561423c0491eba287445166fd22824eeea

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

Case digest / c11d99ef8becfb36ead7acd7ed637128b213a61b55c7aff0990ee4bbc5441580