FA-27607 / HTTP ranges / Member archive
A parallel downloader splits a representation into worker ranges and rebalances idle workers: the victim is chosen by remaining bytes rather than range position · case 02
A parallel downloader splits a representation into worker ranges and rebalances idle workers: the victim is chosen by remaining bytes rather than range position.
Case contract
x has total length, worker count and events. Initial segments follow array-split sizing: base=total//workers, the first total%workers workers get one extra byte; zero-size segments are dropped and later worker indices refer to the surviving list. Each segment is [cursor,end]. data(i,n) advances worker i by n>=0 accepted bytes; an invalid or negative index, negative n or overrun past its end returns null. steal(i) is ignored unless i is a valid finished worker; the victim is the worker with the most remaining bytes (lowest index on ties); a victim with fewer than2 remaining bytes is left alone; otherwise the victim keeps the first ceil(rem/2) bytes and the thief takes the rest. Return Range header values for unfinished workers in worker order. workers<=0 or negative total returns null.
Why this case matters
Range responses combine representation identity, conditional requests, framing, and partial-object state.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| victim-remaining-size fixture 10 | ["bytes=11-11", "bytes=4-7", "bytes=9-10"] | ["bytes=6-7", "bytes=4-5", "bytes=9-11"] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