FAILURE MAP
← Case archive

FA-27146 / HTTP ranges / Open access

A multipart sender resumes framing and payload segments across transport credit windows: a new framing component starts at its own zero offset · case 01

A multipart sender resumes framing and payload segments across transport credit windows: a new framing component starts at its own zero offset.

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

ROOT CAUSE

The multipart-write-cursor-offset-reset decision uses segments=x['segments'] index=0 offset=0 out=[] for budget in x['budgets']: sent='' while index<len(segments): segment=segments[index] if offset>=len(segment): index+=1 offset=min(offset,len(segments[index])) if index<len(segments) else 0 continue if budget==0: break amount=min(budget,len(segment)-offset) sent+=segment[offset:offset+amount] offset+=amount budget-=amount out.append(sent) return [out,index,offset].

THE FAILURE

The multipart-write-cursor-offset-reset decision uses segments=x['segments'] index=0 offset=0 out=[] for budget in x['budgets']: sent='' while index<len(segments): segment=segments[index] if offset>=len(segment): index+=1 offset=min(offset,len(segments[index])) if index<len(segments) else 0 continue if budget==0: break amount=min(budget,len(segment)-offset) sent+=segment[offset:offset+amount] offset+=amount budget-=amount out.append(sent) return [out,index,offset].

Unsuccessful approach: The partial repair uses segments=x['segments'] index=0 offset=0 out=[] for budget in x['budgets']: sent='' while index<len(segments): segment=segments[index] if offset>=len(segment): index+=1 offset=0 if index==len(segments) else min(1,len(segments[index])) continue if budget==0: break amount=min(budget,len(segment)-offset) sent+=segment[offset:offset+amount] offset+=amount budget-=amount out.append(sent) return [out,index,offset], which still violates the stated contract.

Case contract

x has nonempty ASCII segments representing alternating boundary/header/body/framing bytes, and nonnegative write budgets. Drain in order, consuming each budget across segment boundaries. Return [one emitted string per budget,segment-index,intra-segment-offset]. Empty segments are skipped even with zero budget. A exhausted plan is stable. These preframed segments isolate cursor management from wire-format construction.

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):
    segments=x['segments']
    index=0
    offset=0
    out=[]
    for budget in x['budgets']:
        sent=''
        while index<len(segments):
            segment=segments[index]
            if offset>=len(segment):
                index+=1
                offset=min(offset,len(segments[index])) if index<len(segments) else 0
                continue
            if budget==0: break
            amount=min(budget,len(segment)-offset)
            sent+=segment[offset:offset+amount]
            offset+=amount
            budget-=amount
        out.append(sent)
    return [out,index,offset]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('offset-reset fixture 0', json.loads(json.dumps(solve({'segments':['--b','H','BODY','\r\n'],'budgets':[2,2,3,3]}))), json.loads(json.dumps([['--','bH','BOD','Y\r\n'],4,0])))
check('offset-reset fixture 1', json.loads(json.dumps(solve({'segments':['A','BC'],'budgets':[1,0,1,1,1]}))), json.loads(json.dumps([['A','','B','C',''],2,0])))
check('offset-reset fixture 2', json.loads(json.dumps(solve({'segments':['','A','','BC',''],'budgets':[0,2,1]}))), json.loads(json.dumps([['','AB','C'],5,0])))
check('offset-reset fixture 3', json.loads(json.dumps(solve({'segments':[],'budgets':[0,1]}))), json.loads(json.dumps([['',''],0,0])))
check('offset-reset fixture 4', json.loads(json.dumps(solve({'segments':['ABCDE'],'budgets':[2,1]}))), json.loads(json.dumps([['AB','C'],0,3])))
check('offset-reset fixture 5', json.loads(json.dumps(solve({'segments':["p"*N,'X'],'budgets':[N,1]}))), json.loads(json.dumps([["p"*N,'X'],2,0])))
check('offset-reset fixture 6', json.loads(json.dumps(solve({'segments':['AB','CDE'],'budgets':[4]}))), json.loads(json.dumps([['ABCD'],1,2])))
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
offset-reset fixture 0[['--', 'bO', 'DY', ''], 4, 0][['--', 'bH', 'BOD', 'Y\r\n'], 4, 0]Failed
offset-reset fixture 1[['A', '', 'C', '', ''], 2, 0][['A', '', 'B', 'C', ''], 2, 0]Failed
offset-reset fixture 2[['', 'AB', 'C'], 5, 0][['', 'AB', 'C'], 5, 0]Passed
offset-reset fixture 3[['', ''], 0, 0][['', ''], 0, 0]Passed
offset-reset fixture 4[['AB', 'C'], 0, 3][['AB', 'C'], 0, 3]Passed
offset-reset fixture 5[['p', ''], 2, 0][['p', 'X'], 2, 0]Failed
offset-reset fixture 6[['ABE'], 2, 0][['ABCD'], 1, 2]Failed

