FA-27656 / HTTP ranges / Open access
A media player maps a seek time to keyframe-aligned byte range requests around cached spans: a gap request stops before the next cached byte · case 01
A media player maps a seek time to keyframe-aligned byte range requests around cached spans: a gap request stops before the next cached byte.
ROOT CAUSE
The media-seek-range-plan-gap-end decision uses idx=x['index'] T=x['total'] if not idx or T<=0: return None reqs=[] H=x['header_end'] if H>0 and not any(a<=0 and H-1<=b for a,b in x['cached']): reqs.append([0,H-1]) k=-1 for i,(tm,off) in enumerate(idx): if tm<=x['seek']: k=i o=idx[max(k,0)][1] if o>=T: return None e=min(T-1,o+x['window']-1) cur=o for a,b in sorted(x['cached']): if b<cur or a>e: continue if a>cur: reqs.append([cur,a]) cur=max(cur,b+1) if cur<=e: reqs.append([cur,e]) return ['bytes=%d-%d'%(a,b) for a,b in reqs].
VERIFIED REPAIR
Apply the bounded decision exactly: idx=x['index'] T=x['total'] if not idx or T<=0: return None reqs=[] H=x['header_end'] if H>0 and not any(a<=0 and H-1<=b for a,b in x['cached']): reqs.append([0,H-1]) k=-1 for i,(tm,off) in enumerate(idx): if tm<=x['seek']: k=i o=idx[max(k,0)][1] if o>=T: return None e=min(T-1,o+x['window']-1) cur=o for a,b in sorted(x['cached']): if b<cur or a>e: continue if a>cur: reqs.append([cur,a-1]) cur=max(cur,b+1) if cur<=e: reqs.append([cur,e]) return ['bytes=%d-%d'%(a,b) for a,b in reqs]
Unsuccessful approach: The partial repair uses idx=x['index'] T=x['total'] if not idx or T<=0: return None reqs=[] H=x['header_end'] if H>0 and not any(a<=0 and H-1<=b for a,b in x['cached']): reqs.append([0,H-1]) k=-1 for i,(tm,off) in enumerate(idx): if tm<=x['seek']: k=i o=idx[max(k,0)][1] if o>=T: return None e=min(T-1,o+x['window']-1) cur=o for a,b in sorted(x['cached']): if b<cur or a>e: continue if a>cur: reqs.append([cur,b]) cur=max(cur,b+1) if cur<=e: reqs.append([cur,e]) return ['bytes=%d-%d'%(a,b) for a,b in reqs], which still violates the stated contract.
Case contract
x has a time-sorted keyframe index [time,byte-offset], total length, init header length H (bytes 0..H-1), seek time, byte window and cached inclusive spans (unordered). Request the header unless one cached span covers all of it. Start at the last keyframe with time<=seek, or the first keyframe when seeking earlier. A start offset at or beyond total, an empty index or nonpositive total returns null. The media window is [start,min(total-1,start+window-1)]; request only its uncached gaps in ascending order, as inclusive bytes=a-b values after any header request.
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):
idx=x['index']
T=x['total']
if not idx or T<=0: return None
reqs=[]
H=x['header_end']
if H>0 and not any(a<=0 and H-1<=b for a,b in x['cached']): reqs.append([0,H-1])
k=-1
for i,(tm,off) in enumerate(idx):
if tm<=x['seek']: k=i
o=idx[max(k,0)][1]
if o>=T: return None
e=min(T-1,o+x['window']-1)
cur=o
for a,b in sorted(x['cached']):
if b<cur or a>e: continue
if a>cur: reqs.append([cur,a])
cur=max(cur,b+1)
if cur<=e: reqs.append([cur,e])
return ['bytes=%d-%d'%(a,b) for a,b in reqs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('gap-end fixture 0', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 1', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2000,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 2', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':3999,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 3', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[1000,100],[3000,600]],'seek':500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=100-399'])))
check('gap-end fixture 4', json.loads(json.dumps(solve({'cached':[[0,49]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 5', json.loads(json.dumps(solve({'cached':[[50,200]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 6', json.loads(json.dumps(solve({'cached':[[0,150]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-799'])))
check('gap-end fixture 7', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':4500,'total':1200,'window':400}))), json.loads(json.dumps(['bytes=0-99','bytes=900-1199'])))
check('gap-end fixture 8', json.loads(json.dumps(solve({'cached':[[0,99],[600,649]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-599','bytes=650-799'])))
check('gap-end fixture 9', json.loads(json.dumps(solve({'cached':[[0,99],[900,950]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-799'])))
check('gap-end fixture 10', json.loads(json.dumps(solve({'cached':[[0,99],[799,850]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-798'])))
check('gap-end fixture 11', json.loads(json.dumps(solve({'cached':[[0,99],[600,610],[540,700]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-539','bytes=701-799'])))
check('gap-end fixture 12', json.loads(json.dumps(solve({'cached':[[0,99],[500,798]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=799-799'])))
check('gap-end fixture 13', json.loads(json.dumps(solve({'cached':[[0,99],[500,510]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=511-799'])))
check('gap-end fixture 14', json.loads(json.dumps(solve({'cached':[[0,99],[501,510]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-500','bytes=511-799'])))
check('gap-end fixture 15', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,1300]],'seek':3000,'total':1200,'window':300}))), json.loads(json.dumps(None)))
check('gap-end fixture 16', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':10,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=100-399'])))
check('gap-end fixture 17', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[1000,200],[2000,300],[3000,400],[4000,500],[5000,600]],'seek':1000*N,'total':2000,'window':50}))), json.loads(json.dumps(['bytes=0-99',"bytes=%d-%d"%(100*N+100,100*N+149)])))
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 |
|---|---|---|---|
| gap-end fixture 0 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 1 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 2 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 3 | ['bytes=0-99', 'bytes=100-399'] | ['bytes=0-99', 'bytes=100-399'] | Passed |
| gap-end fixture 4 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 5 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 6 | ['bytes=500-799'] | ['bytes=500-799'] | Passed |
| gap-end fixture 7 | ['bytes=0-99', 'bytes=900-1199'] | ['bytes=0-99', 'bytes=900-1199'] | Passed |
| gap-end fixture 8 | ['bytes=500-600', 'bytes=650-799'] | ['bytes=500-599', 'bytes=650-799'] | Failed |
| gap-end fixture 9 | ['bytes=500-799'] | ['bytes=500-799'] | Passed |
| gap-end fixture 10 | ['bytes=500-799'] | ['bytes=500-798'] | Failed |
| gap-end fixture 11 | ['bytes=500-540', 'bytes=701-799'] | ['bytes=500-539', 'bytes=701-799'] | Failed |
| gap-end fixture 12 | ['bytes=799-799'] | ['bytes=799-799'] | Passed |
| gap-end fixture 13 | ['bytes=511-799'] | ['bytes=511-799'] | Passed |
| gap-end fixture 14 | ['bytes=500-501', 'bytes=511-799'] | ['bytes=500-500', 'bytes=511-799'] | Failed |
| gap-end fixture 15 | None | None | Passed |
| gap-end fixture 16 | ['bytes=0-99', 'bytes=100-399'] | ['bytes=0-99', 'bytes=100-399'] | Passed |
| gap-end fixture 17 | ['bytes=0-99', 'bytes=200-249'] | ['bytes=0-99', 'bytes=200-249'] | Passed |
SHA-256 / f876f49559da428cc7725dcb3f7a6046f058f7a631ec8a337992966ec362c3c7
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
idx=x['index']
T=x['total']
if not idx or T<=0: return None
reqs=[]
H=x['header_end']
if H>0 and not any(a<=0 and H-1<=b for a,b in x['cached']): reqs.append([0,H-1])
k=-1
for i,(tm,off) in enumerate(idx):
if tm<=x['seek']: k=i
o=idx[max(k,0)][1]
if o>=T: return None
e=min(T-1,o+x['window']-1)
cur=o
for a,b in sorted(x['cached']):
if b<cur or a>e: continue
if a>cur: reqs.append([cur,b])
cur=max(cur,b+1)
if cur<=e: reqs.append([cur,e])
return ['bytes=%d-%d'%(a,b) for a,b in reqs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('gap-end fixture 0', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 1', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2000,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 2', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':3999,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 3', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[1000,100],[3000,600]],'seek':500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=100-399'])))
check('gap-end fixture 4', json.loads(json.dumps(solve({'cached':[[0,49]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 5', json.loads(json.dumps(solve({'cached':[[50,200]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 6', json.loads(json.dumps(solve({'cached':[[0,150]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-799'])))
check('gap-end fixture 7', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':4500,'total':1200,'window':400}))), json.loads(json.dumps(['bytes=0-99','bytes=900-1199'])))
check('gap-end fixture 8', json.loads(json.dumps(solve({'cached':[[0,99],[600,649]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-599','bytes=650-799'])))
check('gap-end fixture 9', json.loads(json.dumps(solve({'cached':[[0,99],[900,950]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-799'])))
check('gap-end fixture 10', json.loads(json.dumps(solve({'cached':[[0,99],[799,850]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-798'])))
check('gap-end fixture 11', json.loads(json.dumps(solve({'cached':[[0,99],[600,610],[540,700]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-539','bytes=701-799'])))
check('gap-end fixture 12', json.loads(json.dumps(solve({'cached':[[0,99],[500,798]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=799-799'])))
check('gap-end fixture 13', json.loads(json.dumps(solve({'cached':[[0,99],[500,510]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=511-799'])))
check('gap-end fixture 14', json.loads(json.dumps(solve({'cached':[[0,99],[501,510]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-500','bytes=511-799'])))
check('gap-end fixture 15', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,1300]],'seek':3000,'total':1200,'window':300}))), json.loads(json.dumps(None)))
check('gap-end fixture 16', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':10,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=100-399'])))
check('gap-end fixture 17', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[1000,200],[2000,300],[3000,400],[4000,500],[5000,600]],'seek':1000*N,'total':2000,'window':50}))), json.loads(json.dumps(['bytes=0-99',"bytes=%d-%d"%(100*N+100,100*N+149)])))
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 |
|---|---|---|---|
| gap-end fixture 0 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 1 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 2 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 3 | ['bytes=0-99', 'bytes=100-399'] | ['bytes=0-99', 'bytes=100-399'] | Passed |
| gap-end fixture 4 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 5 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 6 | ['bytes=500-799'] | ['bytes=500-799'] | Passed |
| gap-end fixture 7 | ['bytes=0-99', 'bytes=900-1199'] | ['bytes=0-99', 'bytes=900-1199'] | Passed |
| gap-end fixture 8 | ['bytes=500-649', 'bytes=650-799'] | ['bytes=500-599', 'bytes=650-799'] | Failed |
| gap-end fixture 9 | ['bytes=500-799'] | ['bytes=500-799'] | Passed |
| gap-end fixture 10 | ['bytes=500-850'] | ['bytes=500-798'] | Failed |
| gap-end fixture 11 | ['bytes=500-700', 'bytes=701-799'] | ['bytes=500-539', 'bytes=701-799'] | Failed |
| gap-end fixture 12 | ['bytes=799-799'] | ['bytes=799-799'] | Passed |
| gap-end fixture 13 | ['bytes=511-799'] | ['bytes=511-799'] | Passed |
| gap-end fixture 14 | ['bytes=500-510', 'bytes=511-799'] | ['bytes=500-500', 'bytes=511-799'] | Failed |
| gap-end fixture 15 | None | None | Passed |
| gap-end fixture 16 | ['bytes=0-99', 'bytes=100-399'] | ['bytes=0-99', 'bytes=100-399'] | Passed |
| gap-end fixture 17 | ['bytes=0-99', 'bytes=200-249'] | ['bytes=0-99', 'bytes=200-249'] | Passed |
SHA-256 / ee104de0e0ecb66074e6ef38c15298ba4d8bb36525146aeca157e370fa2045f7
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
idx=x['index']
T=x['total']
if not idx or T<=0: return None
reqs=[]
H=x['header_end']
if H>0 and not any(a<=0 and H-1<=b for a,b in x['cached']): reqs.append([0,H-1])
k=-1
for i,(tm,off) in enumerate(idx):
if tm<=x['seek']: k=i
o=idx[max(k,0)][1]
if o>=T: return None
e=min(T-1,o+x['window']-1)
cur=o
for a,b in sorted(x['cached']):
if b<cur or a>e: continue
if a>cur: reqs.append([cur,a-1])
cur=max(cur,b+1)
if cur<=e: reqs.append([cur,e])
return ['bytes=%d-%d'%(a,b) for a,b in reqs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('gap-end fixture 0', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 1', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2000,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 2', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':3999,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 3', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[1000,100],[3000,600]],'seek':500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=100-399'])))
check('gap-end fixture 4', json.loads(json.dumps(solve({'cached':[[0,49]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 5', json.loads(json.dumps(solve({'cached':[[50,200]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=500-799'])))
check('gap-end fixture 6', json.loads(json.dumps(solve({'cached':[[0,150]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-799'])))
check('gap-end fixture 7', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':4500,'total':1200,'window':400}))), json.loads(json.dumps(['bytes=0-99','bytes=900-1199'])))
check('gap-end fixture 8', json.loads(json.dumps(solve({'cached':[[0,99],[600,649]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-599','bytes=650-799'])))
check('gap-end fixture 9', json.loads(json.dumps(solve({'cached':[[0,99],[900,950]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-799'])))
check('gap-end fixture 10', json.loads(json.dumps(solve({'cached':[[0,99],[799,850]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-798'])))
check('gap-end fixture 11', json.loads(json.dumps(solve({'cached':[[0,99],[600,610],[540,700]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-539','bytes=701-799'])))
check('gap-end fixture 12', json.loads(json.dumps(solve({'cached':[[0,99],[500,798]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=799-799'])))
check('gap-end fixture 13', json.loads(json.dumps(solve({'cached':[[0,99],[500,510]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=511-799'])))
check('gap-end fixture 14', json.loads(json.dumps(solve({'cached':[[0,99],[501,510]],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':2500,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=500-500','bytes=511-799'])))
check('gap-end fixture 15', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,1300]],'seek':3000,'total':1200,'window':300}))), json.loads(json.dumps(None)))
check('gap-end fixture 16', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[2000,500],[4000,900]],'seek':10,'total':1200,'window':300}))), json.loads(json.dumps(['bytes=0-99','bytes=100-399'])))
check('gap-end fixture 17', json.loads(json.dumps(solve({'cached':[],'header_end':100,'index':[[0,100],[1000,200],[2000,300],[3000,400],[4000,500],[5000,600]],'seek':1000*N,'total':2000,'window':50}))), json.loads(json.dumps(['bytes=0-99',"bytes=%d-%d"%(100*N+100,100*N+149)])))
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 |
|---|---|---|---|
| gap-end fixture 0 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 1 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 2 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 3 | ['bytes=0-99', 'bytes=100-399'] | ['bytes=0-99', 'bytes=100-399'] | Passed |
| gap-end fixture 4 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 5 | ['bytes=0-99', 'bytes=500-799'] | ['bytes=0-99', 'bytes=500-799'] | Passed |
| gap-end fixture 6 | ['bytes=500-799'] | ['bytes=500-799'] | Passed |
| gap-end fixture 7 | ['bytes=0-99', 'bytes=900-1199'] | ['bytes=0-99', 'bytes=900-1199'] | Passed |
| gap-end fixture 8 | ['bytes=500-599', 'bytes=650-799'] | ['bytes=500-599', 'bytes=650-799'] | Passed |
| gap-end fixture 9 | ['bytes=500-799'] | ['bytes=500-799'] | Passed |
| gap-end fixture 10 | ['bytes=500-798'] | ['bytes=500-798'] | Passed |
| gap-end fixture 11 | ['bytes=500-539', 'bytes=701-799'] | ['bytes=500-539', 'bytes=701-799'] | Passed |
| gap-end fixture 12 | ['bytes=799-799'] | ['bytes=799-799'] | Passed |
| gap-end fixture 13 | ['bytes=511-799'] | ['bytes=511-799'] | Passed |
| gap-end fixture 14 | ['bytes=500-500', 'bytes=511-799'] | ['bytes=500-500', 'bytes=511-799'] | Passed |
| gap-end fixture 15 | None | None | Passed |
| gap-end fixture 16 | ['bytes=0-99', 'bytes=100-399'] | ['bytes=0-99', 'bytes=100-399'] | Passed |
| gap-end fixture 17 | ['bytes=0-99', 'bytes=200-249'] | ['bytes=0-99', 'bytes=200-249'] | Passed |
SHA-256 / 4b1a25ddf9bc3c24f5b04eeadeca2a3dabe9dc3194add0bf0c141b756acc8ef4
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:27.009029+00:00.
Case digest / 1815c22b996f47ef81009f9fa015052b7759e2c0227ced6b4ef11518a7508a4d