FA-27276 / HTTP ranges / Open access
An origin adapter turns byte requests into bounded aligned storage reads: cached blocks retain slice mappings while skipping origin reads · case 01
An origin adapter turns byte requests into bounded aligned storage reads: cached blocks retain slice mappings while skipping origin reads.
ROOT CAUSE
The aligned-origin-read-plan-cached-block-fetch decision uses block=x['block'] needed=set() maps=[] for start,stop in x['requests']: parts=[] cursor=start while cursor<stop: page=cursor//block local=cursor-page*block count=min(stop-cursor,block-local) parts.append([page,local,count]) needed.add(page) cursor+=count maps.append(parts) reads=[] for page in sorted(needed): if False: continue absolute=page*block count=min(block,x['length']-absolute) reads.append([page,absolute,count]) return [reads,maps].
VERIFIED REPAIR
Apply the bounded decision exactly: block=x['block'] needed=set() maps=[] for start,stop in x['requests']: parts=[] cursor=start while cursor<stop: page=cursor//block local=cursor-page*block count=min(stop-cursor,block-local) parts.append([page,local,count]) needed.add(page) cursor+=count maps.append(parts) reads=[] for page in sorted(needed): if page in x['cached']: continue absolute=page*block count=min(block,x['length']-absolute) reads.append([page,absolute,count]) return [reads,maps]
Unsuccessful approach: The partial repair uses block=x['block'] needed=set() maps=[] for start,stop in x['requests']: parts=[] cursor=start while cursor<stop: page=cursor//block local=cursor-page*block count=min(stop-cursor,block-local) parts.append([page,local,count]) needed.add(page) cursor+=count maps.append(parts) reads=[] for page in sorted(needed): if page not in x['cached']: continue absolute=page*block count=min(block,x['length']-absolute) reads.append([page,absolute,count]) return [reads,maps], which still violates the stated contract.
Case contract
x contains complete object length, positive storage block size, ordered [start,stop) requested spans already within object, and cached block numbers. Return [uncached-block-reads,request-to-block-slices]. Each storage read is [block,absolute-start,count], clipped at EOF. Request maps contain [block,offset,count] for every crossed block, including cached ones; empty spans map to an empty list. Storage reads are deduplicated and sorted by block.
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(x):
block=x['block']
needed=set()
maps=[]
for start,stop in x['requests']:
parts=[]
cursor=start
while cursor<stop:
page=cursor//block
local=cursor-page*block
count=min(stop-cursor,block-local)
parts.append([page,local,count])
needed.add(page)
cursor+=count
maps.append(parts)
reads=[]
for page in sorted(needed):
if False: continue
absolute=page*block
count=min(block,x['length']-absolute)
reads.append([page,absolute,count])
return [reads,maps]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cached-block-fetch fixture 0', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[3,9]],'cached':[]}))), json.loads(json.dumps([[[0,0,4],[1,4,4],[2,8,2]],[[[0,3,1],[1,0,4],[2,0,1]]]])))
check('cached-block-fetch fixture 1', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[8,10],[0,2],[1,3]],'cached':[0]}))), json.loads(json.dumps([[[2,8,2]],[[[2,0,2]],[[0,0,2]],[[0,1,2]]]])))
check('cached-block-fetch fixture 2', json.loads(json.dumps(solve({'length':8,'block':4,'requests':[[0,4],[4,8]],'cached':[]}))), json.loads(json.dumps([[[0,0,4],[1,4,4]],[[[0,0,4]],[[1,0,4]]]])))
check('cached-block-fetch fixture 3', json.loads(json.dumps(solve({'length':0,'block':4,'requests':[[0,0]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('cached-block-fetch fixture 4', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[2,2]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('cached-block-fetch fixture 5', json.loads(json.dumps(solve({'length':3*N,'block':N,'requests':[[0,N],[N,2*N]],'cached':[0]}))), json.loads(json.dumps([[[1,N,N]],[[[0,0,N]],[[1,0,N]]]])))
check('cached-block-fetch fixture 6', json.loads(json.dumps(solve({'length':5,'block':4,'requests':[],'cached':[0]}))), json.loads(json.dumps([[],[]])))
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 |
|---|---|---|---|
| cached-block-fetch fixture 0 | [[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]] | [[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]] | Passed |
| cached-block-fetch fixture 1 | [[[0, 0, 4], [2, 8, 2]], [[[2, 0, 2]], [[0, 0, 2]], [[0, 1, 2]]]] | [[[2, 8, 2]], [[[2, 0, 2]], [[0, 0, 2]], [[0, 1, 2]]]] | Failed |
| cached-block-fetch fixture 2 | [[[0, 0, 4], [1, 4, 4]], [[[0, 0, 4]], [[1, 0, 4]]]] | [[[0, 0, 4], [1, 4, 4]], [[[0, 0, 4]], [[1, 0, 4]]]] | Passed |
| cached-block-fetch fixture 3 | [[], [[]]] | [[], [[]]] | Passed |
| cached-block-fetch fixture 4 | [[], [[]]] | [[], [[]]] | Passed |
| cached-block-fetch fixture 5 | [[[0, 0, 1], [1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]] | [[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]] | Failed |
| cached-block-fetch fixture 6 | [[], []] | [[], []] | Passed |
SHA-256 / 9c44992af873a8e37d5c0c89610662f812339b66ca86e67c2cac447e712e5fc4
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
block=x['block']
needed=set()
maps=[]
for start,stop in x['requests']:
parts=[]
cursor=start
while cursor<stop:
page=cursor//block
local=cursor-page*block
count=min(stop-cursor,block-local)
parts.append([page,local,count])
needed.add(page)
cursor+=count
maps.append(parts)
reads=[]
for page in sorted(needed):
if page not in x['cached']: continue
absolute=page*block
count=min(block,x['length']-absolute)
reads.append([page,absolute,count])
return [reads,maps]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cached-block-fetch fixture 0', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[3,9]],'cached':[]}))), json.loads(json.dumps([[[0,0,4],[1,4,4],[2,8,2]],[[[0,3,1],[1,0,4],[2,0,1]]]])))
check('cached-block-fetch fixture 1', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[8,10],[0,2],[1,3]],'cached':[0]}))), json.loads(json.dumps([[[2,8,2]],[[[2,0,2]],[[0,0,2]],[[0,1,2]]]])))
check('cached-block-fetch fixture 2', json.loads(json.dumps(solve({'length':8,'block':4,'requests':[[0,4],[4,8]],'cached':[]}))), json.loads(json.dumps([[[0,0,4],[1,4,4]],[[[0,0,4]],[[1,0,4]]]])))
check('cached-block-fetch fixture 3', json.loads(json.dumps(solve({'length':0,'block':4,'requests':[[0,0]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('cached-block-fetch fixture 4', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[2,2]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('cached-block-fetch fixture 5', json.loads(json.dumps(solve({'length':3*N,'block':N,'requests':[[0,N],[N,2*N]],'cached':[0]}))), json.loads(json.dumps([[[1,N,N]],[[[0,0,N]],[[1,0,N]]]])))
check('cached-block-fetch fixture 6', json.loads(json.dumps(solve({'length':5,'block':4,'requests':[],'cached':[0]}))), json.loads(json.dumps([[],[]])))
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 |
|---|---|---|---|
| cached-block-fetch fixture 0 | [[], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]] | [[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]] | Failed |
| cached-block-fetch fixture 1 | [[[0, 0, 4]], [[[2, 0, 2]], [[0, 0, 2]], [[0, 1, 2]]]] | [[[2, 8, 2]], [[[2, 0, 2]], [[0, 0, 2]], [[0, 1, 2]]]] | Failed |
| cached-block-fetch fixture 2 | [[], [[[0, 0, 4]], [[1, 0, 4]]]] | [[[0, 0, 4], [1, 4, 4]], [[[0, 0, 4]], [[1, 0, 4]]]] | Failed |
| cached-block-fetch fixture 3 | [[], [[]]] | [[], [[]]] | Passed |
| cached-block-fetch fixture 4 | [[], [[]]] | [[], [[]]] | Passed |
| cached-block-fetch fixture 5 | [[[0, 0, 1]], [[[0, 0, 1]], [[1, 0, 1]]]] | [[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]] | Failed |
| cached-block-fetch fixture 6 | [[], []] | [[], []] | Passed |
SHA-256 / 3e0318014597e8a77b74ae77449cf372505b1e9e88f39790a313e61c8c4fa7c1
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
block=x['block']
needed=set()
maps=[]
for start,stop in x['requests']:
parts=[]
cursor=start
while cursor<stop:
page=cursor//block
local=cursor-page*block
count=min(stop-cursor,block-local)
parts.append([page,local,count])
needed.add(page)
cursor+=count
maps.append(parts)
reads=[]
for page in sorted(needed):
if page in x['cached']: continue
absolute=page*block
count=min(block,x['length']-absolute)
reads.append([page,absolute,count])
return [reads,maps]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cached-block-fetch fixture 0', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[3,9]],'cached':[]}))), json.loads(json.dumps([[[0,0,4],[1,4,4],[2,8,2]],[[[0,3,1],[1,0,4],[2,0,1]]]])))
check('cached-block-fetch fixture 1', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[8,10],[0,2],[1,3]],'cached':[0]}))), json.loads(json.dumps([[[2,8,2]],[[[2,0,2]],[[0,0,2]],[[0,1,2]]]])))
check('cached-block-fetch fixture 2', json.loads(json.dumps(solve({'length':8,'block':4,'requests':[[0,4],[4,8]],'cached':[]}))), json.loads(json.dumps([[[0,0,4],[1,4,4]],[[[0,0,4]],[[1,0,4]]]])))
check('cached-block-fetch fixture 3', json.loads(json.dumps(solve({'length':0,'block':4,'requests':[[0,0]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('cached-block-fetch fixture 4', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[2,2]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('cached-block-fetch fixture 5', json.loads(json.dumps(solve({'length':3*N,'block':N,'requests':[[0,N],[N,2*N]],'cached':[0]}))), json.loads(json.dumps([[[1,N,N]],[[[0,0,N]],[[1,0,N]]]])))
check('cached-block-fetch fixture 6', json.loads(json.dumps(solve({'length':5,'block':4,'requests':[],'cached':[0]}))), json.loads(json.dumps([[],[]])))
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 |
|---|---|---|---|
| cached-block-fetch fixture 0 | [[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]] | [[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]] | Passed |
| cached-block-fetch fixture 1 | [[[2, 8, 2]], [[[2, 0, 2]], [[0, 0, 2]], [[0, 1, 2]]]] | [[[2, 8, 2]], [[[2, 0, 2]], [[0, 0, 2]], [[0, 1, 2]]]] | Passed |
| cached-block-fetch fixture 2 | [[[0, 0, 4], [1, 4, 4]], [[[0, 0, 4]], [[1, 0, 4]]]] | [[[0, 0, 4], [1, 4, 4]], [[[0, 0, 4]], [[1, 0, 4]]]] | Passed |
| cached-block-fetch fixture 3 | [[], [[]]] | [[], [[]]] | Passed |
| cached-block-fetch fixture 4 | [[], [[]]] | [[], [[]]] | Passed |
| cached-block-fetch fixture 5 | [[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]] | [[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]] | Passed |
| cached-block-fetch fixture 6 | [[], []] | [[], []] | Passed |
SHA-256 / 0d72ac3b819153b1065b1db96a8329de9e649369a04018b80cb203e0d2cbf61c
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:23.648785+00:00.
Case digest / 895485af6b9292a6b1160539415cb0e86c4a0cd79d2dcba8bbe6b26e9c1a654c