FAILURE MAP
← Case archive

FA-78806 / Broadcast timecode arithmetic / Open access

Chase-lock offset with subframes: subframe digits · case 01

A label ending in .5 contributes 5 hundredths instead of 50.

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

ROOT CAUSE

One-digit subframes are read as hundredths.

THE FAILURE

One-digit subframes are read as hundredths.

Unsuccessful approach: Multiplying every subframe by ten breaks two-digit subframes.

Case contract

Labels HH:MM:SS:FF.s where s is one or two digits of hundredths of a frame (".5" means 50). Return the offset from a to b as [frames, subframes] along the shorter way round 24 hours (exactly 12 hours is positive), with both components carrying the sign and 0 <= |subframes| < 100.

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(a, b, fps):
    def parse(t):
        main,sub=t.split('.')
        h,m,s,f=map(int,main.split(':'))
        return (((h*60+m)*60+s)*fps+f)*100+int(sub)
    day=86400*fps*100
    d=(parse(b)-parse(a))%day
    if d>day//2:
        d-=day
    sign=-1 if d<0 else 1
    q,r=divmod(abs(d),100)
    return [sign*q,sign*r]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: subframe digits', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('regression variant: subframe digits', ['00:59:30:01.5', '23:00:00:29.50', 30], [-215072, 0]), ('partial repair probe: subframe digits', ['00:59:59:00.5', '01:59:00:29.50', 30], [106259, 0]), ('partial repair variant: subframe digits', ['12:59:30:01.50', '00:59:59:00.05', 30], [-1295131, -45]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['00:30:59:00.0', '12:30:59:00.0', 30], [1296000, 0]), ('normal control', ['23:00:00:00.99', '00:00:59:01.99', 30], [109771, 0]), ('normal control', ['00:00:00:01.05', '23:00:00:01.05', 25], [-90000, 0])], [('regression: subframe digits', ['00:59:59:00.5', '01:59:00:29.50', 30], [106259, 0]), ('regression variant: subframe digits', ['23:59:59:01.5', '01:30:00:29.0', 30], [162057, 50]), ('partial repair probe: subframe digits', ['12:30:30:01.00', '23:30:00:24.05', 25], [989273, 5]), ('partial repair variant: subframe digits', ['23:30:00:00.0', '00:59:30:00.99', 30], [161100, 99]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['00:00:00:29.05', '12:00:00:29.05', 30], [1296000, 0]), ('normal control', ['00:59:59:01.05', '12:59:59:01.05', 30], [1296000, 0]), ('normal control', ['12:00:00:29.0', '00:59:59:00.0', 30], [-1188059, 0])], [('regression: subframe digits', ['23:59:00:24.5', '00:30:59:01.0', 25], [47951, 50]), ('regression variant: subframe digits', ['01:30:00:24.50', '12:59:00:01.5', 25], [1033477, 0]), ('partial repair probe: subframe digits', ['23:00:00:24.50', '23:00:30:01.99', 25], [727, 49]), ('partial repair variant: subframe digits', ['01:30:00:00.5', '01:00:59:00.05', 30], [-52230, -45]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['01:59:30:29.05', '13:59:30:29.05', 30], [1296000, 0]), ('normal control', ['00:59:30:00.99', '12:59:30:00.99', 25], [1080000, 0]), ('normal control', ['12:30:59:01.99', '00:30:59:01.99', 30], [1296000, 0])], [('regression: subframe digits', ['23:30:59:00.5', '23:59:30:01.00', 30], [51330, 50]), ('regression variant: subframe digits', ['23:00:59:01.5', '01:30:00:00.0', 30], [268228, 50]), ('partial repair probe: subframe digits', ['01:00:59:29.50', '00:30:30:29.99', 30], [-54869, -51]), ('partial repair variant: subframe digits', ['12:59:59:01.05', '00:00:59:24.00', 25], [991522, 95]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['00:59:00:24.00', '12:59:00:24.00', 25], [1080000, 0]), ('normal control', ['12:30:30:29.00', '00:30:30:29.00', 30], [1296000, 0]), ('normal control', ['01:30:00:01.5', '13:30:00:01.5', 25], [1080000, 0])], [('regression: subframe digits', ['01:30:00:00.5', '01:00:59:00.05', 30], [-52230, -45]), ('regression variant: subframe digits', ['23:00:59:29.5', '23:59:00:29.99', 30], [104430, 49]), ('partial repair probe: subframe digits', ['01:00:30:00.99', '23:30:00:29.50', 30], [-162871, -49]), ('partial repair variant: subframe digits', ['23:59:59:29.05', '00:59:00:01.00', 30], [106201, 95]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['00:00:30:29.50', '12:00:30:29.50', 30], [1296000, 0]), ('normal control', ['00:00:59:29.0', '00:00:59:00.0', 30], [-29, 0]), ('normal control', ['00:30:59:29.00', '12:30:59:29.00', 30], [1296000, 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: subframe digits[0, 95][0, 50]Failed
regression variant: subframe digits[-215071, -55][-215072, 0]Failed
partial repair probe: subframe digits[106259, 45][106259, 0]Failed
partial repair variant: subframe digits[-1295131, -45][-1295131, -45]Passed
boundary control[1080000, 0][1080000, 0]Passed
normal control[1296000, 0][1296000, 0]Passed
normal control[109771, 0][109771, 0]Passed
normal control[-90000, 0][-90000, 0]Passed

