FAILURE MAP
← Case archive

FA-3736 / Binary formats / Open access

A binary boolean treats all nonzero octets as true · case 01

A binary boolean treats all nonzero octets as true.

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 0 as False, 1 as True and reject every other octet with None.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Decode 0 as False, 1 as True and reject every other octet with None.

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

Case contract

Decode 0 as False, 1 as True and reject every other octet with 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:
        return bool(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(2), None)
check('boundary 2', solve(255), None)
check('boundary 3', solve(0), False)
check('boundary 4', solve(1), True)
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 1TrueNoneFailed
boundary 2TrueNoneFailed
boundary 3FalseFalsePassed
boundary 4TrueTruePassed

SHA-256 / c6616214a24402f01f0c00777fca6a00bbd69d89ac1cf3155a91a50fdb83f089

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==1
    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(2), None)
check('boundary 2', solve(255), None)
check('boundary 3', solve(0), False)
check('boundary 4', solve(1), True)
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 1FalseNoneFailed
boundary 2FalseNoneFailed
boundary 3FalseFalsePassed
boundary 4TrueTruePassed

SHA-256 / 1f1fdbd58ba630da29d5cfd1068176496d03ebb5da28ae03922c9c7057b0593a

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 bool(x) if x in (0,1) else 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(2), None)
check('boundary 2', solve(255), None)
check('boundary 3', solve(0), False)
check('boundary 4', solve(1), True)
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 3FalseFalsePassed
boundary 4TrueTruePassed

SHA-256 / 06d4249eb039fd68af5d15954cf71f84904ad7c69af40451b8772734455b4611

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

Case digest / 2629ab94d945a58d7c8ff77a3bf35bb669950f123dc44ac91652a1ee416feca9