FAILURE MAP
← Case archive

FA-3746 / Binary formats / Open access

An all-ones unsigned sentinel becomes a valid length · case 01

An all-ones unsigned sentinel becomes a valid length.

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 a 16-bit big-endian length; all ones means missing and returns None.

THE FAILURE

The implementation applies an operation whose text or grammar semantics violate this contract: Decode a 16-bit big-endian length; all ones means missing and returns None.

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

Case contract

Decode a 16-bit big-endian length; all ones means missing and 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:
        return int.from_bytes(bytes(x),"big")
    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([255, 255]), None)
check('boundary 2', solve([1, 1]), 257)
check('boundary 3', solve([0, 0]), 0)
check('boundary 4', solve([255, 0]), 65280)
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 165535NoneFailed
boundary 2257257Passed
boundary 300Passed
boundary 46528065280Passed

SHA-256 / ba43aaa04539a79e72c9d60e14062e41d4e6821e065bb1d7712ed71e7b08d5e0

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 None if all(x) else int.from_bytes(bytes(x),"big")
    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([255, 255]), None)
check('boundary 2', solve([1, 1]), 257)
check('boundary 3', solve([0, 0]), 0)
check('boundary 4', solve([255, 0]), 65280)
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 2None257Failed
boundary 300Passed
boundary 46528065280Passed

SHA-256 / 752add5a834ddba427d163f26db309663ba8193f51fcdcdb4ab793dee9f9c830

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 1d9a006d93cc10fc8e5574f9fd41d936c64a91be7f0637feda68237207ff24c8