FAILURE MAP
← Case archive

FA-27186 / HTTP ranges / Open access

A multipart sender resumes framing and payload segments across transport credit windows: zero-byte windows remain visible to the transport caller · case 01

A multipart sender resumes framing and payload segments across transport credit windows: zero-byte windows remain visible to the transport caller.

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

ROOT CAUSE

The multipart-write-cursor-window-retention 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=0 continue if budget==0: break amount=min(budget,len(segment)-offset) sent+=segment[offset:offset+amount] offset+=amount budget-=amount if sent: out.append(sent) return [out,index,offset].

THE FAILURE

The multipart-write-cursor-window-retention 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=0 continue if budget==0: break amount=min(budget,len(segment)-offset) sent+=segment[offset:offset+amount] offset+=amount budget-=amount if sent: 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 continue if budget==0: break amount=min(budget,len(segment)-offset) sent+=segment[offset:offset+amount] offset+=amount budget-=amount if sent or budget>0: 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=0
                continue
            if budget==0: break
            amount=min(budget,len(segment)-offset)
            sent+=segment[offset:offset+amount]
            offset+=amount
            budget-=amount
        if sent: out.append(sent)
    return [out,index,offset]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('window-retention 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('window-retention 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('window-retention fixture 2', json.loads(json.dumps(solve({'segments':['','A','','BC',''],'budgets':[0,2,1]}))), json.loads(json.dumps([['','AB','C'],5,0])))
check('window-retention fixture 3', json.loads(json.dumps(solve({'segments':[],'budgets':[0,1]}))), json.loads(json.dumps([['',''],0,0])))
check('window-retention fixture 4', json.loads(json.dumps(solve({'segments':['ABCDE'],'budgets':[2,1]}))), json.loads(json.dumps([['AB','C'],0,3])))
check('window-retention fixture 5', json.loads(json.dumps(solve({'segments':["p"*N,'X'],'budgets':[N,1]}))), json.loads(json.dumps([["p"*N,'X'],2,0])))
check('window-retention 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
window-retention fixture 0[['--', 'bH', 'BOD', 'Y\r\n'], 4, 0][['--', 'bH', 'BOD', 'Y\r\n'], 4, 0]Passed
window-retention fixture 1[['A', 'B', 'C'], 2, 0][['A', '', 'B', 'C', ''], 2, 0]Failed
window-retention fixture 2[['AB', 'C'], 5, 0][['', 'AB', 'C'], 5, 0]Failed
window-retention fixture 3[[], 0, 0][['', ''], 0, 0]Failed
window-retention fixture 4[['AB', 'C'], 0, 3][['AB', 'C'], 0, 3]Passed
window-retention fixture 5[['p', 'X'], 2, 0][['p', 'X'], 2, 0]Passed
window-retention fixture 6[['ABCD'], 1, 2][['ABCD'], 1, 2]Passed

SHA-256 / 4a6083f49c1fd579a3fb629d158ad870800cd69eb2232cde1d6497e67f1b892a

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

SHA-256 / 453124b9e958db42303b7f68a71f605d1df6f3186a9ef1d061ea8cca03ac268e

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

Case digest / 7bba6f7bbd25ba7a423e9108e47bf840a7d14d873368d78f610462807c9ac6f4