FAILURE MAP
← Case archive

FA-78341 / Broadcast timecode arithmetic / Open access

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

A PAL label ending in :25 is accepted and lands on the first frame of the next second.

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

ROOT CAUSE

The frame field check allows a value equal to the frame rate.

VERIFIED REPAIR

Reject frame fields at or above fps.

Unsuccessful approach: A fixed bound of 30 still accepts frame 25 through 29 at 25 fps.

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

SHA-256 / 7f1b191a80764e144dac4bf9fb6c8b4d91ed3210a692e0cc3ce1e6f21909612f

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>59 or s>59:
        return None
    if fr>=30:
        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: frame field bound', ['00:00:00:25', 25], None), ('regression variant: frame field bound', ['01:59:00:24', 24], None), ('partial repair probe: frame field bound', ['00:59:00:29', 25], None), ('partial repair variant: frame field bound', ['23:00:59:25', 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: frame field bound', ['00:59:59:24', 24], None), ('regression variant: frame field bound', ['00:07:59:30', 30], None), ('partial repair probe: frame field bound', ['23:07:00:24', 24], None), ('partial repair variant: frame field bound', ['23:00:00:25', 24], 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: frame field bound', ['23:07:00:24', 24], None), ('regression variant: frame field bound', ['23:00:00:24', 24], None), ('partial repair probe: frame field bound', ['01:00:59:29', 24], None), ('partial repair variant: frame field bound', ['01:07:59:24', 24], None), ('boundary control', ['24:00:00:00', 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: frame field bound', ['01:59:00:30', 30], None), ('regression variant: frame field bound', ['00:59:00:25', 25], None), ('partial repair probe: frame field bound', ['01:00:59:29', 24], None), ('partial repair variant: frame field bound', ['00:00:59:25', 24], None), ('boundary control', ['01:00:00;00', 30], None), ('boundary control', ['24:00:00:00', 25], None), ('normal control', ['00:00:59.29', 24], None), ('normal control', ['99:07:59;29', 30], None), ('normal control', ['23:59:5:29', 25], None)], [('regression: frame field bound', ['00:59:59:30', 30], None), ('regression variant: frame field bound', ['00:07:00:30', 30], None), ('partial repair probe: frame field bound', ['01:59:00:24', 24], None), ('partial repair variant: frame field bound', ['00:00:59:24', 24], None), ('boundary control', ['00:00:00:00', 25], 0), ('boundary control', ['01:00:00;00', 30], None), ('normal control', ['1:59:00;25', 25], None), ('normal control', ['1:60:00:24', 24], None), ('normal control', ['24:00:60:25', 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: frame field bound25NoneFailed
regression variant: frame field bound171384NoneFailed
partial repair probe: frame field bound88529NoneFailed
partial repair variant: frame field bound1988641NoneFailed
boundary control00Passed
boundary controlNoneNonePassed
normal control21599992159999Passed
normal controlNoneNonePassed
normal controlNoneNonePassed

SHA-256 / 36e244e706413f84b4fc0cd2c77819e394b49cf68dde63e03f57de1b8ad29703

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

SHA-256 / 2d2064f3071d3bdd2d808b3856f7a84478a5000242cf5cc1b7a962e701f691ae

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

Case digest / 0fdcf9d8fda5b7088cf44f68cec0e3af440436bd91131cfcf04b158737a1b35d