FAILURE MAP
← Case archive

FA-77871 / Subtitle cue timing / Open access

SRT and WebVTT timestamp formatting: minute field extraction · case 01

Timestamps past the first hour print minute fields such as 61 or 125.

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

ROOT CAUSE

The minute field is computed as total minutes ms//60000 without removing whole hours.

THE FAILURE

The minute field is computed as total minutes ms//60000 without removing whole hours.

Unsuccessful approach: Subtracting h*3600 uses seconds instead of milliseconds, so the minute field is still inflated after an hour.

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//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: minute field extraction', [3600000, 'vtt'], '01:00:00.000'), ('regression variant: minute field extraction', [3849665, 'vtt'], '01:04:09.665'), ('partial repair probe: minute field extraction', [4082731, 'srt'], '01:08:02,731'), ('partial repair variant: minute field extraction', [3689889, 'srt'], '01:01:29,889'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('normal control', [0, 'vtt'], '00:00.000'), ('normal control', [61001, 'vtt'], '01:01.001'), ('normal control', [7834, 'srt'], '00:00:07,834')], [('regression: minute field extraction', [3664439, 'srt'], '01:01:04,439'), ('regression variant: minute field extraction', [360000000, 'srt'], '100:00:00,000'), ('partial repair probe: minute field extraction', [274754132, 'srt'], '76:19:14,132'), ('partial repair variant: minute field extraction', [19225823, 'srt'], '05:20:25,823'), ('boundary control', [0, 'vtt'], '00:00.000'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('normal control', [-999, 'vtt'], '00:00.000'), ('normal control', [60000, 'vtt'], '01:00.000'), ('normal control', [11761, 'vtt'], '00:11.761')], [('regression: minute field extraction', [4082731, 'srt'], '01:08:02,731'), ('regression variant: minute field extraction', [76782995, 'vtt'], '21:19:42.995'), ('partial repair probe: minute field extraction', [360000000, 'vtt'], '100:00:00.000'), ('partial repair variant: minute field extraction', [3673366, 'srt'], '01:01:13,366'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('normal control', [-5000, 'srt'], '00:00:00,000'), ('normal control', [-5000, 'vtt'], '00:00.000'), ('normal control', [5, 'srt'], '00:00:00,005')], [('regression: minute field extraction', [274754132, 'srt'], '76:19:14,132'), ('regression variant: minute field extraction', [175213793, 'vtt'], '48:40:13.793'), ('partial repair probe: minute field extraction', [3849665, 'vtt'], '01:04:09.665'), ('partial repair variant: minute field extraction', [36000000, 'vtt'], '10:00:00.000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('boundary control', [0, 'vtt'], '00:00.000'), ('normal control', [59999, 'vtt'], '00:59.999'), ('normal control', [3509491, 'srt'], '00:58:29,491'), ('normal control', [3441818, 'srt'], '00:57:21,818')], [('regression: minute field extraction', [360000000, 'vtt'], '100:00:00.000'), ('regression variant: minute field extraction', [3689889, 'srt'], '01:01:29,889'), ('partial repair probe: minute field extraction', [360000000, 'srt'], '100:00:00,000'), ('partial repair variant: minute field extraction', [290743422, 'vtt'], '80:45:43.422'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('normal control', [65993, 'srt'], '00:01:05,993'), ('normal control', [61977, 'vtt'], '01:01.977'), ('normal control', [-999, 'srt'], '00:00:00,000')]]
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: minute field extraction01:60:00.00001:00:00.000Failed
regression variant: minute field extraction01:64:09.66501:04:09.665Failed
partial repair probe: minute field extraction01:68:02,73101:08:02,731Failed
partial repair variant: minute field extraction01:61:29,88901:01:29,889Failed
boundary control00:00:00,00000:00:00,000Passed
boundary control59:59.99959:59.999Passed
normal control00:00.00000:00.000Passed
normal control01:01.00101:01.001Passed
normal control00:00:07,83400:00:07,834Passed

