FA-27206 / HTTP ranges / Open access
Concurrent download clients share bounded origin range reads: a scheduling turn does not overrun its origin request slot allowance · case 01
Concurrent download clients share bounded origin range reads: a scheduling turn does not overrun its origin request slot allowance.
ROOT CAUSE
The range-fetch-round-robin-dispatch-slots decision uses queues={} order=[] for client,start,count,cancelled in x['jobs']: if cancelled or count==0: continue if client not in queues: queues[client]=[] order.append(client) queues[client].append([start,count]) out=[] for slot in range(x['slots']+1): if not order: break client=order.pop(0) start,count=queues[client][0] amount=min(count,x['chunk']) out.append([client,start,amount]) if amount==count: queues[client].pop(0) else: queues[client][0]=[start+amount,count-amount] if queues[client]: order.append(client) pending=[[client,start,count] for client in order for start,count in queues[client]] return [out,pending].
VERIFIED REPAIR
Apply the bounded decision exactly: queues={} order=[] for client,start,count,cancelled in x['jobs']: if cancelled or count==0: continue if client not in queues: queues[client]=[] order.append(client) queues[client].append([start,count]) out=[] for slot in range(x['slots']): if not order: break client=order.pop(0) start,count=queues[client][0] amount=min(count,x['chunk']) out.append([client,start,amount]) if amount==count: queues[client].pop(0) else: queues[client][0]=[start+amount,count-amount] if queues[client]: order.append(client) pending=[[client,start,count] for client in order for start,count in queues[client]] return [out,pending]
Unsuccessful approach: The partial repair uses queues={} order=[] for client,start,count,cancelled in x['jobs']: if cancelled or count==0: continue if client not in queues: queues[client]=[] order.append(client) queues[client].append([start,count]) out=[] for slot in range(max(1,x['slots'])): if not order: break client=order.pop(0) start,count=queues[client][0] amount=min(count,x['chunk']) out.append([client,start,amount]) if amount==count: queues[client].pop(0) else: queues[client][0]=[start+amount,count-amount] if queues[client]: order.append(client) pending=[[client,start,count] for client in order for start,count in queues[client]] return [out,pending], which still violates the stated contract.
Case contract
x contains ordered jobs [client,absolute-start,count,cancelled], positive chunk size, and dispatch slot count. Drop canceled and zero-length jobs. Maintain first-appearance client order; each client has FIFO requests. Dispatch at most one chunk per client per round, rotate unfinished clients, split long ranges, and remove exhausted requests. Return [dispatches,pending-jobs], where dispatches are [client,start,count] and pending jobs retain scheduler order. This models range-specific origin request scheduling, without network retries.
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):
queues={}
order=[]
for client,start,count,cancelled in x['jobs']:
if cancelled or count==0: continue
if client not in queues:
queues[client]=[]
order.append(client)
queues[client].append([start,count])
out=[]
for slot in range(x['slots']+1):
if not order: break
client=order.pop(0)
start,count=queues[client][0]
amount=min(count,x['chunk'])
out.append([client,start,amount])
if amount==count:
queues[client].pop(0)
else:
queues[client][0]=[start+amount,count-amount]
if queues[client]: order.append(client)
pending=[[client,start,count] for client in order for start,count in queues[client]]
return [out,pending]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dispatch-slots fixture 0', json.loads(json.dumps(solve({'jobs':[['a',0,5,False],['b',10,2,False]],'chunk':2,'slots':4}))), json.loads(json.dumps([[['a',0,2],['b',10,2],['a',2,2],['a',4,1]],[]])))
check('dispatch-slots fixture 1', json.loads(json.dumps(solve({'jobs':[['b',10,2,False],['a',0,2,False]],'chunk':1,'slots':2}))), json.loads(json.dumps([[['b',10,1],['a',0,1]],[['b',11,1],['a',1,1]]])))
check('dispatch-slots fixture 2', json.loads(json.dumps(solve({'jobs':[['a',0,0,False],['b',10,2,True]],'chunk':1,'slots':2}))), json.loads(json.dumps([[],[]])))
check('dispatch-slots fixture 3', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',9,1,False],['b',4,1,False]],'chunk':2,'slots':2}))), json.loads(json.dumps([[['a',0,2],['b',4,1]],[['a',9,1]]])))
check('dispatch-slots fixture 4', json.loads(json.dumps(solve({'jobs':[['a',0,2,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2]]])))
check('dispatch-slots fixture 5', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',8,1,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2],['a',8,1]]])))
check('dispatch-slots fixture 6', json.loads(json.dumps(solve({'jobs':[['a',N,N+1,False]],'chunk':N,'slots':1}))), json.loads(json.dumps([[['a',N,N]],[['a',2*N,1]]])))
check('dispatch-slots fixture 7', json.loads(json.dumps(solve({'jobs':[['a',0,1,False]],'chunk':3,'slots':2}))), json.loads(json.dumps([[['a',0,1]],[]])))
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| dispatch-slots fixture 0 | [[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []] | [[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []] | Passed |
| dispatch-slots fixture 1 | [[['b', 10, 1], ['a', 0, 1], ['b', 11, 1]], [['a', 1, 1]]] | [[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]] | Failed |
| dispatch-slots fixture 2 | [[], []] | [[], []] | Passed |
| dispatch-slots fixture 3 | [[['a', 0, 2], ['b', 4, 1], ['a', 9, 1]], []] | [[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]] | Failed |
| dispatch-slots fixture 4 | [[['a', 0, 2]], []] | [[], [['a', 0, 2]]] | Failed |
| dispatch-slots fixture 5 | [[['a', 0, 2]], [['a', 8, 1]]] | [[], [['a', 0, 2], ['a', 8, 1]]] | Failed |
| dispatch-slots fixture 6 | [[['a', 1, 1], ['a', 2, 1]], []] | [[['a', 1, 1]], [['a', 2, 1]]] | Failed |
| dispatch-slots fixture 7 | [[['a', 0, 1]], []] | [[['a', 0, 1]], []] | Passed |
SHA-256 / b7603e9c16427e1eab3ff5ee4b07427dc1ee2b4fd8e450b9ac4480ce21f50fb9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
queues={}
order=[]
for client,start,count,cancelled in x['jobs']:
if cancelled or count==0: continue
if client not in queues:
queues[client]=[]
order.append(client)
queues[client].append([start,count])
out=[]
for slot in range(max(1,x['slots'])):
if not order: break
client=order.pop(0)
start,count=queues[client][0]
amount=min(count,x['chunk'])
out.append([client,start,amount])
if amount==count:
queues[client].pop(0)
else:
queues[client][0]=[start+amount,count-amount]
if queues[client]: order.append(client)
pending=[[client,start,count] for client in order for start,count in queues[client]]
return [out,pending]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dispatch-slots fixture 0', json.loads(json.dumps(solve({'jobs':[['a',0,5,False],['b',10,2,False]],'chunk':2,'slots':4}))), json.loads(json.dumps([[['a',0,2],['b',10,2],['a',2,2],['a',4,1]],[]])))
check('dispatch-slots fixture 1', json.loads(json.dumps(solve({'jobs':[['b',10,2,False],['a',0,2,False]],'chunk':1,'slots':2}))), json.loads(json.dumps([[['b',10,1],['a',0,1]],[['b',11,1],['a',1,1]]])))
check('dispatch-slots fixture 2', json.loads(json.dumps(solve({'jobs':[['a',0,0,False],['b',10,2,True]],'chunk':1,'slots':2}))), json.loads(json.dumps([[],[]])))
check('dispatch-slots fixture 3', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',9,1,False],['b',4,1,False]],'chunk':2,'slots':2}))), json.loads(json.dumps([[['a',0,2],['b',4,1]],[['a',9,1]]])))
check('dispatch-slots fixture 4', json.loads(json.dumps(solve({'jobs':[['a',0,2,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2]]])))
check('dispatch-slots fixture 5', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',8,1,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2],['a',8,1]]])))
check('dispatch-slots fixture 6', json.loads(json.dumps(solve({'jobs':[['a',N,N+1,False]],'chunk':N,'slots':1}))), json.loads(json.dumps([[['a',N,N]],[['a',2*N,1]]])))
check('dispatch-slots fixture 7', json.loads(json.dumps(solve({'jobs':[['a',0,1,False]],'chunk':3,'slots':2}))), json.loads(json.dumps([[['a',0,1]],[]])))
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| dispatch-slots fixture 0 | [[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []] | [[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []] | Passed |
| dispatch-slots fixture 1 | [[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]] | [[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]] | Passed |
| dispatch-slots fixture 2 | [[], []] | [[], []] | Passed |
| dispatch-slots fixture 3 | [[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]] | [[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]] | Passed |
| dispatch-slots fixture 4 | [[['a', 0, 2]], []] | [[], [['a', 0, 2]]] | Failed |
| dispatch-slots fixture 5 | [[['a', 0, 2]], [['a', 8, 1]]] | [[], [['a', 0, 2], ['a', 8, 1]]] | Failed |
| dispatch-slots fixture 6 | [[['a', 1, 1]], [['a', 2, 1]]] | [[['a', 1, 1]], [['a', 2, 1]]] | Passed |
| dispatch-slots fixture 7 | [[['a', 0, 1]], []] | [[['a', 0, 1]], []] | Passed |
SHA-256 / 3bb600c5a36c4e7a1cd050498448aa713f8898b98966f11a9bb275054a2a2270
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
queues={}
order=[]
for client,start,count,cancelled in x['jobs']:
if cancelled or count==0: continue
if client not in queues:
queues[client]=[]
order.append(client)
queues[client].append([start,count])
out=[]
for slot in range(x['slots']):
if not order: break
client=order.pop(0)
start,count=queues[client][0]
amount=min(count,x['chunk'])
out.append([client,start,amount])
if amount==count:
queues[client].pop(0)
else:
queues[client][0]=[start+amount,count-amount]
if queues[client]: order.append(client)
pending=[[client,start,count] for client in order for start,count in queues[client]]
return [out,pending]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dispatch-slots fixture 0', json.loads(json.dumps(solve({'jobs':[['a',0,5,False],['b',10,2,False]],'chunk':2,'slots':4}))), json.loads(json.dumps([[['a',0,2],['b',10,2],['a',2,2],['a',4,1]],[]])))
check('dispatch-slots fixture 1', json.loads(json.dumps(solve({'jobs':[['b',10,2,False],['a',0,2,False]],'chunk':1,'slots':2}))), json.loads(json.dumps([[['b',10,1],['a',0,1]],[['b',11,1],['a',1,1]]])))
check('dispatch-slots fixture 2', json.loads(json.dumps(solve({'jobs':[['a',0,0,False],['b',10,2,True]],'chunk':1,'slots':2}))), json.loads(json.dumps([[],[]])))
check('dispatch-slots fixture 3', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',9,1,False],['b',4,1,False]],'chunk':2,'slots':2}))), json.loads(json.dumps([[['a',0,2],['b',4,1]],[['a',9,1]]])))
check('dispatch-slots fixture 4', json.loads(json.dumps(solve({'jobs':[['a',0,2,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2]]])))
check('dispatch-slots fixture 5', json.loads(json.dumps(solve({'jobs':[['a',0,2,False],['a',8,1,False]],'chunk':2,'slots':0}))), json.loads(json.dumps([[],[['a',0,2],['a',8,1]]])))
check('dispatch-slots fixture 6', json.loads(json.dumps(solve({'jobs':[['a',N,N+1,False]],'chunk':N,'slots':1}))), json.loads(json.dumps([[['a',N,N]],[['a',2*N,1]]])))
check('dispatch-slots fixture 7', json.loads(json.dumps(solve({'jobs':[['a',0,1,False]],'chunk':3,'slots':2}))), json.loads(json.dumps([[['a',0,1]],[]])))
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| dispatch-slots fixture 0 | [[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []] | [[['a', 0, 2], ['b', 10, 2], ['a', 2, 2], ['a', 4, 1]], []] | Passed |
| dispatch-slots fixture 1 | [[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]] | [[['b', 10, 1], ['a', 0, 1]], [['b', 11, 1], ['a', 1, 1]]] | Passed |
| dispatch-slots fixture 2 | [[], []] | [[], []] | Passed |
| dispatch-slots fixture 3 | [[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]] | [[['a', 0, 2], ['b', 4, 1]], [['a', 9, 1]]] | Passed |
| dispatch-slots fixture 4 | [[], [['a', 0, 2]]] | [[], [['a', 0, 2]]] | Passed |
| dispatch-slots fixture 5 | [[], [['a', 0, 2], ['a', 8, 1]]] | [[], [['a', 0, 2], ['a', 8, 1]]] | Passed |
| dispatch-slots fixture 6 | [[['a', 1, 1]], [['a', 2, 1]]] | [[['a', 1, 1]], [['a', 2, 1]]] | Passed |
| dispatch-slots fixture 7 | [[['a', 0, 1]], []] | [[['a', 0, 1]], []] | Passed |
SHA-256 / 9e559e9bf00b31bb8f18de1af58f1e3cc5d478f02ed173b69321c10e0a4ae8b9
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.037844+00:00.
Case digest / c037d4739e7ae398c14c37577aa4851a461baa0366289c7f70580b6086ef8aae