{"abstract":"Even-length strings lose their final two characters.","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":"Bounding the loop by the pair count stops halfway through the string.","family":"w2-barcode-symbology-encoding-qr-alnum-bitstream-pair-loop","id":"FA-79686","implementations":{"attempt":{"sha256":"d858b7ab4a4dfecec403a8804d8871757175d70eea94bd2c2071791b0884d1a3","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) // 2, 2):\n        v = 45 * ALNUM.index(s[i]) + ALNUM.index(s[i + 1])\n        bits += format(v, '011b')\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 = [[['A8CG', '0011100101001000101100'], ['GF7$8C', '010110111110010110000000101110100'], ['', ''], ['IG:', '01100111010101100'], ['X', '100001'], ['R1K', '10011000000010100'], ['F -', '01011000111101001'], ['L1', '01110110010']], [['VK5/1S', '101100001110010000110000001001001'], ['Z6UKSE', '110001011011010101101010011111010'], ['4.KFO8', '000110111100111001001110001000000'], ['', ''], ['E', '001110'], ['S', '011100'], ['F6D', '01010101001001101'], ['I1', '01100101011']], [['20Y%', '0000101101011000100000'], ['Y6WB', '1100000000010110101011'], ['%.HZ', '1101101100001100100000'], ['X', '100001'], ['.O/', '11101111010101011'], ['', ''], ['Q', '011010'], ['$K', '11010010101']], [['OJOU', '1000100101110001010110'], ['4F./', '0001100001111110001101'], ['KCK1$.', '011100100000111000010111010101011'], ['1', '000001'], ['', ''], ['89%', '00101110001100110'], [' ', '100100'], ['R2YP', '1001100000111000010011']], [['EWRZTW', '010100101101001110001010100111001'], ['1T0G9', '0000100101000000010000001001'], [' Y/7', '1100111011011110010110'], ['*', '100111'], ['', ''], ['*UZ', '11011111001100011'], ['GNN', '01011100111010111'], ['VS63', '1011000111100100010001']]]\nlabels = [\"regression: pair loop bound\", \"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":"2db08d2a514fa0d628f8458fe25790c176310b1c1dafcfde56dee1e07afae3e8","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) - 2, 2):\n        v = 45 * ALNUM.index(s[i]) + ALNUM.index(s[i + 1])\n        bits += format(v, '011b')\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 = [[['A8CG', '0011100101001000101100'], ['GF7$8C', '010110111110010110000000101110100'], ['', ''], ['IG:', '01100111010101100'], ['X', '100001'], ['R1K', '10011000000010100'], ['F -', '01011000111101001'], ['L1', '01110110010']], [['VK5/1S', '101100001110010000110000001001001'], ['Z6UKSE', '110001011011010101101010011111010'], ['4.KFO8', '000110111100111001001110001000000'], ['', ''], ['E', '001110'], ['S', '011100'], ['F6D', '01010101001001101'], ['I1', '01100101011']], [['20Y%', '0000101101011000100000'], ['Y6WB', '1100000000010110101011'], ['%.HZ', '1101101100001100100000'], ['X', '100001'], ['.O/', '11101111010101011'], ['', ''], ['Q', '011010'], ['$K', '11010010101']], [['OJOU', '1000100101110001010110'], ['4F./', '0001100001111110001101'], ['KCK1$.', '011100100000111000010111010101011'], ['1', '000001'], ['', ''], ['89%', '00101110001100110'], [' ', '100100'], ['R2YP', '1001100000111000010011']], [['EWRZTW', '010100101101001110001010100111001'], ['1T0G9', '0000100101000000010000001001'], [' Y/7', '1100111011011110010110'], ['*', '100111'], ['', ''], ['*UZ', '11011111001100011'], ['GNN', '01011100111010111'], ['VS63', '1011000111100100010001']]]\nlabels = [\"regression: pair loop bound\", \"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-loop","generated_at":"2026-09-29T14:49:46.900111+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":"The loop stops before the last complete pair.","sha256":"57a1e31ebd3b36262c5bac26712aa1a203037a2d178029fd81d64fe1d2ef97e6","title":"Last alphanumeric pair is dropped · 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":37.956,"exit_code":1,"observations":[{"actual":"00111001010","check":"regression: pair loop bound 0","expected":"0011100101001000101100","passed":false},{"actual":"0101101111100101100000","check":"repair trap 1","expected":"010110111110010110000000101110100","passed":false},{"actual":"","check":"combined fault 2","expected":"","passed":true},{"actual":"01100111010101100","check":"control 3","expected":"01100111010101100","passed":true},{"actual":"100001","check":"control 4","expected":"100001","passed":true},{"actual":"10011000000010100","check":"boundary 5","expected":"10011000000010100","passed":true},{"actual":"01011000111101001","check":"boundary 6","expected":"01011000111101001","passed":true},{"actual":"01110110010","check":"control 7","expected":"01110110010","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: pair loop bound 0\", \"actual\": \"00111001010\", \"expected\": \"0011100101001000101100\", \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"0101101111100101100000\", \"expected\": \"010110111110010110000000101110100\", \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"control 3\", \"actual\": \"01100111010101100\", \"expected\": \"01100111010101100\", \"passed\": true}, {\"check\": \"control 4\", \"actual\": \"100001\", \"expected\": \"100001\", \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"10011000000010100\", \"expected\": \"10011000000010100\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"01011000111101001\", \"expected\": \"01011000111101001\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": \"01110110010\", \"expected\": \"01110110010\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.924,"exit_code":1,"observations":[{"actual":"00111001010","check":"regression: pair loop bound 0","expected":"0011100101001000101100","passed":false},{"actual":"0101101111100101100000","check":"repair trap 1","expected":"010110111110010110000000101110100","passed":false},{"actual":"","check":"combined fault 2","expected":"","passed":true},{"actual":"01100111010101100","check":"control 3","expected":"01100111010101100","passed":true},{"actual":"100001","check":"control 4","expected":"100001","passed":true},{"actual":"10011000000010100","check":"boundary 5","expected":"10011000000010100","passed":true},{"actual":"01011000111101001","check":"boundary 6","expected":"01011000111101001","passed":true},{"actual":"","check":"control 7","expected":"01110110010","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: pair loop bound 0\", \"actual\": \"00111001010\", \"expected\": \"0011100101001000101100\", \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"0101101111100101100000\", \"expected\": \"010110111110010110000000101110100\", \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"control 3\", \"actual\": \"01100111010101100\", \"expected\": \"01100111010101100\", \"passed\": true}, {\"check\": \"control 4\", \"actual\": \"100001\", \"expected\": \"100001\", \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"10011000000010100\", \"expected\": \"10011000000010100\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"01011000111101001\", \"expected\": \"01011000111101001\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": \"\", \"expected\": \"01110110010\", \"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."}}