FAILURE MAP
← Case archive

FA-27251 / HTTP ranges / Open access

An origin adapter turns byte requests into bounded aligned storage reads: each slice stops at the current storage block boundary · case 01

An origin adapter turns byte requests into bounded aligned storage reads: each slice stops at the current storage block boundary.

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

ROOT CAUSE

The aligned-origin-read-plan-page-tail 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) 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].

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

SHA-256 / 72d95aea12af56349a78d701e54d470442204f444ea170da8b021cf223781497

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

SHA-256 / 1efb91d11c8df59f12d58b1c65ef5d065a420818f99728e47b3c164a6da3884f

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

SHA-256 / 7e028f54ca33d3fdc91d7488db958a24420155a3bfc3249cf0f659412964fa7a

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

Case digest / ae5e0a54ffdc142c77839aa33bf520261567b64a51e4cc8f6605b7e3c315a8fd