FA-79701 / Barcode symbology encoding / Open access
QR pad codewords start with 0x11 · case 01
Strict decoders flag the pad sequence and some generators produce different symbols for the same data.
ROOT CAUSE
The alternating pad bytes start with 0x11 instead of 0xEC.
THE FAILURE
The alternating pad bytes start with 0x11 instead of 0xEC.
Unsuccessful approach: Repeating 0xEC drops the alternation.
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 = [0x11, 0xEC]
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 = [[[('011111010101101111101000', 5), [125, 91, 232, 0, 236]], [('11000111110010110000011101', 7), [199, 203, 7, 64, 236, 17, 236]], [('11111010', 4), [250, 0, 236, 17]], [('11110', 1), [240]], [('10111110000100110101101101110110', 4), [190, 19, 91, 118]], [('010010001010011000110010101000', 4), [72, 166, 50, 160]], [('01110101', 1), [117]], [('00001110010101111011010001101111', 6), [14, 87, 180, 111, 0, 236]]], [[('010111100111111111101011010111010101', 6), [94, 127, 235, 93, 80, 236]], [('1100010000000100010111100', 6), [196, 4, 94, 0, 236, 17]], [('0000011111000010', 5), [7, 194, 0, 236, 17]], [('10110001011011111', 2), None], [('00101010101111110010011110110010011100110', 5), None], [('000100', 1), [16]], [('0110001100001', 2), [99, 8]], [('1001000010010100100111111101111110011111', 7), [144, 148, 159, 223, 159, 0, 236]]], [[('0110000101010010', 7), [97, 82, 0, 236, 17, 236, 17]], [('00111100', 4), [60, 0, 236, 17]], [('10110101', 1), [181]], [('1011011', 1), [182]], [('011000110111001010011001100110101001', 5), [99, 114, 153, 154, 144]], [('0101101001011000000111111001001110110111010010101000', 7), [90, 88, 31, 147, 183, 74, 128]], [('11010010000000100000001', 4), [210, 2, 2, 0]], [('', 5), [0, 236, 17, 236, 17]]], [[('10110100010010101010', 6), [180, 74, 160, 236, 17, 236]], [('', 4), [0, 236, 17, 236]], [('00011', 1), [24]], [('0001101010100101110100100000001001110111000110110', 6), None], [('01000011', 2), [67, 0]], [('10110010', 2), [178, 0]], [('0011011001010010110110011110111001111101', 5), [54, 82, 217, 238, 125]], [('0011001110001010', 6), [51, 138, 0, 236, 17, 236]]], [[('10011001111', 6), [153, 224, 236, 17, 236, 17]], [('00110110', 5), [54, 0, 236, 17, 236]], [('1100010100110', 7), [197, 48, 0, 236, 17, 236, 17]], [('101000101010111110000010011010001', 4), None], [('010001110011110110111010011110011100001110101010100001101', 7), None], [('1001000010101110001111000110111010001110', 5), [144, 174, 60, 110, 142]], [('000101100', 1), None], [('11001010', 5), [202, 0, 236, 17, 236]]]]
labels = ["regression: pad codeword sequence", "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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: pad codeword sequence 0 | [125, 91, 232, 0, 17] | [125, 91, 232, 0, 236] | Failed |
| repair trap 1 | [199, 203, 7, 64, 17, 236, 17] | [199, 203, 7, 64, 236, 17, 236] | Failed |
| combined fault 2 | [250, 0, 17, 236] | [250, 0, 236, 17] | Failed |
| control 3 | [240] | [240] | Passed |
| control 4 | [190, 19, 91, 118] | [190, 19, 91, 118] | Passed |
| boundary 5 | [72, 166, 50, 160] | [72, 166, 50, 160] | Passed |
| boundary 6 | [117] | [117] | Passed |
| control 7 | [14, 87, 180, 111, 0, 17] | [14, 87, 180, 111, 0, 236] | Failed |
SHA-256 / dff8fd4bade37dc288b5df396ab60a4b2bb81231f52fd686ad5d05ede60b9751
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:
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, 0xEC]
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 = [[[('011111010101101111101000', 5), [125, 91, 232, 0, 236]], [('11000111110010110000011101', 7), [199, 203, 7, 64, 236, 17, 236]], [('11111010', 4), [250, 0, 236, 17]], [('11110', 1), [240]], [('10111110000100110101101101110110', 4), [190, 19, 91, 118]], [('010010001010011000110010101000', 4), [72, 166, 50, 160]], [('01110101', 1), [117]], [('00001110010101111011010001101111', 6), [14, 87, 180, 111, 0, 236]]], [[('010111100111111111101011010111010101', 6), [94, 127, 235, 93, 80, 236]], [('1100010000000100010111100', 6), [196, 4, 94, 0, 236, 17]], [('0000011111000010', 5), [7, 194, 0, 236, 17]], [('10110001011011111', 2), None], [('00101010101111110010011110110010011100110', 5), None], [('000100', 1), [16]], [('0110001100001', 2), [99, 8]], [('1001000010010100100111111101111110011111', 7), [144, 148, 159, 223, 159, 0, 236]]], [[('0110000101010010', 7), [97, 82, 0, 236, 17, 236, 17]], [('00111100', 4), [60, 0, 236, 17]], [('10110101', 1), [181]], [('1011011', 1), [182]], [('011000110111001010011001100110101001', 5), [99, 114, 153, 154, 144]], [('0101101001011000000111111001001110110111010010101000', 7), [90, 88, 31, 147, 183, 74, 128]], [('11010010000000100000001', 4), [210, 2, 2, 0]], [('', 5), [0, 236, 17, 236, 17]]], [[('10110100010010101010', 6), [180, 74, 160, 236, 17, 236]], [('', 4), [0, 236, 17, 236]], [('00011', 1), [24]], [('0001101010100101110100100000001001110111000110110', 6), None], [('01000011', 2), [67, 0]], [('10110010', 2), [178, 0]], [('0011011001010010110110011110111001111101', 5), [54, 82, 217, 238, 125]], [('0011001110001010', 6), [51, 138, 0, 236, 17, 236]]], [[('10011001111', 6), [153, 224, 236, 17, 236, 17]], [('00110110', 5), [54, 0, 236, 17, 236]], [('1100010100110', 7), [197, 48, 0, 236, 17, 236, 17]], [('101000101010111110000010011010001', 4), None], [('010001110011110110111010011110011100001110101010100001101', 7), None], [('1001000010101110001111000110111010001110', 5), [144, 174, 60, 110, 142]], [('000101100', 1), None], [('11001010', 5), [202, 0, 236, 17, 236]]]]
labels = ["regression: pad codeword sequence", "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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: pad codeword sequence 0 | [125, 91, 232, 0, 236] | [125, 91, 232, 0, 236] | Passed |
| repair trap 1 | [199, 203, 7, 64, 236, 236, 236] | [199, 203, 7, 64, 236, 17, 236] | Failed |
| combined fault 2 | [250, 0, 236, 236] | [250, 0, 236, 17] | Failed |
| control 3 | [240] | [240] | Passed |
| control 4 | [190, 19, 91, 118] | [190, 19, 91, 118] | Passed |
| boundary 5 | [72, 166, 50, 160] | [72, 166, 50, 160] | Passed |
| boundary 6 | [117] | [117] | Passed |
| control 7 | [14, 87, 180, 111, 0, 236] | [14, 87, 180, 111, 0, 236] | Passed |
SHA-256 / a6469e4ddd1e87521629c0f944c1f647518b7ef3ad3837b13eeab2578724dcae
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.984801+00:00.
Case digest / 41d8da9ac35a6963bd0668ec30af01cadc0c0ca7f0aefffda9f0bf9c4dbb76ed