FAILURE MAP
← Case archive

FA-72726 / Check-digit algorithms / Open access

Container check keeps remainder ten · case 01

Containers whose sum leaves remainder 10 never validate.

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

ROOT CAUSE

The check is total % 11 without mapping 10 to 0.

VERIFIED REPAIR

Reduce the mod-11 remainder once more mod 10.

Unsuccessful approach: Using total % 10 changes every check digit, not just remainder ten.

Case contract

Shipping container identification check digit: three uppercase owner letters, category U, J or Z, six serial digits and a check digit (else "malformed"). Letter values start at A=10 and skip every multiple of 11 (so B=12, L=23, V=34, Z=38). Position i (0-based) has weight 2^i; the check digit is (sum mod 11) mod 10. Return [check, match].

Why this case matters

Terminal gate systems validate container numbers read by OCR cameras before booking moves.

1 / The failure

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

N = 1
observations = []
def solve(s):
    if len(s) != 11 or not s.isascii() or not s[:3].isalpha() or not s[:3].isupper():
        return 'malformed'
    if s[3] not in 'UJZ' or not s[4:].isdigit():
        return 'malformed'
    vals = {}
    v = 10
    for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
        if v % 11 == 0:
            v += 1
        vals[ch] = v
        v += 1
    total = 0
    for i, ch in enumerate(s[:10]):
        total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
    check = total % 11
    return [check, check == int(s[10])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['partial-repair ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['partial-repair ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["CTZU8384457"]', ['CTZU8384457'], [2, False]], ['partial-repair ["CYVU1050697"]', ['CYVU1050697'], [7, True]], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["OQHU9278051"]', ['OQHU9278051'], [8, False]], ['partial-repair ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]]], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]]]]
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 ["TTNJ3916757"][10, False][0, False]Failed
partial-repair ["HRNU7843702"][9, False][9, False]Passed
partial-repair ["BYYJ6917585"][8, False][8, False]Passed
control ["RGOU0215685"][3, False][3, False]Passed
control ["TSAZ4635083"][9, False][9, False]Passed
control ["CSQU305438"]malformedmalformedPassed
control ["CSQX3054383"]malformedmalformedPassed
control ["csqu3054383"]malformedmalformedPassed

SHA-256 / d36dc7ed149f39bd2fbe3ec8200260cd402301f64cb2e4f53cb62b082e6da14f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(s):
    if len(s) != 11 or not s.isascii() or not s[:3].isalpha() or not s[:3].isupper():
        return 'malformed'
    if s[3] not in 'UJZ' or not s[4:].isdigit():
        return 'malformed'
    vals = {}
    v = 10
    for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
        if v % 11 == 0:
            v += 1
        vals[ch] = v
        v += 1
    total = 0
    for i, ch in enumerate(s[:10]):
        total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
    check = total % 10
    return [check, check == int(s[10])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['partial-repair ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['partial-repair ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["CTZU8384457"]', ['CTZU8384457'], [2, False]], ['partial-repair ["CYVU1050697"]', ['CYVU1050697'], [7, True]], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["OQHU9278051"]', ['OQHU9278051'], [8, False]], ['partial-repair ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]]], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]]]]
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 ["TTNJ3916757"][3, False][0, False]Failed
partial-repair ["HRNU7843702"][2, True][9, False]Failed
partial-repair ["BYYJ6917585"][4, False][8, False]Failed
control ["RGOU0215685"][3, False][3, False]Passed
control ["TSAZ4635083"][9, False][9, False]Passed
control ["CSQU305438"]malformedmalformedPassed
control ["CSQX3054383"]malformedmalformedPassed
control ["csqu3054383"]malformedmalformedPassed

SHA-256 / e9f00bb80abe005ba4c243ea5a1f41fcde3d46154780d10168a095569d87f40e

3 / The verified repair

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

N = 1
observations = []
def solve(s):
    if len(s) != 11 or not s.isascii() or not s[:3].isalpha() or not s[:3].isupper():
        return 'malformed'
    if s[3] not in 'UJZ' or not s[4:].isdigit():
        return 'malformed'
    vals = {}
    v = 10
    for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
        if v % 11 == 0:
            v += 1
        vals[ch] = v
        v += 1
    total = 0
    for i, ch in enumerate(s[:10]):
        total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
    check = total % 11 % 10
    return [check, check == int(s[10])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['partial-repair ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['partial-repair ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["CTZU8384457"]', ['CTZU8384457'], [2, False]], ['partial-repair ["CYVU1050697"]', ['CYVU1050697'], [7, True]], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed']], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["OQHU9278051"]', ['OQHU9278051'], [8, False]], ['partial-repair ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]]], [['regression ["TTNJ3916757"]', ['TTNJ3916757'], [0, False]], ['partial-repair ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]]]]
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 ["TTNJ3916757"][0, False][0, False]Passed
partial-repair ["HRNU7843702"][9, False][9, False]Passed
partial-repair ["BYYJ6917585"][8, False][8, False]Passed
control ["RGOU0215685"][3, False][3, False]Passed
control ["TSAZ4635083"][9, False][9, False]Passed
control ["CSQU305438"]malformedmalformedPassed
control ["CSQX3054383"]malformedmalformedPassed
control ["csqu3054383"]malformedmalformedPassed

SHA-256 / fba73d9d21f229c9a0ab49e7f37588779f6a3b0cce379b4df74598290d220034

Verification & scope

A deterministic, bounded teaching model of the named scheme under the stated contract; not a certified validator. 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:48:41.012167+00:00.

Case digest / 290f3735d63514bdb0507867c2426b7697f485d7f3a297aff89358ab3c710bb7