FAILURE MAP
← Case archive

FA-3721 / Binary formats / Open access

A complemented byte mask includes unbounded high bits · case 01

A complemented byte mask includes unbounded high bits.

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: Complement all eight bits of an octet and retain an octet result.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Complement all eight bits of an octet and retain an octet result.

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

Case contract

Complement all eight bits of an octet and retain an octet result.

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 ~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(0), 255)
check('boundary 2', solve(255), 0)
check('boundary 3', solve(128), 127)
check('boundary 4', solve(1), 254)
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-1255Failed
boundary 2-2560Failed
boundary 3-129127Failed
boundary 4-2254Failed

SHA-256 / fed8d26bb70b825c9b3ef3b39a5b161acd927c91ac834ad1a2c3c7f9f9a93fe2

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 -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(0), 255)
check('boundary 2', solve(255), 0)
check('boundary 3', solve(128), 127)
check('boundary 4', solve(1), 254)
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 10255Failed
boundary 2-2550Failed
boundary 3-128127Failed
boundary 4-1254Failed

SHA-256 / 5231476671d2950064fb9bcaff317b1aaa92f892161c01898151e66bba1d850f

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 x^255
    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), 255)
check('boundary 2', solve(255), 0)
check('boundary 3', solve(128), 127)
check('boundary 4', solve(1), 254)
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 1255255Passed
boundary 200Passed
boundary 3127127Passed
boundary 4254254Passed

SHA-256 / 5ae2f4401131ef0f8f5476a05e072a57597015387061457af7eebaf91fb68229

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

Case digest / 60788ab52751a8f6f7c84f292ae79a1dfa3c425bdd1ecda1cb6e881db2bf6fb0