FA-26501 / HTTP ranges / Open access
Missing cached bytes remain unavailable instead of becoming zero bytes · case 01
Missing cached bytes remain unavailable instead of becoming zero bytes.
ROOT CAUSE
The cache-holes-not-zero-filled decision uses return "".join(cells.get(i,"\x00") for i in offsets).
VERIFIED REPAIR
Apply the bounded decision exactly: return "".join(cells[i] for i in offsets) if all(i in cells for i in offsets) else None
Unsuccessful approach: The partial repair uses return "".join(cells[i] for i in offsets if i in cells), which still violates the stated contract.
Case contract
cells maps integer offsets to one-character strings. Return the requested bytes only if every requested offset exists, else None; empty request returns empty.
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(cells, offsets):
return "".join(cells.get(i,"\x00") for i in offsets)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cache-holes-not-zero-filled fixture 0', solve( {N:"a"},[N,N+1]), None)
check('cache-holes-not-zero-filled fixture 1', solve({},[N]), None)
check('cache-holes-not-zero-filled fixture 2', solve({N:"a"},[N]), "a")
check('cache-holes-not-zero-filled fixture 3', solve({},[]), "")
check('cache-holes-not-zero-filled fixture 4', solve({0:"\x00"},[0]), "\x00")
check('cache-holes-not-zero-filled fixture 5', solve({0:"a",1:"b"},[1,0]), "ba")
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| cache-holes-not-zero-filled fixture 0 | a | None | Failed |
| cache-holes-not-zero-filled fixture 1 | |