Skip to content

feat(cli): honest download-metered bundle pull progress with reconstruction + discovery states - #2097

Merged
alpergundogdu merged 2 commits into
mainfrom
claude/bundle-pull-dedup-progress-ux
Sep 22, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
claude/bundle-pull-dedup-progress-ux

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Closes #2096. Follow-up to #2094 / #2095 (shared-chunk coalescing).

Problem

After coalescing, the pull progress lied: the total bar was denominated by the whole content size and credited spliced-from-disk bytes, so a dedup'd pull read 25.6/25.66 GiB, ETA 1s while only ~14.8 GB was actually transferred; the tail whole-file BLAKE3 verify (a multi-GB hash) ran with no callback and looked frozen; and a blob stalled on discovery (the tokenizer.json case) hid behind a near-full total.

Change

openai-chunked · 14.8 GB to download · 27.5 GB on disk

model-00000-of-00002.safetensors   3.1 GB/4.6 GB               [===========>      ]
original/model.safetensors          1.0 GB/1.0 GB (12.7 GB)  reconstructing…  [====>   ]
tokenizer.json                       0 B/28 MB  discovering…
total   9.2 GB/14.8 GB  (42.1 MiB/s, ETA 2m13s)               [===========>      ]
  • Total bar meters DOWNLOAD. Its denominator is download_bytes — the bytes actually fetched after dedup, each shared chunk counted once under its assigned holder, computed up front from the fetch plan. Only delivered bytes fold in (per-file, capped at that file's download size); splices never inflate it, so rate/ETA describe real transfer. A one-line header shows <dir> · <download> to download · <content> on disk.
  • Per-file rows read downloaded/download-total (reconstructed) + a phase word: discovering… before the first byte, pending siblings… while a deferred chunk is still being fetched by its holder, reconstructing… during the whole-file verify — which now streams its running byte count into the bar (hash_partial_with_progress) so a multi-GB reconstruction never sits frozen.
  • Skipped / whole-file-linked blobs download nothing and so no longer credit the total.

No wire/protocol change — progress rendering only.

Tests

  • download_bytes / blob_download_reconstruct: a shared chunk is counted once, so download < on-disk.
  • Progress: download folds into the total capped at the download size (splices excluded); the row message shows download counts + reconstruct size; reconstructing… spans the whole blob and tracks hashed bytes; pending siblings… marks the download done.
  • Full decdn-cli suite green (739); cargo clippy --workspace --all-targets --all-features, cargo fmt --check, rustdoc -D warnings all clean.

🤖 Generated with Claude Code

…uction + discovery states (#2096)

After shared-chunk coalescing (#2095) the progress display misled: the
total bar was denominated by the whole content size and credited
spliced-from-disk bytes, so a dedup'd pull read "25.6/25.66 GiB, ETA 1s"
while only ~14.8 GB was actually transferred; the tail whole-file verify
(hashing a multi-GB blob) ran with no callback and looked frozen; and a
blob stalled on discovery hid behind a near-full total.

Now:

- The total bar meters the run's DOWNLOAD — the bytes actually fetched
  after dedup (`download_bytes`, computed up front from the fetch plan) —
  and only delivered bytes fold into it, capped per file at its download
  size, so its rate and ETA describe real transfer. A one-line header
  shows `<dir> · <download> to download · <content> on disk`, making the
  dedup saving visible.
- Each per-file row reads `downloaded/download-total (reconstructed)` plus
  a phase word: `discovering…` before the first byte, `pending siblings…`
  while a deferred chunk is still being fetched by its holder, and
  `reconstructing…` during the whole-file verify — which now streams its
  running byte count into the bar so a multi-GB reconstruction never sits
  frozen (`hash_partial_with_progress`).

No wire/protocol change; progress rendering only. Follow-up to #2094/#2095.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 21, 2026 17:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Per-file progress currently breaks for manifest entries without a declared size (explicitly allowed by the manifest format), yielding non-moving/meaningless rows instead of falling back to the stream’s expected length for display.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR updates decdn bundle pull’s progress rendering to meter actual downloaded bytes after shared-chunk coalescing, and to make previously “invisible” phases (discovery, deferred-wait, and reconstruction/verify) explicit in the UI. It primarily refactors the CLI progress renderer and threads it through bundle-pull’s dedup/reassembly path, including adding a byte-count progress reporter to the whole-file BLAKE3 verification step.

Changes:

  • Compute a run-level download_bytes total (dedup-aware) and show a header comparing “to download” vs “on disk”.
  • Replace per-file bars with phase-aware rows (discovering…, pending siblings…, reconstructing…) and meter per-file progress against planned download bytes.
  • Add hash_partial_with_progress so whole-file verification advances the per-file bar during reconstruction.
File Description
crates/​cli/​src/​commands/​pull_progress.rs Redesignes total/per-file progress rendering to be download-metered and phase-aware, and adds reconstruction progress reporting.
crates/​cli/​src/​commands/​fetch.rs Removes now-unused progress style helper and SpeedState::shift support that was tied to the old “credit skipped bytes” approach.
crates/​cli/​src/​commands/​bundle_pull.rs Computes download totals from the manifest fetch plan, threads FileBar through dedup/reassembly, and reports discovery/pending/reconstruction phases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 83.74% (was 83.60%, ▲ +0.14%) — 86586/103403 lines

File Coverage Lines Δ
crates/cli/src/commands/bundle_pull.rs 72.04% 2656/3687 ▲ +0.35%
crates/cli/src/commands/fetch.rs 54.11% 1533/2833 ▲ +2.42%
crates/cli/src/commands/pull_progress.rs 75.48% 237/314 ▲ +4.00%
History
Commit Total Δ vs base
d1ab1f1 83.49% ● 0.00%
7153819 (HEAD) 83.74% ▲ +0.14%

…splay

An entry the manifest declares no size for has download_total 0, so its
per-file bar length stayed 0 and never moved. The row now borrows the
stream's `expected` length for display once delivery starts, so it tracks
progress like any other row — while still contributing nothing to the
total bar's download meter (the fold is capped at download_total, which is
0 for an unsized entry). The counts render as a bare delivered figure when
no size is known, rather than `x/0 B`.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@alpergundogdu
alpergundogdu merged commit 94d5d54 into main Sep 22, 2026
25 checks passed
@alpergundogdu
alpergundogdu deleted the claude/bundle-pull-dedup-progress-ux branch September 22, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bundle pull progress UX: show dedup'd download total, visible reconstruction, and stalled-entry state

2 participants