FA-78396 / Broadcast timecode arithmetic / Open access
Drop-frame 29.97 label to frame count: frame field range · case 01
A label with frame 30 is accepted and aliases the next second.
ROOT CAUSE
The frame field limit allows 30.
VERIFIED REPAIR
Reject frame fields above 29.
Unsuccessful approach: Using the 59.94 limit accepts frames 30 to 59.
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 h>23 or mi>59 or s>59:
return None
if f>30:
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: frame field range', ['01:01:59;30'], None), ('regression variant: frame field range', ['09:09:59,30'], None), ('partial repair probe: frame field range', ['01:11:01;30'], None), ('partial repair variant: frame field range', ['01:01:00,30'], 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: frame field range', ['01:11:01;30'], None), ('regression variant: frame field range', ['01:01:00,30'], None), ('partial repair probe: frame field range', ['23:59:59.30'], None), ('partial repair variant: frame field range', ['01:00:00.30'], None), ('boundary control', ['00:01:00;00'], None), ('boundary control', ['00:00:59;29'], 1799), ('normal control', ['24:01:01.01'], None), ('normal control', ['00:60:00;29'], None), ('normal control', ['09:00:00:02'], None)], [('regression: frame field range', ['23:59:59.30'], None), ('regression variant: frame field range', ['01:00:00.30'], None), ('partial repair probe: frame field range', ['09:11:00;30'], None), ('partial repair variant: frame field range', ['00:00:01;31'], None), ('boundary control', ['00:10:00;00'], 17982), ('boundary control', ['23:59:59;29'], 2589407), ('normal control', ['09:59:01.03'], 1077153), ('normal control', ['00:11:00.03'], 19783), ('normal control', ['00:01:01;03'], 1831)], [('regression: frame field range', ['09:11:00;30'], None), ('regression variant: frame field range', ['23:09:00;30'], None), ('partial repair probe: frame field range', ['23:01:59,30'], None), ('partial repair variant: frame field range', ['23:01:00.31'], None), ('boundary control', ['01:00:00;00'], 107892), ('boundary control', ['00:01:00;02'], 1800), ('normal control', ['01:60:00,02'], None), ('normal control', ['23:11:59;00'], 2503066), ('normal control', ['01:59:00;01'], None)], [('regression: frame field range', ['23:01:59,30'], None), ('regression variant: frame field range', ['01:09:00;30'], None), ('partial repair probe: frame field range', ['23:01:00;31'], None), ('partial repair variant: frame field range', ['23:01:00.31'], None), ('boundary control', ['00:00:59;29'], 1799), ('boundary control', ['00:01:00;00'], None), ('normal control', ['09:01:00;03'], 972829), ('normal control', ['09:01:60,02'], None), ('normal control', ['01:59:01;29'], 214043)]]
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 field range | 111490 | None | Failed |
| regression variant: frame field range | 989010 | None | Failed |
| partial repair probe: frame field range | 127732 | None | Failed |
| partial repair variant: frame field range | 109720 | 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 / 911d2759458981ac26843fd9c3bb1140ce8a9f2d0af0158fb22116fbfdff6d0f
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>23 or mi>59 or s>59:
return None
if f>59:
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: frame field range', ['01:01:59;30'], None), ('regression variant: frame field range', ['09:09:59,30'], None), ('partial repair probe: frame field range', ['01:11:01;30'], None), ('partial repair variant: frame field range', ['01:01:00,30'], 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: frame field range', ['01:11:01;30'], None), ('regression variant: frame field range', ['01:01:00,30'], None), ('partial repair probe: frame field range', ['23:59:59.30'], None), ('partial repair variant: frame field range', ['01:00:00.30'], None), ('boundary control', ['00:01:00;00'], None), ('boundary control', ['00:00:59;29'], 1799), ('normal control', ['24:01:01.01'], None), ('normal control', ['00:60:00;29'], None), ('normal control', ['09:00:00:02'], None)], [('regression: frame field range', ['23:59:59.30'], None), ('regression variant: frame field range', ['01:00:00.30'], None), ('partial repair probe: frame field range', ['09:11:00;30'], None), ('partial repair variant: frame field range', ['00:00:01;31'], None), ('boundary control', ['00:10:00;00'], 17982), ('boundary control', ['23:59:59;29'], 2589407), ('normal control', ['09:59:01.03'], 1077153), ('normal control', ['00:11:00.03'], 19783), ('normal control', ['00:01:01;03'], 1831)], [('regression: frame field range', ['09:11:00;30'], None), ('regression variant: frame field range', ['23:09:00;30'], None), ('partial repair probe: frame field range', ['23:01:59,30'], None), ('partial repair variant: frame field range', ['23:01:00.31'], None), ('boundary control', ['01:00:00;00'], 107892), ('boundary control', ['00:01:00;02'], 1800), ('normal control', ['01:60:00,02'], None), ('normal control', ['23:11:59;00'], 2503066), ('normal control', ['01:59:00;01'], None)], [('regression: frame field range', ['23:01:59,30'], None), ('regression variant: frame field range', ['01:09:00;30'], None), ('partial repair probe: frame field range', ['23:01:00;31'], None), ('partial repair variant: frame field range', ['23:01:00.31'], None), ('boundary control', ['00:00:59;29'], 1799), ('boundary control', ['00:01:00;00'], None), ('normal control', ['09:01:00;03'], 972829), ('normal control', ['09:01:60,02'], None), ('normal control', ['01:59:01;29'], 214043)]]
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 field range | 111490 | None | Failed |
| regression variant: frame field range | 989010 | None | Failed |
| partial repair probe: frame field range | 127732 | None | Failed |
| partial repair variant: frame field range | 109720 | 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 / b288ed68930904bf03464d2f936e161c5492e3730f01491fbdc29ab72c1908b2
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: frame field range', ['01:01:59;30'], None), ('regression variant: frame field range', ['09:09:59,30'], None), ('partial repair probe: frame field range', ['01:11:01;30'], None), ('partial repair variant: frame field range', ['01:01:00,30'], 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: frame field range', ['01:11:01;30'], None), ('regression variant: frame field range', ['01:01:00,30'], None), ('partial repair probe: frame field range', ['23:59:59.30'], None), ('partial repair variant: frame field range', ['01:00:00.30'], None), ('boundary control', ['00:01:00;00'], None), ('boundary control', ['00:00:59;29'], 1799), ('normal control', ['24:01:01.01'], None), ('normal control', ['00:60:00;29'], None), ('normal control', ['09:00:00:02'], None)], [('regression: frame field range', ['23:59:59.30'], None), ('regression variant: frame field range', ['01:00:00.30'], None), ('partial repair probe: frame field range', ['09:11:00;30'], None), ('partial repair variant: frame field range', ['00:00:01;31'], None), ('boundary control', ['00:10:00;00'], 17982), ('boundary control', ['23:59:59;29'], 2589407), ('normal control', ['09:59:01.03'], 1077153), ('normal control', ['00:11:00.03'], 19783), ('normal control', ['00:01:01;03'], 1831)], [('regression: frame field range', ['09:11:00;30'], None), ('regression variant: frame field range', ['23:09:00;30'], None), ('partial repair probe: frame field range', ['23:01:59,30'], None), ('partial repair variant: frame field range', ['23:01:00.31'], None), ('boundary control', ['01:00:00;00'], 107892), ('boundary control', ['00:01:00;02'], 1800), ('normal control', ['01:60:00,02'], None), ('normal control', ['23:11:59;00'], 2503066), ('normal control', ['01:59:00;01'], None)], [('regression: frame field range', ['23:01:59,30'], None), ('regression variant: frame field range', ['01:09:00;30'], None), ('partial repair probe: frame field range', ['23:01:00;31'], None), ('partial repair variant: frame field range', ['23:01:00.31'], None), ('boundary control', ['00:00:59;29'], 1799), ('boundary control', ['00:01:00;00'], None), ('normal control', ['09:01:00;03'], 972829), ('normal control', ['09:01:60,02'], None), ('normal control', ['01:59:01;29'], 214043)]]
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 field range | None | None | Passed |
| regression variant: frame field range | None | None | Passed |
| partial repair probe: frame field range | None | None | Passed |
| partial repair variant: frame field 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 / c614ae5ac82e88a9179cae29106bc5cc137006ffff3bb34f7a94d74995cbbb64
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:34.730273+00:00.
Case digest / 2e8f31988e9ed76d31fc90b70b5035b91dd91bb253846dbfe63253ce89c266f9