FAILURE MAP
← Case archive

FA-27266 / HTTP ranges / Open access

An origin adapter turns byte requests into bounded aligned storage reads: the next block slice begins after bytes actually mapped · case 01

An origin adapter turns byte requests into bounded aligned storage reads: the next block slice begins after bytes actually mapped.

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

ROOT CAUSE

The aligned-origin-read-plan-cursor-step 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+=block 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].

THE FAILURE

The aligned-origin-read-plan-cursor-step 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+=block 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+=max(1,count-1) 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.append([page,local,count])
            needed.add(page)
            cursor+=block
        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('cursor-step 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('cursor-step 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('cursor-step 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('cursor-step fixture 3', json.loads(json.dumps(solve({'length':0,'block':4,'requests':[[0,0]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('cursor-step fixture 4', json.loads(json.dumps(solve({'length':10,'block':4,'requests':[[2,2]],'cached':[]}))), json.loads(json.dumps([[],[[]]])))
check('cursor-step 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('cursor-step 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
cursor-step fixture 0[[[0, 0, 4], [1, 4, 4]], [[[0, 3, 1], [1, 3, 1]]]][[[0, 0, 4], [1, 4, 4], [2, 8, 2]], [[[0, 3, 1], [1, 0, 4], [2, 0, 1]]]]Failed
cursor-step 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
cursor-step 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
cursor-step fixture 3[[], [[]]][[], [[]]]Passed
cursor-step fixture 4[[], [[]]][[], [[]]]Passed
cursor-step fixture 5[[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]][[[1, 1, 1]], [[[0, 0, 1]], [[1, 0, 1]]]]Passed
cursor-step fixture 6[[], []][[], []]Passed

SHA-256 / 924149c8c7c9615c5ab7320ed4b104af326ab8398abd0fbef5518c8bf2349f30

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

SHA-256 / 6130e7946a8264f4f7c9f2be4d44a30f3bd16de938ded2f5297d9e0a3c8d5879

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 4d8324e6abc21b61125d2b297ac9ee2d4e5ffb4cd3063e20dd6f24464fa62ee5