FAILURE MAP
← Case archive

FA-3331 / Encodings / Open access

Canonical hexadecimal output mixes letter case · case 01

Canonical hexadecimal output mixes letter case.

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: Encode integer byte values as uppercase two-nybble hex without separators.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Encode integer byte values as uppercase two-nybble hex without separators.

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

Case contract

Encode integer byte values as uppercase two-nybble hex without separators.

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:
        return bytes(x).hex()
    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([10, 255]), '0AFF')
check('boundary 2', solve([0, 1]), '0001')
check('boundary 3', solve([]), '')
check('boundary 4', solve([16]), '10')
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 10aff0AFFFailed
boundary 200010001Passed
boundary 3Passed
boundary 41010Passed

SHA-256 / b3efaac6aa2773a5f8ff8c020d053393c5ad918c14c6a205f4ec95cbe5dd31e9

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:
        return ''.join(format(v,'X') for v in x)
    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([10, 255]), '0AFF')
check('boundary 2', solve([0, 1]), '0001')
check('boundary 3', solve([]), '')
check('boundary 4', solve([16]), '10')
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 1AFF0AFFFailed
boundary 2010001Failed
boundary 3Passed
boundary 41010Passed

SHA-256 / bcbe2175ee33664c9b1bcf41e0bf20c06d4cd1f1401de563f1ed9415e7f157e8

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:
        return bytes(x).hex().upper()
    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([10, 255]), '0AFF')
check('boundary 2', solve([0, 1]), '0001')
check('boundary 3', solve([]), '')
check('boundary 4', solve([16]), '10')
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 10AFF0AFFPassed
boundary 200010001Passed
boundary 3Passed
boundary 41010Passed

SHA-256 / 4f23d8f497b191ca0fc49a59463fdc29aff42868edd3f34038f9f49eb93bd922

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

Case digest / 9abc1f7c6cd62b5733bf5c9fdf87e126bb844b89a8fb628b79582b86665b8b90