FAILURE MAP
← Case archive

FA-3741 / Binary formats / Open access

A mixed-endian identifier reverses every field · case 01

A mixed-endian identifier reverses every field.

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: For 16 bytes, reverse the first 4-byte field and following two 2-byte fields; retain final 8 bytes. Return hex.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: For 16 bytes, reverse the first 4-byte field and following two 2-byte fields; retain final 8 bytes. Return hex.

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

Case contract

For 16 bytes, reverse the first 4-byte field and following two 2-byte fields; retain final 8 bytes. Return hex.

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([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), '030201000504070608090a0b0c0d0e0f')
check('boundary 2', solve([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), '00000000000000000000000000000000')
check('boundary 3', solve([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), '01010101010101010101010101010101')
check('boundary 4', solve([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), '00000100000000000000000000000000')
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 1000102030405060708090a0b0c0d0e0f030201000504070608090a0b0c0d0e0fFailed
boundary 20000000000000000000000000000000000000000000000000000000000000000Passed
boundary 30101010101010101010101010101010101010101010101010101010101010101Passed
boundary 40001000000000000000000000000000000000100000000000000000000000000Failed

SHA-256 / 898eb24a66eb02b3ce5957fe369c87ebac4873b582713bc5ef3e8627ca301125

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 bytes(reversed(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([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), '030201000504070608090a0b0c0d0e0f')
check('boundary 2', solve([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), '00000000000000000000000000000000')
check('boundary 3', solve([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), '01010101010101010101010101010101')
check('boundary 4', solve([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), '00000100000000000000000000000000')
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 10f0e0d0c0b0a09080706050403020100030201000504070608090a0b0c0d0e0fFailed
boundary 20000000000000000000000000000000000000000000000000000000000000000Passed
boundary 30101010101010101010101010101010101010101010101010101010101010101Passed
boundary 40000000000000000000000000000010000000100000000000000000000000000Failed

SHA-256 / 105e6dffa7e8e93d355a20f96be45e1ddd3bc1709fe74806b425fcc8dd6f26f9

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[:4][::-1]+x[4:6][::-1]+x[6:8][::-1]+x[8:]).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([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), '030201000504070608090a0b0c0d0e0f')
check('boundary 2', solve([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), '00000000000000000000000000000000')
check('boundary 3', solve([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), '01010101010101010101010101010101')
check('boundary 4', solve([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), '00000100000000000000000000000000')
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 1030201000504070608090a0b0c0d0e0f030201000504070608090a0b0c0d0e0fPassed
boundary 20000000000000000000000000000000000000000000000000000000000000000Passed
boundary 30101010101010101010101010101010101010101010101010101010101010101Passed
boundary 40000010000000000000000000000000000000100000000000000000000000000Passed

SHA-256 / eb2ddf1e739b0fb80470f6a145b88b5003f18e7cbfb9732a291006b5d9915641

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

Case digest / 341185450044d89c6285ec1d529a935e5cd0153effd71ba2326e192dbeb0d081