FAILURE MAP
← Case archive

FA-78616 / Broadcast timecode arithmetic / Open access

Linear timecode BCD field packing: tens digit position · case 01

Decoders read 10:00:00:00 as a scrambled time.

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

ROOT CAUSE

The tens digit is shifted into bit 3, overlapping the units nibble.

VERIFIED REPAIR

Place tens from bit 4 and units in bits 0-3.

Unsuccessful approach: Swapping the nibbles puts the units digit in the tens position.

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)<<3|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: tens digit position', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: tens digit position', ['01:59:10:24', True], [164, 16, 89, 1]), ('partial repair probe: tens digit position', ['01:02:03;04', False], [68, 3, 2, 1]), ('partial repair variant: tens digit position', ['10:59:10;24', True], [228, 16, 89, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0])], [('regression: tens digit position', ['10:10:10:10', False], [16, 16, 16, 16]), ('regression variant: tens digit position', ['00:07:09:29', True], [169, 9, 7, 0]), ('partial repair probe: tens digit position', ['01:07:10:29', True], [169, 16, 7, 1]), ('partial repair variant: tens digit position', ['19:07:45:24', True], [164, 69, 7, 25]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0])], [('regression: tens digit position', ['01:07:10:29', True], [169, 16, 7, 1]), ('regression variant: tens digit position', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: tens digit position', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: tens digit position', ['01:00:59;19', True], [217, 89, 0, 1]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0])], [('regression: tens digit position', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: tens digit position', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: tens digit position', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: tens digit position', ['10:07:59:01', False], [1, 89, 7, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0])], [('regression: tens digit position', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: tens digit position', ['19:07:45:24', True], [164, 69, 7, 25]), ('partial repair probe: tens digit position', ['01:59:10:24', True], [164, 16, 89, 1]), ('partial repair variant: tens digit position', ['23:59:59;01', True], [193, 89, 89, 35]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0])]]
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: tens digit position[217, 41, 41, 19][233, 89, 89, 35]Failed
regression variant: tens digit position[148, 8, 41, 1][164, 16, 89, 1]Failed
partial repair probe: tens digit position[68, 3, 2, 1][68, 3, 2, 1]Passed
partial repair variant: tens digit position[212, 8, 41, 8][228, 16, 89, 16]Failed
boundary control[0, 0, 0, 0][0, 0, 0, 0]Passed
normal control[64, 0, 0, 0][64, 0, 0, 0]Passed
normal control[192, 0, 0, 0][192, 0, 0, 0]Passed
normal control[128, 0, 0, 0][128, 0, 0, 0]Passed

SHA-256 / 1673a4ebd78382aba7ac08b06e7c567f3242efd3016902b53019ffe3768cc4d1

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 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: tens digit position', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: tens digit position', ['01:59:10:24', True], [164, 16, 89, 1]), ('partial repair probe: tens digit position', ['01:02:03;04', False], [68, 3, 2, 1]), ('partial repair variant: tens digit position', ['10:59:10;24', True], [228, 16, 89, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0])], [('regression: tens digit position', ['10:10:10:10', False], [16, 16, 16, 16]), ('regression variant: tens digit position', ['00:07:09:29', True], [169, 9, 7, 0]), ('partial repair probe: tens digit position', ['01:07:10:29', True], [169, 16, 7, 1]), ('partial repair variant: tens digit position', ['19:07:45:24', True], [164, 69, 7, 25]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0])], [('regression: tens digit position', ['01:07:10:29', True], [169, 16, 7, 1]), ('regression variant: tens digit position', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: tens digit position', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: tens digit position', ['01:00:59;19', True], [217, 89, 0, 1]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0])], [('regression: tens digit position', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: tens digit position', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: tens digit position', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: tens digit position', ['10:07:59:01', False], [1, 89, 7, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0])], [('regression: tens digit position', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: tens digit position', ['19:07:45:24', True], [164, 69, 7, 25]), ('partial repair probe: tens digit position', ['01:59:10:24', True], [164, 16, 89, 1]), ('partial repair variant: tens digit position', ['23:59:59;01', True], [193, 89, 89, 35]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0])]]
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: tens digit position[210, 149, 149, 50][233, 89, 89, 35]Failed
regression variant: tens digit position[194, 1, 149, 16][164, 16, 89, 1]Failed
partial repair probe: tens digit position[64, 48, 32, 16][68, 3, 2, 1]Failed
partial repair variant: tens digit position[194, 1, 149, 1][228, 16, 89, 16]Failed
boundary control[0, 0, 0, 0][0, 0, 0, 0]Passed
normal control[64, 0, 0, 0][64, 0, 0, 0]Passed
normal control[192, 0, 0, 0][192, 0, 0, 0]Passed
normal control[128, 0, 0, 0][128, 0, 0, 0]Passed

