FAILURE MAP
← Case archive

FA-78631 / Broadcast timecode arithmetic / Open access

Linear timecode BCD field packing: drop detection · case 01

Drop-frame labels are transmitted without the drop-frame flag.

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

ROOT CAUSE

The drop-frame flag is never set.

VERIFIED REPAIR

Set the flag when the label uses the ";" separator.

Unsuccessful approach: Checking the first separator position never sees the drop-frame semicolon before the frames.

Case contract

Pack HH:MM:SS:FF into four bytes [frames, seconds, minutes, hours] in transmission order. Each byte holds units in bits 0-3 and tens from bit 4 upward. The frames byte carries the drop-frame flag (bit 6, set when the last separator is ";") and the color-frame flag (bit 7).

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
import re
N = 1
observations = []
def solve(tc, color):
    h,m,s,f=map(int,re.split('[:;]',tc))
    drop=False
    def bcd(v,flags):
        return (v//10)<<4|v%10|flags
    b0=bcd(f,(0x40 if drop else 0)|(0x80 if color else 0))
    b1=bcd(s,0)
    b2=bcd(m,0)
    b3=bcd(h,0)
    return [b0,b1,b2,b3]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: drop detection', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: drop detection', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: drop detection', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: drop detection', ['10:00:10;09', False], [73, 16, 0, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['01:07:10:29', True], [169, 16, 7, 1]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:07:09:29', True], [169, 9, 7, 0])], [('regression: drop detection', ['01:02:03;04', False], [68, 3, 2, 1]), ('regression variant: drop detection', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: drop detection', ['00:00:00;00', False], [64, 0, 0, 0]), ('partial repair variant: drop detection', ['01:07:00;19', False], [89, 0, 7, 1]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['10:07:59:01', False], [1, 89, 7, 16]), ('normal control', ['23:10:09:01', False], [1, 9, 16, 35]), ('normal control', ['01:10:00:24', False], [36, 0, 16, 1])], [('regression: drop detection', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: drop detection', ['01:00:59;19', True], [217, 89, 0, 1]), ('partial repair probe: drop detection', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: drop detection', ['19:07:09;19', True], [217, 9, 7, 25]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['23:07:10:00', True], [128, 16, 7, 35]), ('normal control', ['00:00:09:24', True], [164, 9, 0, 0]), ('normal control', ['23:10:45:09', False], [9, 69, 16, 35])], [('regression: drop detection', ['00:00:00;00', False], [64, 0, 0, 0]), ('regression variant: drop detection', ['23:59:59;01', True], [193, 89, 89, 35]), ('partial repair probe: drop detection', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair variant: drop detection', ['23:07:00;00', False], [64, 0, 7, 35]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['23:10:00:29', False], [41, 0, 16, 35]), ('normal control', ['19:59:09:00', True], [128, 9, 89, 25]), ('normal control', ['19:59:45:29', True], [169, 69, 89, 25])], [('regression: drop detection', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: drop detection', ['10:00:10;09', False], [73, 16, 0, 16]), ('partial repair probe: drop detection', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair variant: drop detection', ['10:10:00;29', False], [105, 0, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['10:00:59:29', False], [41, 89, 0, 16]), ('normal control', ['19:00:09:29', False], [41, 9, 0, 25]), ('normal control', ['01:59:10:01', True], [129, 16, 89, 1])]]
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: drop detection[169, 89, 89, 35][233, 89, 89, 35]Failed
regression variant: drop detection[153, 16, 0, 16][217, 16, 0, 16]Failed
partial repair probe: drop detection[36, 9, 16, 16][100, 9, 16, 16]Failed
partial repair variant: drop detection[9, 16, 0, 16][73, 16, 0, 16]Failed
boundary control[0, 0, 0, 0][0, 0, 0, 0]Passed
boundary control[16, 16, 16, 16][16, 16, 16, 16]Passed
normal control[169, 16, 7, 1][169, 16, 7, 1]Passed
normal control[128, 0, 0, 0][128, 0, 0, 0]Passed
normal control[169, 9, 7, 0][169, 9, 7, 0]Passed

SHA-256 / 115de6d192edda8dd8a7f708c5c3935c14dce7cc570eb0edfddef934f7f14c57

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(tc, color):
    h,m,s,f=map(int,re.split('[:;]',tc))
    drop=tc[2]==';'
    def bcd(v,flags):
        return (v//10)<<4|v%10|flags
    b0=bcd(f,(0x40 if drop else 0)|(0x80 if color else 0))
    b1=bcd(s,0)
    b2=bcd(m,0)
    b3=bcd(h,0)
    return [b0,b1,b2,b3]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: drop detection', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: drop detection', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: drop detection', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: drop detection', ['10:00:10;09', False], [73, 16, 0, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['01:07:10:29', True], [169, 16, 7, 1]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:07:09:29', True], [169, 9, 7, 0])], [('regression: drop detection', ['01:02:03;04', False], [68, 3, 2, 1]), ('regression variant: drop detection', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: drop detection', ['00:00:00;00', False], [64, 0, 0, 0]), ('partial repair variant: drop detection', ['01:07:00;19', False], [89, 0, 7, 1]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['10:07:59:01', False], [1, 89, 7, 16]), ('normal control', ['23:10:09:01', False], [1, 9, 16, 35]), ('normal control', ['01:10:00:24', False], [36, 0, 16, 1])], [('regression: drop detection', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: drop detection', ['01:00:59;19', True], [217, 89, 0, 1]), ('partial repair probe: drop detection', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: drop detection', ['19:07:09;19', True], [217, 9, 7, 25]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['23:07:10:00', True], [128, 16, 7, 35]), ('normal control', ['00:00:09:24', True], [164, 9, 0, 0]), ('normal control', ['23:10:45:09', False], [9, 69, 16, 35])], [('regression: drop detection', ['00:00:00;00', False], [64, 0, 0, 0]), ('regression variant: drop detection', ['23:59:59;01', True], [193, 89, 89, 35]), ('partial repair probe: drop detection', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair variant: drop detection', ['23:07:00;00', False], [64, 0, 7, 35]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['23:10:00:29', False], [41, 0, 16, 35]), ('normal control', ['19:59:09:00', True], [128, 9, 89, 25]), ('normal control', ['19:59:45:29', True], [169, 69, 89, 25])], [('regression: drop detection', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: drop detection', ['10:00:10;09', False], [73, 16, 0, 16]), ('partial repair probe: drop detection', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair variant: drop detection', ['10:10:00;29', False], [105, 0, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['10:00:59:29', False], [41, 89, 0, 16]), ('normal control', ['19:00:09:29', False], [41, 9, 0, 25]), ('normal control', ['01:59:10:01', True], [129, 16, 89, 1])]]
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: drop detection[169, 89, 89, 35][233, 89, 89, 35]Failed
regression variant: drop detection[153, 16, 0, 16][217, 16, 0, 16]Failed
partial repair probe: drop detection[36, 9, 16, 16][100, 9, 16, 16]Failed
partial repair variant: drop detection[9, 16, 0, 16][73, 16, 0, 16]Failed
boundary control[0, 0, 0, 0][0, 0, 0, 0]Passed
boundary control[16, 16, 16, 16][16, 16, 16, 16]Passed
normal control[169, 16, 7, 1][169, 16, 7, 1]Passed
normal control[128, 0, 0, 0][128, 0, 0, 0]Passed
normal control[169, 9, 7, 0][169, 9, 7, 0]Passed

SHA-256 / 52964105a3f40995fa2f1870052c33a72c70c09672cdb31453a06ade1419882c

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(tc, color):
    h,m,s,f=map(int,re.split('[:;]',tc))
    drop=';' in tc
    def bcd(v,flags):
        return (v//10)<<4|v%10|flags
    b0=bcd(f,(0x40 if drop else 0)|(0x80 if color else 0))
    b1=bcd(s,0)
    b2=bcd(m,0)
    b3=bcd(h,0)
    return [b0,b1,b2,b3]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: drop detection', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: drop detection', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: drop detection', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: drop detection', ['10:00:10;09', False], [73, 16, 0, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['01:07:10:29', True], [169, 16, 7, 1]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:07:09:29', True], [169, 9, 7, 0])], [('regression: drop detection', ['01:02:03;04', False], [68, 3, 2, 1]), ('regression variant: drop detection', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: drop detection', ['00:00:00;00', False], [64, 0, 0, 0]), ('partial repair variant: drop detection', ['01:07:00;19', False], [89, 0, 7, 1]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['10:07:59:01', False], [1, 89, 7, 16]), ('normal control', ['23:10:09:01', False], [1, 9, 16, 35]), ('normal control', ['01:10:00:24', False], [36, 0, 16, 1])], [('regression: drop detection', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: drop detection', ['01:00:59;19', True], [217, 89, 0, 1]), ('partial repair probe: drop detection', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: drop detection', ['19:07:09;19', True], [217, 9, 7, 25]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['23:07:10:00', True], [128, 16, 7, 35]), ('normal control', ['00:00:09:24', True], [164, 9, 0, 0]), ('normal control', ['23:10:45:09', False], [9, 69, 16, 35])], [('regression: drop detection', ['00:00:00;00', False], [64, 0, 0, 0]), ('regression variant: drop detection', ['23:59:59;01', True], [193, 89, 89, 35]), ('partial repair probe: drop detection', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair variant: drop detection', ['23:07:00;00', False], [64, 0, 7, 35]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['23:10:00:29', False], [41, 0, 16, 35]), ('normal control', ['19:59:09:00', True], [128, 9, 89, 25]), ('normal control', ['19:59:45:29', True], [169, 69, 89, 25])], [('regression: drop detection', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: drop detection', ['10:00:10;09', False], [73, 16, 0, 16]), ('partial repair probe: drop detection', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair variant: drop detection', ['10:10:00;29', False], [105, 0, 16, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('normal control', ['10:00:59:29', False], [41, 89, 0, 16]), ('normal control', ['19:00:09:29', False], [41, 9, 0, 25]), ('normal control', ['01:59:10:01', True], [129, 16, 89, 1])]]
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: drop detection[233, 89, 89, 35][233, 89, 89, 35]Passed
regression variant: drop detection[217, 16, 0, 16][217, 16, 0, 16]Passed
partial repair probe: drop detection[100, 9, 16, 16][100, 9, 16, 16]Passed
partial repair variant: drop detection[73, 16, 0, 16][73, 16, 0, 16]Passed
boundary control[0, 0, 0, 0][0, 0, 0, 0]Passed
boundary control[16, 16, 16, 16][16, 16, 16, 16]Passed
normal control[169, 16, 7, 1][169, 16, 7, 1]Passed
normal control[128, 0, 0, 0][128, 0, 0, 0]Passed
normal control[169, 9, 7, 0][169, 9, 7, 0]Passed

SHA-256 / 77a437d5c631ff3e36171fbad6873dd84c84fe922302b69c2a7ea7c14bbf9cae

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

Case digest / ae4d01ddc51d351807e25d811aadef0e47adc784f9ee227a55103ace94d00416