FA-78661 / Broadcast timecode arithmetic / Open access
Programme-relative signed timecode: minute field · case 01
Offsets beyond an hour show minute fields above 59.
ROOT CAUSE
Total minutes are printed without reducing modulo 60.
VERIFIED REPAIR
Reduce the minute field modulo 60.
Unsuccessful approach: Dividing the in-hour remainder by 60 forgets to divide by fps.
Case contract
Express label tc relative to programme start as "+HH:MM:SS:FF" or "-HH:MM:SS:FF" along the shorter way round the 24-hour clock (an offset of exactly 12 hours is negative). Zero is "+".
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(tc, start, fps):
def fr(t):
h,m,s,f=map(int,t.split(':'))
return ((h*60+m)*60+s)*fps+f
day=86400*fps
d=(fr(tc)-fr(start))%day
if d>=day//2:
d-=day
sign='-' if d<0 else '+'
a=abs(d)
return '%s%02d:%02d:%02d:%02d'%(sign,a//(3600*fps),a//(60*fps),a//fps%60,a%fps)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minute field', ['01:59:59:29', '23:59:00:00', 30], '+02:00:59:29'), ('regression variant: minute field', ['01:00:00:01', '10:00:00:00', 25], '-08:59:59:24'), ('partial repair probe: minute field', ['23:59:50:00', '00:00:10:00', 25], '-00:00:20:00'), ('partial repair variant: minute field', ['23:00:59:15', '00:00:10:00', 30], '-00:59:10:15'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 30], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 25], '+00:00:00:00')], [('regression: minute field', ['22:00:00:00', '10:00:00:00', 30], '-12:00:00:00'), ('regression variant: minute field', ['12:59:59:24', '01:00:00:00', 30], '+11:59:59:24'), ('partial repair probe: minute field', ['01:59:59:29', '23:59:00:00', 30], '+02:00:59:29'), ('partial repair variant: minute field', ['00:59:30:00', '00:00:10:00', 30], '+00:59:20:00'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29'), ('normal control', ['01:00:00:01', '01:00:00:00', 30], '+00:00:00:01'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00')], [('regression: minute field', ['11:59:59:00', '01:00:00:00', 25], '+10:59:59:00'), ('regression variant: minute field', ['10:59:59:15', '01:00:00:00', 30], '+09:59:59:15'), ('partial repair probe: minute field', ['00:59:30:00', '00:00:10:00', 25], '+00:59:20:00'), ('partial repair variant: minute field', ['00:00:00:00', '00:00:10:00', 25], '-00:00:10:00'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['10:00:00:00', '10:00:00:00', 25], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 25], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29')], [('regression: minute field', ['12:59:59:24', '23:59:00:00', 25], '-10:59:00:01'), ('regression variant: minute field', ['01:01:01:00', '23:59:00:00', 25], '+01:02:01:00'), ('partial repair probe: minute field', ['11:59:59:00', '01:00:00:00', 25], '+10:59:59:00'), ('partial repair variant: minute field', ['00:01:59:15', '01:00:00:00', 30], '-00:58:00:15'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:01', '01:00:00:00', 25], '+00:00:00:01'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00'), ('normal control', ['10:00:00:00', '10:00:00:00', 25], '+00:00:00:00')], [('regression: minute field', ['01:00:01:01', '10:00:00:00', 30], '-08:59:58:29'), ('regression variant: minute field', ['00:00:00:00', '01:00:00:00', 30], '-01:00:00:00'), ('partial repair probe: minute field', ['01:01:01:01', '01:00:00:00', 25], '+00:01:01:01'), ('partial repair variant: minute field', ['01:00:00:01', '10:00:00:00', 25], '-08:59:59:24'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['23:59:00:00', '23:59:00:00', 25], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29'), ('normal control', ['01:00:00:01', '01:00:00:00', 25], '+00:00:00:01')]]
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: minute field | +02:120:59:29 | +02:00:59:29 | Failed |
| regression variant: minute field | -08:539:59:24 | -08:59:59:24 | Failed |
| partial repair probe: minute field | -00:00:20:00 | -00:00:20:00 | Passed |
| partial repair variant: minute field | -00:59:10:15 | -00:59:10:15 | Passed |
| boundary control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
SHA-256 / 66f376b2ec0598f5d0b8ac498d6c5545eeb0928898da6be892b9c564575a5ba4
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(tc, start, fps):
def fr(t):
h,m,s,f=map(int,t.split(':'))
return ((h*60+m)*60+s)*fps+f
day=86400*fps
d=(fr(tc)-fr(start))%day
if d>=day//2:
d-=day
sign='-' if d<0 else '+'
a=abs(d)
return '%s%02d:%02d:%02d:%02d'%(sign,a//(3600*fps),a%(3600*fps)//60,a//fps%60,a%fps)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minute field', ['01:59:59:29', '23:59:00:00', 30], '+02:00:59:29'), ('regression variant: minute field', ['01:00:00:01', '10:00:00:00', 25], '-08:59:59:24'), ('partial repair probe: minute field', ['23:59:50:00', '00:00:10:00', 25], '-00:00:20:00'), ('partial repair variant: minute field', ['23:00:59:15', '00:00:10:00', 30], '-00:59:10:15'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 30], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 25], '+00:00:00:00')], [('regression: minute field', ['22:00:00:00', '10:00:00:00', 30], '-12:00:00:00'), ('regression variant: minute field', ['12:59:59:24', '01:00:00:00', 30], '+11:59:59:24'), ('partial repair probe: minute field', ['01:59:59:29', '23:59:00:00', 30], '+02:00:59:29'), ('partial repair variant: minute field', ['00:59:30:00', '00:00:10:00', 30], '+00:59:20:00'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29'), ('normal control', ['01:00:00:01', '01:00:00:00', 30], '+00:00:00:01'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00')], [('regression: minute field', ['11:59:59:00', '01:00:00:00', 25], '+10:59:59:00'), ('regression variant: minute field', ['10:59:59:15', '01:00:00:00', 30], '+09:59:59:15'), ('partial repair probe: minute field', ['00:59:30:00', '00:00:10:00', 25], '+00:59:20:00'), ('partial repair variant: minute field', ['00:00:00:00', '00:00:10:00', 25], '-00:00:10:00'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['10:00:00:00', '10:00:00:00', 25], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 25], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29')], [('regression: minute field', ['12:59:59:24', '23:59:00:00', 25], '-10:59:00:01'), ('regression variant: minute field', ['01:01:01:00', '23:59:00:00', 25], '+01:02:01:00'), ('partial repair probe: minute field', ['11:59:59:00', '01:00:00:00', 25], '+10:59:59:00'), ('partial repair variant: minute field', ['00:01:59:15', '01:00:00:00', 30], '-00:58:00:15'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:01', '01:00:00:00', 25], '+00:00:00:01'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00'), ('normal control', ['10:00:00:00', '10:00:00:00', 25], '+00:00:00:00')], [('regression: minute field', ['01:00:01:01', '10:00:00:00', 30], '-08:59:58:29'), ('regression variant: minute field', ['00:00:00:00', '01:00:00:00', 30], '-01:00:00:00'), ('partial repair probe: minute field', ['01:01:01:01', '01:00:00:00', 25], '+00:01:01:01'), ('partial repair variant: minute field', ['01:00:00:01', '10:00:00:00', 25], '-08:59:59:24'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['23:59:00:00', '23:59:00:00', 25], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29'), ('normal control', ['01:00:00:01', '01:00:00:00', 25], '+00:00:00:01')]]
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: minute field | +02:29:59:29 | +02:00:59:29 | Failed |
| regression variant: minute field | -08:1499:59:24 | -08:59:59:24 | Failed |
| partial repair probe: minute field | -00:08:20:00 | -00:00:20:00 | Failed |
| partial repair variant: minute field | -00:1775:10:15 | -00:59:10:15 | Failed |
| boundary control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
SHA-256 / 7ccee4be5ea845b6ff3ec4b3666b6cb4f8a78c60c700552eb95466e643294796
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(tc, start, fps):
def fr(t):
h,m,s,f=map(int,t.split(':'))
return ((h*60+m)*60+s)*fps+f
day=86400*fps
d=(fr(tc)-fr(start))%day
if d>=day//2:
d-=day
sign='-' if d<0 else '+'
a=abs(d)
return '%s%02d:%02d:%02d:%02d'%(sign,a//(3600*fps),a//(60*fps)%60,a//fps%60,a%fps)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minute field', ['01:59:59:29', '23:59:00:00', 30], '+02:00:59:29'), ('regression variant: minute field', ['01:00:00:01', '10:00:00:00', 25], '-08:59:59:24'), ('partial repair probe: minute field', ['23:59:50:00', '00:00:10:00', 25], '-00:00:20:00'), ('partial repair variant: minute field', ['23:00:59:15', '00:00:10:00', 30], '-00:59:10:15'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 30], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 25], '+00:00:00:00')], [('regression: minute field', ['22:00:00:00', '10:00:00:00', 30], '-12:00:00:00'), ('regression variant: minute field', ['12:59:59:24', '01:00:00:00', 30], '+11:59:59:24'), ('partial repair probe: minute field', ['01:59:59:29', '23:59:00:00', 30], '+02:00:59:29'), ('partial repair variant: minute field', ['00:59:30:00', '00:00:10:00', 30], '+00:59:20:00'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29'), ('normal control', ['01:00:00:01', '01:00:00:00', 30], '+00:00:00:01'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00')], [('regression: minute field', ['11:59:59:00', '01:00:00:00', 25], '+10:59:59:00'), ('regression variant: minute field', ['10:59:59:15', '01:00:00:00', 30], '+09:59:59:15'), ('partial repair probe: minute field', ['00:59:30:00', '00:00:10:00', 25], '+00:59:20:00'), ('partial repair variant: minute field', ['00:00:00:00', '00:00:10:00', 25], '-00:00:10:00'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['10:00:00:00', '10:00:00:00', 25], '+00:00:00:00'), ('normal control', ['00:00:10:00', '00:00:10:00', 25], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29')], [('regression: minute field', ['12:59:59:24', '23:59:00:00', 25], '-10:59:00:01'), ('regression variant: minute field', ['01:01:01:00', '23:59:00:00', 25], '+01:02:01:00'), ('partial repair probe: minute field', ['11:59:59:00', '01:00:00:00', 25], '+10:59:59:00'), ('partial repair variant: minute field', ['00:01:59:15', '01:00:00:00', 30], '-00:58:00:15'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['01:00:00:01', '01:00:00:00', 25], '+00:00:00:01'), ('normal control', ['01:00:00:00', '01:00:00:00', 25], '+00:00:00:00'), ('normal control', ['10:00:00:00', '10:00:00:00', 25], '+00:00:00:00')], [('regression: minute field', ['01:00:01:01', '10:00:00:00', 30], '-08:59:58:29'), ('regression variant: minute field', ['00:00:00:00', '01:00:00:00', 30], '-01:00:00:00'), ('partial repair probe: minute field', ['01:01:01:01', '01:00:00:00', 25], '+00:01:01:01'), ('partial repair variant: minute field', ['01:00:00:01', '10:00:00:00', 25], '-08:59:59:24'), ('boundary control', ['01:00:00:00', '01:00:00:00', 30], '+00:00:00:00'), ('normal control', ['23:59:00:00', '23:59:00:00', 25], '+00:00:00:00'), ('normal control', ['01:00:00:29', '01:00:00:00', 30], '+00:00:00:29'), ('normal control', ['01:00:00:01', '01:00:00:00', 25], '+00:00:00:01')]]
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: minute field | +02:00:59:29 | +02:00:59:29 | Passed |
| regression variant: minute field | -08:59:59:24 | -08:59:59:24 | Passed |
| partial repair probe: minute field | -00:00:20:00 | -00:00:20:00 | Passed |
| partial repair variant: minute field | -00:59:10:15 | -00:59:10:15 | Passed |
| boundary control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
| normal control | +00:00:00:00 | +00:00:00:00 | Passed |
SHA-256 / b8dd8620948d5766da0069b7a282e20656f37ddae35dbe165a282c7300dcd440
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.333076+00:00.
Case digest / 3bdb2ca9b4976c3b42563b88aa7bbf8709b1db6758604d232fc0650659cca866