FAILURE MAP
← Case archive

FA-79501 / Barcode symbology encoding / Open access

ITF-14 accepts the Code 128 minimum X-dimension · case 01

Carton labels are printed with bars too thin for distribution-centre scanners.

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

ROOT CAUSE

ITF-14 shares the generic 190 micrometre minimum instead of its own 495.

THE FAILURE

ITF-14 shares the generic 190 micrometre minimum instead of its own 495.

Unsuccessful approach: Adding an upper bound rejects legitimately large ITF-14 symbols.

Case contract

Input {sym, modules, x_um, addon?}. Quiet zones in X: ean13 11 left / 7 right, upca 9/9, ean8 7/7, code128, code39 and itf14 10/10. Allowed X-dimensions in micrometres: EAN/UPC 264..660 inclusive, code128/code39 >= 190, itf14 >= 495. An EAN-2 (20 modules) or EAN-5 (47 modules) add-on is only allowed on EAN/UPC; it replaces the right quiet zone by a 7-module gap, the add-on and a 5-module trailing quiet zone. Return [total_um, left_quiet_um] or unknown/x-out-of-range/bad-addon.

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(spec):
    qz = {'ean13': (11, 7), 'upca': (9, 9), 'ean8': (7, 7), 'code128': (10, 10), 'code39': (10, 10), 'itf14': (10, 10)}
    xr = {'ean13': (264, 660), 'upca': (264, 660), 'ean8': (264, 660), 'code128': (190, None), 'code39': (190, None), 'itf14': (190, None)}
    sym = spec['sym']
    if sym not in qz:
        return 'unknown'
    lo, hi = xr[sym]
    x = spec['x_um']
    if x < lo or (hi is not None and x > hi):
        return 'x-out-of-range'
    left, right = qz[sym]
    addon = spec.get('addon', 0)
    if addon:
        if sym not in ('ean13', 'upca', 'ean8') or addon not in (2, 5):
            return 'bad-addon'
        right = 7 + (20 if addon == 2 else 47) + 5
    total = left + spec['modules'] + right
    return [total * x, left * x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[{'sym': 'itf14', 'modules': 95, 'x_um': 250, 'addon': 2}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 95, 'x_um': 1100}, [126500, 11000]], [{'sym': 'code39', 'modules': 200, 'x_um': 661}, [145420, 6610]], [{'sym': 'ean13', 'modules': 67, 'x_um': 330}, [28050, 3630]], [{'sym': 'qr', 'modules': 200, 'x_um': 250, 'addon': 2}, 'unknown'], [{'sym': 'ean8', 'modules': 101, 'x_um': 1100, 'addon': 5}, 'x-out-of-range'], [{'sym': 'code128', 'modules': 200, 'x_um': 1000, 'addon': 5}, 'bad-addon'], [{'sym': 'itf14', 'modules': 142, 'x_um': 400, 'addon': 5}, 'x-out-of-range']], [[{'sym': 'itf14', 'modules': 142, 'x_um': 263}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 95, 'x_um': 1100}, [126500, 11000]], [{'sym': 'itf14', 'modules': 67, 'x_um': 1000}, [87000, 10000]], [{'sym': 'code128', 'modules': 200, 'x_um': 660}, [145200, 6600]], [{'sym': 'ean13', 'modules': 95, 'x_um': 661}, 'x-out-of-range'], [{'sym': 'ean13', 'modules': 95, 'x_um': 190}, 'x-out-of-range'], [{'sym': 'ean8', 'modules': 95, 'x_um': 330, 'addon': 5}, [53130, 2310]], [{'sym': 'itf14', 'modules': 101, 'x_um': 400}, 'x-out-of-range']], [[{'sym': 'itf14', 'modules': 101, 'x_um': 250}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 200, 'x_um': 1100, 'addon': 2}, 'bad-addon'], [{'sym': 'ean13', 'modules': 200, 'x_um': 190}, 'x-out-of-range'], [{'sym': 'code39', 'modules': 101, 'x_um': 400}, [48400, 4000]], [{'sym': 'code39', 'modules': 101, 'x_um': 190, 'addon': 3}, 'bad-addon'], [{'sym': 'upca', 'modules': 101, 'x_um': 1000}, 'x-out-of-range'], [{'sym': 'code39', 'modules': 95, 'x_um': 495, 'addon': 5}, 'bad-addon'], [{'sym': 'itf14', 'modules': 200, 'x_um': 263}, 'x-out-of-range']], [[{'sym': 'itf14', 'modules': 200, 'x_um': 263, 'addon': 2}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 67, 'x_um': 1100}, [95700, 11000]], [{'sym': 'ean8', 'modules': 142, 'x_um': 400, 'addon': 5}, [83200, 2800]], [{'sym': 'code39', 'modules': 67, 'x_um': 330, 'addon': 2}, 'bad-addon'], [{'sym': 'ean13', 'modules': 101, 'x_um': 1100}, 'x-out-of-range'], [{'sym': 'ean13', 'modules': 67, 'x_um': 661}, 'x-out-of-range'], [{'sym': 'upca', 'modules': 67, 'x_um': 330}, [28050, 2970]], [{'sym': 'itf14', 'modules': 67, 'x_um': 300}, 'x-out-of-range']], [[{'sym': 'itf14', 'modules': 67, 'x_um': 263}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 101, 'x_um': 1100}, [133100, 11000]], [{'sym': 'ean13', 'modules': 67, 'x_um': 330}, [28050, 3630]], [{'sym': 'ean13', 'modules': 101, 'x_um': 264}, [31416, 2904]], [{'sym': 'ean13', 'modules': 67, 'x_um': 264, 'addon': 2}, [29040, 2904]], [{'sym': 'code128', 'modules': 101, 'x_um': 400}, [48400, 4000]], [{'sym': 'ean13', 'modules': 101, 'x_um': 660}, [78540, 7260]], [{'sym': 'itf14', 'modules': 200, 'x_um': 264}, 'x-out-of-range']]]