SHA-256 / 23d1a8b7dc5a46510c2ac952592d5fa0aebc42d8460cf30be26ddb1c48696fa4

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*3600)//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: minute field extraction', [3600000, 'vtt'], '01:00:00.000'), ('regression variant: minute field extraction', [3849665, 'vtt'], '01:04:09.665'), ('partial repair probe: minute field extraction', [4082731, 'srt'], '01:08:02,731'), ('partial repair variant: minute field extraction', [3689889, 'srt'], '01:01:29,889'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('normal control', [0, 'vtt'], '00:00.000'), ('normal control', [61001, 'vtt'], '01:01.001'), ('normal control', [7834, 'srt'], '00:00:07,834')], [('regression: minute field extraction', [3664439, 'srt'], '01:01:04,439'), ('regression variant: minute field extraction', [360000000, 'srt'], '100:00:00,000'), ('partial repair probe: minute field extraction', [274754132, 'srt'], '76:19:14,132'), ('partial repair variant: minute field extraction', [19225823, 'srt'], '05:20:25,823'), ('boundary control', [0, 'vtt'], '00:00.000'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('normal control', [-999, 'vtt'], '00:00.000'), ('normal control', [60000, 'vtt'], '01:00.000'), ('normal control', [11761, 'vtt'], '00:11.761')], [('regression: minute field extraction', [4082731, 'srt'], '01:08:02,731'), ('regression variant: minute field extraction', [76782995, 'vtt'], '21:19:42.995'), ('partial repair probe: minute field extraction', [360000000, 'vtt'], '100:00:00.000'), ('partial repair variant: minute field extraction', [3673366, 'srt'], '01:01:13,366'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('boundary control', [0, 'srt'], '00:00:00,000'), ('normal control', [-5000, 'srt'], '00:00:00,000'), ('normal control', [-5000, 'vtt'], '00:00.000'), ('normal control', [5, 'srt'], '00:00:00,005')], [('regression: minute field extraction', [274754132, 'srt'], '76:19:14,132'), ('regression variant: minute field extraction', [175213793, 'vtt'], '48:40:13.793'), ('partial repair probe: minute field extraction', [3849665, 'vtt'], '01:04:09.665'), ('partial repair variant: minute field extraction', [36000000, 'vtt'], '10:00:00.000'), ('boundary control', [3599999, 'vtt'], '59:59.999'), ('boundary control', [0, 'vtt'], '00:00.000'), ('normal control', [59999, 'vtt'], '00:59.999'), ('normal control', [3509491, 'srt'], '00:58:29,491'), ('normal control', [3441818, 'srt'], '00:57:21,818')], [('regression: minute field extraction', [360000000, 'vtt'], '100:00:00.000'), ('regression variant: minute field extraction', [3689889, 'srt'], '01:01:29,889'), ('partial repair probe: minute field extraction', [360000000, 'srt'], '100:00:00,000'), ('partial repair variant: minute field extraction', [290743422, 'vtt'], '80:45:43.422'), ('boundary control', [61001, 'vtt'], '01:01.001'), ('boundary control', [-1, 'srt'], '00:00:00,000'), ('normal control', [65993, 'srt'], '00:01:05,993'), ('normal control', [61977, 'vtt'], '01:01.977'), ('normal control', [-999, 'srt'], '00:00:00,000')]]
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: minute field extraction01:59:00.00001:00:00.000Failed
regression variant: minute field extraction01:64:09.66501:04:09.665Failed
partial repair probe: minute field extraction01:67:02,73101:08:02,731Failed
partial repair variant: minute field extraction01:61:29,88901:01:29,889Failed
boundary control00:00:00,00000:00:00,000Passed
boundary control59:59.99959:59.999Passed
normal control00:00.00000:00.000Passed
normal control01:01.00101:01.001Passed
normal control00:00:07,83400:00:07,834Passed

SHA-256 / 7dc7f33e0f2e31a6ee43d9da10ca8646cd2d07d0ef311bde3a9989ea8943e7aa

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

Case digest / ce7324245347a002789197b64eb0e0a9d38654b2a924908a21f062b18f90c807