FAILURE MAP
← Case archive

FA-26566 / HTTP ranges / Open access

A would-block read does not mean representation EOF · case 01

A would-block read does not mean representation EOF.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The stream-empty-read-would-block decision uses return ["data",data] if data else ["eof",""].

VERIFIED REPAIR

Apply the bounded decision exactly: return ["data",data] if data else (["wait",""] if blocked else (["eof",""] if eof else ["idle",""]))

Unsuccessful approach: The partial repair uses return ["data",data] if data else (["wait",""] if blocked else ["eof",""]), which still violates the stated contract.

Case contract

Return data if nonempty; otherwise wait when blocked, eof when explicit EOF, else idle. The transport never marks blocked and eof simultaneously.

Why this case matters

Range responses combine representation identity, conditional requests, framing, and partial-object state.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(data, eof, blocked):
    return ["data",data] if data else ["eof",""]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-empty-read-would-block fixture 0', solve("",False,True), ["wait",""])
check('stream-empty-read-would-block fixture 1', solve("",False,False), ["idle",""])
check('stream-empty-read-would-block fixture 2', solve("",True,False), ["eof",""])
check('stream-empty-read-would-block fixture 3', solve("p"*N,False,False), ["data","p"*N])
check('stream-empty-read-would-block fixture 4', solve("x",True,False), ["data","x"])
check('stream-empty-read-would-block fixture 5', solve("p"*N,False,True), ["data","p"*N])
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
stream-empty-read-would-block fixture 0['eof', '']['wait', '']Failed
stream-empty-read-would-block fixture 1['eof', '']['idle', '']Failed
stream-empty-read-would-block fixture 2['eof', '']['eof', '']Passed
stream-empty-read-would-block fixture 3['data', 'p']['data', 'p']Passed
stream-empty-read-would-block fixture 4['data', 'x']['data', 'x']Passed
stream-empty-read-would-block fixture 5['data', 'p']['data', 'p']Passed

SHA-256 / 054714645a19ff3c2406f84052021db9265a13a1ca918226ebfcb53ddb6e09f3

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(data, eof, blocked):
    return ["data",data] if data else (["wait",""] if blocked else ["eof",""])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-empty-read-would-block fixture 0', solve("",False,True), ["wait",""])
check('stream-empty-read-would-block fixture 1', solve("",False,False), ["idle",""])
check('stream-empty-read-would-block fixture 2', solve("",True,False), ["eof",""])
check('stream-empty-read-would-block fixture 3', solve("p"*N,False,False), ["data","p"*N])
check('stream-empty-read-would-block fixture 4', solve("x",True,False), ["data","x"])
check('stream-empty-read-would-block fixture 5', solve("p"*N,False,True), ["data","p"*N])
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
stream-empty-read-would-block fixture 0['wait', '']['wait', '']Passed
stream-empty-read-would-block fixture 1['eof', '']['idle', '']Failed
stream-empty-read-would-block fixture 2['eof', '']['eof', '']Passed
stream-empty-read-would-block fixture 3['data', 'p']['data', 'p']Passed
stream-empty-read-would-block fixture 4['data', 'x']['data', 'x']Passed
stream-empty-read-would-block fixture 5['data', 'p']['data', 'p']Passed

SHA-256 / 0d7d00dd3f5239a580d4052245876981b9cfa393515b562589ca31280a50d268

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(data, eof, blocked):
    return ["data",data] if data else (["wait",""] if blocked else (["eof",""] if eof else ["idle",""]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-empty-read-would-block fixture 0', solve("",False,True), ["wait",""])
check('stream-empty-read-would-block fixture 1', solve("",False,False), ["idle",""])
check('stream-empty-read-would-block fixture 2', solve("",True,False), ["eof",""])
check('stream-empty-read-would-block fixture 3', solve("p"*N,False,False), ["data","p"*N])
check('stream-empty-read-would-block fixture 4', solve("x",True,False), ["data","x"])
check('stream-empty-read-would-block fixture 5', solve("p"*N,False,True), ["data","p"*N])
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
stream-empty-read-would-block fixture 0['wait', '']['wait', '']Passed
stream-empty-read-would-block fixture 1['idle', '']['idle', '']Passed
stream-empty-read-would-block fixture 2['eof', '']['eof', '']Passed
stream-empty-read-would-block fixture 3['data', 'p']['data', 'p']Passed
stream-empty-read-would-block fixture 4['data', 'x']['data', 'x']Passed
stream-empty-read-would-block fixture 5['data', 'p']['data', 'p']Passed

SHA-256 / 9a66e775b8b3ff5a0594df1d0a035f6d1ca37988ad6e5fcc57f5be9917fb53b2

Verification & scope

Deterministic simplified range service, with stipulated local policies and already parsed trusted inputs; not a complete HTTP implementation. 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:41:17.071731+00:00.

Case digest / 78821035ff74b6f9b2ed6badc43fd28396bb861c2e253058e2e7c98c5c794ad0