FAILURE MAP
← Case archive

FA-78526 / Broadcast timecode arithmetic / Open access

Film feet and frames conversion: negative zero feet · case 01

Negative footage within the first foot, such as -0+05, is read as positive.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The sign is detected numerically, and int("-0") is zero.

VERIFIED REPAIR

Detect the sign from the text of the feet field.

Unsuccessful approach: Also testing the magnitude still cannot see the sign of "-0".

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 int(ft)<0 else n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: negative zero feet', ['-0+05', '35mm4'], -5), ('regression variant: negative zero feet', ['-0+01', '16mm'], -1), ('partial repair probe: negative zero feet', ['-0+01', '35mm4'], -1), ('partial repair variant: negative zero feet', ['-0+15', '35mm4'], -15), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['2+39', '16mm'], 119), ('normal control', ['0+01', '35mm4'], 1)], [('regression: negative zero feet', ['-0+15', '35mm4'], -15), ('regression variant: negative zero feet', ['-0+20', '16mm'], -20), ('partial repair probe: negative zero feet', ['-0+31', '16mm'], -31), ('partial repair variant: negative zero feet', ['-0+01', '35mm4'], -1), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', ['2+39', '16mm'], 119), ('normal control', ['-3+20', '35mm4'], None), ('normal control', ['12+32', '35mm4'], None), ('normal control', [15, '35mm4'], '0+15')], [('regression: negative zero feet', ['-0+01', '35mm4'], -1), ('regression variant: negative zero feet', ['-0+15', '16mm'], -15), ('partial repair probe: negative zero feet', ['-0+01', '35mm2'], -1), ('partial repair variant: negative zero feet', ['-0+31', '16mm'], -31), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['-0+40', '16mm'], None), ('normal control', [-43, '16mm'], '-1+03'), ('normal control', ['-3+31', '35mm4'], None)], [('regression: negative zero feet', ['-0+31', '16mm'], -31), ('regression variant: negative zero feet', ['-0+16', '16mm'], -16), ('partial repair probe: negative zero feet', ['-0+01', '16mm'], -1), ('partial repair variant: negative zero feet', ['-0+01', '35mm2'], -1), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['-3+20', '35mm2'], -116), ('normal control', ['-3+32', '35mm2'], None), ('normal control', ['-0+16', '35mm4'], None)], [('regression: negative zero feet', ['-0+01', '35mm2'], -1), ('regression variant: negative zero feet', ['-0+05', '35mm4'], -5), ('partial repair probe: negative zero feet', ['-0+20', '16mm'], -20), ('partial repair variant: negative zero feet', ['-0+01', '16mm'], -1), ('boundary control', ['2+39', '16mm'], 119), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [39, '16mm'], '0+39'), ('normal control', ['0+00', '35mm2'], 0), ('normal control', [-5, '35mm2'], '-0+05')]]
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 fixtureActualExpectedOutcome
regression: negative zero feet5-5Failed
regression variant: negative zero feet1-1Failed
partial repair probe: negative zero feet1-1Failed
partial repair variant: negative zero feet15-15Failed
boundary control1+001+00Passed
boundary controlNoneNonePassed
normal control-0+01-0+01Passed
normal control119119Passed
normal control11Passed

SHA-256 / 755f0e0a0b20f2f89c3e8fc6f59240c164b8d4ef01c4b89f52803971541eef3b

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)>=per:
        return None
    n=abs(int(ft))*per+int(fr)
    return -n if int(ft)<0 or n<0 else n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: negative zero feet', ['-0+05', '35mm4'], -5), ('regression variant: negative zero feet', ['-0+01', '16mm'], -1), ('partial repair probe: negative zero feet', ['-0+01', '35mm4'], -1), ('partial repair variant: negative zero feet', ['-0+15', '35mm4'], -15), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['2+39', '16mm'], 119), ('normal control', ['0+01', '35mm4'], 1)], [('regression: negative zero feet', ['-0+15', '35mm4'], -15), ('regression variant: negative zero feet', ['-0+20', '16mm'], -20), ('partial repair probe: negative zero feet', ['-0+31', '16mm'], -31), ('partial repair variant: negative zero feet', ['-0+01', '35mm4'], -1), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', ['2+39', '16mm'], 119), ('normal control', ['-3+20', '35mm4'], None), ('normal control', ['12+32', '35mm4'], None), ('normal control', [15, '35mm4'], '0+15')], [('regression: negative zero feet', ['-0+01', '35mm4'], -1), ('regression variant: negative zero feet', ['-0+15', '16mm'], -15), ('partial repair probe: negative zero feet', ['-0+01', '35mm2'], -1), ('partial repair variant: negative zero feet', ['-0+31', '16mm'], -31), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['-0+40', '16mm'], None), ('normal control', [-43, '16mm'], '-1+03'), ('normal control', ['-3+31', '35mm4'], None)], [('regression: negative zero feet', ['-0+31', '16mm'], -31), ('regression variant: negative zero feet', ['-0+16', '16mm'], -16), ('partial repair probe: negative zero feet', ['-0+01', '16mm'], -1), ('partial repair variant: negative zero feet', ['-0+01', '35mm2'], -1), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['-3+20', '35mm2'], -116), ('normal control', ['-3+32', '35mm2'], None), ('normal control', ['-0+16', '35mm4'], None)], [('regression: negative zero feet', ['-0+01', '35mm2'], -1), ('regression variant: negative zero feet', ['-0+05', '35mm4'], -5), ('partial repair probe: negative zero feet', ['-0+20', '16mm'], -20), ('partial repair variant: negative zero feet', ['-0+01', '16mm'], -1), ('boundary control', ['2+39', '16mm'], 119), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [39, '16mm'], '0+39'), ('normal control', ['0+00', '35mm2'], 0), ('normal control', [-5, '35mm2'], '-0+05')]]
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 fixtureActualExpectedOutcome
regression: negative zero feet5-5Failed
regression variant: negative zero feet1-1Failed
partial repair probe: negative zero feet1-1Failed
partial repair variant: negative zero feet15-15Failed
boundary control1+001+00Passed
boundary controlNoneNonePassed
normal control-0+01-0+01Passed
normal control119119Passed
normal control11Passed

