FA-78726 / Broadcast timecode arithmetic / Open access
Playout schedule on-air times: gap unit · case 01
Black between clips lasts seconds instead of frames.
ROOT CAUSE
The gap, given in frames, is multiplied by the frame rate as if it were seconds.
VERIFIED REPAIR
Add the gap as a frame count.
Unsuccessful approach: Scaling by fps/25 still treats the gap as a duration in seconds at other rates.
Case contract
Clips [SOM, EOM] use non-drop labels at fps with EOM inclusive; a clip may cross midnight on tape. Clips air back to back from start with gap black frames between consecutive clips. Return the on-air label of each clip followed by the exclusive end label of the schedule, wrapping at 24 hours.
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(start, clips, gap, fps):
def fr(t):
h,m,s,f=map(int,t.split(':'))
return ((h*60+m)*60+s)*fps+f
def lab(n):
n%=86400*fps
return '%02d:%02d:%02d:%02d'%(n//(3600*fps),n//(60*fps)%60,n//fps%60,n%fps)
t=fr(start)
out=[]
for i,(som,eom) in enumerate(clips):
if i:
t+=gap*fps
out.append(lab(t))
d=(fr(eom)-fr(som))%(86400*fps)
t+=d+1
out.append(lab(t))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: gap unit', ['23:59:59:00', [['00:00:00:00', '00:00:01:00'], ['00:00:00:00', '00:00:00:00']], 5, 25], ['23:59:59:00', '00:00:00:06', '00:00:00:07']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '00:00:01:00'], ['10:00:00:00', '00:00:00:10']], 1, 30], ['00:00:00:00', '14:00:01:02', '04:00:01:13']), ('partial repair probe: gap unit', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['01:00:00:00', '00:00:00:10']], 5, 30], ['00:00:00:00', '00:00:10:06', '23:00:10:17']), ('partial repair variant: gap unit', ['00:00:00:00', [['01:00:00:00', '00:00:00:10'], ['23:59:59:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:00']], 5, 30], ['00:00:00:00', '23:00:00:16', '09:00:31:16', '09:00:31:17']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [], 25, 25], ['00:00:00:00']), ('normal control', ['23:59:50:00', [], 1, 30], ['23:59:50:00']), ('normal control', ['18:00:00:00', [['23:59:59:00', '01:00:30:00']], 5, 30], ['18:00:00:00', '19:00:31:01'])], [('regression: gap unit', ['23:59:50:00', [['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '10:00:29:24'], ['00:00:00:00', '01:00:30:00']], 25, 30], ['23:59:50:00', '13:59:51:06', '00:00:21:26', '01:00:51:27']), ('regression variant: gap unit', ['00:00:00:00', [['01:00:00:00', '10:00:29:24'], ['01:00:00:00', '00:00:01:00'], ['23:59:59:00', '01:00:30:00']], 1, 30], ['00:00:00:00', '09:00:29:26', '08:00:30:28', '09:01:01:29']), ('partial repair probe: gap unit', ['23:59:50:00', [['23:59:59:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['23:59:59:00', '00:00:00:00']], 25, 30], ['23:59:50:00', '23:59:52:06', '15:00:23:02', '15:00:24:03']), ('partial repair variant: gap unit', ['23:59:50:00', [['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '00:00:01:00'], ['00:00:00:00', '00:00:00:00']], 5, 30], ['23:59:50:00', '13:59:50:16', '13:59:51:22', '13:59:51:23']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['23:59:50:00', [], 0, 25], ['23:59:50:00']), ('normal control', ['23:59:50:00', [], 25, 30], ['23:59:50:00']), ('normal control', ['00:00:00:00', [['00:00:00:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['10:00:00:00', '00:00:01:00'], ['00:00:00:00', '10:00:29:24']], 0, 25], ['00:00:00:00', '00:00:00:11', '15:00:30:12', '05:00:31:13', '15:01:01:13'])], [('regression: gap unit', ['18:00:00:00', [['01:00:00:00', '00:00:01:00'], ['01:00:00:00', '10:00:10:00'], ['23:59:59:00', '00:00:00:10'], ['00:00:00:00', '00:00:00:10']], 25, 25], ['18:00:00:00', '17:00:02:01', '02:00:13:02', '02:00:15:13', '02:00:15:24']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '00:00:00:10'], ['23:59:59:00', '00:00:00:00'], ['00:00:00:00', '10:00:10:00']], 25, 25], ['00:00:00:00', '14:00:01:11', '14:00:03:12', '00:00:13:13']), ('partial repair probe: gap unit', ['00:00:00:00', [['01:00:00:00', '00:00:00:10'], ['10:00:00:00', '10:00:29:24']], 25, 30], ['00:00:00:00', '23:00:01:06', '23:00:31:01']), ('partial repair variant: gap unit', ['18:00:00:00', [['23:59:59:00', '00:00:00:10'], ['23:59:59:00', '01:00:30:00'], ['23:59:59:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:00']], 25, 30], ['18:00:00:00', '18:00:02:06', '19:00:34:02', '05:01:05:22', '05:01:05:23']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [['00:00:00:00', '00:00:00:00'], ['01:00:00:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00']], 0, 30], ['00:00:00:00', '00:00:00:01', '09:00:29:26', '09:00:30:07', '00:01:00:08']), ('normal control', ['23:59:50:00', [['10:00:00:00', '00:00:00:10']], 5, 25], ['23:59:50:00', '13:59:50:11']), ('normal control', ['18:00:00:00', [], 25, 30], ['18:00:00:00'])], [('regression: gap unit', ['23:59:50:00', [['10:00:00:00', '01:00:30:00'], ['00:00:00:00', '01:00:30:00']], 25, 30], ['23:59:50:00', '15:00:20:26', '16:00:50:27']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['01:00:00:00', '00:00:00:10']], 5, 30], ['00:00:00:00', '00:00:10:06', '23:00:10:17']), ('partial repair probe: gap unit', ['00:00:00:00', [['23:59:59:00', '00:00:00:10'], ['01:00:00:00', '10:00:29:24'], ['23:59:59:00', '00:00:01:00'], ['01:00:00:00', '10:00:10:00']], 5, 30], ['00:00:00:00', '00:00:01:16', '09:00:31:16', '09:00:33:22', '18:00:43:23']), ('partial repair variant: gap unit', ['18:00:00:00', [['00:00:00:00', '00:00:00:00'], ['00:00:00:00', '00:00:00:10']], 5, 30], ['18:00:00:00', '18:00:00:06', '18:00:00:17']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['23:59:50:00', [], 1, 25], ['23:59:50:00']), ('normal control', ['00:00:00:00', [], 25, 30], ['00:00:00:00']), ('normal control', ['00:00:00:00', [['01:00:00:00', '00:00:01:00'], ['01:00:00:00', '00:00:00:10'], ['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '00:00:00:00']], 0, 25], ['00:00:00:00', '23:00:01:01', '22:00:01:12', '12:00:01:23', '12:00:01:24'])], [('regression: gap unit', ['18:00:00:00', [['23:59:59:00', '00:00:00:10'], ['23:59:59:00', '00:00:01:00']], 5, 25], ['18:00:00:00', '18:00:01:16', '18:00:03:17']), ('regression variant: gap unit', ['23:59:50:00', [['23:59:59:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['23:59:59:00', '00:00:00:00']], 25, 30], ['23:59:50:00', '23:59:52:06', '15:00:23:02', '15:00:24:03']), ('partial repair probe: gap unit', ['00:00:00:00', [['00:00:00:00', '10:00:29:24'], ['00:00:00:00', '01:00:30:00']], 5, 30], ['00:00:00:00', '10:00:30:00', '11:01:00:01']), ('partial repair variant: gap unit', ['00:00:00:00', [['00:00:00:00', '10:00:29:24'], ['23:59:59:00', '00:00:01:00'], ['10:00:00:00', '10:00:29:24']], 5, 30], ['00:00:00:00', '10:00:30:00', '10:00:32:06', '10:01:02:01']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['10:00:00:00', '00:00:01:00'], ['23:59:59:00', '10:00:29:24'], ['23:59:59:00', '10:00:29:24']], 0, 25], ['00:00:00:00', '00:00:10:01', '14:00:11:02', '00:00:42:02', '10:01:13:02']), ('normal control', ['18:00:00:00', [], 1, 25], ['18:00:00:00']), ('normal control', ['18:00:00:00', [['00:00:00:00', '00:00:00:00'], ['23:59:59:00', '10:00:10:00'], ['00:00:00:00', '10:00:29:24']], 0, 25], ['18:00:00:00', '18:00:00:01', '04:00:11:02', '14:00:41:02'])]]
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: gap unit | ['23:59:59:00', '00:00:05:01', '00:00:05:02'] | ['23:59:59:00', '00:00:00:06', '00:00:00:07'] | Failed |
| regression variant: gap unit | ['00:00:00:00', '14:00:02:01', '04:00:02:12'] | ['00:00:00:00', '14:00:01:02', '04:00:01:13'] | Failed |
| partial repair probe: gap unit | ['00:00:00:00', '00:00:15:01', '23:00:15:12'] | ['00:00:00:00', '00:00:10:06', '23:00:10:17'] | Failed |
| partial repair variant: gap unit | ['00:00:00:00', '23:00:05:11', '09:00:41:06', '09:00:41:07'] | ['00:00:00:00', '23:00:00:16', '09:00:31:16', '09:00:31:17'] | Failed |
| boundary control | ['18:00:00:00', '18:00:01:00'] | ['18:00:00:00', '18:00:01:00'] | Passed |
| normal control | ['00:00:00:00'] | ['00:00:00:00'] | Passed |
| normal control | ['23:59:50:00'] | ['23:59:50:00'] | Passed |
| normal control | ['18:00:00:00', '19:00:31:01'] | ['18:00:00:00', '19:00:31:01'] | Passed |
SHA-256 / dd8da6c075e47df913f95acb4fb10df5b484b289364b178af478de7cf969260d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(start, clips, gap, fps):
def fr(t):
h,m,s,f=map(int,t.split(':'))
return ((h*60+m)*60+s)*fps+f
def lab(n):
n%=86400*fps
return '%02d:%02d:%02d:%02d'%(n//(3600*fps),n//(60*fps)%60,n//fps%60,n%fps)
t=fr(start)
out=[]
for i,(som,eom) in enumerate(clips):
if i:
t+=gap*fps//25
out.append(lab(t))
d=(fr(eom)-fr(som))%(86400*fps)
t+=d+1
out.append(lab(t))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: gap unit', ['23:59:59:00', [['00:00:00:00', '00:00:01:00'], ['00:00:00:00', '00:00:00:00']], 5, 25], ['23:59:59:00', '00:00:00:06', '00:00:00:07']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '00:00:01:00'], ['10:00:00:00', '00:00:00:10']], 1, 30], ['00:00:00:00', '14:00:01:02', '04:00:01:13']), ('partial repair probe: gap unit', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['01:00:00:00', '00:00:00:10']], 5, 30], ['00:00:00:00', '00:00:10:06', '23:00:10:17']), ('partial repair variant: gap unit', ['00:00:00:00', [['01:00:00:00', '00:00:00:10'], ['23:59:59:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:00']], 5, 30], ['00:00:00:00', '23:00:00:16', '09:00:31:16', '09:00:31:17']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [], 25, 25], ['00:00:00:00']), ('normal control', ['23:59:50:00', [], 1, 30], ['23:59:50:00']), ('normal control', ['18:00:00:00', [['23:59:59:00', '01:00:30:00']], 5, 30], ['18:00:00:00', '19:00:31:01'])], [('regression: gap unit', ['23:59:50:00', [['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '10:00:29:24'], ['00:00:00:00', '01:00:30:00']], 25, 30], ['23:59:50:00', '13:59:51:06', '00:00:21:26', '01:00:51:27']), ('regression variant: gap unit', ['00:00:00:00', [['01:00:00:00', '10:00:29:24'], ['01:00:00:00', '00:00:01:00'], ['23:59:59:00', '01:00:30:00']], 1, 30], ['00:00:00:00', '09:00:29:26', '08:00:30:28', '09:01:01:29']), ('partial repair probe: gap unit', ['23:59:50:00', [['23:59:59:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['23:59:59:00', '00:00:00:00']], 25, 30], ['23:59:50:00', '23:59:52:06', '15:00:23:02', '15:00:24:03']), ('partial repair variant: gap unit', ['23:59:50:00', [['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '00:00:01:00'], ['00:00:00:00', '00:00:00:00']], 5, 30], ['23:59:50:00', '13:59:50:16', '13:59:51:22', '13:59:51:23']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['23:59:50:00', [], 0, 25], ['23:59:50:00']), ('normal control', ['23:59:50:00', [], 25, 30], ['23:59:50:00']), ('normal control', ['00:00:00:00', [['00:00:00:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['10:00:00:00', '00:00:01:00'], ['00:00:00:00', '10:00:29:24']], 0, 25], ['00:00:00:00', '00:00:00:11', '15:00:30:12', '05:00:31:13', '15:01:01:13'])], [('regression: gap unit', ['18:00:00:00', [['01:00:00:00', '00:00:01:00'], ['01:00:00:00', '10:00:10:00'], ['23:59:59:00', '00:00:00:10'], ['00:00:00:00', '00:00:00:10']], 25, 25], ['18:00:00:00', '17:00:02:01', '02:00:13:02', '02:00:15:13', '02:00:15:24']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '00:00:00:10'], ['23:59:59:00', '00:00:00:00'], ['00:00:00:00', '10:00:10:00']], 25, 25], ['00:00:00:00', '14:00:01:11', '14:00:03:12', '00:00:13:13']), ('partial repair probe: gap unit', ['00:00:00:00', [['01:00:00:00', '00:00:00:10'], ['10:00:00:00', '10:00:29:24']], 25, 30], ['00:00:00:00', '23:00:01:06', '23:00:31:01']), ('partial repair variant: gap unit', ['18:00:00:00', [['23:59:59:00', '00:00:00:10'], ['23:59:59:00', '01:00:30:00'], ['23:59:59:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:00']], 25, 30], ['18:00:00:00', '18:00:02:06', '19:00:34:02', '05:01:05:22', '05:01:05:23']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [['00:00:00:00', '00:00:00:00'], ['01:00:00:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00']], 0, 30], ['00:00:00:00', '00:00:00:01', '09:00:29:26', '09:00:30:07', '00:01:00:08']), ('normal control', ['23:59:50:00', [['10:00:00:00', '00:00:00:10']], 5, 25], ['23:59:50:00', '13:59:50:11']), ('normal control', ['18:00:00:00', [], 25, 30], ['18:00:00:00'])], [('regression: gap unit', ['23:59:50:00', [['10:00:00:00', '01:00:30:00'], ['00:00:00:00', '01:00:30:00']], 25, 30], ['23:59:50:00', '15:00:20:26', '16:00:50:27']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['01:00:00:00', '00:00:00:10']], 5, 30], ['00:00:00:00', '00:00:10:06', '23:00:10:17']), ('partial repair probe: gap unit', ['00:00:00:00', [['23:59:59:00', '00:00:00:10'], ['01:00:00:00', '10:00:29:24'], ['23:59:59:00', '00:00:01:00'], ['01:00:00:00', '10:00:10:00']], 5, 30], ['00:00:00:00', '00:00:01:16', '09:00:31:16', '09:00:33:22', '18:00:43:23']), ('partial repair variant: gap unit', ['18:00:00:00', [['00:00:00:00', '00:00:00:00'], ['00:00:00:00', '00:00:00:10']], 5, 30], ['18:00:00:00', '18:00:00:06', '18:00:00:17']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['23:59:50:00', [], 1, 25], ['23:59:50:00']), ('normal control', ['00:00:00:00', [], 25, 30], ['00:00:00:00']), ('normal control', ['00:00:00:00', [['01:00:00:00', '00:00:01:00'], ['01:00:00:00', '00:00:00:10'], ['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '00:00:00:00']], 0, 25], ['00:00:00:00', '23:00:01:01', '22:00:01:12', '12:00:01:23', '12:00:01:24'])], [('regression: gap unit', ['18:00:00:00', [['23:59:59:00', '00:00:00:10'], ['23:59:59:00', '00:00:01:00']], 5, 25], ['18:00:00:00', '18:00:01:16', '18:00:03:17']), ('regression variant: gap unit', ['23:59:50:00', [['23:59:59:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['23:59:59:00', '00:00:00:00']], 25, 30], ['23:59:50:00', '23:59:52:06', '15:00:23:02', '15:00:24:03']), ('partial repair probe: gap unit', ['00:00:00:00', [['00:00:00:00', '10:00:29:24'], ['00:00:00:00', '01:00:30:00']], 5, 30], ['00:00:00:00', '10:00:30:00', '11:01:00:01']), ('partial repair variant: gap unit', ['00:00:00:00', [['00:00:00:00', '10:00:29:24'], ['23:59:59:00', '00:00:01:00'], ['10:00:00:00', '10:00:29:24']], 5, 30], ['00:00:00:00', '10:00:30:00', '10:00:32:06', '10:01:02:01']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['10:00:00:00', '00:00:01:00'], ['23:59:59:00', '10:00:29:24'], ['23:59:59:00', '10:00:29:24']], 0, 25], ['00:00:00:00', '00:00:10:01', '14:00:11:02', '00:00:42:02', '10:01:13:02']), ('normal control', ['18:00:00:00', [], 1, 25], ['18:00:00:00']), ('normal control', ['18:00:00:00', [['00:00:00:00', '00:00:00:00'], ['23:59:59:00', '10:00:10:00'], ['00:00:00:00', '10:00:29:24']], 0, 25], ['18:00:00:00', '18:00:00:01', '04:00:11:02', '14:00:41:02'])]]
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: gap unit | ['23:59:59:00', '00:00:00:06', '00:00:00:07'] | ['23:59:59:00', '00:00:00:06', '00:00:00:07'] | Passed |
| regression variant: gap unit | ['00:00:00:00', '14:00:01:02', '04:00:01:13'] | ['00:00:00:00', '14:00:01:02', '04:00:01:13'] | Passed |
| partial repair probe: gap unit | ['00:00:00:00', '00:00:10:07', '23:00:10:18'] | ['00:00:00:00', '00:00:10:06', '23:00:10:17'] | Failed |
| partial repair variant: gap unit | ['00:00:00:00', '23:00:00:17', '09:00:31:18', '09:00:31:19'] | ['00:00:00:00', '23:00:00:16', '09:00:31:16', '09:00:31:17'] | Failed |
| boundary control | ['18:00:00:00', '18:00:01:00'] | ['18:00:00:00', '18:00:01:00'] | Passed |
| normal control | ['00:00:00:00'] | ['00:00:00:00'] | Passed |
| normal control | ['23:59:50:00'] | ['23:59:50:00'] | Passed |
| normal control | ['18:00:00:00', '19:00:31:01'] | ['18:00:00:00', '19:00:31:01'] | Passed |
SHA-256 / 5f2d52750ac3b90fad3f51ffe3964efc8faf9ef9def624ad5d1fcb0fb973fc09
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(start, clips, gap, fps):
def fr(t):
h,m,s,f=map(int,t.split(':'))
return ((h*60+m)*60+s)*fps+f
def lab(n):
n%=86400*fps
return '%02d:%02d:%02d:%02d'%(n//(3600*fps),n//(60*fps)%60,n//fps%60,n%fps)
t=fr(start)
out=[]
for i,(som,eom) in enumerate(clips):
if i:
t+=gap
out.append(lab(t))
d=(fr(eom)-fr(som))%(86400*fps)
t+=d+1
out.append(lab(t))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: gap unit', ['23:59:59:00', [['00:00:00:00', '00:00:01:00'], ['00:00:00:00', '00:00:00:00']], 5, 25], ['23:59:59:00', '00:00:00:06', '00:00:00:07']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '00:00:01:00'], ['10:00:00:00', '00:00:00:10']], 1, 30], ['00:00:00:00', '14:00:01:02', '04:00:01:13']), ('partial repair probe: gap unit', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['01:00:00:00', '00:00:00:10']], 5, 30], ['00:00:00:00', '00:00:10:06', '23:00:10:17']), ('partial repair variant: gap unit', ['00:00:00:00', [['01:00:00:00', '00:00:00:10'], ['23:59:59:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:00']], 5, 30], ['00:00:00:00', '23:00:00:16', '09:00:31:16', '09:00:31:17']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [], 25, 25], ['00:00:00:00']), ('normal control', ['23:59:50:00', [], 1, 30], ['23:59:50:00']), ('normal control', ['18:00:00:00', [['23:59:59:00', '01:00:30:00']], 5, 30], ['18:00:00:00', '19:00:31:01'])], [('regression: gap unit', ['23:59:50:00', [['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '10:00:29:24'], ['00:00:00:00', '01:00:30:00']], 25, 30], ['23:59:50:00', '13:59:51:06', '00:00:21:26', '01:00:51:27']), ('regression variant: gap unit', ['00:00:00:00', [['01:00:00:00', '10:00:29:24'], ['01:00:00:00', '00:00:01:00'], ['23:59:59:00', '01:00:30:00']], 1, 30], ['00:00:00:00', '09:00:29:26', '08:00:30:28', '09:01:01:29']), ('partial repair probe: gap unit', ['23:59:50:00', [['23:59:59:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['23:59:59:00', '00:00:00:00']], 25, 30], ['23:59:50:00', '23:59:52:06', '15:00:23:02', '15:00:24:03']), ('partial repair variant: gap unit', ['23:59:50:00', [['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '00:00:01:00'], ['00:00:00:00', '00:00:00:00']], 5, 30], ['23:59:50:00', '13:59:50:16', '13:59:51:22', '13:59:51:23']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['23:59:50:00', [], 0, 25], ['23:59:50:00']), ('normal control', ['23:59:50:00', [], 25, 30], ['23:59:50:00']), ('normal control', ['00:00:00:00', [['00:00:00:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['10:00:00:00', '00:00:01:00'], ['00:00:00:00', '10:00:29:24']], 0, 25], ['00:00:00:00', '00:00:00:11', '15:00:30:12', '05:00:31:13', '15:01:01:13'])], [('regression: gap unit', ['18:00:00:00', [['01:00:00:00', '00:00:01:00'], ['01:00:00:00', '10:00:10:00'], ['23:59:59:00', '00:00:00:10'], ['00:00:00:00', '00:00:00:10']], 25, 25], ['18:00:00:00', '17:00:02:01', '02:00:13:02', '02:00:15:13', '02:00:15:24']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '00:00:00:10'], ['23:59:59:00', '00:00:00:00'], ['00:00:00:00', '10:00:10:00']], 25, 25], ['00:00:00:00', '14:00:01:11', '14:00:03:12', '00:00:13:13']), ('partial repair probe: gap unit', ['00:00:00:00', [['01:00:00:00', '00:00:00:10'], ['10:00:00:00', '10:00:29:24']], 25, 30], ['00:00:00:00', '23:00:01:06', '23:00:31:01']), ('partial repair variant: gap unit', ['18:00:00:00', [['23:59:59:00', '00:00:00:10'], ['23:59:59:00', '01:00:30:00'], ['23:59:59:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:00']], 25, 30], ['18:00:00:00', '18:00:02:06', '19:00:34:02', '05:01:05:22', '05:01:05:23']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [['00:00:00:00', '00:00:00:00'], ['01:00:00:00', '10:00:29:24'], ['00:00:00:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00']], 0, 30], ['00:00:00:00', '00:00:00:01', '09:00:29:26', '09:00:30:07', '00:01:00:08']), ('normal control', ['23:59:50:00', [['10:00:00:00', '00:00:00:10']], 5, 25], ['23:59:50:00', '13:59:50:11']), ('normal control', ['18:00:00:00', [], 25, 30], ['18:00:00:00'])], [('regression: gap unit', ['23:59:50:00', [['10:00:00:00', '01:00:30:00'], ['00:00:00:00', '01:00:30:00']], 25, 30], ['23:59:50:00', '15:00:20:26', '16:00:50:27']), ('regression variant: gap unit', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['01:00:00:00', '00:00:00:10']], 5, 30], ['00:00:00:00', '00:00:10:06', '23:00:10:17']), ('partial repair probe: gap unit', ['00:00:00:00', [['23:59:59:00', '00:00:00:10'], ['01:00:00:00', '10:00:29:24'], ['23:59:59:00', '00:00:01:00'], ['01:00:00:00', '10:00:10:00']], 5, 30], ['00:00:00:00', '00:00:01:16', '09:00:31:16', '09:00:33:22', '18:00:43:23']), ('partial repair variant: gap unit', ['18:00:00:00', [['00:00:00:00', '00:00:00:00'], ['00:00:00:00', '00:00:00:10']], 5, 30], ['18:00:00:00', '18:00:00:06', '18:00:00:17']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['23:59:50:00', [], 1, 25], ['23:59:50:00']), ('normal control', ['00:00:00:00', [], 25, 30], ['00:00:00:00']), ('normal control', ['00:00:00:00', [['01:00:00:00', '00:00:01:00'], ['01:00:00:00', '00:00:00:10'], ['10:00:00:00', '00:00:00:10'], ['00:00:00:00', '00:00:00:00']], 0, 25], ['00:00:00:00', '23:00:01:01', '22:00:01:12', '12:00:01:23', '12:00:01:24'])], [('regression: gap unit', ['18:00:00:00', [['23:59:59:00', '00:00:00:10'], ['23:59:59:00', '00:00:01:00']], 5, 25], ['18:00:00:00', '18:00:01:16', '18:00:03:17']), ('regression variant: gap unit', ['23:59:50:00', [['23:59:59:00', '00:00:00:10'], ['10:00:00:00', '01:00:30:00'], ['23:59:59:00', '00:00:00:00']], 25, 30], ['23:59:50:00', '23:59:52:06', '15:00:23:02', '15:00:24:03']), ('partial repair probe: gap unit', ['00:00:00:00', [['00:00:00:00', '10:00:29:24'], ['00:00:00:00', '01:00:30:00']], 5, 30], ['00:00:00:00', '10:00:30:00', '11:01:00:01']), ('partial repair variant: gap unit', ['00:00:00:00', [['00:00:00:00', '10:00:29:24'], ['23:59:59:00', '00:00:01:00'], ['10:00:00:00', '10:00:29:24']], 5, 30], ['00:00:00:00', '10:00:30:00', '10:00:32:06', '10:01:02:01']), ('boundary control', ['18:00:00:00', [['10:00:00:00', '10:00:00:24']], 0, 25], ['18:00:00:00', '18:00:01:00']), ('normal control', ['00:00:00:00', [['10:00:00:00', '10:00:10:00'], ['10:00:00:00', '00:00:01:00'], ['23:59:59:00', '10:00:29:24'], ['23:59:59:00', '10:00:29:24']], 0, 25], ['00:00:00:00', '00:00:10:01', '14:00:11:02', '00:00:42:02', '10:01:13:02']), ('normal control', ['18:00:00:00', [], 1, 25], ['18:00:00:00']), ('normal control', ['18:00:00:00', [['00:00:00:00', '00:00:00:00'], ['23:59:59:00', '10:00:10:00'], ['00:00:00:00', '10:00:29:24']], 0, 25], ['18:00:00:00', '18:00:00:01', '04:00:11:02', '14:00:41:02'])]]
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: gap unit | ['23:59:59:00', '00:00:00:06', '00:00:00:07'] | ['23:59:59:00', '00:00:00:06', '00:00:00:07'] | Passed |
| regression variant: gap unit | ['00:00:00:00', '14:00:01:02', '04:00:01:13'] | ['00:00:00:00', '14:00:01:02', '04:00:01:13'] | Passed |
| partial repair probe: gap unit | ['00:00:00:00', '00:00:10:06', '23:00:10:17'] | ['00:00:00:00', '00:00:10:06', '23:00:10:17'] | Passed |
| partial repair variant: gap unit | ['00:00:00:00', '23:00:00:16', '09:00:31:16', '09:00:31:17'] | ['00:00:00:00', '23:00:00:16', '09:00:31:16', '09:00:31:17'] | Passed |
| boundary control | ['18:00:00:00', '18:00:01:00'] | ['18:00:00:00', '18:00:01:00'] | Passed |
| normal control | ['00:00:00:00'] | ['00:00:00:00'] | Passed |
| normal control | ['23:59:50:00'] | ['23:59:50:00'] | Passed |
| normal control | ['18:00:00:00', '19:00:31:01'] | ['18:00:00:00', '19:00:31:01'] | Passed |
SHA-256 / d9ec94f3ad9a5a85c671450e8b5cfa8da7ffb755067b041146bbc7735392a6b4
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.972082+00:00.
Case digest / 1bdc51aef928b7c255545e0775f1d36bfc6965befec18ccb3bc6daca8eefedb3