FAILURE MAP
← Case archive

FA-78421 / Broadcast timecode arithmetic / Open access

Frame count to drop-frame 29.97 label: in-block minute offset · case 01

Labels near each minute boundary skip too early.

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

ROOT CAUSE

The in-block minute count ignores the two frames of the undropped first minute.

VERIFIED REPAIR

Subtract the first two frames before dividing by 1798.

Unsuccessful approach: Subtracting a single frame misplaces the skip at every minute boundary.

Case contract

Convert a non-negative frame count (negative counts return None; counts wrap to the 2589408-frame drop-frame day) to an HH:MM:SS;FF 29.97 drop-frame label: 18 labels are skipped per 10-minute block of 17982 frames, and labels ;00/;01 are skipped at each minute not divisible by ten.

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(frames):
    if frames<0:
        return None
    frames%=2589408
    d,mrem=divmod(frames,17982)
    add=18*d
    if mrem>=2:
        add+=2*(mrem//1798)
    n=frames+add
    ff=n%30
    ss=n//30%60
    mm=n//1800%60
    hh=n//108000
    return '%02d:%02d:%02d;%02d'%(hh,mm,ss,ff)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: in-block minute offset', [1799], '00:00:59;29'), ('regression variant: in-block minute offset', [17981], '00:09:59;29'), ('partial repair probe: in-block minute offset', [2589407], '23:59:59;29'), ('partial repair variant: in-block minute offset', [557441], '05:09:59;29'), ('boundary control', [1800], '00:01:00;02'), ('boundary control', [0], '00:00:00;00'), ('normal control', [17982], '00:10:00;00'), ('normal control', [-1], None), ('normal control', [52594], '00:29:14;28')], [('regression: in-block minute offset', [107891], '00:59:59;29'), ('regression variant: in-block minute offset', [287711], '02:39:59;29'), ('partial repair probe: in-block minute offset', [683315], '06:19:59;29'), ('partial repair variant: in-block minute offset', [757043], '07:00:59;29'), ('boundary control', [17982], '00:10:00;00'), ('boundary control', [-1], None), ('normal control', [3372691], '07:15:35;17'), ('normal control', [2589408], '00:00:00;00'), ('normal control', [916013], '08:29:24;11')], [('regression: in-block minute offset', [2589407], '23:59:59;29'), ('regression variant: in-block minute offset', [3597], '00:01:59;29'), ('partial repair probe: in-block minute offset', [165435], '01:31:59;29'), ('partial repair variant: in-block minute offset', [125873], '01:09:59;29'), ('boundary control', [107892], '01:00:00;00'), ('boundary control', [1800], '00:01:00;02'), ('normal control', [2576030], '23:52:33;18'), ('normal control', [1346634], '12:28:52;22'), ('normal control', [3599], '00:02:00;03')], [('regression: in-block minute offset', [683315], '06:19:59;29'), ('regression variant: in-block minute offset', [451349], '04:10:59;29'), ('partial repair probe: in-block minute offset', [17981], '00:09:59;29'), ('partial repair variant: in-block minute offset', [793007], '07:20:59;29'), ('boundary control', [0], '00:00:00;00'), ('boundary control', [17982], '00:10:00;00'), ('normal control', [3470210], '08:09:49;14'), ('normal control', [544816], '05:02:58;20'), ('normal control', [431569], '04:00:00;01')], [('regression: in-block minute offset', [165435], '01:31:59;29'), ('regression variant: in-block minute offset', [557441], '05:09:59;29'), ('partial repair probe: in-block minute offset', [287711], '02:39:59;29'), ('partial repair variant: in-block minute offset', [143855], '01:19:59;29'), ('boundary control', [-1], None), ('boundary control', [107892], '01:00:00;00'), ('normal control', [737264], '06:50:00;02'), ('normal control', [701299], '06:30:00;01'), ('normal control', [1874662], '17:22:31;08')]]
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: in-block minute offset00:01:00;0100:00:59;29Failed
regression variant: in-block minute offset00:10:00;0100:09:59;29Failed
partial repair probe: in-block minute offset24:00:00;0123:59:59;29Failed
partial repair variant: in-block minute offset05:10:00;0105:09:59;29Failed
boundary control00:01:00;0200:01:00;02Passed
boundary control00:00:00;0000:00:00;00Passed
normal control00:10:00;0000:10:00;00Passed
normal controlNoneNonePassed
normal control00:29:14;2800:29:14;28Passed

SHA-256 / 7ce450168c99b475ebeb10238e037d2cc810026c828181c500b48af06058236b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(frames):
    if frames<0:
        return None
    frames%=2589408
    d,mrem=divmod(frames,17982)
    add=18*d
    if mrem>=2:
        add+=2*((mrem-1)//1798)
    n=frames+add
    ff=n%30
    ss=n//30%60
    mm=n//1800%60
    hh=n//108000
    return '%02d:%02d:%02d;%02d'%(hh,mm,ss,ff)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: in-block minute offset', [1799], '00:00:59;29'), ('regression variant: in-block minute offset', [17981], '00:09:59;29'), ('partial repair probe: in-block minute offset', [2589407], '23:59:59;29'), ('partial repair variant: in-block minute offset', [557441], '05:09:59;29'), ('boundary control', [1800], '00:01:00;02'), ('boundary control', [0], '00:00:00;00'), ('normal control', [17982], '00:10:00;00'), ('normal control', [-1], None), ('normal control', [52594], '00:29:14;28')], [('regression: in-block minute offset', [107891], '00:59:59;29'), ('regression variant: in-block minute offset', [287711], '02:39:59;29'), ('partial repair probe: in-block minute offset', [683315], '06:19:59;29'), ('partial repair variant: in-block minute offset', [757043], '07:00:59;29'), ('boundary control', [17982], '00:10:00;00'), ('boundary control', [-1], None), ('normal control', [3372691], '07:15:35;17'), ('normal control', [2589408], '00:00:00;00'), ('normal control', [916013], '08:29:24;11')], [('regression: in-block minute offset', [2589407], '23:59:59;29'), ('regression variant: in-block minute offset', [3597], '00:01:59;29'), ('partial repair probe: in-block minute offset', [165435], '01:31:59;29'), ('partial repair variant: in-block minute offset', [125873], '01:09:59;29'), ('boundary control', [107892], '01:00:00;00'), ('boundary control', [1800], '00:01:00;02'), ('normal control', [2576030], '23:52:33;18'), ('normal control', [1346634], '12:28:52;22'), ('normal control', [3599], '00:02:00;03')], [('regression: in-block minute offset', [683315], '06:19:59;29'), ('regression variant: in-block minute offset', [451349], '04:10:59;29'), ('partial repair probe: in-block minute offset', [17981], '00:09:59;29'), ('partial repair variant: in-block minute offset', [793007], '07:20:59;29'), ('boundary control', [0], '00:00:00;00'), ('boundary control', [17982], '00:10:00;00'), ('normal control', [3470210], '08:09:49;14'), ('normal control', [544816], '05:02:58;20'), ('normal control', [431569], '04:00:00;01')], [('regression: in-block minute offset', [165435], '01:31:59;29'), ('regression variant: in-block minute offset', [557441], '05:09:59;29'), ('partial repair probe: in-block minute offset', [287711], '02:39:59;29'), ('partial repair variant: in-block minute offset', [143855], '01:19:59;29'), ('boundary control', [-1], None), ('boundary control', [107892], '01:00:00;00'), ('normal control', [737264], '06:50:00;02'), ('normal control', [701299], '06:30:00;01'), ('normal control', [1874662], '17:22:31;08')]]
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: in-block minute offset00:01:00;0100:00:59;29Failed
regression variant: in-block minute offset00:10:00;0100:09:59;29Failed
partial repair probe: in-block minute offset24:00:00;0123:59:59;29Failed
partial repair variant: in-block minute offset05:10:00;0105:09:59;29Failed
boundary control00:01:00;0200:01:00;02Passed
boundary control00:00:00;0000:00:00;00Passed
normal control00:10:00;0000:10:00;00Passed
normal controlNoneNonePassed
normal control00:29:14;2800:29:14;28Passed

SHA-256 / 0a858a1e93397e59d8bd44aa689e2b92d1a19ae8c24e600abca78ee0bdcc4efd

3 / The verified repair

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

N = 1
observations = []
def solve(frames):
    if frames<0:
        return None
    frames%=2589408
    d,mrem=divmod(frames,17982)
    add=18*d
    if mrem>=2:
        add+=2*((mrem-2)//1798)
    n=frames+add
    ff=n%30
    ss=n//30%60
    mm=n//1800%60
    hh=n//108000
    return '%02d:%02d:%02d;%02d'%(hh,mm,ss,ff)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: in-block minute offset', [1799], '00:00:59;29'), ('regression variant: in-block minute offset', [17981], '00:09:59;29'), ('partial repair probe: in-block minute offset', [2589407], '23:59:59;29'), ('partial repair variant: in-block minute offset', [557441], '05:09:59;29'), ('boundary control', [1800], '00:01:00;02'), ('boundary control', [0], '00:00:00;00'), ('normal control', [17982], '00:10:00;00'), ('normal control', [-1], None), ('normal control', [52594], '00:29:14;28')], [('regression: in-block minute offset', [107891], '00:59:59;29'), ('regression variant: in-block minute offset', [287711], '02:39:59;29'), ('partial repair probe: in-block minute offset', [683315], '06:19:59;29'), ('partial repair variant: in-block minute offset', [757043], '07:00:59;29'), ('boundary control', [17982], '00:10:00;00'), ('boundary control', [-1], None), ('normal control', [3372691], '07:15:35;17'), ('normal control', [2589408], '00:00:00;00'), ('normal control', [916013], '08:29:24;11')], [('regression: in-block minute offset', [2589407], '23:59:59;29'), ('regression variant: in-block minute offset', [3597], '00:01:59;29'), ('partial repair probe: in-block minute offset', [165435], '01:31:59;29'), ('partial repair variant: in-block minute offset', [125873], '01:09:59;29'), ('boundary control', [107892], '01:00:00;00'), ('boundary control', [1800], '00:01:00;02'), ('normal control', [2576030], '23:52:33;18'), ('normal control', [1346634], '12:28:52;22'), ('normal control', [3599], '00:02:00;03')], [('regression: in-block minute offset', [683315], '06:19:59;29'), ('regression variant: in-block minute offset', [451349], '04:10:59;29'), ('partial repair probe: in-block minute offset', [17981], '00:09:59;29'), ('partial repair variant: in-block minute offset', [793007], '07:20:59;29'), ('boundary control', [0], '00:00:00;00'), ('boundary control', [17982], '00:10:00;00'), ('normal control', [3470210], '08:09:49;14'), ('normal control', [544816], '05:02:58;20'), ('normal control', [431569], '04:00:00;01')], [('regression: in-block minute offset', [165435], '01:31:59;29'), ('regression variant: in-block minute offset', [557441], '05:09:59;29'), ('partial repair probe: in-block minute offset', [287711], '02:39:59;29'), ('partial repair variant: in-block minute offset', [143855], '01:19:59;29'), ('boundary control', [-1], None), ('boundary control', [107892], '01:00:00;00'), ('normal control', [737264], '06:50:00;02'), ('normal control', [701299], '06:30:00;01'), ('normal control', [1874662], '17:22:31;08')]]
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: in-block minute offset00:00:59;2900:00:59;29Passed
regression variant: in-block minute offset00:09:59;2900:09:59;29Passed
partial repair probe: in-block minute offset23:59:59;2923:59:59;29Passed
partial repair variant: in-block minute offset05:09:59;2905:09:59;29Passed
boundary control00:01:00;0200:01:00;02Passed
boundary control00:00:00;0000:00:00;00Passed
normal control00:10:00;0000:10:00;00Passed
normal controlNoneNonePassed
normal control00:29:14;2800:29:14;28Passed

SHA-256 / d34b65f7950eeb9c2590fa08e260109da38ea25685707602ba4232ffda8c539a

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

Case digest / 9d6d50a6367af835bc2eaeea45004e148c97e9d6467641270404790da0095f98