{"abstract":"Every letter decodes as its predecessor in the alphabet.","category":"Barcode symbology encoding","checks":8,"contract":"Data Matrix ASCII encodation into `capacity` data codewords: two consecutive ASCII digits become 130 + their value; ASCII 0..127 becomes ord + 1; 128..255 becomes Upper Shift 235 then ord - 127; higher code points are unencodable. Too many codewords -> overflow. Padding: the first pad is 129; each later pad at 1-based position p is 129 + ((149 * p) mod 253) + 1, minus 254 if above 254.","evaluation_group":"w2-barcode-symbology-encoding-datamatrix-ascii","failed_approach":"Subtracting one shifts in the opposite direction.","family":"w2-barcode-symbology-encoding-datamatrix-ascii-ascii-offset","id":"FA-79791","implementations":{"attempt":{"sha256":"2f94b5dca7f133d4d8a44bbce3794827c3f251a15734d470f279e82ee95d3f57","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, capacity):\n    cw = []\n    i = 0\n    while i < len(text):\n        c = text[i]\n        if c in '0123456789' and i + 1 < len(text) and text[i + 1] in '0123456789':\n            cw.append(130 + int(text[i:i + 2]))\n            i += 2\n            continue\n        o = ord(c)\n        if o > 255:\n            return {'error': 'unencodable'}\n        if o > 127:\n            cw += [235, o - 127]\n        else:\n            cw.append(o - 1)\n        i += 1\n    if len(cw) > capacity:\n        return {'error': 'overflow'}\n    if len(cw) < capacity:\n        cw.append(129)\n    while len(cw) < capacity:\n        p = len(cw) + 1\n        v = 129 + ((149 * p) % 253) + 1\n        if v > 254:\n            v -= 254\n        cw.append(v)\n    return cw\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('99x', 5), [229, 121, 129, 220, 115]], [('\\x800', 7), [235, 1, 49, 129, 115, 11, 161]], [('', 6), [129, 175, 70, 220, 115, 11]], [('', 11), [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251]], [('\\x80', 4), [235, 1, 129, 220]], [('0AB12', 3), {'error': 'overflow'}], [('ABé', 1), {'error': 'overflow'}], [('é99AB0', 10), [235, 106, 229, 66, 67, 49, 129, 56, 206, 101]]], [[(' AB', 4), [33, 66, 67, 129]], [(' x99x', 10), [33, 121, 229, 121, 129, 11, 161, 56, 206, 101]], [('ABxx', 2), {'error': 'overflow'}], [('', 2), [129, 175]], [('x€', 10), {'error': 'unencodable'}], [(' 125', 1), {'error': 'overflow'}], [('99€x', 6), {'error': 'unencodable'}], [('0', 9), [49, 129, 70, 220, 115, 11, 161, 56, 206]]], [[('0', 2), [49, 129]], [('x', 12), [121, 129, 70, 220, 115, 11, 161, 56, 206, 101, 251, 147]], [('é€5', 6), {'error': 'unencodable'}], [('éé', 3), {'error': 'overflow'}], [('é\\x80\\x80', 3), {'error': 'overflow'}], [('', 4), [129, 175, 70, 220]], [('', 5), [129, 175, 70, 220, 115]], [('éÿ5', 9), [235, 106, 235, 128, 54, 129, 161, 56, 206]]], [[('\\x80x0', 5), [235, 1, 121, 49, 129]], [('0 ÿ5', 5), [49, 33, 235, 128, 54]], [('', 6), [129, 175, 70, 220, 115, 11]], [('\\x8012x5', 1), {'error': 'overflow'}], [(' €ÿ\\x80', 5), {'error': 'unencodable'}], [('', 11), [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251]], [('', 8), [129, 175, 70, 220, 115, 11, 161, 56]], [('0xÿ', 8), [49, 121, 235, 128, 129, 11, 161, 56]]], [[('AB\\x805AB', 8), [66, 67, 235, 1, 54, 66, 67, 129]], [('AB', 12), [66, 67, 129, 220, 115, 11, 161, 56, 206, 101, 251, 147]], [('990', 1), {'error': 'overflow'}], [('599AB€', 8), {'error': 'unencodable'}], [('', 7), [129, 175, 70, 220, 115, 11, 161]], [('05', 7), [135, 129, 70, 220, 115, 11, 161]], [('\\x80€ 0', 8), {'error': 'unencodable'}], [('5', 2), [54, 129]]]]\nlabels = [\"regression: ASCII codeword offset\", \"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":"d6d8c6adc32f7fe1b9d9be7092475e8e2fd16eee3b8b2c283cbb8dd8162c0052","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, capacity):\n    cw = []\n    i = 0\n    while i < len(text):\n        c = text[i]\n        if c in '0123456789' and i + 1 < len(text) and text[i + 1] in '0123456789':\n            cw.append(130 + int(text[i:i + 2]))\n            i += 2\n            continue\n        o = ord(c)\n        if o > 255:\n            return {'error': 'unencodable'}\n        if o > 127:\n            cw += [235, o - 127]\n        else:\n            cw.append(o)\n        i += 1\n    if len(cw) > capacity:\n        return {'error': 'overflow'}\n    if len(cw) < capacity:\n        cw.append(129)\n    while len(cw) < capacity:\n        p = len(cw) + 1\n        v = 129 + ((149 * p) % 253) + 1\n        if v > 254:\n            v -= 254\n        cw.append(v)\n    return cw\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('99x', 5), [229, 121, 129, 220, 115]], [('\\x800', 7), [235, 1, 49, 129, 115, 11, 161]], [('', 6), [129, 175, 70, 220, 115, 11]], [('', 11), [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251]], [('\\x80', 4), [235, 1, 129, 220]], [('0AB12', 3), {'error': 'overflow'}], [('ABé', 1), {'error': 'overflow'}], [('é99AB0', 10), [235, 106, 229, 66, 67, 49, 129, 56, 206, 101]]], [[(' AB', 4), [33, 66, 67, 129]], [(' x99x', 10), [33, 121, 229, 121, 129, 11, 161, 56, 206, 101]], [('ABxx', 2), {'error': 'overflow'}], [('', 2), [129, 175]], [('x€', 10), {'error': 'unencodable'}], [(' 125', 1), {'error': 'overflow'}], [('99€x', 6), {'error': 'unencodable'}], [('0', 9), [49, 129, 70, 220, 115, 11, 161, 56, 206]]], [[('0', 2), [49, 129]], [('x', 12), [121, 129, 70, 220, 115, 11, 161, 56, 206, 101, 251, 147]], [('é€5', 6), {'error': 'unencodable'}], [('éé', 3), {'error': 'overflow'}], [('é\\x80\\x80', 3), {'error': 'overflow'}], [('', 4), [129, 175, 70, 220]], [('', 5), [129, 175, 70, 220, 115]], [('éÿ5', 9), [235, 106, 235, 128, 54, 129, 161, 56, 206]]], [[('\\x80x0', 5), [235, 1, 121, 49, 129]], [('0 ÿ5', 5), [49, 33, 235, 128, 54]], [('', 6), [129, 175, 70, 220, 115, 11]], [('\\x8012x5', 1), {'error': 'overflow'}], [(' €ÿ\\x80', 5), {'error': 'unencodable'}], [('', 11), [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251]], [('', 8), [129, 175, 70, 220, 115, 11, 161, 56]], [('0xÿ', 8), [49, 121, 235, 128, 129, 11, 161, 56]]], [[('AB\\x805AB', 8), [66, 67, 235, 1, 54, 66, 67, 129]], [('AB', 12), [66, 67, 129, 220, 115, 11, 161, 56, 206, 101, 251, 147]], [('990', 1), {'error': 'overflow'}], [('599AB€', 8), {'error': 'unencodable'}], [('', 7), [129, 175, 70, 220, 115, 11, 161]], [('05', 7), [135, 129, 70, 220, 115, 11, 161]], [('\\x80€ 0', 8), {'error': 'unencodable'}], [('5', 2), [54, 129]]]]\nlabels = [\"regression: ASCII codeword offset\", \"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"},"fixed":{"sha256":"c37d26199f3fe267ee226e36eed2159bceb65dbd83af0c52686399e1e0c6f791","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, capacity):\n    cw = []\n    i = 0\n    while i < len(text):\n        c = text[i]\n        if c in '0123456789' and i + 1 < len(text) and text[i + 1] in '0123456789':\n            cw.append(130 + int(text[i:i + 2]))\n            i += 2\n            continue\n        o = ord(c)\n        if o > 255:\n            return {'error': 'unencodable'}\n        if o > 127:\n            cw += [235, o - 127]\n        else:\n            cw.append(o + 1)\n        i += 1\n    if len(cw) > capacity:\n        return {'error': 'overflow'}\n    if len(cw) < capacity:\n        cw.append(129)\n    while len(cw) < capacity:\n        p = len(cw) + 1\n        v = 129 + ((149 * p) % 253) + 1\n        if v > 254:\n            v -= 254\n        cw.append(v)\n    return cw\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('99x', 5), [229, 121, 129, 220, 115]], [('\\x800', 7), [235, 1, 49, 129, 115, 11, 161]], [('', 6), [129, 175, 70, 220, 115, 11]], [('', 11), [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251]], [('\\x80', 4), [235, 1, 129, 220]], [('0AB12', 3), {'error': 'overflow'}], [('ABé', 1), {'error': 'overflow'}], [('é99AB0', 10), [235, 106, 229, 66, 67, 49, 129, 56, 206, 101]]], [[(' AB', 4), [33, 66, 67, 129]], [(' x99x', 10), [33, 121, 229, 121, 129, 11, 161, 56, 206, 101]], [('ABxx', 2), {'error': 'overflow'}], [('', 2), [129, 175]], [('x€', 10), {'error': 'unencodable'}], [(' 125', 1), {'error': 'overflow'}], [('99€x', 6), {'error': 'unencodable'}], [('0', 9), [49, 129, 70, 220, 115, 11, 161, 56, 206]]], [[('0', 2), [49, 129]], [('x', 12), [121, 129, 70, 220, 115, 11, 161, 56, 206, 101, 251, 147]], [('é€5', 6), {'error': 'unencodable'}], [('éé', 3), {'error': 'overflow'}], [('é\\x80\\x80', 3), {'error': 'overflow'}], [('', 4), [129, 175, 70, 220]], [('', 5), [129, 175, 70, 220, 115]], [('éÿ5', 9), [235, 106, 235, 128, 54, 129, 161, 56, 206]]], [[('\\x80x0', 5), [235, 1, 121, 49, 129]], [('0 ÿ5', 5), [49, 33, 235, 128, 54]], [('', 6), [129, 175, 70, 220, 115, 11]], [('\\x8012x5', 1), {'error': 'overflow'}], [(' €ÿ\\x80', 5), {'error': 'unencodable'}], [('', 11), [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251]], [('', 8), [129, 175, 70, 220, 115, 11, 161, 56]], [('0xÿ', 8), [49, 121, 235, 128, 129, 11, 161, 56]]], [[('AB\\x805AB', 8), [66, 67, 235, 1, 54, 66, 67, 129]], [('AB', 12), [66, 67, 129, 220, 115, 11, 161, 56, 206, 101, 251, 147]], [('990', 1), {'error': 'overflow'}], [('599AB€', 8), {'error': 'unencodable'}], [('', 7), [129, 175, 70, 220, 115, 11, 161]], [('05', 7), [135, 129, 70, 220, 115, 11, 161]], [('\\x80€ 0', 8), {'error': 'unencodable'}], [('5', 2), [54, 129]]]]\nlabels = [\"regression: ASCII codeword offset\", \"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-datamatrix-ascii-ascii-offset","generated_at":"2026-09-29T14:49:47.652574+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.","repair":"Write ord(c) + 1.","root_cause":"ASCII characters are written as their code point without the +1 offset.","sha256":"21bfbdb9985f41de534955099407affdbee7a17e8cfe8a39673d34ad42299d92","title":"Data Matrix ASCII values are not offset by one · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.959,"exit_code":1,"observations":[{"actual":[229,119,129,220,115],"check":"regression: ASCII codeword offset 0","expected":[229,121,129,220,115],"passed":false},{"actual":[235,1,47,129,115,11,161],"check":"repair trap 1","expected":[235,1,49,129,115,11,161],"passed":false},{"actual":[129,175,70,220,115,11],"check":"combined fault 2","expected":[129,175,70,220,115,11],"passed":true},{"actual":[129,175,70,220,115,11,161,56,206,101,251],"check":"control 3","expected":[129,175,70,220,115,11,161,56,206,101,251],"passed":true},{"actual":[235,1,129,220],"check":"control 4","expected":[235,1,129,220],"passed":true},{"actual":{"error":"overflow"},"check":"boundary 5","expected":{"error":"overflow"},"passed":true},{"actual":{"error":"overflow"},"check":"boundary 6","expected":{"error":"overflow"},"passed":true},{"actual":[235,106,229,64,65,47,129,56,206,101],"check":"control 7","expected":[235,106,229,66,67,49,129,56,206,101],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: ASCII codeword offset 0\", \"actual\": [229, 119, 129, 220, 115], \"expected\": [229, 121, 129, 220, 115], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [235, 1, 47, 129, 115, 11, 161], \"expected\": [235, 1, 49, 129, 115, 11, 161], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [129, 175, 70, 220, 115, 11], \"expected\": [129, 175, 70, 220, 115, 11], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251], \"expected\": [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [235, 1, 129, 220], \"expected\": [235, 1, 129, 220], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": {\"error\": \"overflow\"}, \"expected\": {\"error\": \"overflow\"}, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": {\"error\": \"overflow\"}, \"expected\": {\"error\": \"overflow\"}, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [235, 106, 229, 64, 65, 47, 129, 56, 206, 101], \"expected\": [235, 106, 229, 66, 67, 49, 129, 56, 206, 101], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.955,"exit_code":1,"observations":[{"actual":[229,120,129,220,115],"check":"regression: ASCII codeword offset 0","expected":[229,121,129,220,115],"passed":false},{"actual":[235,1,48,129,115,11,161],"check":"repair trap 1","expected":[235,1,49,129,115,11,161],"passed":false},{"actual":[129,175,70,220,115,11],"check":"combined fault 2","expected":[129,175,70,220,115,11],"passed":true},{"actual":[129,175,70,220,115,11,161,56,206,101,251],"check":"control 3","expected":[129,175,70,220,115,11,161,56,206,101,251],"passed":true},{"actual":[235,1,129,220],"check":"control 4","expected":[235,1,129,220],"passed":true},{"actual":{"error":"overflow"},"check":"boundary 5","expected":{"error":"overflow"},"passed":true},{"actual":{"error":"overflow"},"check":"boundary 6","expected":{"error":"overflow"},"passed":true},{"actual":[235,106,229,65,66,48,129,56,206,101],"check":"control 7","expected":[235,106,229,66,67,49,129,56,206,101],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: ASCII codeword offset 0\", \"actual\": [229, 120, 129, 220, 115], \"expected\": [229, 121, 129, 220, 115], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [235, 1, 48, 129, 115, 11, 161], \"expected\": [235, 1, 49, 129, 115, 11, 161], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [129, 175, 70, 220, 115, 11], \"expected\": [129, 175, 70, 220, 115, 11], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251], \"expected\": [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [235, 1, 129, 220], \"expected\": [235, 1, 129, 220], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": {\"error\": \"overflow\"}, \"expected\": {\"error\": \"overflow\"}, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": {\"error\": \"overflow\"}, \"expected\": {\"error\": \"overflow\"}, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [235, 106, 229, 65, 66, 48, 129, 56, 206, 101], \"expected\": [235, 106, 229, 66, 67, 49, 129, 56, 206, 101], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.465,"exit_code":0,"observations":[{"actual":[229,121,129,220,115],"check":"regression: ASCII codeword offset 0","expected":[229,121,129,220,115],"passed":true},{"actual":[235,1,49,129,115,11,161],"check":"repair trap 1","expected":[235,1,49,129,115,11,161],"passed":true},{"actual":[129,175,70,220,115,11],"check":"combined fault 2","expected":[129,175,70,220,115,11],"passed":true},{"actual":[129,175,70,220,115,11,161,56,206,101,251],"check":"control 3","expected":[129,175,70,220,115,11,161,56,206,101,251],"passed":true},{"actual":[235,1,129,220],"check":"control 4","expected":[235,1,129,220],"passed":true},{"actual":{"error":"overflow"},"check":"boundary 5","expected":{"error":"overflow"},"passed":true},{"actual":{"error":"overflow"},"check":"boundary 6","expected":{"error":"overflow"},"passed":true},{"actual":[235,106,229,66,67,49,129,56,206,101],"check":"control 7","expected":[235,106,229,66,67,49,129,56,206,101],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: ASCII codeword offset 0\", \"actual\": [229, 121, 129, 220, 115], \"expected\": [229, 121, 129, 220, 115], \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": [235, 1, 49, 129, 115, 11, 161], \"expected\": [235, 1, 49, 129, 115, 11, 161], \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": [129, 175, 70, 220, 115, 11], \"expected\": [129, 175, 70, 220, 115, 11], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251], \"expected\": [129, 175, 70, 220, 115, 11, 161, 56, 206, 101, 251], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [235, 1, 129, 220], \"expected\": [235, 1, 129, 220], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": {\"error\": \"overflow\"}, \"expected\": {\"error\": \"overflow\"}, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": {\"error\": \"overflow\"}, \"expected\": {\"error\": \"overflow\"}, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [235, 106, 229, 66, 67, 49, 129, 56, 206, 101], \"expected\": [235, 106, 229, 66, 67, 49, 129, 56, 206, 101], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}