FAILURE MAP
← Case archive

FA-78621 / Broadcast timecode arithmetic / Open access

Linear timecode BCD field packing: drop-frame flag bit · case 01

Drop-frame timecode corrupts the frame units digit.

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

ROOT CAUSE

The drop-frame flag is written into bit 2, inside the units nibble.

VERIFIED REPAIR

Set bit 6 of the frames byte for drop frame.

Unsuccessful approach: Bit 5 belongs to the frames tens digit.

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=';' in tc
    def bcd(v,flags):
        return (v//10)<<4|v%10|flags
    b0=bcd(f,(0x04 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-frame flag bit', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: drop-frame flag bit', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: drop-frame flag bit', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['01:02:03;04', False], [68, 3, 2, 1]), ('regression variant: drop-frame flag bit', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: drop-frame flag bit', ['00:00:00;00', False], [64, 0, 0, 0]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: drop-frame flag bit', ['01:00:59;19', True], [217, 89, 0, 1]), ('partial repair probe: drop-frame flag bit', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['00:00:00;00', False], [64, 0, 0, 0]), ('regression variant: drop-frame flag bit', ['23:59:59;01', True], [193, 89, 89, 35]), ('partial repair probe: drop-frame flag bit', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: drop-frame flag bit', ['10:00:10;09', False], [73, 16, 0, 16]), ('partial repair probe: drop-frame flag bit', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit[173, 89, 89, 35][233, 89, 89, 35]Failed
regression variant: drop-frame flag bit[157, 16, 0, 16][217, 16, 0, 16]Failed
partial repair probe: drop-frame flag bit[36, 9, 16, 16][100, 9, 16, 16]Failed
partial repair variant: drop-frame flag bit[13, 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 / a576566ab8d7bb72174ad6c3aba49af65d4e006189f0a5f8a2c1b82e81342ccd

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=';' in tc
    def bcd(v,flags):
        return (v//10)<<4|v%10|flags
    b0=bcd(f,(0x20 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-frame flag bit', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: drop-frame flag bit', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: drop-frame flag bit', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['01:02:03;04', False], [68, 3, 2, 1]), ('regression variant: drop-frame flag bit', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: drop-frame flag bit', ['00:00:00;00', False], [64, 0, 0, 0]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: drop-frame flag bit', ['01:00:59;19', True], [217, 89, 0, 1]), ('partial repair probe: drop-frame flag bit', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['00:00:00;00', False], [64, 0, 0, 0]), ('regression variant: drop-frame flag bit', ['23:59:59;01', True], [193, 89, 89, 35]), ('partial repair probe: drop-frame flag bit', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: drop-frame flag bit', ['10:00:10;09', False], [73, 16, 0, 16]), ('partial repair probe: drop-frame flag bit', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit[169, 89, 89, 35][233, 89, 89, 35]Failed
regression variant: drop-frame flag bit[185, 16, 0, 16][217, 16, 0, 16]Failed
partial repair probe: drop-frame flag bit[36, 9, 16, 16][100, 9, 16, 16]Failed
partial repair variant: drop-frame flag bit[41, 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 / 4ab32a5db888ab5940d87a0fa981165dd710e30a9f0fb9e62ef81820ecf8fff4

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-frame flag bit', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: drop-frame flag bit', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: drop-frame flag bit', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['01:02:03;04', False], [68, 3, 2, 1]), ('regression variant: drop-frame flag bit', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: drop-frame flag bit', ['00:00:00;00', False], [64, 0, 0, 0]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: drop-frame flag bit', ['01:00:59;19', True], [217, 89, 0, 1]), ('partial repair probe: drop-frame flag bit', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['00:00:00;00', False], [64, 0, 0, 0]), ('regression variant: drop-frame flag bit', ['23:59:59;01', True], [193, 89, 89, 35]), ('partial repair probe: drop-frame flag bit', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: drop-frame flag bit', ['10:00:10;09', False], [73, 16, 0, 16]), ('partial repair probe: drop-frame flag bit', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair variant: drop-frame flag bit', ['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-frame flag bit[233, 89, 89, 35][233, 89, 89, 35]Passed
regression variant: drop-frame flag bit[217, 16, 0, 16][217, 16, 0, 16]Passed
partial repair probe: drop-frame flag bit[100, 9, 16, 16][100, 9, 16, 16]Passed
partial repair variant: drop-frame flag bit[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 / 4e114f96a35bc6a3066ce997eb85111ce8196268168a4cfcc7a5163c27bba727

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

Case digest / 8db9e5ec56a411ed03e0abd97949d58b9c2bfd7acf76da60c83b205a94fa9245