Skip to content

Add HTTP byte-range support to a stdlib file server (single, suffix, multipart, 416, If-Range, HEAD)

Exact prompt

# Task: add byte-range support to the file server `server.py` serves the files under `public/` but ignores the `Range` and `If-Range` request headers, so downloads cannot resume and media players cannot seek. Change `server.py` so it implements `RANGES.md` exactly. Everything it already does correctly (paths, 404s, content types) must keep working. Do not change anything under `public/` (the grader checks those files are byte-identical to the originals). Python standard library only. Keep the command line: `python3 server.py [port]`, port also from env `G02_PORT`, default 18702, bind 127.0.0.1. No network beyond localhost. The grader starts your server, sends requests with `http.client`, compares status codes, the headers named in RANGES.md and the exact body bytes, then stops the server.

Exact status/header/body checks for clamping, suffix ranges, unsatisfiable vs malformed headers (416 vs ignore), un-merged multipart bodies with a fixed boundary, ETag-gated If-Range and HEAD parity. Original benchmark task written for usecaserank.com (not based on a specific public post). Headless, offline run on a reproducible fixture. Each run's notes say how its cost was measured (estimates are marked).

Success criteria: 1. public_files_unchanged: files under public/ are byte-identical. 2. full_response_headers: 200 carries Accept-Ranges and the SHA-256-prefix ETag. 3. single_ranges: first-last, first-, -suffix, clamped last, oversize suffix, spaces, correct Content-Type. 4. unsatisfiable_416: 416 with bytes */size for 5 unsatisfiable headers incl. empty file. 5. malformed_range_ignored: 8 malformed headers give a plain 200. 6. multipart_byteranges: exact multipart body, order kept, overlaps not merged, unsatisfiable parts dropped, single survivor gives a single-part 206. 7. if_range: matching ETag honours Range, mismatching/unquoted gives 200, If-Range alone changes nothing. 8. head_requests: HEAD mirrors GET status/headers without body. 9. errors_unaffected: missing files still 404.

Best model for this task so far: Claude Haiku 5.5 (effort default (no --effort flag) · thinking on) (success, $0.0096, 44s).

Run this on another model

All runs (3)

100% pass rate across 3 eligible runs: 3 pass, 0 partial, 0 fail. Partial and failed runs are listed below with everything else.ⓘ

Runs for this use case
ModelCostTimeStep-insⓘAutonomyOutcomeTrustⓘDateCompare
AClaude Haiku 5.5default · thinking on$0.009644s0Fully autonomouspassTrust 80%2026-10-19
AClaude Opus 5.5default · thinking on$0.2347s0Fully autonomouspassTrust 80%2026-10-19
AClaude Sonnet 5.5default · thinking on$0.0718s0Fully autonomouspassTrust 80%2026-10-19

Embed this result

A live badge for this use case. It links back here and updates as new runs are published.

UseCaseRank badge for Add HTTP byte-range support to a stdlib file server (single, suffix, multipart, 416, If-Range, HEAD)

Get new runs and ranking changes weekly

Which models got better or cheaper on real tasks like this one.