FAILURE MAP
← Case archive

FA-78346 / Broadcast timecode arithmetic / Open access

Non-drop timecode label parsing: hour field bound · case 01

Labels at hour 24 are accepted and alias the following day.

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

ROOT CAUSE

The hour limit admits 24.

VERIFIED REPAIR

Reject hours above 23.

Unsuccessful approach: Allowing any two-digit hour still accepts the invalid 24 to 98 range.

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>24:
        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: hour field bound', ['24:00:00:00', 25], None), ('regression variant: hour field bound', ['24:00:59:25', 30], None), ('partial repair probe: hour field bound', ['24:59:59:24', 30], None), ('partial repair variant: hour field bound', ['24:59:59:23', 24], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['23:59:59:24', 25], 2159999), ('normal control', ['1:59:59:24', 30], None), ('normal control', ['00:07:00.24', 25], None)], [('regression: hour field bound', ['24:59:59:23', 24], None), ('regression variant: hour field bound', ['24:59:00:00', 24], None), ('partial repair probe: hour field bound', ['24:00:00:00', 30], None), ('partial repair variant: hour field bound', ['24:59:59:24', 30], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('boundary control', ['00:00:00:00', 25], 0), ('normal control', ['01:00:00.00', 24], None), ('normal control', ['00:59:00.25', 25], None), ('normal control', ['24:07:60:30', 30], None)], [('regression: hour field bound', ['24:59:59:24', 30], None), ('regression variant: hour field bound', ['24:07:59:29', 30], None), ('partial repair probe: hour field bound', ['24:07:59:25', 30], None), ('partial repair variant: hour field bound', ['24:00:00:00', 30], None), ('boundary control', ['00:00:00:25', 25], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('normal control', ['00:07:60:30', 30], None), ('normal control', ['00:59:5:00', 25], None), ('normal control', ['01:59:59;25', 30], None)], [('regression: hour field bound', ['24:00:00:00', 30], None), ('regression variant: hour field bound', ['24:00:00:00', 25], None), ('partial repair probe: hour field bound', ['24:00:59:25', 30], None), ('partial repair variant: hour field bound', ['24:07:59:25', 30], None), ('boundary control', ['01:00:00;00', 30], None), ('boundary control', ['00:00:00:25', 25], None), ('normal control', ['00:00:59.29', 24], None), ('normal control', ['01:00:60:29', 24], None), ('normal control', ['00:07:60:25', 24], None)], [('regression: hour field bound', ['24:07:59:25', 30], None), ('regression variant: hour field bound', ['24:59:59:23', 24], None), ('partial repair probe: hour field bound', ['24:59:00:00', 24], None), ('partial repair variant: hour field bound', ['24:00:59:25', 30], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['24:59:59:24', 24], None), ('normal control', ['99:60:59:25', 25], None), ('normal control', ['01:59:5.30', 30], 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: hour field bound2160000NoneFailed
regression variant: hour field bound2593795NoneFailed
partial repair probe: hour field bound2699994NoneFailed
partial repair variant: hour field bound2159999NoneFailed
boundary control00Passed
boundary controlNoneNonePassed
normal control21599992159999Passed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 6bf663f65a0ac89e184d748fb6003f74ccc924bb419a31b3b9acb57ef4fe5b7f

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>=99:
        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: hour field bound', ['24:00:00:00', 25], None), ('regression variant: hour field bound', ['24:00:59:25', 30], None), ('partial repair probe: hour field bound', ['24:59:59:24', 30], None), ('partial repair variant: hour field bound', ['24:59:59:23', 24], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['23:59:59:24', 25], 2159999), ('normal control', ['1:59:59:24', 30], None), ('normal control', ['00:07:00.24', 25], None)], [('regression: hour field bound', ['24:59:59:23', 24], None), ('regression variant: hour field bound', ['24:59:00:00', 24], None), ('partial repair probe: hour field bound', ['24:00:00:00', 30], None), ('partial repair variant: hour field bound', ['24:59:59:24', 30], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('boundary control', ['00:00:00:00', 25], 0), ('normal control', ['01:00:00.00', 24], None), ('normal control', ['00:59:00.25', 25], None), ('normal control', ['24:07:60:30', 30], None)], [('regression: hour field bound', ['24:59:59:24', 30], None), ('regression variant: hour field bound', ['24:07:59:29', 30], None), ('partial repair probe: hour field bound', ['24:07:59:25', 30], None), ('partial repair variant: hour field bound', ['24:00:00:00', 30], None), ('boundary control', ['00:00:00:25', 25], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('normal control', ['00:07:60:30', 30], None), ('normal control', ['00:59:5:00', 25], None), ('normal control', ['01:59:59;25', 30], None)], [('regression: hour field bound', ['24:00:00:00', 30], None), ('regression variant: hour field bound', ['24:00:00:00', 25], None), ('partial repair probe: hour field bound', ['24:00:59:25', 30], None), ('partial repair variant: hour field bound', ['24:07:59:25', 30], None), ('boundary control', ['01:00:00;00', 30], None), ('boundary control', ['00:00:00:25', 25], None), ('normal control', ['00:00:59.29', 24], None), ('normal control', ['01:00:60:29', 24], None), ('normal control', ['00:07:60:25', 24], None)], [('regression: hour field bound', ['24:07:59:25', 30], None), ('regression variant: hour field bound', ['24:59:59:23', 24], None), ('partial repair probe: hour field bound', ['24:59:00:00', 24], None), ('partial repair variant: hour field bound', ['24:00:59:25', 30], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['24:59:59:24', 24], None), ('normal control', ['99:60:59:25', 25], None), ('normal control', ['01:59:5.30', 30], 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: hour field bound2160000NoneFailed
