FAILURE MAP
← Case archive

FA-79776 / Barcode symbology encoding / Open access

Elements on the threshold are silently called wide · case 01

Borderline scans decode to wrong data instead of being retried.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

An element exactly on the threshold is classified instead of being reported as ambiguous.

THE FAILURE

An element exactly on the threshold is classified instead of being reported as ambiguous.

Unsuccessful approach: Silently calling it narrow is just as unsafe.

Case 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}.

Why this case matters

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.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(w):
    out = [''] * len(w)
    for parity in (0, 1):
        idx = list(range(parity, len(w), 2))
        if not idx:
            continue
        vals = [w[i] for i in idx]
        lo, hi = min(vals), max(vals)
        if hi * 2 < lo * 3:
            for i in idx:
                out[i] = 'N'
            continue
        t2 = lo + hi
        for i in idx:
            out[i] = 'W' if w[i] * 2 >= t2 else 'N'
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[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']]]
labels = ["regression: threshold tie", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (labels[i % len(labels)], i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: threshold tie 0NNNWNWNNW{'error': 'ambiguous', 'index': 5}Failed
repair trap 1NNNNNNNNNNNNNNNNPassed
combined fault 2WWNNNWWWWNNNWWPassed
control 3NNNWWNNNWWPassed
control 4NWNNNNNNNNWNNNNNNNPassed
boundary 5WNNWNNPassed
boundary 6NNNNPassed
control 7WNNNNWNW{'error': 'ambiguous', 'index': 5}Failed

SHA-256 / db3d9f2ce8121951e58311058569c0d4dd96e8685cfa7efb120dce3d419f8ce3

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(w):
    out = [''] * len(w)
    for parity in (0, 1):
        idx = list(range(parity, len(w), 2))
        if not idx:
            continue
        vals = [w[i] for i in idx]
        lo, hi = min(vals), max(vals)
        if hi * 2 < lo * 3:
            for i in idx:
                out[i] = 'N'
            continue
        t2 = lo + hi
        for i in idx:
            out[i] = 'W' if w[i] * 2 > t2 else 'N'
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[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']]]
labels = ["regression: threshold tie", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (labels[i % len(labels)], i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: threshold tie 0NNNWNNNNW{'error': 'ambiguous', 'index': 5}Failed
repair trap 1NNNNNNNNNNNNNNNNPassed
combined fault 2WWNNNWWWWNNNWWPassed
control 3NNNWWNNNWWPassed
control 4NWNNNNNNNNWNNNNNNNPassed
boundary 5WNNWNNPassed
boundary 6NNNNPassed
control 7WNNNNNNW{'error': 'ambiguous', 'index': 5}Failed

SHA-256 / 4d9815e57af6b5e2ad368c0f8cf949b6d142a3d90f5d4d7d15e9b1e1108057aa

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:49:47.603469+00:00.

Case digest / 4aac177e6d797f5e07cdf4b99b1e42717c93ee6ff08bbf0289533326c1113788