{"abstract":"Scanned text has every pair of characters swapped, so \"AC\" reads as \"CA\".","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 base of 44 makes distinct pairs collide.","family":"w2-barcode-symbology-encoding-qr-alnum-bitstream-pair-weight","id":"FA-79671","implementations":{"attempt":{"sha256":"b78012f5a00b8bdde915f0536ce04ba49da4b15e9164620e5abdda475573fac0","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 = 44 * 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 = [[['IG:', '01100111010101100'], ['R1K', '10011000000010100'], ['', ''], ['X', '100001'], ['4', '000100'], ['L', '010101'], ['2', '000010'], ['A8CG', '0011100101001000101100']], [[':HKK4', '1111100110101110011000000100'], ['0-KJ', '0000010100101110010111'], ['E', '001110'], ['', ''], ['S', '011100'], ['-', '101001'], [':', '101100'], ['Z6UKSE', '110001011011010101101010011111010']], [['Y6WB', '1100000000010110101011'], ['EAB AB', '010100000000100001001100111001101'], ['X', '100001'], ['', ''], ['Q', '011010'], ['9', '001001'], ['2', '000010'], ['T:XJ6', '1010100010110111100000000110']], [['P.9 MW9', '100100011110011011100101111111110001001'], ['M12BT%B', '011110111110000110010110100111111001011'], ['', ''], [' ', '100100'], ['F', '001111'], ['M', '010110'], ['*', '100111'], ['HE9', '01100001011001001']], [['RBW3-', '1001100101010110100011101001'], ['EG$9', '0101000011011010001010'], ['', ''], ['P', '011001'], ['H', '010001'], ['D', '001101'], ['M', '010110'], ['TY9', '10100111011001001']]]\nlabels = [\"regression: pair value weighting\", \"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":"2d1758b488eddf964e9782d54f3ae37f59127ded252a88f79a15b3625d45a670","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 = ALNUM.index(s[i]) + 45 * 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 = [[['IG:', '01100111010101100'], ['R1K', '10011000000010100'], ['', ''], ['X', '100001'], ['4', '000100'], ['L', '010101'], ['2', '000010'], ['A8CG', '0011100101001000101100']], [[':HKK4', '1111100110101110011000000100'], ['0-KJ', '0000010100101110010111'], ['E', '001110'], ['', ''], ['S', '011100'], ['-', '101001'], [':', '101100'], ['Z6UKSE', '110001011011010101101010011111010']], [['Y6WB', '1100000000010110101011'], ['EAB AB', '010100000000100001001100111001101'], ['X', '100001'], ['', ''], ['Q', '011010'], ['9', '001001'], ['2', '000010'], ['T:XJ6', '1010100010110111100000000110']], [['P.9 MW9', '100100011110011011100101111111110001001'], ['M12BT%B', '011110111110000110010110100111111001011'], ['', ''], [' ', '100100'], ['F', '001111'], ['M', '010110'], ['*', '100111'], ['HE9', '01100001011001001']], [['RBW3-', '1001100101010110100011101001'], ['EG$9', '0101000011011010001010'], ['', ''], ['P', '011001'], ['H', '010001'], ['D', '001101'], ['M', '010110'], ['TY9', '10100111011001001']]]\nlabels = [\"regression: pair value weighting\", \"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-weight","generated_at":"2026-09-29T14:49:46.685455+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 multiplier 45 is applied to the second character of the pair.","sha256":"795fa3504461346e07b2311f77e60a208dcdaf34ca166d411f757ef70c39e110","title":"QR alphanumeric pairs weight the second character · 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":39.248,"exit_code":1,"observations":[{"actual":"01100101000101100","check":"regression: pair value weighting 0","expected":"01100111010101100","passed":false},{"actual":"10010100101010100","check":"repair trap 1","expected":"10011000000010100","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":"0011100000001000100000","check":"control 7","expected":"0011100101001000101100","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: pair value weighting 0\", \"actual\": \"01100101000101100\", \"expected\": \"01100111010101100\", \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"10010100101010100\", \"expected\": \"10011000000010100\", \"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\": \"0011100000001000100000\", \"expected\": \"0011100101001000101100\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.651,"exit_code":1,"observations":[{"actual":"01011100010101100","check":"regression: pair value weighting 0","expected":"01100111010101100","passed":false},{"actual":"00001001000010100","check":"repair trap 1","expected":"10011000000010100","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":"0010111001001011011100","check":"control 7","expected":"0011100101001000101100","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: pair value weighting 0\", \"actual\": \"01011100010101100\", \"expected\": \"01100111010101100\", \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"00001001000010100\", \"expected\": \"10011000000010100\", \"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\": \"0010111001001011011100\", \"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."}}