FAILURE MAP
← Case archive

FA-26926 / HTTP ranges / Open access

A packed-object origin maps logical byte requests to immutable backing objects: Python negative indices cannot stand in for physical object offsets · case 01

A packed-object origin maps logical byte requests to immutable backing objects: Python negative indices cannot stand in for physical object offsets.

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

ROOT CAUSE

The packed-origin-map-negative-physical decision uses cells={} for logical,handle,physical,count in x['extents']: if count==0: continue if logical<0 or count<0: return None if handle not in x['packs']: return None pack=x['packs'][handle] if physical+count>len(pack): return None for i in range(count): at=logical+i if at in cells: return None cells[at]=pack[physical+i] if any(at not in cells for at in x['requested']): return None return ''.join(cells[at] for at in x['requested']).

THE FAILURE

The packed-origin-map-negative-physical decision uses cells={} for logical,handle,physical,count in x['extents']: if count==0: continue if logical<0 or count<0: return None if handle not in x['packs']: return None pack=x['packs'][handle] if physical+count>len(pack): return None for i in range(count): at=logical+i if at in cells: return None cells[at]=pack[physical+i] if any(at not in cells for at in x['requested']): return None return ''.join(cells[at] for at in x['requested']).

Unsuccessful approach: The partial repair uses cells={} for logical,handle,physical,count in x['extents']: if count==0: continue if logical<0 or physical<-1 or count<0: return None if handle not in x['packs']: return None pack=x['packs'][handle] if physical+count>len(pack): return None for i in range(count): at=logical+i if at in cells: return None cells[at]=pack[physical+i] if any(at not in cells for at in x['requested']): return None return ''.join(cells[at] for at in x['requested']), which still violates the stated contract.

Case contract

x has pack strings keyed by handle, extent rows [logical-start,handle,physical-start,count], and explicit requested logical offsets. Extents may arrive unordered. Empty extents ignored. Reject negative mapping coordinates, missing handles, out-of-pack spans, or overlapping logical ownership. Return requested characters in request order, retaining repeated requested offsets; unavailable requested offsets yield None. This is a bounded storage adapter underlying HTTP range delivery, not interval normalization.

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):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<0 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-physical fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-physical fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-physical fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-physical fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-physical fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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
negative-physical fixture 0axbyczaxbyczPassed
negative-physical fixture 1caccacPassed
negative-physical fixture 2NoneNonePassed
negative-physical fixture 3NoneNonePassed
negative-physical fixture 4aaPassed
negative-physical fixture 5NoneNonePassed
negative-physical fixture 6cNoneFailed
negative-physical fixture 7NoneNonePassed
negative-physical fixture 8NoneNonePassed
negative-physical fixture 9NoneNonePassed
negative-physical fixture 10Passed
negative-physical fixture 11ppPassed

SHA-256 / 5a38134c1512dda1a0fa7143ba8e68fbfb5823fab4f24796d8c7a4fecd20d00e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<0 or physical<-1 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-physical fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-physical fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-physical fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-physical fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-physical fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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
negative-physical fixture 0axbyczaxbyczPassed
negative-physical fixture 1caccacPassed
negative-physical fixture 2NoneNonePassed
negative-physical fixture 3NoneNonePassed
negative-physical fixture 4aaPassed
negative-physical fixture 5NoneNonePassed
negative-physical fixture 6cNoneFailed
negative-physical fixture 7NoneNonePassed
negative-physical fixture 8NoneNonePassed
negative-physical fixture 9NoneNonePassed
negative-physical fixture 10Passed
negative-physical fixture 11ppPassed

SHA-256 / 91a5a7e4cad38b4bb2e258f011b343e281849f86114992e6e9ab0ba7b37d7395

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 12 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:20.307551+00:00.

Case digest / 200f8e0af261f00e74b26559aa07ab4d316291bb598972968ad4f076dc94d831