FAILURE MAP
← Case archive

FA-79641 / Barcode symbology encoding / Open access

Version 9 and 26 use the wider count indicator · case 01

Symbols at versions 9 and 26 are built with a count field two bits too wide and fail to decode.

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

ROOT CAUSE

The band boundaries are exclusive, moving versions 9 and 26 into the next band.

VERIFIED REPAIR

Versions 1-9, 10-26 and 27-40 form the three bands.

Unsuccessful approach: Extending the first band to version 10 gives version 10 the short indicator.

Case contract

Compute the length in bits of one QR segment: 4-bit mode indicator, a character count indicator whose width depends on mode and version band (1-9, 10-26, 27-40): numeric 10/12/14, alphanumeric 9/11/13, byte 8/16/16, and the data bits: numeric 10 bits per 3 digits plus 4 or 7 for a remainder of 1 or 2, alphanumeric 11 bits per pair plus 6 for a single, byte 8 bits per UTF-8 byte. Alphanumeric allows 0-9 A-Z space $ % * + - . / :. A count that does not fit the indicator is too-long. Errors: version, charset, mode, too-long.

Why this case matters

Retail, logistics, pharmacy and document workflows depend on encoders that produce exactly the module pattern, code-set switches, separators and quiet zones scanners expect; one misplaced module or separator makes a label unreadable or, worse, scan as different data.

1 / The failure

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

