{"abstract":"Borderline scans decode to wrong data instead of being retried.","category":"Barcode symbology encoding","checks":8,"contract":"Classify measured element widths of a two-width symbology scanline (bars at even indexes, spaces at odd) into N/W. Bars and spaces are classified separately because ink spread widens bars. Within a class, if max < 1.5 * min all elements are narrow; otherwise the threshold is (min + max) / 2, elements above it are wide, below it narrow, and an element exactly on it is {\"error\": \"ambiguous\", \"index\": i}.","contract_signature":"w","evaluation_group":"w2-barcode-symbology-encoding-scanline-width-classes","failed_approach":"Silently calling it narrow is just as unsafe.","family":"w2-barcode-symbology-encoding-scanline-width-classes-tie-handling","id":"FA-79776","implementations":{"attempt":{"sha256":"4d9815e57af6b5e2ad368c0f8cf949b6d142a3d90f5d4d7d15e9b1e1108057aa","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(w):\n    out = [''] * len(w)\n    for parity in (0, 1):\n        idx = list(range(parity, len(w), 2))\n        if not idx:\n            continue\n        vals = [w[i] for i in idx]\n        lo, hi = min(vals), max(vals)\n        if hi * 2 < lo * 3:\n            for i in idx:\n                out[i] = 'N'\n            continue\n        t2 = lo + hi\n        for i in idx:\n            out[i] = 'W' if w[i] * 2 > t2 else 'N'\n    return ''.join(out)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[6, 4, 5, 6, 6, 5, 6, 4, 9], {'error': 'ambiguous', 'index': 5}], [[4, 4, 4, 4, 3, 3, 3, 3], 'NNNNNNNN'], [[6, 8, 4, 3, 3, 8, 7], 'WWNNNWW'], [[2, 5, 2, 10, 9], 'NNNWW'], [[6, 11, 6, 3, 6, 4, 6, 3, 5], 'NWNNNNNNN'], [[13, 4, 6], 'WNN'], [[3, 3], 'NN'], [[7, 4, 4, 4, 4, 5, 4, 6], {'error': 'ambiguous', 'index': 5}]], [[[11, 6, 5, 4, 6, 5], {'error': 'ambiguous', 'index': 5}], [[5, 5, 5, 4, 5, 6, 5, 5, 6], {'error': 'ambiguous', 'index': 1}], [[5, 2, 11, 2, 11, 6, 11, 2], 'NNWNWWWN'], [[3, 11, 2, 4, 6], 'NWNNW'], [[6, 2, 7, 2, 6], 'NNNNN'], [[2, 6, 2, 3, 13, 6], 'NWNNWW'], [[3, 5, 11], 'NNW'], [[12, 4, 12, 5, 4, 3, 12, 5], {'error': 'ambiguous', 'index': 1}]], [[[12, 4, 12, 5, 11, 5, 11, 6], {'error': 'ambiguous', 'index': 3}], [[6, 2, 4, 3, 5, 6, 5, 2], {'error': 'ambiguous', 'index': 4}], [[11, 4, 4, 4, 3, 10], 'WNNNNW'], [[9, 3, 9, 4, 5], 'WNWNN'], [[8, 1], 'NN'], [[2, 4], 'NN'], [[3, 1, 7, 1, 3, 11, 3, 12], 'NNWNNWNW'], [[4, 4, 11, 3, 4, 3, 11, 5], {'error': 'ambiguous', 'index': 1}]], [[[5, 5, 5, 6, 8, 4, 6], {'error': 'ambiguous', 'index': 1}], [[6, 3, 5, 3, 8, 4, 5, 10], 'NNNNWNNW'], [[13, 3], 'NN'], [[13, 4, 5, 3, 12, 4, 6, 4, 6], 'WNNNWNNNN'], [[6, 4], 'NN'], [[3, 3, 3, 3, 4], 'NNNNN'], [[2], 'N'], [[3, 6, 2, 5, 3, 6, 3, 4], {'error': 'ambiguous', 'index': 3}]], [[[4, 2, 10, 2, 7], {'error': 'ambiguous', 'index': 4}], [[3, 4], 'NN'], [[2, 1, 2, 1, 3, 2, 3, 11, 2], 'NNNNWNWWN'], [[4, 2, 4, 9, 5], 'NNNWN'], [[13, 9, 5, 4, 13, 8, 6], 'WWNNWWN'], [[4, 5, 10], 'NNW'], [[10, 2], 'NN'], [[3, 5, 3, 12, 2, 13, 2, 13], 'WNWWNWNW']]]\nlabels = [\"regression: threshold tie\", \"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":"db3d9f2ce8121951e58311058569c0d4dd96e8685cfa7efb120dce3d419f8ce3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(w):\n    out = [''] * len(w)\n    for parity in (0, 1):\n        idx = list(range(parity, len(w), 2))\n        if not idx:\n            continue\n        vals = [w[i] for i in idx]\n        lo, hi = min(vals), max(vals)\n        if hi * 2 < lo * 3:\n            for i in idx:\n                out[i] = 'N'\n            continue\n        t2 = lo + hi\n        for i in idx:\n            out[i] = 'W' if w[i] * 2 >= t2 else 'N'\n    return ''.join(out)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[6, 4, 5, 6, 6, 5, 6, 4, 9], {'error': 'ambiguous', 'index': 5}], [[4, 4, 4, 4, 3, 3, 3, 3], 'NNNNNNNN'], [[6, 8, 4, 3, 3, 8, 7], 'WWNNNWW'], [[2, 5, 2, 10, 9], 'NNNWW'], [[6, 11, 6, 3, 6, 4, 6, 3, 5], 'NWNNNNNNN'], [[13, 4, 6], 'WNN'], [[3, 3], 'NN'], [[7, 4, 4, 4, 4, 5, 4, 6], {'error': 'ambiguous', 'index': 5}]], [[[11, 6, 5, 4, 6, 5], {'error': 'ambiguous', 'index': 5}], [[5, 5, 5, 4, 5, 6, 5, 5, 6], {'error': 'ambiguous', 'index': 1}], [[5, 2, 11, 2, 11, 6, 11, 2], 'NNWNWWWN'], [[3, 11, 2, 4, 6], 'NWNNW'], [[6, 2, 7, 2, 6], 'NNNNN'], [[2, 6, 2, 3, 13, 6], 'NWNNWW'], [[3, 5, 11], 'NNW'], [[12, 4, 12, 5, 4, 3, 12, 5], {'error': 'ambiguous', 'index': 1}]], [[[12, 4, 12, 5, 11, 5, 11, 6], {'error': 'ambiguous', 'index': 3}], [[6, 2, 4, 3, 5, 6, 5, 2], {'error': 'ambiguous', 'index': 4}], [[11, 4, 4, 4, 3, 10], 'WNNNNW'], [[9, 3, 9, 4, 5], 'WNWNN'], [[8, 1], 'NN'], [[2, 4], 'NN'], [[3, 1, 7, 1, 3, 11, 3, 12], 'NNWNNWNW'], [[4, 4, 11, 3, 4, 3, 11, 5], {'error': 'ambiguous', 'index': 1}]], [[[5, 5, 5, 6, 8, 4, 6], {'error': 'ambiguous', 'index': 1}], [[6, 3, 5, 3, 8, 4, 5, 10], 'NNNNWNNW'], [[13, 3], 'NN'], [[13, 4, 5, 3, 12, 4, 6, 4, 6], 'WNNNWNNNN'], [[6, 4], 'NN'], [[3, 3, 3, 3, 4], 'NNNNN'], [[2], 'N'], [[3, 6, 2, 5, 3, 6, 3, 4], {'error': 'ambiguous', 'index': 3}]], [[[4, 2, 10, 2, 7], {'error': 'ambiguous', 'index': 4}], [[3, 4], 'NN'], [[2, 1, 2, 1, 3, 2, 3, 11, 2], 'NNNNWNWWN'], [[4, 2, 4, 9, 5], 'NNNWN'], [[13, 9, 5, 4, 13, 8, 6], 'WWNNWWN'], [[4, 5, 10], 'NNW'], [[10, 2], 'NN'], [[3, 5, 3, 12, 2, 13, 2, 13], 'WNWWNWNW']]]\nlabels = [\"regression: threshold tie\", \"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-scanline-width-classes-tie-handling","generated_at":"2026-09-29T14:49:47.603469+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":"An element exactly on the threshold is classified instead of being reported as ambiguous.","sha256":"4aac177e6d797f5e07cdf4b99b1e42717c93ee6ff08bbf0289533326c1113788","title":"Elements on the threshold are silently called wide · 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":38.38,"exit_code":1,"observations":[{"actual":"NNNWNNNNW","check":"regression: threshold tie 0","expected":{"error":"ambiguous","index":5},"passed":false},{"actual":"NNNNNNNN","check":"repair trap 1","expected":"NNNNNNNN","passed":true},{"actual":"WWNNNWW","check":"combined fault 2","expected":"WWNNNWW","passed":true},{"actual":"NNNWW","check":"control 3","expected":"NNNWW","passed":true},{"actual":"NWNNNNNNN","check":"control 4","expected":"NWNNNNNNN","passed":true},{"actual":"WNN","check":"boundary 5","expected":"WNN","passed":true},{"actual":"NN","check":"boundary 6","expected":"NN","passed":true},{"actual":"WNNNNNNW","check":"control 7","expected":{"error":"ambiguous","index":5},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: threshold tie 0\", \"actual\": \"NNNWNNNNW\", \"expected\": {\"error\": \"ambiguous\", \"index\": 5}, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"NNNNNNNN\", \"expected\": \"NNNNNNNN\", \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": \"WWNNNWW\", \"expected\": \"WWNNNWW\", \"passed\": true}, {\"check\": \"control 3\", \"actual\": \"NNNWW\", \"expected\": \"NNNWW\", \"passed\": true}, {\"check\": \"control 4\", \"actual\": \"NWNNNNNNN\", \"expected\": \"NWNNNNNNN\", \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"WNN\", \"expected\": \"WNN\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"NN\", \"expected\": \"NN\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": \"WNNNNNNW\", \"expected\": {\"error\": \"ambiguous\", \"index\": 5}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.661,"exit_code":1,"observations":[{"actual":"NNNWNWNNW","check":"regression: threshold tie 0","expected":{"error":"ambiguous","index":5},"passed":false},{"actual":"NNNNNNNN","check":"repair trap 1","expected":"NNNNNNNN","passed":true},{"actual":"WWNNNWW","check":"combined fault 2","expected":"WWNNNWW","passed":true},{"actual":"NNNWW","check":"control 3","expected":"NNNWW","passed":true},{"actual":"NWNNNNNNN","check":"control 4","expected":"NWNNNNNNN","passed":true},{"actual":"WNN","check":"boundary 5","expected":"WNN","passed":true},{"actual":"NN","check":"boundary 6","expected":"NN","passed":true},{"actual":"WNNNNWNW","check":"control 7","expected":{"error":"ambiguous","index":5},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: threshold tie 0\", \"actual\": \"NNNWNWNNW\", \"expected\": {\"error\": \"ambiguous\", \"index\": 5}, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"NNNNNNNN\", \"expected\": \"NNNNNNNN\", \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": \"WWNNNWW\", \"expected\": \"WWNNNWW\", \"passed\": true}, {\"check\": \"control 3\", \"actual\": \"NNNWW\", \"expected\": \"NNNWW\", \"passed\": true}, {\"check\": \"control 4\", \"actual\": \"NWNNNNNNN\", \"expected\": \"NWNNNNNNN\", \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"WNN\", \"expected\": \"WNN\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"NN\", \"expected\": \"NN\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": \"WNNNNWNW\", \"expected\": {\"error\": \"ambiguous\", \"index\": 5}, \"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."}}