FAILURE MAP
← Case archive

FA-78626 / Broadcast timecode arithmetic / Open access

Linear timecode BCD field packing: color flag bit · case 01

Color-framed non-drop timecode is announced as drop frame.

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

ROOT CAUSE

The color flag is written into the drop-frame bit.

THE FAILURE

The color flag is written into the drop-frame bit.

Unsuccessful approach: Tying the color flag to drop frame loses it on non-drop timecode.

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,(0x40 if drop else 0)|(0x40 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: color flag bit', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: color flag bit', ['00:07:09:29', True], [169, 9, 7, 0]), ('partial repair probe: color flag bit', ['01:59:10:24', True], [164, 16, 89, 1]), ('partial repair variant: color flag bit', ['00:10:09:00', True], [128, 9, 16, 0]), ('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:02:03;04', False], [68, 3, 2, 1]), ('normal control', ['10:10:09;24', False], [100, 9, 16, 16]), ('normal control', ['10:07:59:01', False], [1, 89, 7, 16])], [('regression: color flag bit', ['01:07:10:29', True], [169, 16, 7, 1]), ('regression variant: color flag bit', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: color flag bit', ['00:07:09:29', True], [169, 9, 7, 0]), ('partial repair variant: color flag bit', ['00:00:09:24', True], [164, 9, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['01:02:03;04', False], [68, 3, 2, 1]), ('normal control', ['10:00:10;09', False], [73, 16, 0, 16]), ('normal control', ['10:10:00;29', False], [105, 0, 16, 16]), ('normal control', ['10:10:00;19', False], [89, 0, 16, 16])], [('regression: color flag bit', ['00:00:00:00', True], [128, 0, 0, 0]), ('regression variant: color flag bit', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: color flag bit', ['19:07:45:24', True], [164, 69, 7, 25]), ('partial repair variant: color flag bit', ['01:59:59:10', True], [144, 89, 89, 1]), ('boundary control', ['01:02:03;04', False], [68, 3, 2, 1]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['23:10:09:01', False], [1, 9, 16, 35]), ('normal control', ['00:07:59;01', False], [65, 89, 7, 0]), ('normal control', ['01:00:10;19', False], [89, 16, 0, 1])], [('regression: color flag bit', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: color flag bit', ['19:07:45:24', True], [164, 69, 7, 25]), ('partial repair probe: color flag bit', ['01:00:09:10', True], [144, 9, 0, 1]), ('partial repair variant: color flag bit', ['00:00:09:01', True], [129, 9, 0, 0]), ('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:10:45:09', False], [9, 69, 16, 35]), ('normal control', ['10:10:10;24', False], [100, 16, 16, 16]), ('normal control', ['00:07:00;00', False], [64, 0, 7, 0])], [('regression: color flag bit', ['01:59:10:24', True], [164, 16, 89, 1]), ('regression variant: color flag bit', ['01:00:59;19', True], [217, 89, 0, 1]), ('partial repair probe: color flag bit', ['19:10:10:24', True], [164, 16, 16, 25]), ('partial repair variant: color flag bit', ['19:59:09:00', True], [128, 9, 89, 25]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['01:02:03;04', False], [68, 3, 2, 1]), ('normal control', ['19:59:45;09', False], [73, 69, 89, 25]), ('normal control', ['01:59:59;24', False], [100, 89, 89, 1]), ('normal control', ['10:10:10;19', False], [89, 16, 16, 16])]]
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: color flag bit[105, 89, 89, 35][233, 89, 89, 35]Failed
regression variant: color flag bit[105, 9, 7, 0][169, 9, 7, 0]Failed
partial repair probe: color flag bit[100, 16, 89, 1][164, 16, 89, 1]Failed
partial repair variant: color flag bit[64, 9, 16, 0][128, 9, 16, 0]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[68, 3, 2, 1][68, 3, 2, 1]Passed
normal control[100, 9, 16, 16][100, 9, 16, 16]Passed
normal control[1, 89, 7, 16][1, 89, 7, 16]Passed

SHA-256 / 4f2049c61bd6be6634c11768172026d32b08c751a5273241425f6fe8db9fa111

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,(0x40 if drop else 0)|(0x80 if color and drop 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: color flag bit', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: color flag bit', ['00:07:09:29', True], [169, 9, 7, 0]), ('partial repair probe: color flag bit', ['01:59:10:24', True], [164, 16, 89, 1]), ('partial repair variant: color flag bit', ['00:10:09:00', True], [128, 9, 16, 0]), ('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:02:03;04', False], [68, 3, 2, 1]), ('normal control', ['10:10:09;24', False], [100, 9, 16, 16]), ('normal control', ['10:07:59:01', False], [1, 89, 7, 16])], [('regression: color flag bit', ['01:07:10:29', True], [169, 16, 7, 1]), ('regression variant: color flag bit', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: color flag bit', ['00:07:09:29', True], [169, 9, 7, 0]), ('partial repair variant: color flag bit', ['00:00:09:24', True], [164, 9, 0, 0]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['01:02:03;04', False], [68, 3, 2, 1]), ('normal control', ['10:00:10;09', False], [73, 16, 0, 16]), ('normal control', ['10:10:00;29', False], [105, 0, 16, 16]), ('normal control', ['10:10:00;19', False], [89, 0, 16, 16])], [('regression: color flag bit', ['00:00:00:00', True], [128, 0, 0, 0]), ('regression variant: color flag bit', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: color flag bit', ['19:07:45:24', True], [164, 69, 7, 25]), ('partial repair variant: color flag bit', ['01:59:59:10', True], [144, 89, 89, 1]), ('boundary control', ['01:02:03;04', False], [68, 3, 2, 1]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['23:10:09:01', False], [1, 9, 16, 35]), ('normal control', ['00:07:59;01', False], [65, 89, 7, 0]), ('normal control', ['01:00:10;19', False], [89, 16, 0, 1])], [('regression: color flag bit', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: color flag bit', ['19:07:45:24', True], [164, 69, 7, 25]), ('partial repair probe: color flag bit', ['01:00:09:10', True], [144, 9, 0, 1]), ('partial repair variant: color flag bit', ['00:00:09:01', True], [129, 9, 0, 0]), ('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:10:45:09', False], [9, 69, 16, 35]), ('normal control', ['10:10:10;24', False], [100, 16, 16, 16]), ('normal control', ['00:07:00;00', False], [64, 0, 7, 0])], [('regression: color flag bit', ['01:59:10:24', True], [164, 16, 89, 1]), ('regression variant: color flag bit', ['01:00:59;19', True], [217, 89, 0, 1]), ('partial repair probe: color flag bit', ['19:10:10:24', True], [164, 16, 16, 25]), ('partial repair variant: color flag bit', ['19:59:09:00', True], [128, 9, 89, 25]), ('boundary control', ['10:10:10:10', False], [16, 16, 16, 16]), ('boundary control', ['01:02:03;04', False], [68, 3, 2, 1]), ('normal control', ['19:59:45;09', False], [73, 69, 89, 25]), ('normal control', ['01:59:59;24', False], [100, 89, 89, 1]), ('normal control', ['10:10:10;19', False], [89, 16, 16, 16])]]
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: color flag bit[233, 89, 89, 35][233, 89, 89, 35]Passed
regression variant: color flag bit[41, 9, 7, 0][169, 9, 7, 0]Failed
partial repair probe: color flag bit[36, 16, 89, 1][164, 16, 89, 1]Failed
partial repair variant: color flag bit[0, 9, 16, 0][128, 9, 16, 0]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[68, 3, 2, 1][68, 3, 2, 1]Passed
normal control[100, 9, 16, 16][100, 9, 16, 16]Passed
normal control[1, 89, 7, 16][1, 89, 7, 16]Passed

SHA-256 / 291df1e9bcd4cea9f72e49297ab068c9f787b09e586ddb32148a6fe474060a34

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 9 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 52c3900160de5f0bbd54ce231c576fc2f5902924286bbe2f6062a0ebed78fa3e