SHA-256 / f873a1ac5bf4b78270ab7c4f94d354fa51a94942e18b59887cb0c1e86bfcdd6a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(a, b, fps):
    def parse(t):
        main,sub=t.split('.')
        h,m,s,f=map(int,main.split(':'))
        return (((h*60+m)*60+s)*fps+f)*100+int(sub)*10
    day=86400*fps*100
    d=(parse(b)-parse(a))%day
    if d>day//2:
        d-=day
    sign=-1 if d<0 else 1
    q,r=divmod(abs(d),100)
    return [sign*q,sign*r]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: subframe digits', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('regression variant: subframe digits', ['00:59:30:01.5', '23:00:00:29.50', 30], [-215072, 0]), ('partial repair probe: subframe digits', ['00:59:59:00.5', '01:59:00:29.50', 30], [106259, 0]), ('partial repair variant: subframe digits', ['12:59:30:01.50', '00:59:59:00.05', 30], [-1295131, -45]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['00:30:59:00.0', '12:30:59:00.0', 30], [1296000, 0]), ('normal control', ['23:00:00:00.99', '00:00:59:01.99', 30], [109771, 0]), ('normal control', ['00:00:00:01.05', '23:00:00:01.05', 25], [-90000, 0])], [('regression: subframe digits', ['00:59:59:00.5', '01:59:00:29.50', 30], [106259, 0]), ('regression variant: subframe digits', ['23:59:59:01.5', '01:30:00:29.0', 30], [162057, 50]), ('partial repair probe: subframe digits', ['12:30:30:01.00', '23:30:00:24.05', 25], [989273, 5]), ('partial repair variant: subframe digits', ['23:30:00:00.0', '00:59:30:00.99', 30], [161100, 99]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['00:00:00:29.05', '12:00:00:29.05', 30], [1296000, 0]), ('normal control', ['00:59:59:01.05', '12:59:59:01.05', 30], [1296000, 0]), ('normal control', ['12:00:00:29.0', '00:59:59:00.0', 30], [-1188059, 0])], [('regression: subframe digits', ['23:59:00:24.5', '00:30:59:01.0', 25], [47951, 50]), ('regression variant: subframe digits', ['01:30:00:24.50', '12:59:00:01.5', 25], [1033477, 0]), ('partial repair probe: subframe digits', ['23:00:00:24.50', '23:00:30:01.99', 25], [727, 49]), ('partial repair variant: subframe digits', ['01:30:00:00.5', '01:00:59:00.05', 30], [-52230, -45]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['01:59:30:29.05', '13:59:30:29.05', 30], [1296000, 0]), ('normal control', ['00:59:30:00.99', '12:59:30:00.99', 25], [1080000, 0]), ('normal control', ['12:30:59:01.99', '00:30:59:01.99', 30], [1296000, 0])], [('regression: subframe digits', ['23:30:59:00.5', '23:59:30:01.00', 30], [51330, 50]), ('regression variant: subframe digits', ['23:00:59:01.5', '01:30:00:00.0', 30], [268228, 50]), ('partial repair probe: subframe digits', ['01:00:59:29.50', '00:30:30:29.99', 30], [-54869, -51]), ('partial repair variant: subframe digits', ['12:59:59:01.05', '00:00:59:24.00', 25], [991522, 95]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['00:59:00:24.00', '12:59:00:24.00', 25], [1080000, 0]), ('normal control', ['12:30:30:29.00', '00:30:30:29.00', 30], [1296000, 0]), ('normal control', ['01:30:00:01.5', '13:30:00:01.5', 25], [1080000, 0])], [('regression: subframe digits', ['01:30:00:00.5', '01:00:59:00.05', 30], [-52230, -45]), ('regression variant: subframe digits', ['23:00:59:29.5', '23:59:00:29.99', 30], [104430, 49]), ('partial repair probe: subframe digits', ['01:00:30:00.99', '23:30:00:29.50', 30], [-162871, -49]), ('partial repair variant: subframe digits', ['23:59:59:29.05', '00:59:00:01.00', 30], [106201, 95]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['00:00:30:29.50', '12:00:30:29.50', 30], [1296000, 0]), ('normal control', ['00:00:59:29.0', '00:00:59:00.0', 30], [-29, 0]), ('normal control', ['00:30:59:29.00', '12:30:59:29.00', 30], [1296000, 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: subframe digits[0, 50][0, 50]Passed
regression variant: subframe digits[-215067, -50][-215072, 0]Failed
partial repair probe: subframe digits[106263, 50][106259, 0]Failed
partial repair variant: subframe digits[-1295135, -50][-1295131, -45]Failed
boundary control[1080000, 0][1080000, 0]Passed
normal control[1296000, 0][1296000, 0]Passed
normal control[109771, 0][109771, 0]Passed
normal control[-90000, 0][-90000, 0]Passed

SHA-256 / 3679c69183324ee61e0fb792a9afe3d36a56985616c14a6ce9cc665ccc407758

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 8 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:38.607570+00:00.

Case digest / 8bc2f1881f0a2187fc29007f2cf4bc69a16134c8b3417ab1effdf637378e4e16