FAILURE MAP
← Case archive

FA-79706 / Barcode symbology encoding / Open access

Data that exactly fills the symbol is rejected · case 01

The encoder moves to a larger version for payloads that fit exactly.

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

ROOT CAUSE

The overflow test rejects data equal to the capacity.

THE FAILURE

The overflow test rejects data equal to the capacity.

Unsuccessful approach: Allowing four extra bits accepts data that does not fit.

Case contract

Finish a QR data bit stream for a symbol with `capacity` data codewords: data longer than capacity*8 bits returns None; append a terminator of up to four 0 bits (truncated if capacity is reached), pad with 0 bits to a byte boundary, split into codewords, then append pad codewords alternating 0xEC, 0x11 starting with 0xEC until the capacity is filled.

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(bits, capacity):
    cap = capacity * 8
    if len(bits) >= cap:
        return None
    bits += '0' * min(4, cap - len(bits))
    bits += '0' * (-len(bits) % 8)
    words = [int(bits[i:i + 8], 2) for i in range(0, len(bits), 8)]
    pads = [0xEC, 0x11]
    k = 0
    while len(words) < capacity:
        words.append(pads[k % 2])
        k += 1
    return words
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[('10111110000100110101101101110110', 4), [190, 19, 91, 118]], [('101011111101111010101001010011000', 4), None], [('11110', 1), [240]], [('010010001010011000110010101000', 4), [72, 166, 50, 160]], [('0101100111101', 2), [89, 232]], [('011111010101101111101000', 5), [125, 91, 232, 0, 236]], [('1110001010001010000011000101110', 4), [226, 138, 12, 92]], [('01110101', 1), [117]]], [[('0000010010000100111101000110000101110011', 5), [4, 132, 244, 97, 115]], [('00101010101111110010011110110010011100110', 5), None], [('1110011111000110', 7), [231, 198, 0, 236, 17, 236, 17]], [('010111100111111111101011010111010101', 6), [94, 127, 235, 93, 80, 236]], [('000100', 1), [16]], [('0110001100001', 2), [99, 8]], [('110000', 1), [192]], [('10100100000101111100100011011110', 4), [164, 23, 200, 222]]], [[('1001111000111101000111101011000010011100', 5), [158, 61, 30, 176, 156]], [('1100011111010101100100001111010111100110101001110', 6), None], [('00111000', 6), [56, 0, 236, 17, 236, 17]], [('', 5), [0, 236, 17, 236, 17]], [('1011011', 1), [182]], [('011000110111001010011001100110101001', 5), [99, 114, 153, 154, 144]], [('0101101001011000000111111001001110110111010010101000', 7), [90, 88, 31, 147, 183, 74, 128]], [('1001101000011101000000110011010010100101', 5), [154, 29, 3, 52, 165]]], [[('00010010010101111101101100010011101101001111010110100000', 7), [18, 87, 219, 19, 180, 245, 160]], [('10001101000010011', 2), None], [('01000011', 2), [67, 0]], [('10110010', 2), [178, 0]], [('111110101001011001000', 3), [250, 150, 64]], [('10110101101011111001101001000', 4), [181, 175, 154, 64]], [('0011001110001010', 6), [51, 138, 0, 236, 17, 236]], [('01110011101100110010100111000111100111011111110101101110', 7), [115, 179, 41, 199, 157, 253, 110]]], [[('111100010111101010011001', 3), [241, 122, 153]], [('100010101011001101000110110111110', 4), None], [('100100000001111010001', 3), [144, 30, 136]], [('10101100011011111011000010111001110101111010010011011', 7), [172, 111, 176, 185, 215, 164, 216]], [('0100011110111010010001', 5), [71, 186, 68, 0, 236]], [('1011000001110101001101010100', 6), [176, 117, 53, 64, 236, 17]], [('1011110011011110010111001100011010', 5), [188, 222, 92, 198, 128]], [('1001000010101110001111000110111010001110', 5), [144, 174, 60, 110, 142]]]]
labels = ["regression: exactly full data", "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: exactly full data 0None[190, 19, 91, 118]Failed
repair trap 1NoneNonePassed
combined fault 2[240][240]Passed
control 3[72, 166, 50, 160][72, 166, 50, 160]Passed
control 4[89, 232][89, 232]Passed
boundary 5[125, 91, 232, 0, 236][125, 91, 232, 0, 236]Passed
boundary 6[226, 138, 12, 92][226, 138, 12, 92]Passed
control 7None[117]Failed

SHA-256 / e6f37a0abe188d6affdc12f9d51c5c11ca1ec1e3f44cd991a82a5db65c8b9b46

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(bits, capacity):
    cap = capacity * 8
    if len(bits) > cap + 4:
        return None
    bits += '0' * min(4, cap - len(bits))
    bits += '0' * (-len(bits) % 8)
    words = [int(bits[i:i + 8], 2) for i in range(0, len(bits), 8)]
    pads = [0xEC, 0x11]
    k = 0
    while len(words) < capacity:
        words.append(pads[k % 2])
        k += 1
    return words
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[('10111110000100110101101101110110', 4), [190, 19, 91, 118]], [('101011111101111010101001010011000', 4), None], [('11110', 1), [240]], [('010010001010011000110010101000', 4), [72, 166, 50, 160]], [('0101100111101', 2), [89, 232]], [('011111010101101111101000', 5), [125, 91, 232, 0, 236]], [('1110001010001010000011000101110', 4), [226, 138, 12, 92]], [('01110101', 1), [117]]], [[('0000010010000100111101000110000101110011', 5), [4, 132, 244, 97, 115]], [('00101010101111110010011110110010011100110', 5), None], [('1110011111000110', 7), [231, 198, 0, 236, 17, 236, 17]], [('010111100111111111101011010111010101', 6), [94, 127, 235, 93, 80, 236]], [('000100', 1), [16]], [('0110001100001', 2), [99, 8]], [('110000', 1), [192]], [('10100100000101111100100011011110', 4), [164, 23, 200, 222]]], [[('1001111000111101000111101011000010011100', 5), [158, 61, 30, 176, 156]], [('1100011111010101100100001111010111100110101001110', 6), None], [('00111000', 6), [56, 0, 236, 17, 236, 17]], [('', 5), [0, 236, 17, 236, 17]], [('1011011', 1), [182]], [('011000110111001010011001100110101001', 5), [99, 114, 153, 154, 144]], [('0101101001011000000111111001001110110111010010101000', 7), [90, 88, 31, 147, 183, 74, 128]], [('1001101000011101000000110011010010100101', 5), [154, 29, 3, 52, 165]]], [[('00010010010101111101101100010011101101001111010110100000', 7), [18, 87, 219, 19, 180, 245, 160]], [('10001101000010011', 2), None], [('01000011', 2), [67, 0]], [('10110010', 2), [178, 0]], [('111110101001011001000', 3), [250, 150, 64]], [('10110101101011111001101001000', 4), [181, 175, 154, 64]], [('0011001110001010', 6), [51, 138, 0, 236, 17, 236]], [('01110011101100110010100111000111100111011111110101101110', 7), [115, 179, 41, 199, 157, 253, 110]]], [[('111100010111101010011001', 3), [241, 122, 153]], [('100010101011001101000110110111110', 4), None], [('100100000001111010001', 3), [144, 30, 136]], [('10101100011011111011000010111001110101111010010011011', 7), [172, 111, 176, 185, 215, 164, 216]], [('0100011110111010010001', 5), [71, 186, 68, 0, 236]], [('1011000001110101001101010100', 6), [176, 117, 53, 64, 236, 17]], [('1011110011011110010111001100011010', 5), [188, 222, 92, 198, 128]], [('1001000010101110001111000110111010001110', 5), [144, 174, 60, 110, 142]]]]
labels = ["regression: exactly full data", "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: exactly full data 0[190, 19, 91, 118][190, 19, 91, 118]Passed
repair trap 1[175, 222, 169, 76, 0]NoneFailed
combined fault 2[240][240]Passed
control 3[72, 166, 50, 160][72, 166, 50, 160]Passed
control 4[89, 232][89, 232]Passed
boundary 5[125, 91, 232, 0, 236][125, 91, 232, 0, 236]Passed
boundary 6[226, 138, 12, 92][226, 138, 12, 92]Passed
control 7[117][117]Passed

SHA-256 / 2f58e4f40fca10bd59d85accb87d5cf33418b48ff6da3d58b875861fa89d7d22

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 1a7435822987301dc054531dead5fa6cced7652c61755253ad6e5646f0c27f9a