FAILURE MAP
← Case archive

FA-78351 / Broadcast timecode arithmetic / Open access

Non-drop timecode label parsing: sexagesimal bounds · case 01

Labels with a seconds field of 60 are accepted and roll into the next minute.

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

ROOT CAUSE

The seconds limit is 60 instead of 59.

VERIFIED REPAIR

Reject minute and second fields above 59.

Unsuccessful approach: Moving the off-by-one to the minute field still accepts a minute of 60.

Case contract

Parse a non-drop label HH:MM:SS:FF (exactly two digits per field, colons only) at integer fps to a frame count from midnight. Hours 0-23, minutes and seconds 0-59, frames below fps; anything else, including drop-frame separators, returns None.

Why this case matters

Timecode arithmetic errors misplace edits, commercial breaks and captions against the broadcast clock.

1 / The failure

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

N = 1
observations = []
def solve(tc, fps):
    f=tc.split(':')
    if len(f)!=4 or not all(len(x)==2 and x.isdigit() for x in f):
        return None
    h,m,s,fr=map(int,f)
    if h>23:
        return None
    if m>59 or s>60:
        return None
    if fr>=fps:
        return None
    return ((h*60+m)*60+s)*fps+fr
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: sexagesimal bounds', ['01:00:60:00', 25], None), ('regression variant: sexagesimal bounds', ['23:59:60:25', 30], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:24', 30], None), ('partial repair variant: sexagesimal bounds', ['23:60:00:24', 30], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['00:00:00:25', 25], None), ('normal control', ['23:59:59:24', 25], 2159999), ('normal control', ['01:00:00;00', 30], None), ('normal control', ['1:59:59:24', 30], None)], [('regression: sexagesimal bounds', ['00:59:60:24', 25], None), ('regression variant: sexagesimal bounds', ['00:00:60:23', 24], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:00', 24], None), ('partial repair variant: sexagesimal bounds', ['00:60:59:23', 24], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['23:07:60.30', 30], None), ('normal control', ['24:07:59:30', 30], None), ('normal control', ['1:59:59:00', 24], None)], [('regression: sexagesimal bounds', ['01:00:60:23', 24], None), ('regression variant: sexagesimal bounds', ['01:00:60:00', 30], None), ('partial repair probe: sexagesimal bounds', ['23:60:59:29', 30], None), ('partial repair variant: sexagesimal bounds', ['01:60:59:24', 30], None), ('boundary control', ['24:00:00:00', 25], None), ('boundary control', ['00:00:00:00', 25], 0), ('normal control', ['00:60:5:30', 24], None), ('normal control', ['99:07:00:30', 25], None), ('normal control', ['00:00:5:00', 25], None)], [('regression: sexagesimal bounds', ['00:07:60:29', 30], None), ('regression variant: sexagesimal bounds', ['00:00:60:00', 24], None), ('partial repair probe: sexagesimal bounds', ['01:60:00:23', 24], None), ('partial repair variant: sexagesimal bounds', ['01:60:59:00', 24], None), ('boundary control', ['00:00:00:25', 25], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('normal control', ['00:59:59:24', 25], 89999), ('normal control', ['1:07:59.29', 25], None), ('normal control', ['99:07:59;29', 30], None)], [('regression: sexagesimal bounds', ['00:07:60:00', 25], None), ('regression variant: sexagesimal bounds', ['00:07:60:24', 30], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:24', 25], None), ('partial repair variant: sexagesimal bounds', ['23:60:59:29', 30], None), ('boundary control', ['01:00:00;00', 30], None), ('boundary control', ['24:00:00:00', 25], None), ('normal control', ['23:59:5:29', 25], None), ('normal control', ['23:00:59;30', 30], None), ('normal control', ['1:60:00:24', 24], 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: sexagesimal bounds91500NoneFailed
regression variant: sexagesimal bounds2592025NoneFailed
partial repair probe: sexagesimal boundsNoneNonePassed
partial repair variant: sexagesimal boundsNoneNonePassed
boundary control00Passed
boundary controlNoneNonePassed
normal control21599992159999Passed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 25a4c33d68395300e8304482c3666fa5390c59c18effa9250f1c7ff21e1ff15a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(tc, fps):
    f=tc.split(':')
    if len(f)!=4 or not all(len(x)==2 and x.isdigit() for x in f):
        return None
    h,m,s,fr=map(int,f)
    if h>23:
        return None
    if m>60 or s>59:
        return None
    if fr>=fps:
        return None
    return ((h*60+m)*60+s)*fps+fr
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: sexagesimal bounds', ['01:00:60:00', 25], None), ('regression variant: sexagesimal bounds', ['23:59:60:25', 30], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:24', 30], None), ('partial repair variant: sexagesimal bounds', ['23:60:00:24', 30], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['00:00:00:25', 25], None), ('normal control', ['23:59:59:24', 25], 2159999), ('normal control', ['01:00:00;00', 30], None), ('normal control', ['1:59:59:24', 30], None)], [('regression: sexagesimal bounds', ['00:59:60:24', 25], None), ('regression variant: sexagesimal bounds', ['00:00:60:23', 24], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:00', 24], None), ('partial repair variant: sexagesimal bounds', ['00:60:59:23', 24], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['23:07:60.30', 30], None), ('normal control', ['24:07:59:30', 30], None), ('normal control', ['1:59:59:00', 24], None)], [('regression: sexagesimal bounds', ['01:00:60:23', 24], None), ('regression variant: sexagesimal bounds', ['01:00:60:00', 30], None), ('partial repair probe: sexagesimal bounds', ['23:60:59:29', 30], None), ('partial repair variant: sexagesimal bounds', ['01:60:59:24', 30], None), ('boundary control', ['24:00:00:00', 25], None), ('boundary control', ['00:00:00:00', 25], 0), ('normal control', ['00:60:5:30', 24], None), ('normal control', ['99:07:00:30', 25], None), ('normal control', ['00:00:5:00', 25], None)], [('regression: sexagesimal bounds', ['00:07:60:29', 30], None), ('regression variant: sexagesimal bounds', ['00:00:60:00', 24], None), ('partial repair probe: sexagesimal bounds', ['01:60:00:23', 24], None), ('partial repair variant: sexagesimal bounds', ['01:60:59:00', 24], None), ('boundary control', ['00:00:00:25', 25], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('normal control', ['00:59:59:24', 25], 89999), ('normal control', ['1:07:59.29', 25], None), ('normal control', ['99:07:59;29', 30], None)], [('regression: sexagesimal bounds', ['00:07:60:00', 25], None), ('regression variant: sexagesimal bounds', ['00:07:60:24', 30], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:24', 25], None), ('partial repair variant: sexagesimal bounds', ['23:60:59:29', 30], None), ('boundary control', ['01:00:00;00', 30], None), ('boundary control', ['24:00:00:00', 25], None), ('normal control', ['23:59:5:29', 25], None), ('normal control', ['23:00:59;30', 30], None), ('normal control', ['1:60:00:24', 24], 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: sexagesimal boundsNoneNonePassed
regression variant: sexagesimal boundsNoneNonePassed
partial repair probe: sexagesimal bounds217794NoneFailed
partial repair variant: sexagesimal bounds2592024NoneFailed
boundary control00Passed
boundary controlNoneNonePassed
normal control21599992159999Passed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / bca9681f11883dc96e458925209ae2b77cfd09035d752356072c9690ae3afed8

3 / The verified repair

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

N = 1
observations = []
def solve(tc, fps):
    f=tc.split(':')
    if len(f)!=4 or not all(len(x)==2 and x.isdigit() for x in f):
        return None
    h,m,s,fr=map(int,f)
    if h>23:
        return None
    if m>59 or s>59:
        return None
    if fr>=fps:
        return None
    return ((h*60+m)*60+s)*fps+fr
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: sexagesimal bounds', ['01:00:60:00', 25], None), ('regression variant: sexagesimal bounds', ['23:59:60:25', 30], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:24', 30], None), ('partial repair variant: sexagesimal bounds', ['23:60:00:24', 30], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['00:00:00:25', 25], None), ('normal control', ['23:59:59:24', 25], 2159999), ('normal control', ['01:00:00;00', 30], None), ('normal control', ['1:59:59:24', 30], None)], [('regression: sexagesimal bounds', ['00:59:60:24', 25], None), ('regression variant: sexagesimal bounds', ['00:00:60:23', 24], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:00', 24], None), ('partial repair variant: sexagesimal bounds', ['00:60:59:23', 24], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['23:07:60.30', 30], None), ('normal control', ['24:07:59:30', 30], None), ('normal control', ['1:59:59:00', 24], None)], [('regression: sexagesimal bounds', ['01:00:60:23', 24], None), ('regression variant: sexagesimal bounds', ['01:00:60:00', 30], None), ('partial repair probe: sexagesimal bounds', ['23:60:59:29', 30], None), ('partial repair variant: sexagesimal bounds', ['01:60:59:24', 30], None), ('boundary control', ['24:00:00:00', 25], None), ('boundary control', ['00:00:00:00', 25], 0), ('normal control', ['00:60:5:30', 24], None), ('normal control', ['99:07:00:30', 25], None), ('normal control', ['00:00:5:00', 25], None)], [('regression: sexagesimal bounds', ['00:07:60:29', 30], None), ('regression variant: sexagesimal bounds', ['00:00:60:00', 24], None), ('partial repair probe: sexagesimal bounds', ['01:60:00:23', 24], None), ('partial repair variant: sexagesimal bounds', ['01:60:59:00', 24], None), ('boundary control', ['00:00:00:25', 25], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('normal control', ['00:59:59:24', 25], 89999), ('normal control', ['1:07:59.29', 25], None), ('normal control', ['99:07:59;29', 30], None)], [('regression: sexagesimal bounds', ['00:07:60:00', 25], None), ('regression variant: sexagesimal bounds', ['00:07:60:24', 30], None), ('partial repair probe: sexagesimal bounds', ['01:60:59:24', 25], None), ('partial repair variant: sexagesimal bounds', ['23:60:59:29', 30], None), ('boundary control', ['01:00:00;00', 30], None), ('boundary control', ['24:00:00:00', 25], None), ('normal control', ['23:59:5:29', 25], None), ('normal control', ['23:00:59;30', 30], None), ('normal control', ['1:60:00:24', 24], 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: sexagesimal boundsNoneNonePassed
regression variant: sexagesimal boundsNoneNonePassed
partial repair probe: sexagesimal boundsNoneNonePassed
partial repair variant: sexagesimal boundsNoneNonePassed
boundary control00Passed
boundary controlNoneNonePassed
normal control21599992159999Passed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 876b6b75b85e0fbda0c398a4f5c6a0eecfa1416beebd26a61542b11f2f673a3a

Verification & scope

A deterministic bounded teaching model with a stipulated toy contract; it does not claim conformance to SMPTE or any broadcast 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:34.633138+00:00.

Case digest / 303540a513295da3a01b72d0d0b9e108102f68fb9475e4448cae777d3c3d91ad