labels = ["regression: ITF-14 minimum X-dimension", "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: ITF-14 minimum X-dimension 0bad-addonx-out-of-rangeFailed
repair trap 1[126500, 11000][126500, 11000]Passed
combined fault 2[145420, 6610][145420, 6610]Passed
control 3[28050, 3630][28050, 3630]Passed
control 4unknownunknownPassed
boundary 5x-out-of-rangex-out-of-rangePassed
boundary 6bad-addonbad-addonPassed
control 7bad-addonx-out-of-rangeFailed

SHA-256 / 7d7bd485460ef92f23ea84bcc1b8649cbe8a46b76d399463bf8ee8affe6bf58b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(spec):
    qz = {'ean13': (11, 7), 'upca': (9, 9), 'ean8': (7, 7), 'code128': (10, 10), 'code39': (10, 10), 'itf14': (10, 10)}
    xr = {'ean13': (264, 660), 'upca': (264, 660), 'ean8': (264, 660), 'code128': (190, None), 'code39': (190, None), 'itf14': (495, 1016)}
    sym = spec['sym']
    if sym not in qz:
        return 'unknown'
    lo, hi = xr[sym]
    x = spec['x_um']
    if x < lo or (hi is not None and x > hi):
        return 'x-out-of-range'
    left, right = qz[sym]
    addon = spec.get('addon', 0)
    if addon:
        if sym not in ('ean13', 'upca', 'ean8') or addon not in (2, 5):
            return 'bad-addon'
        right = 7 + (20 if addon == 2 else 47) + 5
    total = left + spec['modules'] + right
    return [total * x, left * x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[{'sym': 'itf14', 'modules': 95, 'x_um': 250, 'addon': 2}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 95, 'x_um': 1100}, [126500, 11000]], [{'sym': 'code39', 'modules': 200, 'x_um': 661}, [145420, 6610]], [{'sym': 'ean13', 'modules': 67, 'x_um': 330}, [28050, 3630]], [{'sym': 'qr', 'modules': 200, 'x_um': 250, 'addon': 2}, 'unknown'], [{'sym': 'ean8', 'modules': 101, 'x_um': 1100, 'addon': 5}, 'x-out-of-range'], [{'sym': 'code128', 'modules': 200, 'x_um': 1000, 'addon': 5}, 'bad-addon'], [{'sym': 'itf14', 'modules': 142, 'x_um': 400, 'addon': 5}, 'x-out-of-range']], [[{'sym': 'itf14', 'modules': 142, 'x_um': 263}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 95, 'x_um': 1100}, [126500, 11000]], [{'sym': 'itf14', 'modules': 67, 'x_um': 1000}, [87000, 10000]], [{'sym': 'code128', 'modules': 200, 'x_um': 660}, [145200, 6600]], [{'sym': 'ean13', 'modules': 95, 'x_um': 661}, 'x-out-of-range'], [{'sym': 'ean13', 'modules': 95, 'x_um': 190}, 'x-out-of-range'], [{'sym': 'ean8', 'modules': 95, 'x_um': 330, 'addon': 5}, [53130, 2310]], [{'sym': 'itf14', 'modules': 101, 'x_um': 400}, 'x-out-of-range']], [[{'sym': 'itf14', 'modules': 101, 'x_um': 250}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 200, 'x_um': 1100, 'addon': 2}, 'bad-addon'], [{'sym': 'ean13', 'modules': 200, 'x_um': 190}, 'x-out-of-range'], [{'sym': 'code39', 'modules': 101, 'x_um': 400}, [48400, 4000]], [{'sym': 'code39', 'modules': 101, 'x_um': 190, 'addon': 3}, 'bad-addon'], [{'sym': 'upca', 'modules': 101, 'x_um': 1000}, 'x-out-of-range'], [{'sym': 'code39', 'modules': 95, 'x_um': 495, 'addon': 5}, 'bad-addon'], [{'sym': 'itf14', 'modules': 200, 'x_um': 263}, 'x-out-of-range']], [[{'sym': 'itf14', 'modules': 200, 'x_um': 263, 'addon': 2}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 67, 'x_um': 1100}, [95700, 11000]], [{'sym': 'ean8', 'modules': 142, 'x_um': 400, 'addon': 5}, [83200, 2800]], [{'sym': 'code39', 'modules': 67, 'x_um': 330, 'addon': 2}, 'bad-addon'], [{'sym': 'ean13', 'modules': 101, 'x_um': 1100}, 'x-out-of-range'], [{'sym': 'ean13', 'modules': 67, 'x_um': 661}, 'x-out-of-range'], [{'sym': 'upca', 'modules': 67, 'x_um': 330}, [28050, 2970]], [{'sym': 'itf14', 'modules': 67, 'x_um': 300}, 'x-out-of-range']], [[{'sym': 'itf14', 'modules': 67, 'x_um': 263}, 'x-out-of-range'], [{'sym': 'itf14', 'modules': 101, 'x_um': 1100}, [133100, 11000]], [{'sym': 'ean13', 'modules': 67, 'x_um': 330}, [28050, 3630]], [{'sym': 'ean13', 'modules': 101, 'x_um': 264}, [31416, 2904]], [{'sym': 'ean13', 'modules': 67, 'x_um': 264, 'addon': 2}, [29040, 2904]], [{'sym': 'code128', 'modules': 101, 'x_um': 400}, [48400, 4000]], [{'sym': 'ean13', 'modules': 101, 'x_um': 660}, [78540, 7260]], [{'sym': 'itf14', 'modules': 200, 'x_um': 264}, 'x-out-of-range']]]
labels = ["regression: ITF-14 minimum X-dimension", "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: ITF-14 minimum X-dimension 0x-out-of-rangex-out-of-rangePassed
repair trap 1x-out-of-range[126500, 11000]Failed
combined fault 2[145420, 6610][145420, 6610]Passed
control 3[28050, 3630][28050, 3630]Passed
control 4unknownunknownPassed
boundary 5x-out-of-rangex-out-of-rangePassed
boundary 6bad-addonbad-addonPassed
control 7x-out-of-rangex-out-of-rangePassed

SHA-256 / b5070b03e2af6578a56523ee8a300dd1c74a0194908f389c1c15e79b8bc8d987

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:45.077949+00:00.

Case digest / 333f4975cd3863c6bf68bd634ce26b6303ca3c9b64b091521a0cde806810bdb1