FAILURE MAP
← Case archive

FA-78786 / Broadcast timecode arithmetic / Open access

Operator timecode entry normalization: frame field carry · case 01

An entry of 99 frames shows frame field 99.

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

ROOT CAUSE

The frame field prints the typed value instead of the carried remainder.

VERIFIED REPAIR

Print the frame remainder of the carried total.

Unsuccessful approach: Clamping the typed frames discards the carry into seconds.

Case contract

Normalize typed timecode. Separators ":", ";" and "." are equivalent. With separators, up to four numeric fields fill from the right (frames last). Without separators, up to eight digits are right-aligned into HH MM SS FF pairs. Field overflow carries through the total frame count, which wraps at 24 hours. Invalid entry returns 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, fps):
    s=s.replace(';',':').replace('.',':')
    if ':' in s:
        parts=s.split(':')
        if len(parts)>4 or not all(p.isdigit() for p in parts):
            return None
        vals=[0]*(4-len(parts))+[int(p) for p in parts]
    else:
        if not s.isdigit() or len(s)>8:
            return None
        d=s.zfill(8)
        vals=[int(d[i:i+2]) for i in range(0,8,2)]
    h,m,sec,f=vals
    n=((h*60+m)*60+sec)*fps+f
    n%=86400*fps
    return '%02d:%02d:%02d:%02d'%(n//(3600*fps),n//(60*fps)%60,n//fps%60,f)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame field carry', ['99', 25], '00:00:03:24'), ('regression variant: frame field carry', ['5959', 30], '00:01:00:29'), ('partial repair probe: frame field carry', ['5959', 24], '00:01:01:11'), ('partial repair variant: frame field carry', ['10:30', 30], '00:00:11:00'), ('boundary control', ['100', 25], '00:00:01:00'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('normal control', ['1:2', 25], '00:00:01:02'), ('normal control', ['59.10', 24], '00:00:59:10'), ('normal control', ['100', 30], '00:00:01:00')], [('regression: frame field carry', ['59.99', 24], '00:01:03:03'), ('regression variant: frame field carry', ['30', 24], '00:00:01:06'), ('partial repair probe: frame field carry', ['12345678', 25], '12:34:59:03'), ('partial repair variant: frame field carry', ['123456', 30], '00:12:35:26'), ('boundary control', ['1:2', 25], '00:00:01:02'), ('boundary control', ['100', 25], '00:00:01:00'), ('normal control', ['0:23:23', 24], '00:00:23:23'), ('normal control', ['', 25], None), ('normal control', ['10000', 25], '00:01:00:00')], [('regression: frame field carry', ['99', 24], '00:00:04:03'), ('regression variant: frame field carry', ['30', 30], '00:00:01:00'), ('partial repair probe: frame field carry', ['30', 24], '00:00:01:06'), ('partial repair variant: frame field carry', ['23:59', 25], '00:00:25:09'), ('boundary control', ['1.2.3.4', 25], '01:02:03:04'), ('boundary control', ['1:2', 25], '00:00:01:02'), ('normal control', ['61:59:59:24:0', 25], None), ('normal control', ['59.2', 24], '00:00:59:02'), ('normal control', ['1:30:10', 30], '00:01:30:10')], [('regression: frame field carry', ['5959', 24], '00:01:01:11'), ('regression variant: frame field carry', ['2:23:61:99', 25], '02:24:04:24'), ('partial repair probe: frame field carry', ['30', 30], '00:00:01:00'), ('partial repair variant: frame field carry', ['23;1;99', 30], '00:23:04:09'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('boundary control', ['1.2.3.4', 25], '01:02:03:04'), ('normal control', ['x1', 25], None), ('normal control', ['59:59:2', 30], '00:59:59:02'), ('normal control', ['x1', 24], None)], [('regression: frame field carry', ['12345678', 25], '12:34:59:03'), ('regression variant: frame field carry', ['23:30:30', 24], '00:23:31:06'), ('partial repair probe: frame field carry', ['59.23.99', 30], '00:59:26:09'), ('partial repair variant: frame field carry', ['59.99.23.24', 24], '12:39:24:00'), ('boundary control', ['100', 25], '00:00:01:00'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('normal control', ['1000000', 30], '01:00:00:00'), ('normal control', ['59:23:23:10:10', 30], None), ('normal control', ['0.30.59.10.1', 24], 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 fixtureActualExpectedOutcome
regression: frame field carry00:00:03:9900:00:03:24Failed
regression variant: frame field carry00:01:00:5900:01:00:29Failed
partial repair probe: frame field carry00:01:01:5900:01:01:11Failed
partial repair variant: frame field carry00:00:11:3000:00:11:00Failed
boundary control00:00:01:0000:00:01:00Passed
boundary control23:59:59:2423:59:59:24Passed
normal control00:00:01:0200:00:01:02Passed
normal control00:00:59:1000:00:59:10Passed
normal control00:00:01:0000:00:01:00Passed

SHA-256 / ce4344c68e5fcb393fac921ce6cc826c571f3cd779d23097dfecf7f840ed30a7

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s, fps):
    s=s.replace(';',':').replace('.',':')
    if ':' in s:
        parts=s.split(':')
        if len(parts)>4 or not all(p.isdigit() for p in parts):
            return None
        vals=[0]*(4-len(parts))+[int(p) for p in parts]
    else:
        if not s.isdigit() or len(s)>8:
            return None
        d=s.zfill(8)
        vals=[int(d[i:i+2]) for i in range(0,8,2)]
    h,m,sec,f=vals
    n=((h*60+m)*60+sec)*fps+f
    n%=86400*fps
    return '%02d:%02d:%02d:%02d'%(n//(3600*fps),n//(60*fps)%60,n//fps%60,min(f,fps-1))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame field carry', ['99', 25], '00:00:03:24'), ('regression variant: frame field carry', ['5959', 30], '00:01:00:29'), ('partial repair probe: frame field carry', ['5959', 24], '00:01:01:11'), ('partial repair variant: frame field carry', ['10:30', 30], '00:00:11:00'), ('boundary control', ['100', 25], '00:00:01:00'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('normal control', ['1:2', 25], '00:00:01:02'), ('normal control', ['59.10', 24], '00:00:59:10'), ('normal control', ['100', 30], '00:00:01:00')], [('regression: frame field carry', ['59.99', 24], '00:01:03:03'), ('regression variant: frame field carry', ['30', 24], '00:00:01:06'), ('partial repair probe: frame field carry', ['12345678', 25], '12:34:59:03'), ('partial repair variant: frame field carry', ['123456', 30], '00:12:35:26'), ('boundary control', ['1:2', 25], '00:00:01:02'), ('boundary control', ['100', 25], '00:00:01:00'), ('normal control', ['0:23:23', 24], '00:00:23:23'), ('normal control', ['', 25], None), ('normal control', ['10000', 25], '00:01:00:00')], [('regression: frame field carry', ['99', 24], '00:00:04:03'), ('regression variant: frame field carry', ['30', 30], '00:00:01:00'), ('partial repair probe: frame field carry', ['30', 24], '00:00:01:06'), ('partial repair variant: frame field carry', ['23:59', 25], '00:00:25:09'), ('boundary control', ['1.2.3.4', 25], '01:02:03:04'), ('boundary control', ['1:2', 25], '00:00:01:02'), ('normal control', ['61:59:59:24:0', 25], None), ('normal control', ['59.2', 24], '00:00:59:02'), ('normal control', ['1:30:10', 30], '00:01:30:10')], [('regression: frame field carry', ['5959', 24], '00:01:01:11'), ('regression variant: frame field carry', ['2:23:61:99', 25], '02:24:04:24'), ('partial repair probe: frame field carry', ['30', 30], '00:00:01:00'), ('partial repair variant: frame field carry', ['23;1;99', 30], '00:23:04:09'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('boundary control', ['1.2.3.4', 25], '01:02:03:04'), ('normal control', ['x1', 25], None), ('normal control', ['59:59:2', 30], '00:59:59:02'), ('normal control', ['x1', 24], None)], [('regression: frame field carry', ['12345678', 25], '12:34:59:03'), ('regression variant: frame field carry', ['23:30:30', 24], '00:23:31:06'), ('partial repair probe: frame field carry', ['59.23.99', 30], '00:59:26:09'), ('partial repair variant: frame field carry', ['59.99.23.24', 24], '12:39:24:00'), ('boundary control', ['100', 25], '00:00:01:00'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('normal control', ['1000000', 30], '01:00:00:00'), ('normal control', ['59:23:23:10:10', 30], None), ('normal control', ['0.30.59.10.1', 24], 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 fixtureActualExpectedOutcome
regression: frame field carry00:00:03:2400:00:03:24Passed
regression variant: frame field carry00:01:00:2900:01:00:29Passed
partial repair probe: frame field carry00:01:01:2300:01:01:11Failed
partial repair variant: frame field carry00:00:11:2900:00:11:00Failed
boundary control00:00:01:0000:00:01:00Passed
boundary control23:59:59:2423:59:59:24Passed
normal control00:00:01:0200:00:01:02Passed
normal control00:00:59:1000:00:59:10Passed
normal control00:00:01:0000:00:01:00Passed

SHA-256 / e99568249eea6efec30f0881bce0843300de04bd89a8db14c0139074a0ba9fa7

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s, fps):
    s=s.replace(';',':').replace('.',':')
    if ':' in s:
        parts=s.split(':')
        if len(parts)>4 or not all(p.isdigit() for p in parts):
            return None
        vals=[0]*(4-len(parts))+[int(p) for p in parts]
    else:
        if not s.isdigit() or len(s)>8:
            return None
        d=s.zfill(8)
        vals=[int(d[i:i+2]) for i in range(0,8,2)]
    h,m,sec,f=vals
    n=((h*60+m)*60+sec)*fps+f
    n%=86400*fps
    return '%02d:%02d:%02d:%02d'%(n//(3600*fps),n//(60*fps)%60,n//fps%60,n%fps)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: frame field carry', ['99', 25], '00:00:03:24'), ('regression variant: frame field carry', ['5959', 30], '00:01:00:29'), ('partial repair probe: frame field carry', ['5959', 24], '00:01:01:11'), ('partial repair variant: frame field carry', ['10:30', 30], '00:00:11:00'), ('boundary control', ['100', 25], '00:00:01:00'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('normal control', ['1:2', 25], '00:00:01:02'), ('normal control', ['59.10', 24], '00:00:59:10'), ('normal control', ['100', 30], '00:00:01:00')], [('regression: frame field carry', ['59.99', 24], '00:01:03:03'), ('regression variant: frame field carry', ['30', 24], '00:00:01:06'), ('partial repair probe: frame field carry', ['12345678', 25], '12:34:59:03'), ('partial repair variant: frame field carry', ['123456', 30], '00:12:35:26'), ('boundary control', ['1:2', 25], '00:00:01:02'), ('boundary control', ['100', 25], '00:00:01:00'), ('normal control', ['0:23:23', 24], '00:00:23:23'), ('normal control', ['', 25], None), ('normal control', ['10000', 25], '00:01:00:00')], [('regression: frame field carry', ['99', 24], '00:00:04:03'), ('regression variant: frame field carry', ['30', 30], '00:00:01:00'), ('partial repair probe: frame field carry', ['30', 24], '00:00:01:06'), ('partial repair variant: frame field carry', ['23:59', 25], '00:00:25:09'), ('boundary control', ['1.2.3.4', 25], '01:02:03:04'), ('boundary control', ['1:2', 25], '00:00:01:02'), ('normal control', ['61:59:59:24:0', 25], None), ('normal control', ['59.2', 24], '00:00:59:02'), ('normal control', ['1:30:10', 30], '00:01:30:10')], [('regression: frame field carry', ['5959', 24], '00:01:01:11'), ('regression variant: frame field carry', ['2:23:61:99', 25], '02:24:04:24'), ('partial repair probe: frame field carry', ['30', 30], '00:00:01:00'), ('partial repair variant: frame field carry', ['23;1;99', 30], '00:23:04:09'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('boundary control', ['1.2.3.4', 25], '01:02:03:04'), ('normal control', ['x1', 25], None), ('normal control', ['59:59:2', 30], '00:59:59:02'), ('normal control', ['x1', 24], None)], [('regression: frame field carry', ['12345678', 25], '12:34:59:03'), ('regression variant: frame field carry', ['23:30:30', 24], '00:23:31:06'), ('partial repair probe: frame field carry', ['59.23.99', 30], '00:59:26:09'), ('partial repair variant: frame field carry', ['59.99.23.24', 24], '12:39:24:00'), ('boundary control', ['100', 25], '00:00:01:00'), ('boundary control', ['23595924', 25], '23:59:59:24'), ('normal control', ['1000000', 30], '01:00:00:00'), ('normal control', ['59:23:23:10:10', 30], None), ('normal control', ['0.30.59.10.1', 24], 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 fixtureActualExpectedOutcome
regression: frame field carry00:00:03:2400:00:03:24Passed
regression variant: frame field carry00:01:00:2900:01:00:29Passed
partial repair probe: frame field carry00:01:01:1100:01:01:11Passed
partial repair variant: frame field carry00:00:11:0000:00:11:00Passed
boundary control00:00:01:0000:00:01:00Passed
boundary control23:59:59:2423:59:59:24Passed
normal control00:00:01:0200:00:01:02Passed
normal control00:00:59:1000:00:59:10Passed
normal control00:00:01:0000:00:01:00Passed

SHA-256 / 0fdcd63d026d6e7ed5eb7af5cd5ca90ccdb3ca0b025cd553a79e141e84b689b8

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

Case digest / d8a4201df7ab19d91ac9fc2217b65f0626e9f49b4f4377f702eb6746c6759d1c