FA-78521 / Broadcast timecode arithmetic / Open access
Film feet and frames conversion: frame field bound · case 01
A frame field equal to the frames per foot is accepted.
ROOT CAUSE
The bound allows ff equal to the frames per foot.
VERIFIED REPAIR
Reject frame fields at or above frames per foot.
Unsuccessful approach: Using the 35mm 4-perf value of 16 rejects valid 2-perf and 16mm frame fields.
Case contract
Frames per foot: 35mm4 16, 35mm2 32, 16mm 40. An int frame count converts to "[-]F+ff" (feet, two-digit frames, sign in front for negatives); a string "[-]F+ff" converts to a signed frame count, with ff below frames per foot (else None). "-0+05" means -5.
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(value, gauge):
per={'35mm4':16,'35mm2':32,'16mm':40}[gauge]
if isinstance(value,int):
sign='-' if value<0 else ''
v=abs(value)
return '%s%d+%02d'%(sign,v//per,v%per)
ft,fr=value.split('+')
if int(fr)>per:
return None
n=abs(int(ft))*per+int(fr)
return -n if ft.startswith('-') else n
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame field bound', ['0+16', '35mm4'], None), ('regression variant: frame field bound', ['-0+32', '35mm2'], None), ('partial repair probe: frame field bound', ['100+16', '16mm'], 4016), ('partial repair variant: frame field bound', ['-3+16', '16mm'], -136), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+01', '35mm4'], 1), ('normal control', [-1, '35mm2'], '-0+01')], [('regression: frame field bound', ['-0+40', '16mm'], None), ('regression variant: frame field bound', ['0+32', '35mm2'], None), ('partial repair probe: frame field bound', ['100+16', '35mm2'], 3216), ('partial repair variant: frame field bound', ['-1+20', '16mm'], -60), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', [1, '16mm'], '0+01'), ('normal control', [0, '16mm'], '0+00'), ('normal control', [-43, '16mm'], '-1+03')], [('regression: frame field bound', ['-3+32', '35mm2'], None), ('regression variant: frame field bound', ['12+16', '35mm4'], None), ('partial repair probe: frame field bound', ['-3+20', '35mm2'], -116), ('partial repair variant: frame field bound', ['-0+31', '16mm'], -31), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['-3+31', '35mm4'], None), ('normal control', [-32, '35mm2'], '-1+00'), ('normal control', [39, '16mm'], '0+39')], [('regression: frame field bound', ['-0+16', '35mm4'], None), ('regression variant: frame field bound', ['12+40', '16mm'], None), ('partial repair probe: frame field bound', ['1+20', '16mm'], 60), ('partial repair variant: frame field bound', ['-1+32', '16mm'], -72), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', ['-0+05', '35mm4'], -5), ('normal control', ['0+00', '35mm2'], 0), ('normal control', [33, '35mm2'], '1+01'), ('normal control', ['-0+00', '35mm4'], 0)], [('regression: frame field bound', ['-3+16', '35mm4'], None), ('regression variant: frame field bound', ['100+16', '35mm4'], None), ('partial repair probe: frame field bound', ['1+16', '35mm2'], 48), ('partial repair variant: frame field bound', ['100+39', '16mm'], 4039), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [999, '16mm'], '24+39'), ('normal control', ['-3+40', '35mm4'], None), ('normal control', ['100+31', '35mm4'], 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: frame field bound | 16 | None | Failed |
| regression variant: frame field bound | -32 | None | Failed |
| partial repair probe: frame field bound | 4016 | 4016 | Passed |
| partial repair variant: frame field bound | -136 | -136 | Passed |
| boundary control | 1+00 | 1+00 | Passed |
| boundary control | 31 | 31 | Passed |
| normal control | -0+01 | -0+01 | Passed |
| normal control | 1 | 1 | Passed |
| normal control | -0+01 | -0+01 | Passed |
SHA-256 / e3e9e20cdaa06a1cd88ccc0190e3bb58c5d7e3355585267aa41a774e9aecf9a0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(value, gauge):
per={'35mm4':16,'35mm2':32,'16mm':40}[gauge]
if isinstance(value,int):
sign='-' if value<0 else ''
v=abs(value)
return '%s%d+%02d'%(sign,v//per,v%per)
ft,fr=value.split('+')
if int(fr)>=16:
return None
n=abs(int(ft))*per+int(fr)
return -n if ft.startswith('-') else n
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame field bound', ['0+16', '35mm4'], None), ('regression variant: frame field bound', ['-0+32', '35mm2'], None), ('partial repair probe: frame field bound', ['100+16', '16mm'], 4016), ('partial repair variant: frame field bound', ['-3+16', '16mm'], -136), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+01', '35mm4'], 1), ('normal control', [-1, '35mm2'], '-0+01')], [('regression: frame field bound', ['-0+40', '16mm'], None), ('regression variant: frame field bound', ['0+32', '35mm2'], None), ('partial repair probe: frame field bound', ['100+16', '35mm2'], 3216), ('partial repair variant: frame field bound', ['-1+20', '16mm'], -60), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', [1, '16mm'], '0+01'), ('normal control', [0, '16mm'], '0+00'), ('normal control', [-43, '16mm'], '-1+03')], [('regression: frame field bound', ['-3+32', '35mm2'], None), ('regression variant: frame field bound', ['12+16', '35mm4'], None), ('partial repair probe: frame field bound', ['-3+20', '35mm2'], -116), ('partial repair variant: frame field bound', ['-0+31', '16mm'], -31), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['-3+31', '35mm4'], None), ('normal control', [-32, '35mm2'], '-1+00'), ('normal control', [39, '16mm'], '0+39')], [('regression: frame field bound', ['-0+16', '35mm4'], None), ('regression variant: frame field bound', ['12+40', '16mm'], None), ('partial repair probe: frame field bound', ['1+20', '16mm'], 60), ('partial repair variant: frame field bound', ['-1+32', '16mm'], -72), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', ['-0+05', '35mm4'], -5), ('normal control', ['0+00', '35mm2'], 0), ('normal control', [33, '35mm2'], '1+01'), ('normal control', ['-0+00', '35mm4'], 0)], [('regression: frame field bound', ['-3+16', '35mm4'], None), ('regression variant: frame field bound', ['100+16', '35mm4'], None), ('partial repair probe: frame field bound', ['1+16', '35mm2'], 48), ('partial repair variant: frame field bound', ['100+39', '16mm'], 4039), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [999, '16mm'], '24+39'), ('normal control', ['-3+40', '35mm4'], None), ('normal control', ['100+31', '35mm4'], 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: frame field bound | None | None | Passed |
| regression variant: frame field bound | None | None | Passed |
| partial repair probe: frame field bound | None | 4016 | Failed |
| partial repair variant: frame field bound | None | -136 | Failed |
| boundary control | 1+00 | 1+00 | Passed |
| boundary control | 31 | 31 | Passed |
| normal control | -0+01 | -0+01 | Passed |
| normal control | 1 | 1 | Passed |
| normal control | -0+01 | -0+01 | Passed |
SHA-256 / 080c06aec34bd665810b964ce095296573e3010043b42da15ae56441146514e5
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(value, gauge):
per={'35mm4':16,'35mm2':32,'16mm':40}[gauge]
if isinstance(value,int):
sign='-' if value<0 else ''
v=abs(value)
return '%s%d+%02d'%(sign,v//per,v%per)
ft,fr=value.split('+')
if int(fr)>=per:
return None
n=abs(int(ft))*per+int(fr)
return -n if ft.startswith('-') else n
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame field bound', ['0+16', '35mm4'], None), ('regression variant: frame field bound', ['-0+32', '35mm2'], None), ('partial repair probe: frame field bound', ['100+16', '16mm'], 4016), ('partial repair variant: frame field bound', ['-3+16', '16mm'], -136), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+01', '35mm4'], 1), ('normal control', [-1, '35mm2'], '-0+01')], [('regression: frame field bound', ['-0+40', '16mm'], None), ('regression variant: frame field bound', ['0+32', '35mm2'], None), ('partial repair probe: frame field bound', ['100+16', '35mm2'], 3216), ('partial repair variant: frame field bound', ['-1+20', '16mm'], -60), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', [1, '16mm'], '0+01'), ('normal control', [0, '16mm'], '0+00'), ('normal control', [-43, '16mm'], '-1+03')], [('regression: frame field bound', ['-3+32', '35mm2'], None), ('regression variant: frame field bound', ['12+16', '35mm4'], None), ('partial repair probe: frame field bound', ['-3+20', '35mm2'], -116), ('partial repair variant: frame field bound', ['-0+31', '16mm'], -31), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['-3+31', '35mm4'], None), ('normal control', [-32, '35mm2'], '-1+00'), ('normal control', [39, '16mm'], '0+39')], [('regression: frame field bound', ['-0+16', '35mm4'], None), ('regression variant: frame field bound', ['12+40', '16mm'], None), ('partial repair probe: frame field bound', ['1+20', '16mm'], 60), ('partial repair variant: frame field bound', ['-1+32', '16mm'], -72), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', ['-0+05', '35mm4'], -5), ('normal control', ['0+00', '35mm2'], 0), ('normal control', [33, '35mm2'], '1+01'), ('normal control', ['-0+00', '35mm4'], 0)], [('regression: frame field bound', ['-3+16', '35mm4'], None), ('regression variant: frame field bound', ['100+16', '35mm4'], None), ('partial repair probe: frame field bound', ['1+16', '35mm2'], 48), ('partial repair variant: frame field bound', ['100+39', '16mm'], 4039), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [999, '16mm'], '24+39'), ('normal control', ['-3+40', '35mm4'], None), ('normal control', ['100+31', '35mm4'], 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: frame field bound | None | None | Passed |
| regression variant: frame field bound | None | None | Passed |
| partial repair probe: frame field bound | 4016 | 4016 | Passed |
| partial repair variant: frame field bound | -136 | -136 | Passed |
| boundary control | 1+00 | 1+00 | Passed |
| boundary control | 31 | 31 | Passed |
| normal control | -0+01 | -0+01 | Passed |
| normal control | 1 | 1 | Passed |
| normal control | -0+01 | -0+01 | Passed |
SHA-256 / 776ad82a693fae7d6f8b5a0c311b516bd9a07fb81a6d8b05f784b225f410151c
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.957255+00:00.
Case digest / 88e152484e5eaae2d0535048e31168325a43c2dc410b48adf71714e71856fa0f