FAILURE MAP
← Case archive

FA-78471 / Broadcast timecode arithmetic / Open access

Field-wise non-drop timecode addition: frame remainder · case 01

PAL sums produce frame fields of 25 to 29.

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

ROOT CAUSE

The frame remainder uses 30 regardless of the rate.

VERIFIED REPAIR

Reduce the frame field modulo fps.

Unsuccessful approach: Subtracting only above fps leaves an exact fps sum as an invalid frame field.

Case contract

Add two valid non-drop labels at integer fps field by field with carries (frames into seconds at fps, seconds into minutes at 60, minutes into hours at 60) and wrap hours modulo 24.

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):
    x=[int(v) for v in a.split(':')]
    y=[int(v) for v in b.split(':')]
    f=x[3]+y[3]
    c=f//fps
    f%=30
    s=x[2]+y[2]+c
    c=s//60
    s%=60
    m=x[1]+y[1]+c
    c=m//60
    m%=60
    h=(x[0]+y[0]+c)%24
    return '%02d:%02d:%02d:%02d'%(h,m,s,f)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame remainder', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('regression variant: frame remainder', ['23:30:59:12', '12:59:30:12', 24], '12:30:30:00'), ('partial repair probe: frame remainder', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('partial repair variant: frame remainder', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:59:01:00', '01:00:30:12', 25], '01:59:31:12'), ('normal control', ['00:59:30:00', '00:00:59:01', 30], '01:00:29:01'), ('normal control', ['23:00:01:24', '23:00:00:00', 25], '22:00:01:24')], [('regression: frame remainder', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('regression variant: frame remainder', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('partial repair probe: frame remainder', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('partial repair variant: frame remainder', ['12:01:00:15', '00:59:30:15', 30], '13:00:31:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:00:59:12', '00:01:01:12', 25], '00:02:00:24'), ('normal control', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12'), ('normal control', ['01:00:00:29', '00:30:00:15', 30], '01:30:01:14')], [('regression: frame remainder', ['12:00:00:12', '12:00:01:24', 25], '00:00:02:11'), ('regression variant: frame remainder', ['00:00:30:12', '23:30:01:24', 25], '23:30:32:11'), ('partial repair probe: frame remainder', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('partial repair variant: frame remainder', ['01:01:30:24', '01:59:00:01', 25], '03:00:31:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('normal control', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('normal control', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24')], [('regression: frame remainder', ['12:00:59:12', '00:59:59:24', 25], '13:00:59:11'), ('regression variant: frame remainder', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('partial repair probe: frame remainder', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair variant: frame remainder', ['12:01:30:29', '01:30:30:01', 30], '13:32:01:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['01:59:01:01', '00:59:01:12', 24], '02:58:02:13'), ('normal control', ['23:30:00:00', '23:01:30:00', 24], '22:31:30:00'), ('normal control', ['00:59:01:00', '12:00:01:23', 24], '12:59:02:23')], [('regression: frame remainder', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('regression variant: frame remainder', ['00:01:30:23', '00:59:30:12', 24], '01:01:01:11'), ('partial repair probe: frame remainder', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair variant: frame remainder', ['12:01:30:01', '01:01:01:29', 30], '13:02:32:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:30:59:00', '12:59:01:15', 30], '13:30:00:15'), ('normal control', ['23:59:59:01', '23:01:01:00', 24], '23:01:00:01'), ('normal control', ['01:59:00:23', '23:01:01:00', 24], '01:00:01:23')]]
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: frame remainder00:00:01:2500:00:01:00Failed
regression variant: frame remainder12:30:30:2412:30:30:00Failed
partial repair probe: frame remainder00:00:00:0000:00:00:00Passed
partial repair variant: frame remainder01:00:02:2501:00:02:00Failed
boundary control00:00:00:0000:00:00:00Passed
normal control01:59:31:1201:59:31:12Passed
normal control01:00:29:0101:00:29:01Passed
normal control22:00:01:2422:00:01:24Passed

SHA-256 / fdcb26e94bbb025468e89a03de6a7cc771cdccd170a3dad0d1149af5f05905b4

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(a, b, fps):
    x=[int(v) for v in a.split(':')]
    y=[int(v) for v in b.split(':')]
    f=x[3]+y[3]
    c=f//fps
    f=f-fps if f>fps else f
    s=x[2]+y[2]+c
    c=s//60
    s%=60
    m=x[1]+y[1]+c
    c=m//60
    m%=60
    h=(x[0]+y[0]+c)%24
    return '%02d:%02d:%02d:%02d'%(h,m,s,f)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame remainder', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('regression variant: frame remainder', ['23:30:59:12', '12:59:30:12', 24], '12:30:30:00'), ('partial repair probe: frame remainder', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('partial repair variant: frame remainder', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:59:01:00', '01:00:30:12', 25], '01:59:31:12'), ('normal control', ['00:59:30:00', '00:00:59:01', 30], '01:00:29:01'), ('normal control', ['23:00:01:24', '23:00:00:00', 25], '22:00:01:24')], [('regression: frame remainder', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('regression variant: frame remainder', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('partial repair probe: frame remainder', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('partial repair variant: frame remainder', ['12:01:00:15', '00:59:30:15', 30], '13:00:31:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:00:59:12', '00:01:01:12', 25], '00:02:00:24'), ('normal control', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12'), ('normal control', ['01:00:00:29', '00:30:00:15', 30], '01:30:01:14')], [('regression: frame remainder', ['12:00:00:12', '12:00:01:24', 25], '00:00:02:11'), ('regression variant: frame remainder', ['00:00:30:12', '23:30:01:24', 25], '23:30:32:11'), ('partial repair probe: frame remainder', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('partial repair variant: frame remainder', ['01:01:30:24', '01:59:00:01', 25], '03:00:31:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('normal control', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('normal control', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24')], [('regression: frame remainder', ['12:00:59:12', '00:59:59:24', 25], '13:00:59:11'), ('regression variant: frame remainder', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('partial repair probe: frame remainder', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair variant: frame remainder', ['12:01:30:29', '01:30:30:01', 30], '13:32:01:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['01:59:01:01', '00:59:01:12', 24], '02:58:02:13'), ('normal control', ['23:30:00:00', '23:01:30:00', 24], '22:31:30:00'), ('normal control', ['00:59:01:00', '12:00:01:23', 24], '12:59:02:23')], [('regression: frame remainder', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('regression variant: frame remainder', ['00:01:30:23', '00:59:30:12', 24], '01:01:01:11'), ('partial repair probe: frame remainder', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair variant: frame remainder', ['12:01:30:01', '01:01:01:29', 30], '13:02:32:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:30:59:00', '12:59:01:15', 30], '13:30:00:15'), ('normal control', ['23:59:59:01', '23:01:01:00', 24], '23:01:00:01'), ('normal control', ['01:59:00:23', '23:01:01:00', 24], '01:00:01:23')]]
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: frame remainder00:00:01:2500:00:01:00Failed
regression variant: frame remainder12:30:30:2412:30:30:00Failed
partial repair probe: frame remainder00:00:00:3000:00:00:00Failed
partial repair variant: frame remainder01:00:02:2501:00:02:00Failed
boundary control00:00:00:0000:00:00:00Passed
normal control01:59:31:1201:59:31:12Passed
normal control01:00:29:0101:00:29:01Passed
normal control22:00:01:2422:00:01:24Passed

SHA-256 / a0324ee985437f4419c9c41ac37aeb7a4f4e134f29eaa8b7d060b5195e7f609e

3 / The verified repair

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

N = 1
observations = []
def solve(a, b, fps):
    x=[int(v) for v in a.split(':')]
    y=[int(v) for v in b.split(':')]
    f=x[3]+y[3]
    c=f//fps
    f%=fps
    s=x[2]+y[2]+c
    c=s//60
    s%=60
    m=x[1]+y[1]+c
    c=m//60
    m%=60
    h=(x[0]+y[0]+c)%24
    return '%02d:%02d:%02d:%02d'%(h,m,s,f)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame remainder', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('regression variant: frame remainder', ['23:30:59:12', '12:59:30:12', 24], '12:30:30:00'), ('partial repair probe: frame remainder', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('partial repair variant: frame remainder', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:59:01:00', '01:00:30:12', 25], '01:59:31:12'), ('normal control', ['00:59:30:00', '00:00:59:01', 30], '01:00:29:01'), ('normal control', ['23:00:01:24', '23:00:00:00', 25], '22:00:01:24')], [('regression: frame remainder', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('regression variant: frame remainder', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('partial repair probe: frame remainder', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('partial repair variant: frame remainder', ['12:01:00:15', '00:59:30:15', 30], '13:00:31:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:00:59:12', '00:01:01:12', 25], '00:02:00:24'), ('normal control', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12'), ('normal control', ['01:00:00:29', '00:30:00:15', 30], '01:30:01:14')], [('regression: frame remainder', ['12:00:00:12', '12:00:01:24', 25], '00:00:02:11'), ('regression variant: frame remainder', ['00:00:30:12', '23:30:01:24', 25], '23:30:32:11'), ('partial repair probe: frame remainder', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('partial repair variant: frame remainder', ['01:01:30:24', '01:59:00:01', 25], '03:00:31:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('normal control', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('normal control', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24')], [('regression: frame remainder', ['12:00:59:12', '00:59:59:24', 25], '13:00:59:11'), ('regression variant: frame remainder', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('partial repair probe: frame remainder', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair variant: frame remainder', ['12:01:30:29', '01:30:30:01', 30], '13:32:01:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['01:59:01:01', '00:59:01:12', 24], '02:58:02:13'), ('normal control', ['23:30:00:00', '23:01:30:00', 24], '22:31:30:00'), ('normal control', ['00:59:01:00', '12:00:01:23', 24], '12:59:02:23')], [('regression: frame remainder', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('regression variant: frame remainder', ['00:01:30:23', '00:59:30:12', 24], '01:01:01:11'), ('partial repair probe: frame remainder', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair variant: frame remainder', ['12:01:30:01', '01:01:01:29', 30], '13:02:32:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:30:59:00', '12:59:01:15', 30], '13:30:00:15'), ('normal control', ['23:59:59:01', '23:01:01:00', 24], '23:01:00:01'), ('normal control', ['01:59:00:23', '23:01:01:00', 24], '01:00:01:23')]]
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: frame remainder00:00:01:0000:00:01:00Passed
regression variant: frame remainder12:30:30:0012:30:30:00Passed
partial repair probe: frame remainder00:00:00:0000:00:00:00Passed
partial repair variant: frame remainder01:00:02:0001:00:02:00Passed
boundary control00:00:00:0000:00:00:00Passed
normal control01:59:31:1201:59:31:12Passed
normal control01:00:29:0101:00:29:01Passed
normal control22:00:01:2422:00:01:24Passed

SHA-256 / 4a1942671e71eaea5d38902f743489f1093461d25a68296c57e93216a56f189d

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

Case digest / dd3a5c196f8ff4c411ca228b85744a570228a9a46add8e02d3a919429a6b8eb1