N = 1
observations = []
def solve(mode, data, version):
    if not 1 <= version <= 40:
        return {'error': 'version'}
    band = 0 if version < 9 else (1 if version < 26 else 2)
    ALNUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
    if mode == 'numeric':
        if not all(c in '0123456789' for c in data):
            return {'error': 'charset'}
        count = len(data)
        bits = 10 * (count // 3) + [0, 4, 7][count % 3]
        cci = [10, 12, 14][band]
    elif mode == 'alnum':
        if not all(c in ALNUM for c in data):
            return {'error': 'charset'}
        count = len(data)
        bits = 11 * (count // 2) + 6 * (count % 2)
        cci = [9, 11, 13][band]
    elif mode == 'byte':
        count = len(data.encode('utf-8'))
        bits = 8 * count
        cci = [8, 16, 16][band]
    else:
        return {'error': 'mode'}
    if count >= 1 << cci:
        return {'error': 'too-long'}
    return 4 + cci + bits
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[('numeric', '443978087443', 26), 56], [('numeric', '115232806735', 10), 56], [('alnum', '-/$é+/%é+', 0), {'error': 'version'}], [('alnum', '-', 1), 19], [('alnum', '%', 1), 19], [('byte', '1€11€é', 40), 108], [('alnum', 'ééA- q', 9), {'error': 'charset'}], [('byte', '€éa1a1 ', 9), 92]], [[('numeric', '7643868', 9), 38], [('alnum', '*::2Z%:*', 10), 59], [('numeric', '053142', 0), {'error': 'version'}], [('kanji', 'b1ab11', 5), {'error': 'mode'}], [('alnum', 'q+$ ', 40), {'error': 'charset'}], [('alnum', '++$:é1*.+', 10), {'error': 'charset'}], [('alnum', '+qB+', 0), {'error': 'version'}], [('byte', 'bé', 9), 36]], [[('alnum', '*Z+-', 9), 35], [('numeric', '9420', 10), 30], [('numeric', '37219', 5), 31], [('numeric', '', 40), 18], [('numeric', '716925614701', 5), 54], [('kanji', 'é b€b', 10), {'error': 'mode'}], [('byte', '', 26), 20], [('numeric', '53', 26), 23]], [[('alnum', '$A.', 9), 30], [('byte', ' 11b€€', 10), 100], [('byte', 'abbbaaa', 26), 76], [('byte', '€', 41), {'error': 'version'}], [('numeric', '', 0), {'error': 'version'}], [('numeric', '2', 1), 18], [('alnum', '%1.qZ-', 5), {'error': 'charset'}], [('alnum', ' *$$:*/Z$', 26), 65]], [[('alnum', '+Z2Z2B', 26), 48], [('alnum', '+', 10), 21], [('kanji', 'é ba', 40), {'error': 'mode'}], [('kanji', 'éb', 1), {'error': 'mode'}], [('byte', 'a€', 26), 52], [('alnum', '.', 5), 19], [('byte', '€é1', 27), 68], [('numeric', '14974', 9), 31]]]
labels = ["regression: count indicator version band", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (labels[i % len(labels)], i), 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: count indicator version band 05856Failed
repair trap 15656Passed
combined fault 2{'error': 'version'}{'error': 'version'}Passed
control 31919Passed
control 41919Passed
boundary 5108108Passed
boundary 6{'error': 'charset'}{'error': 'charset'}Passed
control 710092Failed

SHA-256 / cee5db9796c977a7f030ffdab5fed062e7b7d36c21061a3377f18d06b996507e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(mode, data, version):
    if not 1 <= version <= 40:
        return {'error': 'version'}
    band = 0 if version <= 10 else (1 if version <= 26 else 2)
    ALNUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
    if mode == 'numeric':
        if not all(c in '0123456789' for c in data):
            return {'error': 'charset'}
        count = len(data)
        bits = 10 * (count // 3) + [0, 4, 7][count % 3]
        cci = [10, 12, 14][band]
    elif mode == 'alnum':
        if not all(c in ALNUM for c in data):
            return {'error': 'charset'}
        count = len(data)
        bits = 11 * (count // 2) + 6 * (count % 2)
        cci = [9, 11, 13][band]
    elif mode == 'byte':
        count = len(data.encode('utf-8'))
        bits = 8 * count
        cci = [8, 16, 16][band]
    else:
        return {'error': 'mode'}
    if count >= 1 << cci:
        return {'error': 'too-long'}
    return 4 + cci + bits
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[('numeric', '443978087443', 26), 56], [('numeric', '115232806735', 10), 56], [('alnum', '-/$é+/%é+', 0), {'error': 'version'}], [('alnum', '-', 1), 19], [('alnum', '%', 1), 19], [('byte', '1€11€é', 40), 108], [('alnum', 'ééA- q', 9), {'error': 'charset'}], [('byte', '€éa1a1 ', 9), 92]], [[('numeric', '7643868', 9), 38], [('alnum', '*::2Z%:*', 10), 59], [('numeric', '053142', 0), {'error': 'version'}], [('kanji', 'b1ab11', 5), {'error': 'mode'}], [('alnum', 'q+$ ', 40), {'error': 'charset'}], [('alnum', '++$:é1*.+', 10), {'error': 'charset'}], [('alnum', '+qB+', 0), {'error': 'version'}], [('byte', 'bé', 9), 36]], [[('alnum', '*Z+-', 9), 35], [('numeric', '9420', 10), 30], [('numeric', '37219', 5), 31], [('numeric', '', 40), 18], [('numeric', '716925614701', 5), 54], [('kanji', 'é b€b', 10), {'error': 'mode'}], [('byte', '', 26), 20], [('numeric', '53', 26), 23]], [[('alnum', '$A.', 9), 30], [('byte', ' 11b€€', 10), 100], [('byte', 'abbbaaa', 26), 76], [('byte', '€', 41), {'error': 'version'}], [('numeric', '', 0), {'error': 'version'}], [('numeric', '2', 1), 18], [('alnum', '%1.qZ-', 5), {'error': 'charset'}], [('alnum', ' *$$:*/Z$', 26), 65]], [[('alnum', '+Z2Z2B', 26), 48], [('alnum', '+', 10), 21], [('kanji', 'é ba', 40), {'error': 'mode'}], [('kanji', 'éb', 1), {'error': 'mode'}], [('byte', 'a€', 26), 52], [('alnum', '.', 5), 19], [('byte', '€é1', 27), 68], [('numeric', '14974', 9), 31]]]
labels = ["regression: count indicator version band", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (labels[i % len(labels)], i), 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: count indicator version band 05656Passed
repair trap 15456Failed
combined fault 2{'error': 'version'}{'error': 'version'}Passed
control 31919Passed
control 41919Passed
boundary 5108108Passed
boundary 6{'error': 'charset'}{'error': 'charset'}Passed
control 79292Passed

SHA-256 / 40f79b14f1466ef8b7f7ebb84dc426b1a186c84dbd659693a932af45300300a3

3 / The verified repair

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

N = 1
observations = []
def solve(mode, data, version):
    if not 1 <= version <= 40:
        return {'error': 'version'}
    band = 0 if version <= 9 else (1 if version <= 26 else 2)
    ALNUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
    if mode == 'numeric':
        if not all(c in '0123456789' for c in data):
            return {'error': 'charset'}
        count = len(data)
        bits = 10 * (count // 3) + [0, 4, 7][count % 3]
        cci = [10, 12, 14][band]
    elif mode == 'alnum':
        if not all(c in ALNUM for c in data):
            return {'error': 'charset'}
        count = len(data)
        bits = 11 * (count // 2) + 6 * (count % 2)
        cci = [9, 11, 13][band]
    elif mode == 'byte':
        count = len(data.encode('utf-8'))
        bits = 8 * count
        cci = [8, 16, 16][band]
    else:
        return {'error': 'mode'}
    if count >= 1 << cci:
        return {'error': 'too-long'}
    return 4 + cci + bits
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[('numeric', '443978087443', 26), 56], [('numeric', '115232806735', 10), 56], [('alnum', '-/$é+/%é+', 0), {'error': 'version'}], [('alnum', '-', 1), 19], [('alnum', '%', 1), 19], [('byte', '1€11€é', 40), 108], [('alnum', 'ééA- q', 9), {'error': 'charset'}], [('byte', '€éa1a1 ', 9), 92]], [[('numeric', '7643868', 9), 38], [('alnum', '*::2Z%:*', 10), 59], [('numeric', '053142', 0), {'error': 'version'}], [('kanji', 'b1ab11', 5), {'error': 'mode'}], [('alnum', 'q+$ ', 40), {'error': 'charset'}], [('alnum', '++$:é1*.+', 10), {'error': 'charset'}], [('alnum', '+qB+', 0), {'error': 'version'}], [('byte', 'bé', 9), 36]], [[('alnum', '*Z+-', 9), 35], [('numeric', '9420', 10), 30], [('numeric', '37219', 5), 31], [('numeric', '', 40), 18], [('numeric', '716925614701', 5), 54], [('kanji', 'é b€b', 10), {'error': 'mode'}], [('byte', '', 26), 20], [('numeric', '53', 26), 23]], [[('alnum', '$A.', 9), 30], [('byte', ' 11b€€', 10), 100], [('byte', 'abbbaaa', 26), 76], [('byte', '€', 41), {'error': 'version'}], [('numeric', '', 0), {'error': 'version'}], [('numeric', '2', 1), 18], [('alnum', '%1.qZ-', 5), {'error': 'charset'}], [('alnum', ' *$$:*/Z$', 26), 65]], [[('alnum', '+Z2Z2B', 26), 48], [('alnum', '+', 10), 21], [('kanji', 'é ba', 40), {'error': 'mode'}], [('kanji', 'éb', 1), {'error': 'mode'}], [('byte', 'a€', 26), 52], [('alnum', '.', 5), 19], [('byte', '€é1', 27), 68], [('numeric', '14974', 9), 31]]]
labels = ["regression: count indicator version band", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (labels[i % len(labels)], i), 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: count indicator version band 05656Passed
repair trap 15656Passed
combined fault 2{'error': 'version'}{'error': 'version'}Passed
control 31919Passed
control 41919Passed
boundary 5108108Passed
boundary 6{'error': 'charset'}{'error': 'charset'}Passed
control 79292Passed

SHA-256 / 6ed81e51989bc79dcd9a2d51ecfa1cc6ddce00939a48fc9d96c8f9e36742c056

Verification & scope

A deterministic bounded teaching model with a stipulated contract; it makes no claim of conformance to any published specification. 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:46.354713+00:00.

Case digest / e6402eb38edbdf3ce10eaec74899197a84c877b60d0030572bc12b0edb6c4808