regression variant: hour field bound2593795NoneFailed
partial repair probe: hour field bound2699994NoneFailed
partial repair variant: hour field bound2159999NoneFailed
boundary control00Passed
boundary controlNoneNonePassed
normal control21599992159999Passed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / c3e3ef93bd381e98deefa67fdba40a61357de59dd524c5f8fb2d40c50ec28ed7

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: hour field bound', ['24:00:00:00', 25], None), ('regression variant: hour field bound', ['24:00:59:25', 30], None), ('partial repair probe: hour field bound', ['24:59:59:24', 30], None), ('partial repair variant: hour field bound', ['24:59:59:23', 24], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['23:59:59:24', 25], 2159999), ('normal control', ['1:59:59:24', 30], None), ('normal control', ['00:07:00.24', 25], None)], [('regression: hour field bound', ['24:59:59:23', 24], None), ('regression variant: hour field bound', ['24:59:00:00', 24], None), ('partial repair probe: hour field bound', ['24:00:00:00', 30], None), ('partial repair variant: hour field bound', ['24:59:59:24', 30], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('boundary control', ['00:00:00:00', 25], 0), ('normal control', ['01:00:00.00', 24], None), ('normal control', ['00:59:00.25', 25], None), ('normal control', ['24:07:60:30', 30], None)], [('regression: hour field bound', ['24:59:59:24', 30], None), ('regression variant: hour field bound', ['24:07:59:29', 30], None), ('partial repair probe: hour field bound', ['24:07:59:25', 30], None), ('partial repair variant: hour field bound', ['24:00:00:00', 30], None), ('boundary control', ['00:00:00:25', 25], None), ('boundary control', ['23:59:59:24', 25], 2159999), ('normal control', ['00:07:60:30', 30], None), ('normal control', ['00:59:5:00', 25], None), ('normal control', ['01:59:59;25', 30], None)], [('regression: hour field bound', ['24:00:00:00', 30], None), ('regression variant: hour field bound', ['24:00:00:00', 25], None), ('partial repair probe: hour field bound', ['24:00:59:25', 30], None), ('partial repair variant: hour field bound', ['24:07:59:25', 30], None), ('boundary control', ['01:00:00;00', 30], None), ('boundary control', ['00:00:00:25', 25], None), ('normal control', ['00:00:59.29', 24], None), ('normal control', ['01:00:60:29', 24], None), ('normal control', ['00:07:60:25', 24], None)], [('regression: hour field bound', ['24:07:59:25', 30], None), ('regression variant: hour field bound', ['24:59:59:23', 24], None), ('partial repair probe: hour field bound', ['24:59:00:00', 24], None), ('partial repair variant: hour field bound', ['24:00:59:25', 30], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['24:59:59:24', 24], None), ('normal control', ['99:60:59:25', 25], None), ('normal control', ['01:59:5.30', 30], 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: hour field boundNoneNonePassed
regression variant: hour field boundNoneNonePassed
partial repair probe: hour field boundNoneNonePassed
partial repair variant: hour field boundNoneNonePassed
boundary control00Passed
boundary controlNoneNonePassed
normal control21599992159999Passed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 79c7b5149d60faebfaa1852e95a5320c8f35aada2cb2b18343eaa1453b936fce

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

Case digest / 5728dc47d7c9dfb67a6a1a05f3802f6bc6a25f8e8a603272af40ff19b0174ae4