FA-78466 / Broadcast timecode arithmetic / Open access
Field-wise non-drop timecode addition: frame carry test · case 01
Adding frames that sum exactly to one second loses that second.
ROOT CAUSE
The frame carry is only produced when the sum exceeds fps.
VERIFIED REPAIR
Carry f//fps whole seconds.
Unsuccessful approach: Special-casing sums above fps still drops the carry for an exact fps sum.
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=int(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 carry test', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('regression variant: frame carry test', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair probe: frame carry test', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('partial repair variant: frame carry test', ['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 carry test', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('regression variant: frame carry test', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair probe: frame carry test', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('partial repair variant: frame carry test', ['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', ['00:59:59:15', '23:30:00:29', 30], '00:30:00:14'), ('normal control', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12')], [('regression: frame carry test', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('regression variant: frame carry test', ['00:30:00:15', '23:01:59:15', 30], '23:32:00:00'), ('partial repair probe: frame carry test', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('partial repair variant: frame carry test', ['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', ['01:00:00:29', '00:30:00:15', 30], '01:30:01:14'), ('normal control', ['12:59:00:29', '00:00:00:15', 30], '12:59:01:14'), ('normal control', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15')], [('regression: frame carry test', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('regression variant: frame carry test', ['23:30:59:12', '12:59:30:12', 24], '12:30:30:00'), ('partial repair probe: frame carry test', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair variant: frame carry test', ['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', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24'), ('normal control', ['00:00:00:12', '23:00:01:01', 25], '23:00:01:13'), ('normal control', ['23:30:00:00', '23:01:30:00', 24], '22:31:30:00')], [('regression: frame carry test', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('regression variant: frame carry test', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('partial repair probe: frame carry test', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair variant: frame carry test', ['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:59:01:00', '12:00:01:23', 24], '12:59:02:23'), ('normal control', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('normal control', ['01:01:59:23', '01:00:01:00', 24], '02:02:00: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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: frame carry test | 00:00:00:00 | 00:00:01:00 | Failed |
| regression variant: frame carry test | 01:58:31:00 | 01:58:32:00 | Failed |
| partial repair probe: frame carry test | 23:59:59:00 | 00:00:00:00 | Failed |
| partial repair variant: frame carry test | 01:00:01:00 | 01:00:02:00 | Failed |
| boundary control | 00:00:00:00 | 00:00:00:00 | Passed |
| normal control | 01:59:31:12 | 01:59:31:12 | Passed |
| normal control | 01:00:29:01 | 01:00:29:01 | Passed |
| normal control | 22:00:01:24 | 22:00:01:24 | Passed |
SHA-256 / f764bcda0811d8dbb907429ff394d53758be248f5aa5dbac0407d6414f5f0fd0
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 if f>fps else 0
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 carry test', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('regression variant: frame carry test', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair probe: frame carry test', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('partial repair variant: frame carry test', ['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 carry test', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('regression variant: frame carry test', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair probe: frame carry test', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('partial repair variant: frame carry test', ['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', ['00:59:59:15', '23:30:00:29', 30], '00:30:00:14'), ('normal control', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12')], [('regression: frame carry test', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('regression variant: frame carry test', ['00:30:00:15', '23:01:59:15', 30], '23:32:00:00'), ('partial repair probe: frame carry test', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('partial repair variant: frame carry test', ['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', ['01:00:00:29', '00:30:00:15', 30], '01:30:01:14'), ('normal control', ['12:59:00:29', '00:00:00:15', 30], '12:59:01:14'), ('normal control', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15')], [('regression: frame carry test', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('regression variant: frame carry test', ['23:30:59:12', '12:59:30:12', 24], '12:30:30:00'), ('partial repair probe: frame carry test', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair variant: frame carry test', ['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', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24'), ('normal control', ['00:00:00:12', '23:00:01:01', 25], '23:00:01:13'), ('normal control', ['23:30:00:00', '23:01:30:00', 24], '22:31:30:00')], [('regression: frame carry test', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('regression variant: frame carry test', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('partial repair probe: frame carry test', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair variant: frame carry test', ['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:59:01:00', '12:00:01:23', 24], '12:59:02:23'), ('normal control', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('normal control', ['01:01:59:23', '01:00:01:00', 24], '02:02:00: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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: frame carry test | 00:00:00:00 | 00:00:01:00 | Failed |
| regression variant: frame carry test | 01:58:31:00 | 01:58:32:00 | Failed |
| partial repair probe: frame carry test | 23:59:59:00 | 00:00:00:00 | Failed |
| partial repair variant: frame carry test | 01:00:01:00 | 01:00:02:00 | Failed |
| boundary control | 00:00:00:00 | 00:00:00:00 | Passed |
| normal control | 01:59:31:12 | 01:59:31:12 | Passed |
| normal control | 01:00:29:01 | 01:00:29:01 | Passed |
| normal control | 22:00:01:24 | 22:00:01:24 | Passed |
SHA-256 / 20d744f38753934140acee4b986c4ec7a4ca1ac044108b38878139d7cd34a498
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 carry test', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('regression variant: frame carry test', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair probe: frame carry test', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('partial repair variant: frame carry test', ['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 carry test', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('regression variant: frame carry test', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair probe: frame carry test', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('partial repair variant: frame carry test', ['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', ['00:59:59:15', '23:30:00:29', 30], '00:30:00:14'), ('normal control', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12')], [('regression: frame carry test', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('regression variant: frame carry test', ['00:30:00:15', '23:01:59:15', 30], '23:32:00:00'), ('partial repair probe: frame carry test', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('partial repair variant: frame carry test', ['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', ['01:00:00:29', '00:30:00:15', 30], '01:30:01:14'), ('normal control', ['12:59:00:29', '00:00:00:15', 30], '12:59:01:14'), ('normal control', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15')], [('regression: frame carry test', ['01:30:30:15', '01:59:30:15', 30], '03:30:01:00'), ('regression variant: frame carry test', ['23:30:59:12', '12:59:30:12', 24], '12:30:30:00'), ('partial repair probe: frame carry test', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair variant: frame carry test', ['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', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24'), ('normal control', ['00:00:00:12', '23:00:01:01', 25], '23:00:01:13'), ('normal control', ['23:30:00:00', '23:01:30:00', 24], '22:31:30:00')], [('regression: frame carry test', ['12:00:30:23', '01:00:30:01', 24], '13:01:01:00'), ('regression variant: frame carry test', ['01:30:01:24', '23:30:00:01', 25], '01:00:02:00'), ('partial repair probe: frame carry test', ['01:01:00:15', '01:59:00:15', 30], '03:00:01:00'), ('partial repair variant: frame carry test', ['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:59:01:00', '12:00:01:23', 24], '12:59:02:23'), ('normal control', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('normal control', ['01:01:59:23', '01:00:01:00', 24], '02:02:00: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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: frame carry test | 00:00:01:00 | 00:00:01:00 | Passed |
| regression variant: frame carry test | 01:58:32:00 | 01:58:32:00 | Passed |
| partial repair probe: frame carry test | 00:00:00:00 | 00:00:00:00 | Passed |
| partial repair variant: frame carry test | 01:00:02:00 | 01:00:02:00 | Passed |
| boundary control | 00:00:00:00 | 00:00:00:00 | Passed |
| normal control | 01:59:31:12 | 01:59:31:12 | Passed |
| normal control | 01:00:29:01 | 01:00:29:01 | Passed |
| normal control | 22:00:01:24 | 22:00:01:24 | Passed |
SHA-256 / 1da04e39a65bb9359c424563f9563f61c62da985a7ce93cffcc7a9b1a97acefb
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.361912+00:00.
Case digest / 8f770a9726e1562c4998395b7c1aa5170329c898f2216b53dbfa2966c6f6ff4e