SHA-256 / a30c6891d01f4d4e06d0c8b0c8662fac34fe4a69f96728de427b99b9ecbdd376

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: negative zero feet', ['-0+05', '35mm4'], -5), ('regression variant: negative zero feet', ['-0+01', '16mm'], -1), ('partial repair probe: negative zero feet', ['-0+01', '35mm4'], -1), ('partial repair variant: negative zero feet', ['-0+15', '35mm4'], -15), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', [-1, '35mm4'], '-0+01'), ('normal control', ['2+39', '16mm'], 119), ('normal control', ['0+01', '35mm4'], 1)], [('regression: negative zero feet', ['-0+15', '35mm4'], -15), ('regression variant: negative zero feet', ['-0+20', '16mm'], -20), ('partial repair probe: negative zero feet', ['-0+31', '16mm'], -31), ('partial repair variant: negative zero feet', ['-0+01', '35mm4'], -1), ('boundary control', [-1, '35mm4'], '-0+01'), ('boundary control', ['2+39', '16mm'], 119), ('normal control', ['-3+20', '35mm4'], None), ('normal control', ['12+32', '35mm4'], None), ('normal control', [15, '35mm4'], '0+15')], [('regression: negative zero feet', ['-0+01', '35mm4'], -1), ('regression variant: negative zero feet', ['-0+15', '16mm'], -15), ('partial repair probe: negative zero feet', ['-0+01', '35mm2'], -1), ('partial repair variant: negative zero feet', ['-0+31', '16mm'], -31), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['-0+40', '16mm'], None), ('normal control', [-43, '16mm'], '-1+03'), ('normal control', ['-3+31', '35mm4'], None)], [('regression: negative zero feet', ['-0+31', '16mm'], -31), ('regression variant: negative zero feet', ['-0+16', '16mm'], -16), ('partial repair probe: negative zero feet', ['-0+01', '16mm'], -1), ('partial repair variant: negative zero feet', ['-0+01', '35mm2'], -1), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', [-1, '35mm4'], '-0+01'), ('normal control', ['-3+20', '35mm2'], -116), ('normal control', ['-3+32', '35mm2'], None), ('normal control', ['-0+16', '35mm4'], None)], [('regression: negative zero feet', ['-0+01', '35mm2'], -1), ('regression variant: negative zero feet', ['-0+05', '35mm4'], -5), ('partial repair probe: negative zero feet', ['-0+20', '16mm'], -20), ('partial repair variant: negative zero feet', ['-0+01', '16mm'], -1), ('boundary control', ['2+39', '16mm'], 119), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', [39, '16mm'], '0+39'), ('normal control', ['0+00', '35mm2'], 0), ('normal control', [-5, '35mm2'], '-0+05')]]
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 fixtureActualExpectedOutcome
regression: negative zero feet-5-5Passed
regression variant: negative zero feet-1-1Passed
partial repair probe: negative zero feet-1-1Passed
partial repair variant: negative zero feet-15-15Passed
boundary control1+001+00Passed
boundary controlNoneNonePassed
normal control-0+01-0+01Passed
normal control119119Passed
normal control11Passed

SHA-256 / 721a69aee72b65c067dbda4169849bd35949257cfe302272bd6e01c7118dc394

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.957241+00:00.

Case digest / 110a85d1657b2288f2d002ab3863fbbefefda966828f4d38b3403b5e3bc939a6