FA-78411 / Broadcast timecode arithmetic / Open access
Drop-frame 29.97 label to frame count: hour range · case 01
Labels at hour 24 or later produce counts beyond the broadcast day.
ROOT CAUSE
The hour field is not range checked.
VERIFIED REPAIR
Reject hours above 23.
Unsuccessful approach: Allowing hour 24 still produces a count one full day long.
Case contract
Parse HH:MM:SS;FF drop-frame 29.97 labels (the last separator may be ";", "," or "."). Labels ;00 and ;01 at second 00 of minutes not divisible by 10 do not exist and return None, as do out-of-range fields (hours 0-23, frames 0-29). Frame count = nominal 30 fps count minus 2 per elapsed minute except every tenth minute.
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
import re
N = 1
observations = []
def solve(tc):
m=re.fullmatch(r'(\d{2}):(\d{2}):(\d{2})[;,.](\d{2})',tc)
if not m:
return None
h,mi,s,f=map(int,m.groups())
if mi>59 or s>59:
return None
if f>29:
return None
if s==0 and f<2 and mi%10!=0:
return None
tm=h*60+mi
return (tm*60+s)*30+f-2*(tm-tm//10)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: hour range', ['24:01:01.01'], None), ('regression variant: hour range', ['24:01:00,03'], None), ('partial repair probe: hour range', ['24:10:00,02'], None), ('partial repair variant: hour range', ['24:20:00.01'], None), ('boundary control', ['00:01:00;02'], 1800), ('boundary control', ['01:00:00;00'], 107892), ('normal control', ['00:01:00;00'], None), ('normal control', ['00:00:59;29'], 1799), ('normal control', ['23:59:59;29'], 2589407)], [('regression: hour range', ['24:59:01.01'], None), ('regression variant: hour range', ['24:11:00;29'], None), ('partial repair probe: hour range', ['24:59:01;03'], None), ('partial repair variant: hour range', ['24:20:01;01'], None), ('boundary control', ['00:01:00;00'], None), ('boundary control', ['00:00:59;29'], 1799), ('normal control', ['24:00:00:31'], None), ('normal control', ['09:11:60.03'], None), ('normal control', ['00:01:59;01'], 3569)], [('regression: hour range', ['24:10:00,02'], None), ('regression variant: hour range', ['24:01:01;29'], None), ('partial repair probe: hour range', ['24:20:59;15'], None), ('partial repair variant: hour range', ['24:11:00,15'], None), ('boundary control', ['00:10:00;00'], 17982), ('boundary control', ['23:59:59;29'], 2589407), ('normal control', ['23:10:01.01'], 2499529), ('normal control', ['01:09:59;03'], 125847), ('normal control', ['00:59:00;31'], None)], [('regression: hour range', ['24:59:01;03'], None), ('regression variant: hour range', ['24:09:01;03'], None), ('partial repair probe: hour range', ['24:01:00,03'], None), ('partial repair variant: hour range', ['24:09:00;03'], None), ('boundary control', ['01:00:00;00'], 107892), ('boundary control', ['00:01:00;02'], 1800), ('normal control', ['01:60:00,02'], None), ('normal control', ['01:01:59;30'], None), ('normal control', ['00:20:60;03'], None)], [('regression: hour range', ['24:20:59;15'], None), ('regression variant: hour range', ['24:20:00.01'], None), ('partial repair probe: hour range', ['24:11:00;29'], None), ('partial repair variant: hour range', ['24:09:59;02'], None), ('boundary control', ['00:00:59;29'], 1799), ('boundary control', ['00:01:00;00'], None), ('normal control', ['01:20:60;00'], None), ('normal control', ['09:60:00:31'], None), ('normal control', ['01:11:01;30'], None)]]
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 range | 2591237 | None | Failed |
| regression variant: hour range | 2591209 | None | Failed |
| partial repair probe: hour range | 2607392 | None | Failed |
| partial repair variant: hour range | 2625373 | None | Failed |
| boundary control | 1800 | 1800 | Passed |
| boundary control | 107892 | 107892 | Passed |
| normal control | None | None | Passed |
| normal control | 1799 | 1799 | Passed |
| normal control | 2589407 | 2589407 | Passed |
SHA-256 / 8833502515d9b233e08dac1ebf64e0bea048132c0a1e5083cc4e6a13c0b8db73
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(tc):
m=re.fullmatch(r'(\d{2}):(\d{2}):(\d{2})[;,.](\d{2})',tc)
if not m:
return None
h,mi,s,f=map(int,m.groups())
if h>24 or mi>59 or s>59:
return None
if f>29:
return None
if s==0 and f<2 and mi%10!=0:
return None
tm=h*60+mi
return (tm*60+s)*30+f-2*(tm-tm//10)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: hour range', ['24:01:01.01'], None), ('regression variant: hour range', ['24:01:00,03'], None), ('partial repair probe: hour range', ['24:10:00,02'], None), ('partial repair variant: hour range', ['24:20:00.01'], None), ('boundary control', ['00:01:00;02'], 1800), ('boundary control', ['01:00:00;00'], 107892), ('normal control', ['00:01:00;00'], None), ('normal control', ['00:00:59;29'], 1799), ('normal control', ['23:59:59;29'], 2589407)], [('regression: hour range', ['24:59:01.01'], None), ('regression variant: hour range', ['24:11:00;29'], None), ('partial repair probe: hour range', ['24:59:01;03'], None), ('partial repair variant: hour range', ['24:20:01;01'], None), ('boundary control', ['00:01:00;00'], None), ('boundary control', ['00:00:59;29'], 1799), ('normal control', ['24:00:00:31'], None), ('normal control', ['09:11:60.03'], None), ('normal control', ['00:01:59;01'], 3569)], [('regression: hour range', ['24:10:00,02'], None), ('regression variant: hour range', ['24:01:01;29'], None), ('partial repair probe: hour range', ['24:20:59;15'], None), ('partial repair variant: hour range', ['24:11:00,15'], None), ('boundary control', ['00:10:00;00'], 17982), ('boundary control', ['23:59:59;29'], 2589407), ('normal control', ['23:10:01.01'], 2499529), ('normal control', ['01:09:59;03'], 125847), ('normal control', ['00:59:00;31'], None)], [('regression: hour range', ['24:59:01;03'], None), ('regression variant: hour range', ['24:09:01;03'], None), ('partial repair probe: hour range', ['24:01:00,03'], None), ('partial repair variant: hour range', ['24:09:00;03'], None), ('boundary control', ['01:00:00;00'], 107892), ('boundary control', ['00:01:00;02'], 1800), ('normal control', ['01:60:00,02'], None), ('normal control', ['01:01:59;30'], None), ('normal control', ['00:20:60;03'], None)], [('regression: hour range', ['24:20:59;15'], None), ('regression variant: hour range', ['24:20:00.01'], None), ('partial repair probe: hour range', ['24:11:00;29'], None), ('partial repair variant: hour range', ['24:09:59;02'], None), ('boundary control', ['00:00:59;29'], 1799), ('boundary control', ['00:01:00;00'], None), ('normal control', ['01:20:60;00'], None), ('normal control', ['09:60:00:31'], None), ('normal control', ['01:11:01;30'], None)]]
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 range | 2591237 | None | Failed |
| regression variant: hour range | 2591209 | None | Failed |
| partial repair probe: hour range | 2607392 | None | Failed |
| partial repair variant: hour range | 2625373 | None | Failed |
| boundary control | 1800 | 1800 | Passed |
| boundary control | 107892 | 107892 | Passed |
| normal control | None | None | Passed |
| normal control | 1799 | 1799 | Passed |
| normal control | 2589407 | 2589407 | Passed |
SHA-256 / 2d1917cf9a15d7073125a2d3300a4696bec502370d36f1b70af882e51de9b8c6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(tc):
m=re.fullmatch(r'(\d{2}):(\d{2}):(\d{2})[;,.](\d{2})',tc)
if not m:
return None
h,mi,s,f=map(int,m.groups())
if h>23 or mi>59 or s>59:
return None
if f>29:
return None
if s==0 and f<2 and mi%10!=0:
return None
tm=h*60+mi
return (tm*60+s)*30+f-2*(tm-tm//10)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: hour range', ['24:01:01.01'], None), ('regression variant: hour range', ['24:01:00,03'], None), ('partial repair probe: hour range', ['24:10:00,02'], None), ('partial repair variant: hour range', ['24:20:00.01'], None), ('boundary control', ['00:01:00;02'], 1800), ('boundary control', ['01:00:00;00'], 107892), ('normal control', ['00:01:00;00'], None), ('normal control', ['00:00:59;29'], 1799), ('normal control', ['23:59:59;29'], 2589407)], [('regression: hour range', ['24:59:01.01'], None), ('regression variant: hour range', ['24:11:00;29'], None), ('partial repair probe: hour range', ['24:59:01;03'], None), ('partial repair variant: hour range', ['24:20:01;01'], None), ('boundary control', ['00:01:00;00'], None), ('boundary control', ['00:00:59;29'], 1799), ('normal control', ['24:00:00:31'], None), ('normal control', ['09:11:60.03'], None), ('normal control', ['00:01:59;01'], 3569)], [('regression: hour range', ['24:10:00,02'], None), ('regression variant: hour range', ['24:01:01;29'], None), ('partial repair probe: hour range', ['24:20:59;15'], None), ('partial repair variant: hour range', ['24:11:00,15'], None), ('boundary control', ['00:10:00;00'], 17982), ('boundary control', ['23:59:59;29'], 2589407), ('normal control', ['23:10:01.01'], 2499529), ('normal control', ['01:09:59;03'], 125847), ('normal control', ['00:59:00;31'], None)], [('regression: hour range', ['24:59:01;03'], None), ('regression variant: hour range', ['24:09:01;03'], None), ('partial repair probe: hour range', ['24:01:00,03'], None), ('partial repair variant: hour range', ['24:09:00;03'], None), ('boundary control', ['01:00:00;00'], 107892), ('boundary control', ['00:01:00;02'], 1800), ('normal control', ['01:60:00,02'], None), ('normal control', ['01:01:59;30'], None), ('normal control', ['00:20:60;03'], None)], [('regression: hour range', ['24:20:59;15'], None), ('regression variant: hour range', ['24:20:00.01'], None), ('partial repair probe: hour range', ['24:11:00;29'], None), ('partial repair variant: hour range', ['24:09:59;02'], None), ('boundary control', ['00:00:59;29'], 1799), ('boundary control', ['00:01:00;00'], None), ('normal control', ['01:20:60;00'], None), ('normal control', ['09:60:00:31'], None), ('normal control', ['01:11:01;30'], None)]]
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 range | None | None | Passed |
| regression variant: hour range | None | None | Passed |
| partial repair probe: hour range | None | None | Passed |
| partial repair variant: hour range | None | None | Passed |
| boundary control | 1800 | 1800 | Passed |
| boundary control | 107892 | 107892 | Passed |
| normal control | None | None | Passed |
| normal control | 1799 | 1799 | Passed |
| normal control | 2589407 | 2589407 | Passed |
SHA-256 / 453120e3c64015f1f992ddd884d51cc3b5231659400cefd7cf8cd99f53d7c29f
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.063879+00:00.
Case digest / 2a8610b07652d07074dd2c3b494716939e59b4c9a212d7b10b271fef48ac14a9