You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bundle pull: range-dedup complement pays ~1,300 16 KiB boundary ranges serially, one QUIC connection each #2119
After the shards finished, original/model.safetensors (13.76 GB, 02bd48…) in the gpt-oss bundle crawled. Tempo serve_stream spans on bcl for this client show a strictly serial run of requests: each is byte_len=16384, each lasts about 1.1 s, and there are 1–30 s gaps between them. Offsets increase monotonically (5373018112, 5383094272, … 5873876992). About 24 minutes in, the paid frontier was at 5.87/13.76 GB.
Root cause
The complement is ~1,300 tiny ranges. Range dedup gives each shared chunk to its smallest holder (build_fetch_plan, crates/cli/src/commands/bundle_pull.rs:1966, :3120). original/model.safetensors shares almost everything with the shards, so plan_reassembly (:3196-3227) sets its paid ranges to complement_runs (:3424) over the deferred chunk interiors. That leaves about one 16 KiB bao group at each chunk boundary that isn't group-aligned. That comes to roughly 1,300 ranges, which matches the 14.5 KB .ranges sidecar.
They are paid first.reassemble_dedup (:2565) pays for these ranges before any splice.
One at a time, one connection each.drive_ranges (crates/cli/src/commands/fetch.rs:2266) runs for &(offset, len) in ranges { drive(…).await }. Each drive → fill_gap → source.open → open_progressive_pull dials a new QUIC connection (crates/client-pull/src/lib.rs:1651) with its own signed request/response, closing voucher and checkpoint fsync.
No merging or parallelism. Adjacent ranges are not coalesced. The dedup path also skips multi-source on purpose (bundle_pull.rs:1866-1868).
Effective throughput is about 16 KiB per 2–10 s. Paying for ~20 MB of boundary groups takes close to an hour, and the transatlantic RTT to the only origin-holding node makes each leg slower.
Candidate fixes
A. Coalesce nearby ranges, since paying a little extra beats one round trip per 16 KiB. Reuse one connection per provider for all of an entry's ranges.
B. Drive ranges concurrently, up to --max-lane-streams, across the entry's candidates.
C. Protocol: allow one request to carry many ranges, so a whole complement is one paid leg.
D. Defer boundary groups a sibling entry will fetch anyway, and splice them after it lands, instead of paying for them up front.
Related: #2117 (stall that triggers the early failovers), #2120 (no per-entry slow-source detection).
🤖 Generated with Claude Code
Activity
fix(cli,client-pull): harden bundle pull failover, dedup complement, …