{"abstract":"With bar width reduction every wide bar shows hairline gaps between its modules.","category":"Barcode symbology encoding","checks":8,"contract":"Render a module string (\"1\" bar, \"0\" space) at xn/xd device pixels per module after `quiet` leading quiet-zone modules. Module boundary k lies at round-half-up((quiet + k) * X), computed from the exact fraction so errors do not accumulate. Adjacent bar modules merge into one bar [start, end); bar width reduction shaves `bwr` pixels from the right edge of each bar, but a bar is never narrower than 1 pixel.","evaluation_group":"w2-barcode-symbology-encoding-device-pixel-rendering","failed_approach":"Capping a run at three modules still splits the four-module bars of wider symbologies.","family":"w2-barcode-symbology-encoding-device-pixel-rendering-run-merge","id":"FA-79751","implementations":{"attempt":{"sha256":"476c7686308a1ff9ff24483b258e9f5e1e49e43c3cb6e32c7c3e10b4882f4025","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(mods, xn, xd, bwr, quiet):\n    X = Fraction(xn, xd)\n    def edge(i):\n        return math.floor((quiet + i) * X + Fraction(1, 2))\n    bars = []\n    i = 0\n    n = len(mods)\n    while i < n:\n        if mods[i] == '1':\n            j = i\n            while j < n and mods[j] == '1' and j - i < 3:\n                j += 1\n            s, e = edge(i), edge(j) - bwr\n            if e - s < 1:\n                e = s + 1\n            bars.append([s, e])\n            i = j\n        else:\n            i += 1\n    return bars\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('0001111', 2, 1, 0, 1), [[8, 16]]], [('000011011110', 4, 3, 1, 1), [[7, 8], [11, 15]]], [('00001010', 1, 1, 0, 1), [[5, 6], [7, 8]]], [('00101', 3, 1, 0, 0), [[6, 9], [12, 15]]], [('001', 9, 4, 0, 3), [[11, 14]]], [('000101', 4, 3, 0, 3), [[8, 9], [11, 12]]], [('10', 5, 2, 1, 10), [[25, 27]]], [('011', 5, 2, 1, 10), [[28, 32]]]], [[('0010101000110', 7, 3, 0, 0), [[5, 7], [9, 12], [14, 16], [23, 28]]], [('1100001111', 9, 4, 0, 0), [[0, 5], [14, 23]]], [('0101001111010', 7, 3, 0, 3), [[9, 12], [14, 16], [21, 30], [33, 35]]], [('00101', 3, 1, 1, 3), [[15, 17], [21, 23]]], [('0001001', 5, 2, 0, 10), [[33, 35], [40, 43]]], [('1', 4, 3, 1, 0), [[0, 1]]], [('000', 5, 2, 2, 3), []], [('1111', 9, 4, 2, 3), [[7, 14]]]], [[('00010110011', 7, 3, 2, 3), [[14, 15], [19, 21], [28, 31]]], [('101011111011', 11, 5, 0, 0), [[0, 2], [4, 7], [9, 20], [22, 26]]], [('0110111111', 11, 5, 2, 3), [[9, 11], [15, 27]]], [('001', 7, 3, 2, 10), [[28, 29]]], [('100000010', 9, 4, 1, 0), [[0, 1], [16, 17]]], [('000', 7, 3, 0, 0), []], [('010', 9, 4, 0, 3), [[9, 11]]], [('11000100111001', 5, 2, 1, 10), [[25, 29], [38, 39], [45, 52], [58, 59]]]], [[('01100', 2, 1, 0, 0), [[2, 6]]], [('111100000', 5, 2, 1, 0), [[0, 9]]], [('010011111100', 7, 3, 2, 1), [[5, 6], [12, 24]]], [('100000010010', 11, 5, 0, 1), [[2, 4], [18, 20], [24, 26]]], [('0100000100', 7, 3, 0, 1), [[5, 7], [19, 21]]], [('01001000000', 5, 2, 1, 1), [[5, 7], [13, 14]]], [('10100001', 1, 1, 0, 10), [[10, 11], [12, 13], [17, 18]]], [('0000111', 7, 3, 0, 0), [[9, 16]]]], [[('111', 4, 3, 2, 10), [[13, 15]]], [('1011111001100', 2, 1, 0, 3), [[6, 8], [10, 20], [24, 28]]], [('111100', 4, 3, 0, 1), [[1, 7]]], [('010', 7, 3, 1, 0), [[2, 4]]], [('10', 4, 3, 2, 0), [[0, 1]]], [('10', 2, 1, 1, 0), [[0, 1]]], [('1', 9, 4, 1, 1), [[2, 4]]], [('0010110011101', 3, 1, 1, 1), [[9, 11], [15, 20], [27, 35], [39, 41]]]]]\nlabels = [\"regression: adjacent bar merging\", \"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":"b1c57c6bc135a7aacaeff62550a58a41d1ccc17c1e7bfda8de39d672369e4062","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(mods, xn, xd, bwr, quiet):\n    X = Fraction(xn, xd)\n    def edge(i):\n        return math.floor((quiet + i) * X + Fraction(1, 2))\n    bars = []\n    i = 0\n    n = len(mods)\n    while i < n:\n        if mods[i] == '1':\n            j = i\n            while j < i + 1 and mods[j] == '1':\n                j += 1\n            s, e = edge(i), edge(j) - bwr\n            if e - s < 1:\n                e = s + 1\n            bars.append([s, e])\n            i = j\n        else:\n            i += 1\n    return bars\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('0001111', 2, 1, 0, 1), [[8, 16]]], [('000011011110', 4, 3, 1, 1), [[7, 8], [11, 15]]], [('00001010', 1, 1, 0, 1), [[5, 6], [7, 8]]], [('00101', 3, 1, 0, 0), [[6, 9], [12, 15]]], [('001', 9, 4, 0, 3), [[11, 14]]], [('000101', 4, 3, 0, 3), [[8, 9], [11, 12]]], [('10', 5, 2, 1, 10), [[25, 27]]], [('011', 5, 2, 1, 10), [[28, 32]]]], [[('0010101000110', 7, 3, 0, 0), [[5, 7], [9, 12], [14, 16], [23, 28]]], [('1100001111', 9, 4, 0, 0), [[0, 5], [14, 23]]], [('0101001111010', 7, 3, 0, 3), [[9, 12], [14, 16], [21, 30], [33, 35]]], [('00101', 3, 1, 1, 3), [[15, 17], [21, 23]]], [('0001001', 5, 2, 0, 10), [[33, 35], [40, 43]]], [('1', 4, 3, 1, 0), [[0, 1]]], [('000', 5, 2, 2, 3), []], [('1111', 9, 4, 2, 3), [[7, 14]]]], [[('00010110011', 7, 3, 2, 3), [[14, 15], [19, 21], [28, 31]]], [('101011111011', 11, 5, 0, 0), [[0, 2], [4, 7], [9, 20], [22, 26]]], [('0110111111', 11, 5, 2, 3), [[9, 11], [15, 27]]], [('001', 7, 3, 2, 10), [[28, 29]]], [('100000010', 9, 4, 1, 0), [[0, 1], [16, 17]]], [('000', 7, 3, 0, 0), []], [('010', 9, 4, 0, 3), [[9, 11]]], [('11000100111001', 5, 2, 1, 10), [[25, 29], [38, 39], [45, 52], [58, 59]]]], [[('01100', 2, 1, 0, 0), [[2, 6]]], [('111100000', 5, 2, 1, 0), [[0, 9]]], [('010011111100', 7, 3, 2, 1), [[5, 6], [12, 24]]], [('100000010010', 11, 5, 0, 1), [[2, 4], [18, 20], [24, 26]]], [('0100000100', 7, 3, 0, 1), [[5, 7], [19, 21]]], [('01001000000', 5, 2, 1, 1), [[5, 7], [13, 14]]], [('10100001', 1, 1, 0, 10), [[10, 11], [12, 13], [17, 18]]], [('0000111', 7, 3, 0, 0), [[9, 16]]]], [[('111', 4, 3, 2, 10), [[13, 15]]], [('1011111001100', 2, 1, 0, 3), [[6, 8], [10, 20], [24, 28]]], [('111100', 4, 3, 0, 1), [[1, 7]]], [('010', 7, 3, 1, 0), [[2, 4]]], [('10', 4, 3, 2, 0), [[0, 1]]], [('10', 2, 1, 1, 0), [[0, 1]]], [('1', 9, 4, 1, 1), [[2, 4]]], [('0010110011101', 3, 1, 1, 1), [[9, 11], [15, 20], [27, 35], [39, 41]]]]]\nlabels = [\"regression: adjacent bar merging\", \"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":"c2aeb72c737cbd65ebc67eb6b0d7b0d1f63b7170206ba9299d49db56dd128d58","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(mods, xn, xd, bwr, quiet):\n    X = Fraction(xn, xd)\n    def edge(i):\n        return math.floor((quiet + i) * X + Fraction(1, 2))\n    bars = []\n    i = 0\n    n = len(mods)\n    while i < n:\n        if mods[i] == '1':\n            j = i\n            while j < n and mods[j] == '1':\n                j += 1\n            s, e = edge(i), edge(j) - bwr\n            if e - s < 1:\n                e = s + 1\n            bars.append([s, e])\n            i = j\n        else:\n            i += 1\n    return bars\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('0001111', 2, 1, 0, 1), [[8, 16]]], [('000011011110', 4, 3, 1, 1), [[7, 8], [11, 15]]], [('00001010', 1, 1, 0, 1), [[5, 6], [7, 8]]], [('00101', 3, 1, 0, 0), [[6, 9], [12, 15]]], [('001', 9, 4, 0, 3), [[11, 14]]], [('000101', 4, 3, 0, 3), [[8, 9], [11, 12]]], [('10', 5, 2, 1, 10), [[25, 27]]], [('011', 5, 2, 1, 10), [[28, 32]]]], [[('0010101000110', 7, 3, 0, 0), [[5, 7], [9, 12], [14, 16], [23, 28]]], [('1100001111', 9, 4, 0, 0), [[0, 5], [14, 23]]], [('0101001111010', 7, 3, 0, 3), [[9, 12], [14, 16], [21, 30], [33, 35]]], [('00101', 3, 1, 1, 3), [[15, 17], [21, 23]]], [('0001001', 5, 2, 0, 10), [[33, 35], [40, 43]]], [('1', 4, 3, 1, 0), [[0, 1]]], [('000', 5, 2, 2, 3), []], [('1111', 9, 4, 2, 3), [[7, 14]]]], [[('00010110011', 7, 3, 2, 3), [[14, 15], [19, 21], [28, 31]]], [('101011111011', 11, 5, 0, 0), [[0, 2], [4, 7], [9, 20], [22, 26]]], [('0110111111', 11, 5, 2, 3), [[9, 11], [15, 27]]], [('001', 7, 3, 2, 10), [[28, 29]]], [('100000010', 9, 4, 1, 0), [[0, 1], [16, 17]]], [('000', 7, 3, 0, 0), []], [('010', 9, 4, 0, 3), [[9, 11]]], [('11000100111001', 5, 2, 1, 10), [[25, 29], [38, 39], [45, 52], [58, 59]]]], [[('01100', 2, 1, 0, 0), [[2, 6]]], [('111100000', 5, 2, 1, 0), [[0, 9]]], [('010011111100', 7, 3, 2, 1), [[5, 6], [12, 24]]], [('100000010010', 11, 5, 0, 1), [[2, 4], [18, 20], [24, 26]]], [('0100000100', 7, 3, 0, 1), [[5, 7], [19, 21]]], [('01001000000', 5, 2, 1, 1), [[5, 7], [13, 14]]], [('10100001', 1, 1, 0, 10), [[10, 11], [12, 13], [17, 18]]], [('0000111', 7, 3, 0, 0), [[9, 16]]]], [[('111', 4, 3, 2, 10), [[13, 15]]], [('1011111001100', 2, 1, 0, 3), [[6, 8], [10, 20], [24, 28]]], [('111100', 4, 3, 0, 1), [[1, 7]]], [('010', 7, 3, 1, 0), [[2, 4]]], [('10', 4, 3, 2, 0), [[0, 1]]], [('10', 2, 1, 1, 0), [[0, 1]]], [('1', 9, 4, 1, 1), [[2, 4]]], [('0010110011101', 3, 1, 1, 1), [[9, 11], [15, 20], [27, 35], [39, 41]]]]]\nlabels = [\"regression: adjacent bar merging\", \"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-device-pixel-rendering-run-merge","generated_at":"2026-09-29T14:49:47.532235+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":"Merge consecutive bar modules into one bar.","root_cause":"Each bar module is emitted separately instead of merging runs.","sha256":"f4a3e24ae375c6c4d9a1d6cf290cc975013860cebd1a4578cc60d7d056acb75e","title":"Wide bars are drawn as separate one-module bars · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.759,"exit_code":1,"observations":[{"actual":[[8,14],[14,16]],"check":"regression: adjacent bar merging 0","expected":[[8,16]],"passed":false},{"actual":[[7,8],[11,14],[15,16]],"check":"repair trap 1","expected":[[7,8],[11,15]],"passed":false},{"actual":[[5,6],[7,8]],"check":"combined fault 2","expected":[[5,6],[7,8]],"passed":true},{"actual":[[6,9],[12,15]],"check":"control 3","expected":[[6,9],[12,15]],"passed":true},{"actual":[[11,14]],"check":"control 4","expected":[[11,14]],"passed":true},{"actual":[[8,9],[11,12]],"check":"boundary 5","expected":[[8,9],[11,12]],"passed":true},{"actual":[[25,27]],"check":"boundary 6","expected":[[25,27]],"passed":true},{"actual":[[28,32]],"check":"control 7","expected":[[28,32]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: adjacent bar merging 0\", \"actual\": [[8, 14], [14, 16]], \"expected\": [[8, 16]], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [[7, 8], [11, 14], [15, 16]], \"expected\": [[7, 8], [11, 15]], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [[5, 6], [7, 8]], \"expected\": [[5, 6], [7, 8]], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [[6, 9], [12, 15]], \"expected\": [[6, 9], [12, 15]], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [[11, 14]], \"expected\": [[11, 14]], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [[8, 9], [11, 12]], \"expected\": [[8, 9], [11, 12]], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [[25, 27]], \"expected\": [[25, 27]], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [[28, 32]], \"expected\": [[28, 32]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.596,"exit_code":1,"observations":[{"actual":[[8,10],[10,12],[12,14],[14,16]],"check":"regression: adjacent bar merging 0","expected":[[8,16]],"passed":false},{"actual":[[7,8],[8,9],[11,12],[12,13],[13,14],[15,16]],"check":"repair trap 1","expected":[[7,8],[11,15]],"passed":false},{"actual":[[5,6],[7,8]],"check":"combined fault 2","expected":[[5,6],[7,8]],"passed":true},{"actual":[[6,9],[12,15]],"check":"control 3","expected":[[6,9],[12,15]],"passed":true},{"actual":[[11,14]],"check":"control 4","expected":[[11,14]],"passed":true},{"actual":[[8,9],[11,12]],"check":"boundary 5","expected":[[8,9],[11,12]],"passed":true},{"actual":[[25,27]],"check":"boundary 6","expected":[[25,27]],"passed":true},{"actual":[[28,29],[30,32]],"check":"control 7","expected":[[28,32]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: adjacent bar merging 0\", \"actual\": [[8, 10], [10, 12], [12, 14], [14, 16]], \"expected\": [[8, 16]], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [[7, 8], [8, 9], [11, 12], [12, 13], [13, 14], [15, 16]], \"expected\": [[7, 8], [11, 15]], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [[5, 6], [7, 8]], \"expected\": [[5, 6], [7, 8]], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [[6, 9], [12, 15]], \"expected\": [[6, 9], [12, 15]], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [[11, 14]], \"expected\": [[11, 14]], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [[8, 9], [11, 12]], \"expected\": [[8, 9], [11, 12]], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [[25, 27]], \"expected\": [[25, 27]], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [[28, 29], [30, 32]], \"expected\": [[28, 32]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.073,"exit_code":0,"observations":[{"actual":[[8,16]],"check":"regression: adjacent bar merging 0","expected":[[8,16]],"passed":true},{"actual":[[7,8],[11,15]],"check":"repair trap 1","expected":[[7,8],[11,15]],"passed":true},{"actual":[[5,6],[7,8]],"check":"combined fault 2","expected":[[5,6],[7,8]],"passed":true},{"actual":[[6,9],[12,15]],"check":"control 3","expected":[[6,9],[12,15]],"passed":true},{"actual":[[11,14]],"check":"control 4","expected":[[11,14]],"passed":true},{"actual":[[8,9],[11,12]],"check":"boundary 5","expected":[[8,9],[11,12]],"passed":true},{"actual":[[25,27]],"check":"boundary 6","expected":[[25,27]],"passed":true},{"actual":[[28,32]],"check":"control 7","expected":[[28,32]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: adjacent bar merging 0\", \"actual\": [[8, 16]], \"expected\": [[8, 16]], \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": [[7, 8], [11, 15]], \"expected\": [[7, 8], [11, 15]], \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": [[5, 6], [7, 8]], \"expected\": [[5, 6], [7, 8]], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [[6, 9], [12, 15]], \"expected\": [[6, 9], [12, 15]], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [[11, 14]], \"expected\": [[11, 14]], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [[8, 9], [11, 12]], \"expected\": [[8, 9], [11, 12]], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [[25, 27]], \"expected\": [[25, 27]], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [[28, 32]], \"expected\": [[28, 32]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}