FAILURE MAP
← Case archive

FA-27256 / HTTP ranges / Open access

An origin adapter turns byte requests into bounded aligned storage reads: one request keeps all of its crossed block slices · case 01

An origin adapter turns byte requests into bounded aligned storage reads: one request keeps all of its crossed block slices.

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

ROOT CAUSE

The aligned-origin-read-plan-request-map-append 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=[[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].

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.insert(0,[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], 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=[[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('request-map-append 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('request-map-append 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('request-map-append 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('request-map-append fixture 3', json.loads(json.dumps(solve({'length':0,'block':4,'requests':[[0,0]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('request-map-append fixture 4', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[2,2]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('request-map-append 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('request-map-append 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 fixtureActualExpectedOutcome
request-map-append fixture 0[[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[2, 0, 1]]]][[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]]Failed
request-map-append 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
request-map-append 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
request-map-append fixture 3[[], [[]]][[], [[]]]Passed
request-map-append fixture 4[[], [[]]][[], [[]]]Passed
request-map-append fixture 5[[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]][[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]]Passed
request-map-append fixture 6[[], []][[], []]Passed

SHA-256 / 52f8b7880d4c552c80b61eb36bc9cab455816868779123e0fa79836394941e4c

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.insert(0,[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('request-map-append 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('request-map-append 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('request-map-append 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('request-map-append fixture 3', json.loads(json.dumps(solve({'length':0,'block':4,'requests':[[0,0]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('request-map-append fixture 4', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[2,2]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('request-map-append 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('request-map-append 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 fixtureActualExpectedOutcome
request-map-append fixture 0[[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[2, 0, 1], [1, 0, 4], [0, 3, 1]]]][[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]]Failed
request-map-append 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
request-map-append 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
request-map-append fixture 3[[], [[]]][[], [[]]]Passed
request-map-append fixture 4[[], [[]]][[], [[]]]Passed
request-map-append fixture 5[[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]][[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]]Passed
request-map-append fixture 6[[], []][[], []]Passed

SHA-256 / 8a3c34a111f240dffdb24abcd4f96ef82ba2a02c6f88af346940686d55a9c435

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('request-map-append 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('request-map-append 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('request-map-append 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('request-map-append fixture 3', json.loads(json.dumps(solve({'length':0,'block':4,'requests':[[0,0]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('request-map-append fixture 4', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[2,2]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('request-map-append 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('request-map-append 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 fixtureActualExpectedOutcome
request-map-append 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
request-map-append 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
request-map-append 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
request-map-append fixture 3[[], [[]]][[], [[]]]Passed
request-map-append fixture 4[[], [[]]][[], [[]]]Passed
request-map-append fixture 5[[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]][[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]]Passed
request-map-append fixture 6[[], []][[], []]Passed

SHA-256 / 05ce4e38a0a701d9719fb39eb3bc4c79b9af132596271c82f4e315eb857e7787

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

Case digest / cd869b41b1d7245036e50693521348980382560554b9159580a5e77f55581f0e