FA-78486 / Broadcast timecode arithmetic / Open access
Field-wise non-drop timecode addition: hour wrap · case 01
Sums past midnight produce hours 24 and above.
ROOT CAUSE
The hour sum is not wrapped.
VERIFIED REPAIR
Wrap the hour modulo 24.
Unsuccessful approach: Subtracting 24 only above 24 leaves an hour field of exactly 24.
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%=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
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: hour wrap', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('regression variant: hour wrap', ['00:59:59:15', '23:30:00:29', 30], '00:30:00:14'), ('partial repair probe: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair variant: hour wrap', ['23:59:01:00', '00:00:59:24', 25], '00:00:00:24'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('normal 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', ['01:30:30:00', '12:59:01:01', 24], '14:29:31:01')], [('regression: hour wrap', ['23:59:01:00', '12:00:01:12', 25], '11:59:02:12'), ('regression variant: hour wrap', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12'), ('partial repair probe: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair variant: hour wrap', ['23:30:59:01', '00:30:59:23', 24], '00:01:59:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00: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', ['01:59:30:24', '12:01:00:00', 25], '14:00:30:24'), ('normal control', ['01:30:01:01', '00:30:59:01', 30], '02:01:00:02')], [('regression: hour wrap', ['23:00:01:24', '23:00:00:00', 25], '22:00:01:24'), ('regression variant: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair probe: hour wrap', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('partial repair variant: hour wrap', ['00:59:01:24', '23:59:00:12', 25], '00:58:02:11'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('normal control', ['12:59:00:29', '00:00:00:15', 30], '12:59:01:14'), ('normal control', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24'), ('normal control', ['01:59:01:01', '00:59:01:12', 24], '02:58:02:13')], [('regression: hour wrap', ['23:30:00:15', '23:30:01:00', 30], '23:00:01:15'), ('regression variant: hour wrap', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair probe: hour wrap', ['23:00:00:29', '00:59:59:15', 30], '00:00:00:14'), ('partial repair variant: hour wrap', ['23:30:59:01', '01:00:01:12', 25], '00:31:00:13'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('normal control', ['00:00:00:12', '23:00:01:01', 25], '23:00:01:13'), ('normal control', ['00:59:01:00', '12:00:01:23', 24], '12:59:02:23'), ('normal control', ['00:00:30:12', '23:30:01:24', 25], '23:30:32:11')], [('regression: hour wrap', ['12:00:00:12', '12:00:01:24', 25], '00:00:02:11'), ('regression variant: hour wrap', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('partial repair probe: hour wrap', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('partial repair variant: hour wrap', ['12:30:00:01', '12:00:59:15', 30], '00:30:59:16'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:01:30:23', '00:59:30:12', 24], '01:01:01:11'), ('normal control', ['01:01:30:24', '01:59:00:01', 25], '03:00:31:00'), ('normal control', ['23:30:01:12', '00:01:59:12', 25], '23:32:00:24')]]
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: hour wrap | 24:00:00:00 | 00:00:00:00 | Failed |
| regression variant: hour wrap | 24:30:00:14 | 00:30:00:14 | Failed |
| partial repair probe: hour wrap | 24:01:58:01 | 00:01:58:01 | Failed |
| partial repair variant: hour wrap | 24:00:00:24 | 00:00:00:24 | Failed |
| boundary control | 00:00:01:00 | 00:00:01:00 | Passed |
| boundary control | 00:01:00:00 | 00:01:00:00 | Passed |
| normal control | 00:00:00:00 | 00:00:00:00 | Passed |
| normal control | 01:59:31:12 | 01:59:31:12 | Passed |
| normal control | 14:29:31:01 | 14:29:31:01 | Passed |
SHA-256 / a934b153f280fbed9caa3ab35bfd438b25e3a16ba1c683e1f7b35b8bb6b2f109
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%=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 if x[0]+y[0]+c>24 else x[0]+y[0]+c
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: hour wrap', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('regression variant: hour wrap', ['00:59:59:15', '23:30:00:29', 30], '00:30:00:14'), ('partial repair probe: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair variant: hour wrap', ['23:59:01:00', '00:00:59:24', 25], '00:00:00:24'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('normal 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', ['01:30:30:00', '12:59:01:01', 24], '14:29:31:01')], [('regression: hour wrap', ['23:59:01:00', '12:00:01:12', 25], '11:59:02:12'), ('regression variant: hour wrap', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12'), ('partial repair probe: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair variant: hour wrap', ['23:30:59:01', '00:30:59:23', 24], '00:01:59:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00: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', ['01:59:30:24', '12:01:00:00', 25], '14:00:30:24'), ('normal control', ['01:30:01:01', '00:30:59:01', 30], '02:01:00:02')], [('regression: hour wrap', ['23:00:01:24', '23:00:00:00', 25], '22:00:01:24'), ('regression variant: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair probe: hour wrap', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('partial repair variant: hour wrap', ['00:59:01:24', '23:59:00:12', 25], '00:58:02:11'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('normal control', ['12:59:00:29', '00:00:00:15', 30], '12:59:01:14'), ('normal control', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24'), ('normal control', ['01:59:01:01', '00:59:01:12', 24], '02:58:02:13')], [('regression: hour wrap', ['23:30:00:15', '23:30:01:00', 30], '23:00:01:15'), ('regression variant: hour wrap', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair probe: hour wrap', ['23:00:00:29', '00:59:59:15', 30], '00:00:00:14'), ('partial repair variant: hour wrap', ['23:30:59:01', '01:00:01:12', 25], '00:31:00:13'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('normal control', ['00:00:00:12', '23:00:01:01', 25], '23:00:01:13'), ('normal control', ['00:59:01:00', '12:00:01:23', 24], '12:59:02:23'), ('normal control', ['00:00:30:12', '23:30:01:24', 25], '23:30:32:11')], [('regression: hour wrap', ['12:00:00:12', '12:00:01:24', 25], '00:00:02:11'), ('regression variant: hour wrap', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('partial repair probe: hour wrap', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('partial repair variant: hour wrap', ['12:30:00:01', '12:00:59:15', 30], '00:30:59:16'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:01:30:23', '00:59:30:12', 24], '01:01:01:11'), ('normal control', ['01:01:30:24', '01:59:00:01', 25], '03:00:31:00'), ('normal control', ['23:30:01:12', '00:01:59:12', 25], '23:32:00:24')]]
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: hour wrap | 24:00:00:00 | 00:00:00:00 | Failed |
| regression variant: hour wrap | 24:30:00:14 | 00:30:00:14 | Failed |
| partial repair probe: hour wrap | 24:01:58:01 | 00:01:58:01 | Failed |
| partial repair variant: hour wrap | 24:00:00:24 | 00:00:00:24 | Failed |
| boundary control | 00:00:01:00 | 00:00:01:00 | Passed |
| boundary control | 00:01:00:00 | 00:01:00:00 | Passed |
| normal control | 00:00:00:00 | 00:00:00:00 | Passed |
| normal control | 01:59:31:12 | 01:59:31:12 | Passed |
| normal control | 14:29:31:01 | 14:29:31:01 | Passed |
SHA-256 / a209c6cbd394cb9959449557da24a5feb8bfe471d18d6412fde724cffbb577f0
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: hour wrap', ['23:59:59:29', '00:00:00:01', 30], '00:00:00:00'), ('regression variant: hour wrap', ['00:59:59:15', '23:30:00:29', 30], '00:30:00:14'), ('partial repair probe: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair variant: hour wrap', ['23:59:01:00', '00:00:59:24', 25], '00:00:00:24'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('normal 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', ['01:30:30:00', '12:59:01:01', 24], '14:29:31:01')], [('regression: hour wrap', ['23:59:01:00', '12:00:01:12', 25], '11:59:02:12'), ('regression variant: hour wrap', ['23:01:30:12', '23:00:59:00', 24], '22:02:29:12'), ('partial repair probe: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair variant: hour wrap', ['23:30:59:01', '00:30:59:23', 24], '00:01:59:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00: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', ['01:59:30:24', '12:01:00:00', 25], '14:00:30:24'), ('normal control', ['01:30:01:01', '00:30:59:01', 30], '02:01:00:02')], [('regression: hour wrap', ['23:00:01:24', '23:00:00:00', 25], '22:00:01:24'), ('regression variant: hour wrap', ['00:59:59:01', '23:01:59:00', 25], '00:01:58:01'), ('partial repair probe: hour wrap', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('partial repair variant: hour wrap', ['00:59:01:24', '23:59:00:12', 25], '00:58:02:11'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('normal control', ['12:59:00:29', '00:00:00:15', 30], '12:59:01:14'), ('normal control', ['00:00:01:24', '23:01:59:00', 25], '23:02:00:24'), ('normal control', ['01:59:01:01', '00:59:01:12', 24], '02:58:02:13')], [('regression: hour wrap', ['23:30:00:15', '23:30:01:00', 30], '23:00:01:15'), ('regression variant: hour wrap', ['12:59:01:15', '12:59:30:15', 30], '01:58:32:00'), ('partial repair probe: hour wrap', ['23:00:00:29', '00:59:59:15', 30], '00:00:00:14'), ('partial repair variant: hour wrap', ['23:30:59:01', '01:00:01:12', 25], '00:31:00:13'), ('boundary control', ['00:00:00:12', '00:00:00:13', 25], '00:00:01:00'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('normal control', ['00:00:00:12', '23:00:01:01', 25], '23:00:01:13'), ('normal control', ['00:59:01:00', '12:00:01:23', 24], '12:59:02:23'), ('normal control', ['00:00:30:12', '23:30:01:24', 25], '23:30:32:11')], [('regression: hour wrap', ['12:00:00:12', '12:00:01:24', 25], '00:00:02:11'), ('regression variant: hour wrap', ['12:01:01:15', '12:01:00:00', 30], '00:02:01:15'), ('partial repair probe: hour wrap', ['23:01:30:24', '01:00:01:12', 25], '00:01:32:11'), ('partial repair variant: hour wrap', ['12:30:00:01', '12:00:59:15', 30], '00:30:59:16'), ('boundary control', ['00:00:59:24', '00:00:00:01', 25], '00:01:00:00'), ('boundary control', ['00:00:00:00', '00:00:00:00', 24], '00:00:00:00'), ('normal control', ['00:01:30:23', '00:59:30:12', 24], '01:01:01:11'), ('normal control', ['01:01:30:24', '01:59:00:01', 25], '03:00:31:00'), ('normal control', ['23:30:01:12', '00:01:59:12', 25], '23:32:00:24')]]
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: hour wrap | 00:00:00:00 | 00:00:00:00 | Passed |
| regression variant: hour wrap | 00:30:00:14 | 00:30:00:14 | Passed |
| partial repair probe: hour wrap | 00:01:58:01 | 00:01:58:01 | Passed |
| partial repair variant: hour wrap | 00:00:00:24 | 00:00:00:24 | Passed |
| boundary control | 00:00:01:00 | 00:00:01:00 | Passed |
| boundary control | 00:01:00:00 | 00:01:00:00 | Passed |
| normal control | 00:00:00:00 | 00:00:00:00 | Passed |
| normal control | 01:59:31:12 | 01:59:31:12 | Passed |
| normal control | 14:29:31:01 | 14:29:31:01 | Passed |
SHA-256 / 9d52f8dda2fdeaa907c2e2edee94d6cb525c419170252949ec33a65ff4abc8f7
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.902630+00:00.
Case digest / eab9f26d897d0b7b37770971d173df069a135182070d831e6f9d5c6cb0f79f7b