FA-79676 / Barcode symbology encoding / Open access
QR alphanumeric pairs are written in 10 bits · case 01
Every pair value above 1023 overflows its field and the rest of the stream is misaligned.
ROOT CAUSE
Pairs are formatted with width 10, but 45*45-1 = 2024 needs 11 bits.
VERIFIED REPAIR
Write each pair value in exactly 11 bits.
Unsuccessful approach: A 12-bit field shifts every following pair by one bit.
Case contract
Encode the data part of a QR alphanumeric segment. Character values: 0-9 -> 0-9, A-Z -> 10-35, space 36, $ 37, % 38, * 39, + 40, - 41, . 42, / 43, : 44. Each pair becomes 45*first + second in 11 bits, a final single character becomes its value in 6 bits. Characters outside the set return None.
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(s):
ALNUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
if any(c not in ALNUM for c in s):
return None
bits = ''
for i in range(0, len(s) - 1, 2):
v = 45 * ALNUM.index(s[i]) + ALNUM.index(s[i + 1])
bits += format(v, '010b')
if len(s) % 2:
bits += format(ALNUM.index(s[-1]), '06b')
return bits
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['IG:', '01100111010101100'], ['F -', '01011000111101001'], ['', ''], ['X', '100001'], ['4', '000100'], ['L', '010101'], ['2', '000010'], ['A8CG', '0011100101001000101100']], [['VK5/1S', '101100001110010000110000001001001'], [':HKK4', '1111100110101110011000000100'], ['KX', '01110100101'], ['E', '001110'], ['', ''], ['S', '011100'], ['-', '101001'], ['I1', '01100101011']], [['ZMHUK', '1100011110101100011011010100'], ['Y6WB', '1100000000010110101011'], ['$FBR8T', '110100100000100000101000110000101'], ['X', '100001'], ['', ''], ['Q', '011010'], ['9', '001001'], ['20Y%', '0000101101011000100000']], [['4F./', '0001100001111110001101'], ['P.9 MW9', '100100011110011011100101111111110001001'], ['FO', '01010111011'], ['', ''], [' ', '100100'], ['F', '001111'], ['M', '010110'], ['HE9', '01100001011001001']], [['ANFC$Q/', '001110110010101010111111010011011101011'], ['RBW3-', '1001100101010110100011101001'], ['IE4+S', '0110011100000011011100011100'], ['', ''], ['P', '011001'], ['H', '010001'], ['D', '001101'], [':ZKI6O', '111110111110111001011000100100110']]]
labels = ["regression: pair bit width", "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: pair bit width 0 | 1100111010101100 | 01100111010101100 | Failed |
| repair trap 1 | 1011000111101001 | 01011000111101001 | Failed |
| combined fault 2 | | | Passed |
| control 3 | 100001 | 100001 | Passed |
| control 4 | 000100 | 000100 | Passed |
| boundary 5 | 010101 | 010101 | Passed |
| boundary 6 | 000010 | 000010 | Passed |
| control 7 | 01110010101000101100 | 0011100101001000101100 | Failed |
SHA-256 / e490df0fd00cb7e16f08aef6102cad7faa255ad39edfd1ebb75b682ce2bb0576
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
ALNUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
if any(c not in ALNUM for c in s):
return None
bits = ''
for i in range(0, len(s) - 1, 2):
v = 45 * ALNUM.index(s[i]) + ALNUM.index(s[i + 1])
bits += format(v, '012b')
if len(s) % 2:
bits += format(ALNUM.index(s[-1]), '06b')
return bits
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['IG:', '01100111010101100'], ['F -', '01011000111101001'], ['', ''], ['X', '100001'], ['4', '000100'], ['L', '010101'], ['2', '000010'], ['A8CG', '0011100101001000101100']], [['VK5/1S', '101100001110010000110000001001001'], [':HKK4', '1111100110101110011000000100'], ['KX', '01110100101'], ['E', '001110'], ['', ''], ['S', '011100'], ['-', '101001'], ['I1', '01100101011']], [['ZMHUK', '1100011110101100011011010100'], ['Y6WB', '1100000000010110101011'], ['$FBR8T', '110100100000100000101000110000101'], ['X', '100001'], ['', ''], ['Q', '011010'], ['9', '001001'], ['20Y%', '0000101101011000100000']], [['4F./', '0001100001111110001101'], ['P.9 MW9', '100100011110011011100101111111110001001'], ['FO', '01010111011'], ['', ''], [' ', '100100'], ['F', '001111'], ['M', '010110'], ['HE9', '01100001011001001']], [['ANFC$Q/', '001110110010101010111111010011011101011'], ['RBW3-', '1001100101010110100011101001'], ['IE4+S', '0110011100000011011100011100'], ['', ''], ['P', '011001'], ['H', '010001'], ['D', '001101'], [':ZKI6O', '111110111110111001011000100100110']]]
labels = ["regression: pair bit width", "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: pair bit width 0 | 001100111010101100 | 01100111010101100 | Failed |
| repair trap 1 | 001011000111101001 | 01011000111101001 | Failed |
| combined fault 2 | | | Passed |
| control 3 | 100001 | 100001 | Passed |
| control 4 | 000100 | 000100 | Passed |
| boundary 5 | 010101 | 010101 | Passed |
| boundary 6 | 000010 | 000010 | Passed |
| control 7 | 000111001010001000101100 | 0011100101001000101100 | Failed |
SHA-256 / a3e56e5c7112364850aff996464ca212394b2d2fb48ee29ee2e2e7bf242fb534
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
ALNUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
if any(c not in ALNUM for c in s):
return None
bits = ''
for i in range(0, len(s) - 1, 2):
v = 45 * ALNUM.index(s[i]) + ALNUM.index(s[i + 1])
bits += format(v, '011b')
if len(s) % 2:
bits += format(ALNUM.index(s[-1]), '06b')
return bits
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['IG:', '01100111010101100'], ['F -', '01011000111101001'], ['', ''], ['X', '100001'], ['4', '000100'], ['L', '010101'], ['2', '000010'], ['A8CG', '0011100101001000101100']], [['VK5/1S', '101100001110010000110000001001001'], [':HKK4', '1111100110101110011000000100'], ['KX', '01110100101'], ['E', '001110'], ['', ''], ['S', '011100'], ['-', '101001'], ['I1', '01100101011']], [['ZMHUK', '1100011110101100011011010100'], ['Y6WB', '1100000000010110101011'], ['$FBR8T', '110100100000100000101000110000101'], ['X', '100001'], ['', ''], ['Q', '011010'], ['9', '001001'], ['20Y%', '0000101101011000100000']], [['4F./', '0001100001111110001101'], ['P.9 MW9', '100100011110011011100101111111110001001'], ['FO', '01010111011'], ['', ''], [' ', '100100'], ['F', '001111'], ['M', '010110'], ['HE9', '01100001011001001']], [['ANFC$Q/', '001110110010101010111111010011011101011'], ['RBW3-', '1001100101010110100011101001'], ['IE4+S', '0110011100000011011100011100'], ['', ''], ['P', '011001'], ['H', '010001'], ['D', '001101'], [':ZKI6O', '111110111110111001011000100100110']]]
labels = ["regression: pair bit width", "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: pair bit width 0 | 01100111010101100 | 01100111010101100 | Passed |
| repair trap 1 | 01011000111101001 | 01011000111101001 | Passed |
| combined fault 2 | | | Passed |
| control 3 | 100001 | 100001 | Passed |
| control 4 | 000100 | 000100 | Passed |
| boundary 5 | 010101 | 010101 | Passed |
| boundary 6 | 000010 | 000010 | Passed |
| control 7 | 0011100101001000101100 | 0011100101001000101100 | Passed |
SHA-256 / 3277a10901c6a78e5db13041ed09dc4880a51f9a3f81a33472c887194f7513e8
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.900148+00:00.
Case digest / 5547893948548fc3ec90771f05f812c1cdf1171662360c2c71440ef2aae900b8