FA-78706 / Broadcast timecode arithmetic / Open access
Frame-rate descriptor parsing: drop-frame validity · case 01
A 23.976 DF descriptor is accepted although that rate has no drop-frame labels.
ROOT CAUSE
Only integer rates are refused for drop frame.
VERIFIED REPAIR
Refuse drop frame for every rate other than 29.97 and 59.94.
Unsuccessful approach: Refusing only 23.976 drop frame now accepts 30 DF and 25 DF.
Case contract
Parse a rate descriptor: a known rate (23.976, 23.98, 24, 25, 29.97, 30, 50, 59.94, 60; redundant trailing decimal zeros allowed) with an optional case-insensitive DF/NDF suffix, optionally separated by a space or hyphen; surrounding whitespace ignored. Drop frame is only valid for 29.97 and 59.94. Return [num,den,drop] or None.
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(s):
t=s.strip().upper()
drop=t.endswith('DF') and not t.endswith('NDF')
base=t[:-3] if t.endswith('NDF') else t[:-2] if t.endswith('DF') else t
base=base.rstrip(' -')
if '.' in base:
base=base.rstrip('0').rstrip('.')
table={'23.976':(24000,1001),'23.98':(24000,1001),'24':(24,1),'25':(25,1),'29.97':(30000,1001),'30':(30,1),'50':(50,1),'59.94':(60000,1001),'60':(60,1)}
if base not in table:
return None
num,den=table[base]
if drop and den!=1001:
return None
return [num,den,drop]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: drop-frame validity', [' 23.98df '], None), ('regression variant: drop-frame validity', ['23.98df'], None), ('partial repair probe: drop-frame validity', [' 25 DF '], None), ('partial repair variant: drop-frame validity', ['25DF'], None), ('boundary control', ['29.97DF'], [30000, 1001, True]), ('boundary control', ['59.94-df'], [60000, 1001, True]), ('normal control', ['29.97 NDF'], [30000, 1001, False]), ('normal control', ['30.0'], [30, 1, False]), ('normal control', [' 30 ndf '], [30, 1, False])], [('regression: drop-frame validity', ['23.976df'], None), ('regression variant: drop-frame validity', ['23.976-DF'], None), ('partial repair probe: drop-frame validity', ['25df'], None), ('partial repair variant: drop-frame validity', ['24.0DF'], None), ('boundary control', ['29.97 NDF'], [30000, 1001, False]), ('boundary control', ['30.0'], [30, 1, False]), ('normal control', [' 29.97NDF '], [30000, 1001, False]), ('normal control', ['30'], [30, 1, False]), ('normal control', ['31-DF'], None)], [('regression: drop-frame validity', [' 23.976 DF '], None), ('regression variant: drop-frame validity', ['23.98 DF'], None), ('partial repair probe: drop-frame validity', [' 30.0df '], None), ('partial repair variant: drop-frame validity', [' 25.00DF '], None), ('boundary control', ['23.976'], [24000, 1001, False]), ('boundary control', ['29.97DF'], [30000, 1001, True]), ('normal control', [' 60 '], [60, 1, False]), ('normal control', [' 29.97DF '], [30000, 1001, True]), ('normal control', ['30.0 ndf'], [30, 1, False])], [('regression: drop-frame validity', ['23.976DF'], None), ('regression variant: drop-frame validity', ['23.976 DF'], None), ('partial repair probe: drop-frame validity', [' 25DF '], None), ('partial repair variant: drop-frame validity', ['24DF'], None), ('boundary control', ['59.94-df'], [60000, 1001, True]), ('boundary control', ['29.97 NDF'], [30000, 1001, False]), ('normal control', [' 29.970 '], [30000, 1001, False]), ('normal control', [' 29.970DF '], [30000, 1001, True]), ('normal control', ['25.00'], [25, 1, False])], [('regression: drop-frame validity', [' 23.98-DF '], None), ('regression variant: drop-frame validity', ['23.98-DF'], None), ('partial repair probe: drop-frame validity', ['25.00df'], None), ('partial repair variant: drop-frame validity', ['25.00DF'], None), ('boundary control', ['30.0'], [30, 1, False]), ('boundary control', ['23.976'], [24000, 1001, False]), ('normal control', [' 59.94-DF '], [60000, 1001, True]), ('normal control', [' 25 '], [25, 1, False]), ('normal control', [' 59.94 '], [60000, 1001, False])]]
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: drop-frame validity | [24000, 1001, True] | None | Failed |
| regression variant: drop-frame validity | [24000, 1001, True] | None | Failed |
| partial repair probe: drop-frame validity | None | None | Passed |
| partial repair variant: drop-frame validity | None | None | Passed |
| boundary control | [30000, 1001, True] | [30000, 1001, True] | Passed |
| boundary control | [60000, 1001, True] | [60000, 1001, True] | Passed |
| normal control | [30000, 1001, False] | [30000, 1001, False] | Passed |
| normal control | [30, 1, False] | [30, 1, False] | Passed |
| normal control | [30, 1, False] | [30, 1, False] | Passed |
SHA-256 / e3c260edd2975fd9740759d90f8a69b5b442e74634619f7aa1bf69db53508464
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
t=s.strip().upper()
drop=t.endswith('DF') and not t.endswith('NDF')
base=t[:-3] if t.endswith('NDF') else t[:-2] if t.endswith('DF') else t
base=base.rstrip(' -')
if '.' in base:
base=base.rstrip('0').rstrip('.')
table={'23.976':(24000,1001),'23.98':(24000,1001),'24':(24,1),'25':(25,1),'29.97':(30000,1001),'30':(30,1),'50':(50,1),'59.94':(60000,1001),'60':(60,1)}
if base not in table:
return None
num,den=table[base]
if drop and num==24000:
return None
return [num,den,drop]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: drop-frame validity', [' 23.98df '], None), ('regression variant: drop-frame validity', ['23.98df'], None), ('partial repair probe: drop-frame validity', [' 25 DF '], None), ('partial repair variant: drop-frame validity', ['25DF'], None), ('boundary control', ['29.97DF'], [30000, 1001, True]), ('boundary control', ['59.94-df'], [60000, 1001, True]), ('normal control', ['29.97 NDF'], [30000, 1001, False]), ('normal control', ['30.0'], [30, 1, False]), ('normal control', [' 30 ndf '], [30, 1, False])], [('regression: drop-frame validity', ['23.976df'], None), ('regression variant: drop-frame validity', ['23.976-DF'], None), ('partial repair probe: drop-frame validity', ['25df'], None), ('partial repair variant: drop-frame validity', ['24.0DF'], None), ('boundary control', ['29.97 NDF'], [30000, 1001, False]), ('boundary control', ['30.0'], [30, 1, False]), ('normal control', [' 29.97NDF '], [30000, 1001, False]), ('normal control', ['30'], [30, 1, False]), ('normal control', ['31-DF'], None)], [('regression: drop-frame validity', [' 23.976 DF '], None), ('regression variant: drop-frame validity', ['23.98 DF'], None), ('partial repair probe: drop-frame validity', [' 30.0df '], None), ('partial repair variant: drop-frame validity', [' 25.00DF '], None), ('boundary control', ['23.976'], [24000, 1001, False]), ('boundary control', ['29.97DF'], [30000, 1001, True]), ('normal control', [' 60 '], [60, 1, False]), ('normal control', [' 29.97DF '], [30000, 1001, True]), ('normal control', ['30.0 ndf'], [30, 1, False])], [('regression: drop-frame validity', ['23.976DF'], None), ('regression variant: drop-frame validity', ['23.976 DF'], None), ('partial repair probe: drop-frame validity', [' 25DF '], None), ('partial repair variant: drop-frame validity', ['24DF'], None), ('boundary control', ['59.94-df'], [60000, 1001, True]), ('boundary control', ['29.97 NDF'], [30000, 1001, False]), ('normal control', [' 29.970 '], [30000, 1001, False]), ('normal control', [' 29.970DF '], [30000, 1001, True]), ('normal control', ['25.00'], [25, 1, False])], [('regression: drop-frame validity', [' 23.98-DF '], None), ('regression variant: drop-frame validity', ['23.98-DF'], None), ('partial repair probe: drop-frame validity', ['25.00df'], None), ('partial repair variant: drop-frame validity', ['25.00DF'], None), ('boundary control', ['30.0'], [30, 1, False]), ('boundary control', ['23.976'], [24000, 1001, False]), ('normal control', [' 59.94-DF '], [60000, 1001, True]), ('normal control', [' 25 '], [25, 1, False]), ('normal control', [' 59.94 '], [60000, 1001, False])]]
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: drop-frame validity | None | None | Passed |
| regression variant: drop-frame validity | None | None | Passed |
| partial repair probe: drop-frame validity | [25, 1, True] | None | Failed |
| partial repair variant: drop-frame validity | [25, 1, True] | None | Failed |
| boundary control | [30000, 1001, True] | [30000, 1001, True] | Passed |
| boundary control | [60000, 1001, True] | [60000, 1001, True] | Passed |
| normal control | [30000, 1001, False] | [30000, 1001, False] | Passed |
| normal control | [30, 1, False] | [30, 1, False] | Passed |
| normal control | [30, 1, False] | [30, 1, False] | Passed |
SHA-256 / b4d926516410a2c3f60ba68ae21ebe9121421a876e46e735200c67077e187fe6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
t=s.strip().upper()
drop=t.endswith('DF') and not t.endswith('NDF')
base=t[:-3] if t.endswith('NDF') else t[:-2] if t.endswith('DF') else t
base=base.rstrip(' -')
if '.' in base:
base=base.rstrip('0').rstrip('.')
table={'23.976':(24000,1001),'23.98':(24000,1001),'24':(24,1),'25':(25,1),'29.97':(30000,1001),'30':(30,1),'50':(50,1),'59.94':(60000,1001),'60':(60,1)}
if base not in table:
return None
num,den=table[base]
if drop and den!=1001 or drop and num==24000:
return None
return [num,den,drop]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: drop-frame validity', [' 23.98df '], None), ('regression variant: drop-frame validity', ['23.98df'], None), ('partial repair probe: drop-frame validity', [' 25 DF '], None), ('partial repair variant: drop-frame validity', ['25DF'], None), ('boundary control', ['29.97DF'], [30000, 1001, True]), ('boundary control', ['59.94-df'], [60000, 1001, True]), ('normal control', ['29.97 NDF'], [30000, 1001, False]), ('normal control', ['30.0'], [30, 1, False]), ('normal control', [' 30 ndf '], [30, 1, False])], [('regression: drop-frame validity', ['23.976df'], None), ('regression variant: drop-frame validity', ['23.976-DF'], None), ('partial repair probe: drop-frame validity', ['25df'], None), ('partial repair variant: drop-frame validity', ['24.0DF'], None), ('boundary control', ['29.97 NDF'], [30000, 1001, False]), ('boundary control', ['30.0'], [30, 1, False]), ('normal control', [' 29.97NDF '], [30000, 1001, False]), ('normal control', ['30'], [30, 1, False]), ('normal control', ['31-DF'], None)], [('regression: drop-frame validity', [' 23.976 DF '], None), ('regression variant: drop-frame validity', ['23.98 DF'], None), ('partial repair probe: drop-frame validity', [' 30.0df '], None), ('partial repair variant: drop-frame validity', [' 25.00DF '], None), ('boundary control', ['23.976'], [24000, 1001, False]), ('boundary control', ['29.97DF'], [30000, 1001, True]), ('normal control', [' 60 '], [60, 1, False]), ('normal control', [' 29.97DF '], [30000, 1001, True]), ('normal control', ['30.0 ndf'], [30, 1, False])], [('regression: drop-frame validity', ['23.976DF'], None), ('regression variant: drop-frame validity', ['23.976 DF'], None), ('partial repair probe: drop-frame validity', [' 25DF '], None), ('partial repair variant: drop-frame validity', ['24DF'], None), ('boundary control', ['59.94-df'], [60000, 1001, True]), ('boundary control', ['29.97 NDF'], [30000, 1001, False]), ('normal control', [' 29.970 '], [30000, 1001, False]), ('normal control', [' 29.970DF '], [30000, 1001, True]), ('normal control', ['25.00'], [25, 1, False])], [('regression: drop-frame validity', [' 23.98-DF '], None), ('regression variant: drop-frame validity', ['23.98-DF'], None), ('partial repair probe: drop-frame validity', ['25.00df'], None), ('partial repair variant: drop-frame validity', ['25.00DF'], None), ('boundary control', ['30.0'], [30, 1, False]), ('boundary control', ['23.976'], [24000, 1001, False]), ('normal control', [' 59.94-DF '], [60000, 1001, True]), ('normal control', [' 25 '], [25, 1, False]), ('normal control', [' 59.94 '], [60000, 1001, False])]]
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: drop-frame validity | None | None | Passed |
| regression variant: drop-frame validity | None | None | Passed |
| partial repair probe: drop-frame validity | None | None | Passed |
| partial repair variant: drop-frame validity | None | None | Passed |
| boundary control | [30000, 1001, True] | [30000, 1001, True] | Passed |
| boundary control | [60000, 1001, True] | [60000, 1001, True] | Passed |
| normal control | [30000, 1001, False] | [30000, 1001, False] | Passed |
| normal control | [30, 1, False] | [30, 1, False] | Passed |
| normal control | [30, 1, False] | [30, 1, False] | Passed |
SHA-256 / 27d9f403f68b4fac29e019ab3a8bf4eef46982a0947bd43b5cbe358b17cd811e
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.933776+00:00.
Case digest / 370dcd03734742603f5c029d50c618d7405d2e205e9d5f9ee68d1ccb10868e9e