{"abstract":"Every pair value above 1023 overflows its field and the rest of the stream is misaligned.","category":"Barcode symbology encoding","checks":8,"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.","contract_signature":"s","evaluation_group":"w2-barcode-symbology-encoding-qr-alnum-bitstream","failed_approach":"A 12-bit field shifts every following pair by one bit.","family":"w2-barcode-symbology-encoding-qr-alnum-bitstream-pair-width","id":"FA-79676","implementations":{"attempt":{"sha256":"a3e56e5c7112364850aff996464ca212394b2d2fb48ee29ee2e2e7bf242fb534","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    ALNUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'\n    if any(c not in ALNUM for c in s):\n        return None\n    bits = ''\n    for i in range(0, len(s) - 1, 2):\n        v = 45 * ALNUM.index(s[i]) + ALNUM.index(s[i + 1])\n        bits += format(v, '012b')\n    if len(s) % 2:\n        bits += format(ALNUM.index(s[-1]), '06b')\n    return bits\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['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']]]\nlabels = [\"regression: pair bit width\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"e490df0fd00cb7e16f08aef6102cad7faa255ad39edfd1ebb75b682ce2bb0576","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    ALNUM = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'\n    if any(c not in ALNUM for c in s):\n        return None\n    bits = ''\n    for i in range(0, len(s) - 1, 2):\n        v = 45 * ALNUM.index(s[i]) + ALNUM.index(s[i + 1])\n        bits += format(v, '010b')\n    if len(s) % 2:\n        bits += format(ALNUM.index(s[-1]), '06b')\n    return bits\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['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']]]\nlabels = [\"regression: pair bit width\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-barcode-symbology-encoding-qr-alnum-bitstream-pair-width","generated_at":"2026-09-29T14:49:46.900148+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"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.","root_cause":"Pairs are formatted with width 10, but 45*45-1 = 2024 needs 11 bits.","sha256":"48858df26abc35a1cbda140259f52a792c7db37d20431e5e3d6b51861086e272","title":"QR alphanumeric pairs are written in 10 bits · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.901,"exit_code":1,"observations":[{"actual":"001100111010101100","check":"regression: pair bit width 0","expected":"01100111010101100","passed":false},{"actual":"001011000111101001","check":"repair trap 1","expected":"01011000111101001","passed":false},{"actual":"","check":"combined fault 2","expected":"","passed":true},{"actual":"100001","check":"control 3","expected":"100001","passed":true},{"actual":"000100","check":"control 4","expected":"000100","passed":true},{"actual":"010101","check":"boundary 5","expected":"010101","passed":true},{"actual":"000010","check":"boundary 6","expected":"000010","passed":true},{"actual":"000111001010001000101100","check":"control 7","expected":"0011100101001000101100","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: pair bit width 0\", \"actual\": \"001100111010101100\", \"expected\": \"01100111010101100\", \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"001011000111101001\", \"expected\": \"01011000111101001\", \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"control 3\", \"actual\": \"100001\", \"expected\": \"100001\", \"passed\": true}, {\"check\": \"control 4\", \"actual\": \"000100\", \"expected\": \"000100\", \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"010101\", \"expected\": \"010101\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"000010\", \"expected\": \"000010\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": \"000111001010001000101100\", \"expected\": \"0011100101001000101100\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.401,"exit_code":1,"observations":[{"actual":"1100111010101100","check":"regression: pair bit width 0","expected":"01100111010101100","passed":false},{"actual":"1011000111101001","check":"repair trap 1","expected":"01011000111101001","passed":false},{"actual":"","check":"combined fault 2","expected":"","passed":true},{"actual":"100001","check":"control 3","expected":"100001","passed":true},{"actual":"000100","check":"control 4","expected":"000100","passed":true},{"actual":"010101","check":"boundary 5","expected":"010101","passed":true},{"actual":"000010","check":"boundary 6","expected":"000010","passed":true},{"actual":"01110010101000101100","check":"control 7","expected":"0011100101001000101100","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: pair bit width 0\", \"actual\": \"1100111010101100\", \"expected\": \"01100111010101100\", \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"1011000111101001\", \"expected\": \"01011000111101001\", \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"control 3\", \"actual\": \"100001\", \"expected\": \"100001\", \"passed\": true}, {\"check\": \"control 4\", \"actual\": \"000100\", \"expected\": \"000100\", \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"010101\", \"expected\": \"010101\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"000010\", \"expected\": \"000010\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": \"01110010101000101100\", \"expected\": \"0011100101001000101100\", \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}