FAILURE MAP
← Case archive

FA-78516 / Broadcast timecode arithmetic / Open access

Film feet and frames conversion: negative sign emission · case 01

Negative footage counts print as positive footage.

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

ROOT CAUSE

The sign is never emitted for negative counts.

VERIFIED REPAIR

Prefix "-" exactly when the count is negative.

Unsuccessful approach: Treating zero as negative prints "-0+00" for the head frame.

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=''
        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 sign emission', [-1, '35mm4'], '-0+01'), ('regression variant: negative sign emission', [-32, '35mm2'], '-1+00'), ('partial repair probe: negative sign emission', [0, '35mm4'], '0+00'), ('partial repair variant: negative sign emission', [0, '16mm'], '0+00'), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', ['-0+05', '35mm4'], -5), ('normal control', ['2+39', '16mm'], 119), ('normal control', ['0+01', '35mm4'], 1)], [('regression: negative sign emission', [-1, '35mm2'], '-0+01'), ('regression variant: negative sign emission', [-5, '35mm2'], '-0+05'), ('partial repair probe: negative sign emission', [0, '16mm'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm2'], '0+00'), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', ['2+39', '16mm'], 119), ('normal control', ['100+31', '35mm2'], 3231), ('normal control', ['100+16', '16mm'], 4016), ('normal control', ['-0+40', '16mm'], None)], [('regression: negative sign emission', [-43, '16mm'], '-1+03'), ('regression variant: negative sign emission', [-5, '35mm4'], '-0+05'), ('partial repair probe: negative sign emission', [0, '35mm2'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm4'], '0+00'), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['100+16', '35mm2'], 3216), ('normal control', ['1+00', '35mm4'], 16), ('normal control', ['1+20', '16mm'], 60)], [('regression: negative sign emission', [-5, '16mm'], '-0+05'), ('regression variant: negative sign emission', [-16, '35mm4'], '-1+00'), ('partial repair probe: negative sign emission', [0, '35mm4'], '0+00'), ('partial repair variant: negative sign emission', [0, '16mm'], '0+00'), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', ['-0+05', '35mm4'], -5), ('normal control', ['0+20', '35mm4'], None), ('normal control', [1, '35mm2'], '0+01'), ('normal control', ['0+15', '35mm4'], 15)], [('regression: negative sign emission', [-40, '16mm'], '-1+00'), ('regression variant: negative sign emission', [-35, '35mm2'], '-1+03'), ('partial repair probe: negative sign emission', [0, '16mm'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm2'], '0+00'), ('boundary control', ['2+39', '16mm'], 119), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', ['-0+15', '35mm4'], -15), ('normal control', ['-3+00', '35mm2'], -96), ('normal control', [999, '16mm'], '24+39')]]
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 sign emission0+01-0+01Failed
regression variant: negative sign emission1+00-1+00Failed
partial repair probe: negative sign emission0+000+00Passed
partial repair variant: negative sign emission0+000+00Passed
boundary control1+001+00Passed
boundary controlNoneNonePassed
normal control-5-5Passed
normal control119119Passed
normal control11Passed

SHA-256 / 7eb93903bd900616e01748799cdea05245a1099da0625369b84210f2869cddd3

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 ft.startswith('-') else n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: negative sign emission', [-1, '35mm4'], '-0+01'), ('regression variant: negative sign emission', [-32, '35mm2'], '-1+00'), ('partial repair probe: negative sign emission', [0, '35mm4'], '0+00'), ('partial repair variant: negative sign emission', [0, '16mm'], '0+00'), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', ['-0+05', '35mm4'], -5), ('normal control', ['2+39', '16mm'], 119), ('normal control', ['0+01', '35mm4'], 1)], [('regression: negative sign emission', [-1, '35mm2'], '-0+01'), ('regression variant: negative sign emission', [-5, '35mm2'], '-0+05'), ('partial repair probe: negative sign emission', [0, '16mm'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm2'], '0+00'), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', ['2+39', '16mm'], 119), ('normal control', ['100+31', '35mm2'], 3231), ('normal control', ['100+16', '16mm'], 4016), ('normal control', ['-0+40', '16mm'], None)], [('regression: negative sign emission', [-43, '16mm'], '-1+03'), ('regression variant: negative sign emission', [-5, '35mm4'], '-0+05'), ('partial repair probe: negative sign emission', [0, '35mm2'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm4'], '0+00'), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['100+16', '35mm2'], 3216), ('normal control', ['1+00', '35mm4'], 16), ('normal control', ['1+20', '16mm'], 60)], [('regression: negative sign emission', [-5, '16mm'], '-0+05'), ('regression variant: negative sign emission', [-16, '35mm4'], '-1+00'), ('partial repair probe: negative sign emission', [0, '35mm4'], '0+00'), ('partial repair variant: negative sign emission', [0, '16mm'], '0+00'), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', ['-0+05', '35mm4'], -5), ('normal control', ['0+20', '35mm4'], None), ('normal control', [1, '35mm2'], '0+01'), ('normal control', ['0+15', '35mm4'], 15)], [('regression: negative sign emission', [-40, '16mm'], '-1+00'), ('regression variant: negative sign emission', [-35, '35mm2'], '-1+03'), ('partial repair probe: negative sign emission', [0, '16mm'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm2'], '0+00'), ('boundary control', ['2+39', '16mm'], 119), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', ['-0+15', '35mm4'], -15), ('normal control', ['-3+00', '35mm2'], -96), ('normal control', [999, '16mm'], '24+39')]]
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 sign emission-0+01-0+01Passed
regression variant: negative sign emission-1+00-1+00Passed
partial repair probe: negative sign emission-0+000+00Failed
partial repair variant: negative sign emission-0+000+00Failed
boundary control1+001+00Passed
boundary controlNoneNonePassed
normal control-5-5Passed
normal control119119Passed
normal control11Passed

SHA-256 / b32209768c8f036c633e415d3af3c13e841c4588a0549fb76870a8715692eed2

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 sign emission', [-1, '35mm4'], '-0+01'), ('regression variant: negative sign emission', [-32, '35mm2'], '-1+00'), ('partial repair probe: negative sign emission', [0, '35mm4'], '0+00'), ('partial repair variant: negative sign emission', [0, '16mm'], '0+00'), ('boundary control', [16, '35mm4'], '1+00'), ('boundary control', ['0+16', '35mm4'], None), ('normal control', ['-0+05', '35mm4'], -5), ('normal control', ['2+39', '16mm'], 119), ('normal control', ['0+01', '35mm4'], 1)], [('regression: negative sign emission', [-1, '35mm2'], '-0+01'), ('regression variant: negative sign emission', [-5, '35mm2'], '-0+05'), ('partial repair probe: negative sign emission', [0, '16mm'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm2'], '0+00'), ('boundary control', ['-0+05', '35mm4'], -5), ('boundary control', ['2+39', '16mm'], 119), ('normal control', ['100+31', '35mm2'], 3231), ('normal control', ['100+16', '16mm'], 4016), ('normal control', ['-0+40', '16mm'], None)], [('regression: negative sign emission', [-43, '16mm'], '-1+03'), ('regression variant: negative sign emission', [-5, '35mm4'], '-0+05'), ('partial repair probe: negative sign emission', [0, '35mm2'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm4'], '0+00'), ('boundary control', ['1+15', '35mm4'], 31), ('boundary control', [16, '35mm4'], '1+00'), ('normal control', ['100+16', '35mm2'], 3216), ('normal control', ['1+00', '35mm4'], 16), ('normal control', ['1+20', '16mm'], 60)], [('regression: negative sign emission', [-5, '16mm'], '-0+05'), ('regression variant: negative sign emission', [-16, '35mm4'], '-1+00'), ('partial repair probe: negative sign emission', [0, '35mm4'], '0+00'), ('partial repair variant: negative sign emission', [0, '16mm'], '0+00'), ('boundary control', ['0+16', '35mm4'], None), ('boundary control', ['-0+05', '35mm4'], -5), ('normal control', ['0+20', '35mm4'], None), ('normal control', [1, '35mm2'], '0+01'), ('normal control', ['0+15', '35mm4'], 15)], [('regression: negative sign emission', [-40, '16mm'], '-1+00'), ('regression variant: negative sign emission', [-35, '35mm2'], '-1+03'), ('partial repair probe: negative sign emission', [0, '16mm'], '0+00'), ('partial repair variant: negative sign emission', [0, '35mm2'], '0+00'), ('boundary control', ['2+39', '16mm'], 119), ('boundary control', ['1+15', '35mm4'], 31), ('normal control', ['-0+15', '35mm4'], -15), ('normal control', ['-3+00', '35mm2'], -96), ('normal control', [999, '16mm'], '24+39')]]
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 sign emission-0+01-0+01Passed
regression variant: negative sign emission-1+00-1+00Passed
partial repair probe: negative sign emission0+000+00Passed
partial repair variant: negative sign emission0+000+00Passed
boundary control1+001+00Passed
boundary controlNoneNonePassed
normal control-5-5Passed
normal control119119Passed
normal control11Passed

SHA-256 / 809f6833d1aa915e9d7d1f9801fb891b14f753b9c6a83571d3a0e870b66a7ae0

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

Case digest / 54a6244604530011a5cd565e494850c24b0aa37e7a7781b28c206a72faf0d63f