FA-78536 / Broadcast timecode arithmetic / Open access
Film feet and frames conversion: foot divisor · case 01
Converted 16mm footage shows three times too many feet.
ROOT CAUSE
The formatter divides by the 35mm 4-perf value for every gauge.
VERIFIED REPAIR
Divide by the gauge frames-per-foot for both fields.
Unsuccessful approach: Fixing only the feet leaves the frame field reduced modulo 16.
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//16,v%16)
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: foot divisor', [-43, '16mm'], '-1+03'), ('regression variant: foot divisor', [999, '16mm'], '24+39'), ('partial repair probe: foot divisor', [39, '16mm'], '0+39'), ('partial repair variant: foot divisor', [4080, '35mm2'], '127+16'), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+16', '35mm4'], None), ('normal control', ['2+39', '16mm'], 119)], [('regression: foot divisor', [-40, '16mm'], '-1+00'), ('regression variant: foot divisor', [31, '35mm2'], '0+31'), ('partial repair probe: foot divisor', [999, '16mm'], '24+39'), ('partial repair variant: foot divisor', [40, '16mm'], '1+00'), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', [-1, '35mm2'], '-0+01'), ('normal control', [1, '16mm'], '0+01'), ('normal control', ['100+16', '16mm'], 4016)], [('regression: foot divisor', [-32, '35mm2'], '-1+00'), ('regression variant: foot divisor', [41, '16mm'], '1+01'), ('partial repair probe: foot divisor', [31, '35mm2'], '0+31'), ('partial repair variant: foot divisor', [1422, '16mm'], '35+22'), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', ['2+39', '16mm'], 119), ('normal control', [0, '16mm'], '0+00'), ('normal control', ['100+16', '35mm2'], 3216), ('normal control', ['-3+31', '35mm4'], None)], [('regression: foot divisor', [39, '16mm'], '0+39'), ('regression variant: foot divisor', [999, '35mm2'], '31+07'), ('partial repair probe: foot divisor', [41, '16mm'], '1+01'), ('partial repair variant: foot divisor', [2711, '16mm'], '67+31'), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['1+00', '35mm4'], 16), ('normal control', ['-0+16', '35mm4'], None), ('normal control', ['1+16', '35mm2'], 48)], [('regression: foot divisor', [33, '35mm2'], '1+01'), ('regression variant: foot divisor', [-35, '35mm2'], '-1+03'), ('partial repair probe: foot divisor', [2612, '35mm2'], '81+20'), ('partial repair variant: foot divisor', [3865, '16mm'], '96+25'), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+00', '35mm2'], 0), ('normal control', ['-0+15', '35mm4'], -15), ('normal control', ['-3+16', '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: foot divisor | -2+11 | -1+03 | Failed |
| regression variant: foot divisor | 62+07 | 24+39 | Failed |
| partial repair probe: foot divisor | 2+07 | 0+39 | Failed |
| partial repair variant: foot divisor | 255+00 | 127+16 | Failed |
| boundary control | 1+00 | 1+00 | Passed |
| boundary control | 31 | 31 | Passed |
| normal control | -0+01 | -0+01 | Passed |
| normal control | None | None | Passed |
| normal control | 119 | 119 | Passed |
SHA-256 / 63a97ff5199d95cf0aebe6c9ea6cc8de888195bba82ee7af51f971961c834616
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%16)
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: foot divisor', [-43, '16mm'], '-1+03'), ('regression variant: foot divisor', [999, '16mm'], '24+39'), ('partial repair probe: foot divisor', [39, '16mm'], '0+39'), ('partial repair variant: foot divisor', [4080, '35mm2'], '127+16'), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+16', '35mm4'], None), ('normal control', ['2+39', '16mm'], 119)], [('regression: foot divisor', [-40, '16mm'], '-1+00'), ('regression variant: foot divisor', [31, '35mm2'], '0+31'), ('partial repair probe: foot divisor', [999, '16mm'], '24+39'), ('partial repair variant: foot divisor', [40, '16mm'], '1+00'), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', [-1, '35mm2'], '-0+01'), ('normal control', [1, '16mm'], '0+01'), ('normal control', ['100+16', '16mm'], 4016)], [('regression: foot divisor', [-32, '35mm2'], '-1+00'), ('regression variant: foot divisor', [41, '16mm'], '1+01'), ('partial repair probe: foot divisor', [31, '35mm2'], '0+31'), ('partial repair variant: foot divisor', [1422, '16mm'], '35+22'), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', ['2+39', '16mm'], 119), ('normal control', [0, '16mm'], '0+00'), ('normal control', ['100+16', '35mm2'], 3216), ('normal control', ['-3+31', '35mm4'], None)], [('regression: foot divisor', [39, '16mm'], '0+39'), ('regression variant: foot divisor', [999, '35mm2'], '31+07'), ('partial repair probe: foot divisor', [41, '16mm'], '1+01'), ('partial repair variant: foot divisor', [2711, '16mm'], '67+31'), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['1+00', '35mm4'], 16), ('normal control', ['-0+16', '35mm4'], None), ('normal control', ['1+16', '35mm2'], 48)], [('regression: foot divisor', [33, '35mm2'], '1+01'), ('regression variant: foot divisor', [-35, '35mm2'], '-1+03'), ('partial repair probe: foot divisor', [2612, '35mm2'], '81+20'), ('partial repair variant: foot divisor', [3865, '16mm'], '96+25'), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+00', '35mm2'], 0), ('normal control', ['-0+15', '35mm4'], -15), ('normal control', ['-3+16', '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: foot divisor | -1+11 | -1+03 | Failed |
| regression variant: foot divisor | 24+07 | 24+39 | Failed |
| partial repair probe: foot divisor | 0+07 | 0+39 | Failed |
| partial repair variant: foot divisor | 127+00 | 127+16 | Failed |
| boundary control | 1+00 | 1+00 | Passed |
| boundary control | 31 | 31 | Passed |
| normal control | -0+01 | -0+01 | Passed |
| normal control | None | None | Passed |
| normal control | 119 | 119 | Passed |
SHA-256 / 1b5f1df2e8ec1359f006eaf09a50bd0f17832f9dd2441066498f983234eef56c
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: foot divisor', [-43, '16mm'], '-1+03'), ('regression variant: foot divisor', [999, '16mm'], '24+39'), ('partial repair probe: foot divisor', [39, '16mm'], '0+39'), ('partial repair variant: foot divisor', [4080, '35mm2'], '127+16'), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+16', '35mm4'], None), ('normal control', ['2+39', '16mm'], 119)], [('regression: foot divisor', [-40, '16mm'], '-1+00'), ('regression variant: foot divisor', [31, '35mm2'], '0+31'), ('partial repair probe: foot divisor', [999, '16mm'], '24+39'), ('partial repair variant: foot divisor', [40, '16mm'], '1+00'), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', [-1, '35mm2'], '-0+01'), ('normal control', [1, '16mm'], '0+01'), ('normal control', ['100+16', '16mm'], 4016)], [('regression: foot divisor', [-32, '35mm2'], '-1+00'), ('regression variant: foot divisor', [41, '16mm'], '1+01'), ('partial repair probe: foot divisor', [31, '35mm2'], '0+31'), ('partial repair variant: foot divisor', [1422, '16mm'], '35+22'), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', ['2+39', '16mm'], 119), ('normal control', [0, '16mm'], '0+00'), ('normal control', ['100+16', '35mm2'], 3216), ('normal control', ['-3+31', '35mm4'], None)], [('regression: foot divisor', [39, '16mm'], '0+39'), ('regression variant: foot divisor', [999, '35mm2'], '31+07'), ('partial repair probe: foot divisor', [41, '16mm'], '1+01'), ('partial repair variant: foot divisor', [2711, '16mm'], '67+31'), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['1+00', '35mm4'], 16), ('normal control', ['-0+16', '35mm4'], None), ('normal control', ['1+16', '35mm2'], 48)], [('regression: foot divisor', [33, '35mm2'], '1+01'), ('regression variant: foot divisor', [-35, '35mm2'], '-1+03'), ('partial repair probe: foot divisor', [2612, '35mm2'], '81+20'), ('partial repair variant: foot divisor', [3865, '16mm'], '96+25'), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['0+00', '35mm2'], 0), ('normal control', ['-0+15', '35mm4'], -15), ('normal control', ['-3+16', '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: foot divisor | -1+03 | -1+03 | Passed |
| regression variant: foot divisor | 24+39 | 24+39 | Passed |
| partial repair probe: foot divisor | 0+39 | 0+39 | Passed |
| partial repair variant: foot divisor | 127+16 | 127+16 | Passed |
| boundary control | 1+00 | 1+00 | Passed |
| boundary control | 31 | 31 | Passed |
| normal control | -0+01 | -0+01 | Passed |
| normal control | None | None | Passed |
| normal control | 119 | 119 | Passed |
SHA-256 / cf8c051b6d72eeedb11d74e2e582d0e5cd7b243aa65cf39d242d6fc281a326d3
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.987406+00:00.
Case digest / b89dc2b3a0094e3a1c4d5d501cbb2a405fb8801bf35ecb816d84d3f404e25704