SHA-256 / e3e4c325d3bf954f8ec509b57d85cef1a8d6fcff08ad21996579d46e40b6a649

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    segments=x['segments']
    index=0
    offset=0
    out=[]
    for budget in x['budgets']:
        sent=''
        while index<len(segments):
            segment=segments[index]
            if offset>=len(segment):
                index+=1
                offset=0 if index==len(segments) else min(1,len(segments[index]))
                continue
            if budget==0: break
            amount=min(budget,len(segment)-offset)
            sent+=segment[offset:offset+amount]
            offset+=amount
            budget-=amount
        out.append(sent)
    return [out,index,offset]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('offset-reset fixture 0', json.loads(json.dumps(solve({'segments':['--b','H','BODY','\r\n'],'budgets':[2,2,3,3]}))), json.loads(json.dumps([['--','bH','BOD','Y\r\n'],4,0])))
check('offset-reset fixture 1', json.loads(json.dumps(solve({'segments':['A','BC'],'budgets':[1,0,1,1,1]}))), json.loads(json.dumps([['A','','B','C',''],2,0])))
check('offset-reset fixture 2', json.loads(json.dumps(solve({'segments':['','A','','BC',''],'budgets':[0,2,1]}))), json.loads(json.dumps([['','AB','C'],5,0])))
check('offset-reset fixture 3', json.loads(json.dumps(solve({'segments':[],'budgets':[0,1]}))), json.loads(json.dumps([['',''],0,0])))
check('offset-reset fixture 4', json.loads(json.dumps(solve({'segments':['ABCDE'],'budgets':[2,1]}))), json.loads(json.dumps([['AB','C'],0,3])))
check('offset-reset fixture 5', json.loads(json.dumps(solve({'segments':["p"*N,'X'],'budgets':[N,1]}))), json.loads(json.dumps([["p"*N,'X'],2,0])))
check('offset-reset fixture 6', json.loads(json.dumps(solve({'segments':['AB','CDE'],'budgets':[4]}))), json.loads(json.dumps([['ABCD'],1,2])))
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
offset-reset fixture 0[['--', 'bO', 'DY\n', ''], 4, 0][['--', 'bH', 'BOD', 'Y\r\n'], 4, 0]Failed
offset-reset fixture 1[['A', '', 'C', '', ''], 2, 0][['A', '', 'B', 'C', ''], 2, 0]Failed
offset-reset fixture 2[['', 'C', ''], 5, 0][['', 'AB', 'C'], 5, 0]Failed
offset-reset fixture 3[['', ''], 0, 0][['', ''], 0, 0]Passed
offset-reset fixture 4[['AB', 'C'], 0, 3][['AB', 'C'], 0, 3]Passed
offset-reset fixture 5[['p', ''], 2, 0][['p', 'X'], 2, 0]Failed
offset-reset fixture 6[['ABDE'], 2, 0][['ABCD'], 1, 2]Failed

SHA-256 / 82d6db8462dfee01ed4ddb991ed2b9aeed5ccbcae3d9d06992096eed87be2341

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

Case digest / 60b2da6d2919beee768d44aaa235982f34fa659bf5525660a28248ef4821e8e2