Skip to content

bundle pull: a range-dedup complement still drains as 147 serial requests to one holder and sets every run's finish time #2252

Closed

Description

@altanoruc

Summary

In the Mistral bundle smoke pull, the range-dedup complement of consolidated.safetensors sets the finish time of every run. The complement is 2.43 GiB in 147 runs. All 147 go to one holder (bcl) as 147 separate cdn/client/v1 requests, effectively one at a time. The drive starts with the run and ends 15–203 s after the last shard finishes.

#2168 was closed for this shape. Its node half (the credit ramp, #2176) is in. The client still drives the runs serially and uncoalesced.

Evidence (testnet, 2026-09-30, CLI at ef4bb891, fleet redeployed ~15:27 UTC)

decdn bundle pull --hash 9194000d…af69e5, 5 runs from one client. Runs 1–2 went through a VPN. Every run: downloaded 17.1 GB → reconstructed 29.0 GB, spliced 11.9 GB from disk, 0 failed.

run wall complement drive (first→last stream) bcl streams summed stream time tail after last shard
1 (VPN) 698 s 651 s 147 652 s 170 s
2 (VPN) 850 s 808 s 147 808 s 203 s
3 527 s 484 s 147 484 s 15 s
4 497 s 448 s 147 459 s 82 s
5 659 s 616 s 147 617 s 67 s
  • Source: Tempo serve_stream spans with span.hash="7cbb4846…". The summed stream time equals the drive's span, so the requests do not overlap.
  • Per-request cost: each run is 2–70 MiB, with its own request and first byte (bcl serve_first_byte_hit mean ≈ 0.25 s). In run 4, after the shards finished, single streams ran at ~15–20 MiB/s. The lane was request-bound, not bandwidth-bound.
  • Other holders sat idle: nbg1, lon1 and hel1 each served one ≤ 0.5 MiB stream of this entry at the start and nothing after, while 146 runs waited for bcl.
  • Node counter: bcl decdn_serve_cache_partial_hit_total +147 in each run.

Why (code)

  • The complement drive holds one bundle fetch permit (crates/cli/src/commands/bundle_pull.rs ~L2546) and stripes its runs over the entry's holders by coverage (feat(cli,client): stripe a range-dedup entry's ranges across its holders #2143). bcl covers every run, so ADR 039's "a lane takes the blocks it covers first" keeps all of them on bcl.
  • per_source_inflight = 1 (ADR 039). LaneStreamCap::widen (bundle_pull.rs:1880) grants extra streams only to a faulted lane's remainder. A healthy lane never widens, even after the shard entries release bcl's other --max-lane-streams permits.
  • Adjacent runs are not coalesced, so each run is its own request.

ADR 039 keeps one segment per source because "a source is bandwidth-bound". That holds for one large segment. It does not hold for 147 short runs, where each request pays its own setup.

Proposed

🤖 Generated with Claude Code

