FAILURE MAP
← Case archive

FA-2971 / Binary formats / Open access

Odd hex nybbles become a complete byte · case 01

Odd hex nybbles become a complete byte.

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

ROOT CAUSE

The implementation applies an operation whose text or grammar semantics violate this contract: Decode whitespace-separated hexadecimal byte pairs to integer bytes; malformed input returns None.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Decode whitespace-separated hexadecimal byte pairs to integer bytes; malformed input returns None.

Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.

Case contract

Decode whitespace-separated hexadecimal byte pairs to integer bytes; malformed input returns None.

Why this case matters

A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        try:
            return list(bytes.fromhex('0'+x if len(x)%2 else x))
        except ValueError:
            return None
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('f'), None)
check('boundary 2', solve('a b'), None)
check('boundary 3', solve('0a ff'), [10, 255])
check('boundary 4', solve(''), [])
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
boundary 1[15]NoneFailed
boundary 2NoneNonePassed
boundary 3None[10, 255]Failed
boundary 4[][]Passed

SHA-256 / 91d34b28adbd06851c5c213e25273ff06dac44d6e69dd9caca612a39e1f48cdc

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        try:
            return list(bytes.fromhex(x.replace(' ','')))
        except ValueError:
            return None
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('f'), None)
check('boundary 2', solve('a b'), None)
check('boundary 3', solve('0a ff'), [10, 255])
check('boundary 4', solve(''), [])
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
boundary 1NoneNonePassed
boundary 2[171]NoneFailed
boundary 3[10, 255][10, 255]Passed
boundary 4[][]Passed

SHA-256 / 22dda72272dd987a759f446a11e76f7269f60c8462ebc31e038dd547d9668ae4

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        try:
            return list(bytes.fromhex(x))
        except ValueError:
            return None
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('f'), None)
check('boundary 2', solve('a b'), None)
check('boundary 3', solve('0a ff'), [10, 255])
check('boundary 4', solve(''), [])
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
boundary 1NoneNonePassed
boundary 2NoneNonePassed
boundary 3[10, 255][10, 255]Passed
boundary 4[][]Passed

SHA-256 / a2c0d5fffeb7d856e921d4620d8f91758d5d282349695a98110cc09dc3e14fa2

Verification & scope

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

Case digest / 7ddc44f7300b1cf3c09076c59dde0787b45b99599db0d7f5348619c5d624d1a0