SHA-256 / 239b1944535b80422a4902ef38e1e7bb36b9406e2010169b3b1039e3162f4f62

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: tens digit position', ['23:59:59;29', True], [233, 89, 89, 35]), ('regression variant: tens digit position', ['01:59:10:24', True], [164, 16, 89, 1]), ('partial repair probe: tens digit position', ['01:02:03;04', False], [68, 3, 2, 1]), ('partial repair variant: tens digit position', ['10:59:10;24', True], [228, 16, 89, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0])], [('regression: tens digit position', ['10:10:10:10', False], [16, 16, 16, 16]), ('regression variant: tens digit position', ['00:07:09:29', True], [169, 9, 7, 0]), ('partial repair probe: tens digit position', ['01:07:10:29', True], [169, 16, 7, 1]), ('partial repair variant: tens digit position', ['19:07:45:24', True], [164, 69, 7, 25]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0])], [('regression: tens digit position', ['01:07:10:29', True], [169, 16, 7, 1]), ('regression variant: tens digit position', ['10:00:10;19', True], [217, 16, 0, 16]), ('partial repair probe: tens digit position', ['10:10:09;24', False], [100, 9, 16, 16]), ('partial repair variant: tens digit position', ['01:00:59;19', True], [217, 89, 0, 1]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0])], [('regression: tens digit position', ['10:10:09;24', False], [100, 9, 16, 16]), ('regression variant: tens digit position', ['10:59:10;24', True], [228, 16, 89, 16]), ('partial repair probe: tens digit position', ['19:00:09;19', True], [217, 9, 0, 25]), ('partial repair variant: tens digit position', ['10:07:59:01', False], [1, 89, 7, 16]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0])], [('regression: tens digit position', ['19:00:09;19', True], [217, 9, 0, 25]), ('regression variant: tens digit position', ['19:07:45:24', True], [164, 69, 7, 25]), ('partial repair probe: tens digit position', ['01:59:10:24', True], [164, 16, 89, 1]), ('partial repair variant: tens digit position', ['23:59:59;01', True], [193, 89, 89, 35]), ('boundary control', ['00:00:00:00', False], [0, 0, 0, 0]), ('normal control', ['00:00:00;00', False], [64, 0, 0, 0]), ('normal control', ['00:00:00;00', True], [192, 0, 0, 0]), ('normal control', ['00:00:00:00', True], [128, 0, 0, 0])]]
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: tens digit position[233, 89, 89, 35][233, 89, 89, 35]Passed
regression variant: tens digit position[164, 16, 89, 1][164, 16, 89, 1]Passed
partial repair probe: tens digit position[68, 3, 2, 1][68, 3, 2, 1]Passed
partial repair variant: tens digit position[228, 16, 89, 16][228, 16, 89, 16]Passed
boundary control[0, 0, 0, 0][0, 0, 0, 0]Passed
normal control[64, 0, 0, 0][64, 0, 0, 0]Passed
normal control[192, 0, 0, 0][192, 0, 0, 0]Passed
normal control[128, 0, 0, 0][128, 0, 0, 0]Passed

SHA-256 / c1bcea50a83d0fb6bb734dcea36a4e15cdbabb1adf039d16efd53839df0f3eca

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

Case digest / 860d6306334b8d79e238bb8d3e3871f0b23f4e7a68f561a078c9b138b1757916