Activity

  1. added
    kind:bug
    rust
    area:cli
    on Sep 30, 2026
  2. altanoruc commented on Sep 30, 2026

    @altanoruc
    ContributorAuthor

    Unchanged on a direct (non-VPN) run, 2026-09-30 18:52 UTC

    One more Mistral smoke pull (--hash 9194000d…af69e5), CLI ef4bb891 built fresh, VPN off.

    wall complement 7cbb4846… bcl streams (Tempo serve_stream, span.hash="7cbb4846…") last shard done tail after last shard
    619 s 13.50 GiB in 611.0 s (2.42 GiB downloaded at 4.06 MiB/s, 11.08 GiB spliced) 147 (+1 on lon1) 19:01:55 (ad7f7e…) 78 s

    downloaded 17.1 GB → reconstructed 29.0 GB, spliced 11.9 GB from disk, 0 failed. This is the same shape as the five runs in the body: 147 requests to bcl, and the complement finishes last. The 78 s tail sits inside the 15–203 s range recorded there.

    🤖 Generated with Claude Code

  3. altanoruc commented on Oct 1, 2026

    @altanoruc
    ContributorAuthor

    Unchanged across 8 more Mistral runs (2026-09-30 21:27 → 2026-10-01 05:01 UTC, CLI ef4bb891, VPN off)

    These 8 Mistral smoke pulls were part of a 24-run batch. All were rc=0, wall time 464–691 s. In every run, the complement 7cbb4846… (2.42 GiB downloaded, 11.08 GiB spliced) was the last file to finish:

    run wall complement last shard done complement done tail
    1 691 s 682.5 s, 3.64 MiB/s 21:34:08 21:39:06 298 s
    3 489 s 482.6 s, 5.14 MiB/s 22:03:35 22:05:28 113 s
    12 577 s 568.7 s, 4.36 MiB/s 01:34:53 01:39:00 247 s
    14 568 s 560.3 s, 4.43 MiB/s 02:26:04 02:29:54 230 s
    15 534 s 526.0 s, 4.72 MiB/s 02:36:42 02:38:49 127 s
    17 464 s 447.3 s, 5.55 MiB/s 02:54:09 02:55:13 64 s
    18 500 s 489.0 s, 5.07 MiB/s 03:03:19 03:03:35 16 s
    24 563 s 554.7 s, 4.47 MiB/s 05:00:54 05:01:28 34 s

    The requests are still serial. In run 24, Tempo serve_stream spans for span.hash="7cbb4846…" run back to back: each starts as the previous one ends, for example 04:52:43.702 + 3.79 s → 04:52:47.494 + 3.67 s → 04:52:51.161.

    🤖 Generated with Claude Code

  4. self-assigned this
    on Oct 2, 2026
  5. altanoruc commented on Oct 2, 2026

    @altanoruc
    ContributorAuthor

    Unchanged at 2e1a93c5, and the same shape on SDXL (2026-10-01/02 overnight batch, VPN off)

    Mistral. In each Mistral run, bcl's decdn_serve_cache_partial_hit_total rose by about 151 over the run window, against 147 in the original report. Examples: run b3/12 (01:50:55–01:58:24 UTC, 449 s) +151.1, and run b3/13 (01:58:25–02:14:02 UTC, 937 s) +151.7. In every Mistral run, the 13.50 GiB file was the last to finish (439–992 s).

    SDXL. The range-dedup complements of SDXL set the finish time in the same way:

    run entry result
    b3/18 e0a583ab… (9.56 GiB) 1691.0 s: 1.72 GiB downloaded at 1.04 MiB/s, 7.85 GiB spliced
    b3/18 44711b24… (2.59 GiB) 574.0 s: 762 MiB downloaded at 1.33 MiB/s, 1.84 GiB spliced
    b3/21 e0a583ab… 406.8 s: 1.72 GiB at 4.32 MiB/s
    b3/3 d4b89247… (6.46 GiB) 855.5 s: 46.6 MiB at 55.7 KiB/s, 6.42 GiB spliced
    b2/1 e0a583ab… 565.0 s: 1.72 GiB at 3.11 MiB/s

    By contrast, the fully downloaded 9.56 GiB file in the same runs (5a7fddce…) ran at 5.2–22.5 MiB/s.

    Over SDXL run b3/18 (02:55:36–03:41:27 UTC, 2751 s), bcl's decdn_serve_cache_partial_hit_total rose by +583. The other nodes rose by 0–287.

    So the serial complement drain is not specific to Mistral. On SDXL it costs several minutes per run.

  6. thiras commented on Oct 2, 2026

    @thiras
    Contributor

    Fixed in #2293: the complement now finishes with the shards

    Mistral smoke pull (--hash 9194000d…af69e5), VPN off. Every run had 0 failures and the same byte counts as in the body: downloaded 17.1 GB → reconstructed 29.0 GB, 11.9 GB spliced.

    run CLI wall last shard → last complement leg last shard → complement done
    1 HEAD 41b6830d 619 s ~176 s 218 s
    6 #2293 ce10c78e 377 s 19 s 57 s
    7 #2293 ce10c78e 374 s 26 s 63 s
    8 #2293 ce10c78e 417 s 53 s 89 s

    About 40 s of "complement done" is the last runs landing plus the whole-file BLAKE3 check of 13.5 GiB (42 s on HEAD too). Once the shards finish, complement legs open at 48–57 per minute; on HEAD it was about 13.

    What was wrong (three causes, all client-side)

    1. Growth never re-ran. A lane's own worker drains a queue without ending, so no worker end asked for growth. The first growth pass ran before the worker held a range and armed no retry. The HEAD run had 0 extra-stream grants.
    2. One extra stream per lane. ADR 039 capped a busy source at one additional stream. In bundle pull, --max-lane-streams already bounds the streams to one provider, so the cap only held the complement at 2 streams. The cap is gone; at a cap of 3 or more, an extra stream leaves the provider's last free permit for a sibling entry's first lane.
    3. An idle lane held its permit. A parked own worker kept its lease for its whole fetch. In one run, the last shard's idle bcl lane held a bcl permit for about 4 min while the complement waited for it. A parked lane now gives its permit back while it waits.

    Why not coalescing

    The gaps between the 147 runs are spliced tensors: median 102 MiB, p25 27 MiB. Merging gaps up to 16 MiB cuts the requests to 130 and pays 3% more bytes. A fit of the bcl legs gives 0.33 s fixed cost per leg plus about 12 MiB/s per stream, so per-request cost is only about 20% of the old tail. The limit was stream count, not request count.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clikind:bugrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions