FAILURE MAP
← Case archive

FA-27641 / HTTP ranges / Open access

A media player maps a seek time to keyframe-aligned byte range requests around cached spans: the header is skipped only when one cached span covers every header byte · case 01

A media player maps a seek time to keyframe-aligned byte range requests around cached spans: the header is skipped only when one cached span covers every header byte.

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

ROOT CAUSE

The media-seek-range-plan-init-cache-coverage 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 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].

THE FAILURE

The media-seek-range-plan-init-cache-coverage 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 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 or 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], 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 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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 fixtureActualExpectedOutcome
init-cache-coverage fixture 0['bytes=0-99', 'bytes=500-799']['bytes=0-99', 'bytes=500-799']Passed
init-cache-coverage fixture 1['bytes=0-99', 'bytes=500-799']['bytes=0-99', 'bytes=500-799']Passed
init-cache-coverage fixture 2['bytes=0-99', 'bytes=500-799']['bytes=0-99', 'bytes=500-799']Passed
init-cache-coverage fixture 3['bytes=0-99', 'bytes=100-399']['bytes=0-99', 'bytes=100-399']Passed
init-cache-coverage fixture 4['bytes=500-799']['bytes=0-99', 'bytes=500-799']Failed
init-cache-coverage fixture 5['bytes=0-99', 'bytes=500-799']['bytes=0-99', 'bytes=500-799']Passed
init-cache-coverage fixture 6['bytes=500-799']['bytes=500-799']Passed
init-cache-coverage fixture 7['bytes=0-99', 'bytes=900-1199']['bytes=0-99', 'bytes=900-1199']Passed
init-cache-coverage fixture 8['bytes=500-599', 'bytes=650-799']['bytes=500-599', 'bytes=650-799']Passed
init-cache-coverage fixture 9['bytes=500-799']['bytes=500-799']Passed
init-cache-coverage fixture 10['bytes=500-798']['bytes=500-798']Passed
init-cache-coverage fixture 11['bytes=500-539', 'bytes=701-799']['bytes=500-539', 'bytes=701-799']Passed
init-cache-coverage fixture 12['bytes=799-799']['bytes=799-799']Passed
init-cache-coverage fixture 13['bytes=511-799']['bytes=511-799']Passed
init-cache-coverage fixture 14['bytes=500-500', 'bytes=511-799']['bytes=500-500', 'bytes=511-799']Passed
init-cache-coverage fixture 15NoneNonePassed
init-cache-coverage fixture 16['bytes=0-99', 'bytes=100-399']['bytes=0-99', 'bytes=100-399']Passed
init-cache-coverage fixture 17['bytes=0-99', 'bytes=200-249']['bytes=0-99', 'bytes=200-249']Passed

SHA-256 / 81fdef1c2848c4bd3040ccc14aed5b6c4795ec518e1c2cec1b2df44d768dae33

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 or 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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('init-cache-coverage 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 fixtureActualExpectedOutcome
init-cache-coverage fixture 0['bytes=0-99', 'bytes=500-799']['bytes=0-99', 'bytes=500-799']Passed
init-cache-coverage fixture 1['bytes=0-99', 'bytes=500-799']['bytes=0-99', 'bytes=500-799']Passed
init-cache-coverage fixture 2['bytes=0-99', 'bytes=500-799']['bytes=0-99', 'bytes=500-799']Passed
init-cache-coverage fixture 3['bytes=0-99', 'bytes=100-399']['bytes=0-99', 'bytes=100-399']Passed
init-cache-coverage fixture 4['bytes=500-799']['bytes=0-99', 'bytes=500-799']Failed
init-cache-coverage fixture 5['bytes=500-799']['bytes=0-99', 'bytes=500-799']Failed
init-cache-coverage fixture 6['bytes=500-799']['bytes=500-799']Passed
init-cache-coverage fixture 7['bytes=0-99', 'bytes=900-1199']['bytes=0-99', 'bytes=900-1199']Passed
init-cache-coverage fixture 8['bytes=500-599', 'bytes=650-799']['bytes=500-599', 'bytes=650-799']Passed
init-cache-coverage fixture 9['bytes=500-799']['bytes=500-799']Passed
init-cache-coverage fixture 10['bytes=500-798']['bytes=500-798']Passed
init-cache-coverage fixture 11['bytes=500-539', 'bytes=701-799']['bytes=500-539', 'bytes=701-799']Passed
init-cache-coverage fixture 12['bytes=799-799']['bytes=799-799']Passed
init-cache-coverage fixture 13['bytes=511-799']['bytes=511-799']Passed
init-cache-coverage fixture 14['bytes=500-500', 'bytes=511-799']['bytes=500-500', 'bytes=511-799']Passed
init-cache-coverage fixture 15NoneNonePassed
init-cache-coverage fixture 16['bytes=0-99', 'bytes=100-399']['bytes=0-99', 'bytes=100-399']Passed
init-cache-coverage fixture 17['bytes=0-99', 'bytes=200-249']['bytes=0-99', 'bytes=200-249']Passed

SHA-256 / 951497ac8e97a6d5938c15648c3ba97b18556b5f12bb40d36646ff278daa39a8

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 18 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:26.964310+00:00.

Case digest / ecc730b2efd28cb9da452faa83277e4f2f4f3bb4ade743a516169eaf87bdb7f1