Skip to content

docs(adr): remove endgame hedging from multi-source fetch - #1448

Merged
thiras merged 2 commits into
mainfrom
codex/1442-remove-endgame-hedging
Jul 25, 2026
Merged

thiras merged 2 commits into
mainfrom
codex/1442-remove-endgame-hedging

Conversation

@altanoruc

Copy link
Copy Markdown
Contributor

Summary

  • remove endgame hedging and its parameter from ADR 039
  • retain multi-source scheduling, dynamic work stealing, finite source/concurrency bounds, and deadline-based re-dispatch
  • reconcile ADR 038's scheduler summary with the simplified ADR 039 design

Rationale

Every delivered byte is paid, so speculative duplicate units add real spend. The scheduler now relies on source selection and deadline-based re-dispatch for tail handling without adding a replacement feature or wire surface.

Impact

This is spec-only. ADR 039 remains a draft multi-source-fetch design; no implementation, protocol, or configuration surface changes.

Validation

  • red/green consistency assertion for endgame|hedg(e|ing) across ADRs 038 and 039
  • make -C adr check-book-list
  • make -C adr check-refs
  • npx --yes [email protected] --dot adr/038-bao-verified-range-streaming.md adr/039-multi-source-parallel-fetch.md
  • cargo fmt -- --check
  • cargo build
  • cargo clippy --workspace --all-targets -- -D warnings
  • RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps --document-private-items

Baseline note: cargo nextest is unavailable in the local environment. The cargo test --workspace fallback stopped in decdn-cache after 110 passing tests when five existing S3 constructor tests panicked because the host native TLS trust store yielded no valid root certificates; the docs diff does not touch that code.

Closes #1442

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@altanoruc, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Free

Run ID: b1fc71b8-761e-4ab5-b488-482d22525ee3

📥 Commits

Reviewing files that changed from the base of the PR and between fa8f606 and e1d7d93.

📒 Files selected for processing (2)
  • adr/038-bao-verified-range-streaming.md
  • adr/039-multi-source-parallel-fetch.md

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

Review — spec-only removal of endgame hedging

What it does: deletes § Endgame hedging, the endgame_hedge parameter row, its Negative-consequences bullet, and acceptance criterion 4 from ADR 039, replacing them with a two-sentence invariant + rationale; reconciles ADR 038's one-line scheduler summary. Scope matches #1442's DROP verdict exactly — the scheduler, work-stealing, finite source/concurrency bounds, and deadline-based re-dispatch all survive untouched.

Verified on 8ba563b

  • No endgame|hedg left anywhere in the tree (only hit is an unrelated "hedge" in crates/cli/src/commands/bond.rs, about the wording of a resume hint).
  • No dangling #endgame-hedging anchors. make -C adr check-refs and make -C adr check-book-list pass; markdownlint clean on both files.
  • Acceptance criteria renumber contiguously 1–7; the parameter table stays well-formed; trailing newline preserved.
  • Confirms the issue's blast-radius claim — nothing under crates/ referenced the removed surface.

Main substantive point: the tail-latency claim now overreaches

unit_deadline_ms is specified as a verified-progress deadline (§ Failure handling: "Stalls. No verified progress within unit_deadline_ms"; the parameter table repeats "Verified-progress deadline"). A source delivering steadily at a tenth of everyone else's rate never trips it — which is precisely the case endgame mode covered.

The Positive bullet is carefully worded and stays true ("prevents a stalled source from delaying completion indefinitely"). The new prose in § Failure handling generalizes past that:

the scheduler controls completion latency through source selection and deadline-based re-dispatch rather than speculative duplicate requests

Source selection is an up-front admission decision (RTT, rate, reputation), and re-dispatch only fires on zero progress, so neither one addresses a source that degrades mid-fetch. Two ways to close it:

  • (a) Narrow the claim. Say the scheduler bounds the tail against stalled and failing sources and accepts a slow-but-progressing source as a residual, plus a § Risks bullet naming it. Cheapest, and honest.
  • (b) Give the deadline a rate dimension. Re-dispatch when a unit's observed throughput falls below some fraction of the admitted set's median. Preserves "at most one source owns a unit at a time" and adds zero double-pay — it's the "tighter unit_deadline_ms + smarter ranking" option Remove endgame hedging from multi-source fetch (ADR 039) #1442 floated.

#1442's open question is unanswered

The issue asks directly: "should ADR 039 note that explicitly so the option isn't lost?" — i.e. record that a capped, opt-in hedge stays available if tail latency proves real in implementation. The PR closes the issue without that note. One sentence in § Scope boundary or § Risks preserves both the deferred option and the override rationale ("design the fix against real data rather than pre-committing to torrent-style hedging"). This is the one item I'd want in before merge, since it's a stated requirement of the issue being closed.

Trade-off ledger is now one-sided

§ Negative lost its only tail-related bullet (double-pay) and gained nothing, so the removal reads as free. ADRs here consistently carry the cost of each choice — a one-liner such as "tail latency is bounded only against stalled or failed sources; a slow-but-progressing source can extend completion by up to its remaining unit" keeps the ledger balanced.

Minor

  • Placement. "At most one source owns a unit at a time" is an assignment invariant now living in § Failure handling. It reads fine as a contrast to re-dispatch, but § Work-unit partitioning and dynamic assignment is where a reader looks for it. Consider also appending it to acceptance criterion 5, so no-duplicate-dispatch is a testable commitment rather than prose — matching how the other criteria are written.
  • Sub-unit progress is now load-bearing. With hedging gone, re-dispatch is the sole tail tool, and the ADR still says only "verified units already stored are untouched" — silent on whether a partially delivered unit resumes at its last verified chunk-group boundary (ADR 038 makes that possible) or is refetched and re-paid from the unit start. One clause would pin down the real cost of the mechanism this PR now leans on.
  • CLAUDE.md history. Sibling simplifications updated it (e.g. refactor(reputation)!: drop the network/gossip tier, keep local-only scoring #1418's reputation-tier removal). A sub-feature of a Draft ADR is plausibly below that bar — flagging for your call, not asking for it.

CI

Red, but not from this diff: detect changes was abandoned after ~15 min and CI success failed on changes → abandoned. Side effect is that markdownlint and ADR book check never actually ran here — I ran both locally on the head commit along with check-refs/check-book-list and all pass. Still needs a re-run to get the required check green.

Clean, well-scoped edit overall — the substance is the tail-latency framing and the #1442 note, not the mechanics.


Generated by Claude Code

…edging

Removing endgame hedging left ADR 039 claiming more than the remaining
mechanism delivers. `unit_deadline_ms` is a verified-progress deadline, so
re-dispatch preempts a stalled source but never one that keeps delivering
below the set's rate — precisely the case hedging covered.

- Narrow the § Failure handling claim to what re-dispatch actually does,
  and name the slow-but-progressing source as the residual.
- Record that residual as a § Negative bullet, restoring the trade-off
  ledger the removed double-pay bullet used to carry.
- Answer the open question on #1442: § Scope boundary now records that
  speculative duplicates are out by decision rather than by sequencing,
  and that a capped, opt-in hedge is the option that returns if measured
  tail latency on large blobs demands one.
- Promote "at most one source owns a unit at a time" into acceptance
  criterion 5, so the no-duplicate-dispatch property is testable.

Spec-only; no implementation, protocol, or configuration surface changes.

Refs #1442, #1448

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015cSoEK1Bh4eXEFw887mkJY
@thiras
thiras merged commit 9563458 into main Jul 25, 2026
24 checks passed
@thiras
thiras deleted the codex/1442-remove-endgame-hedging branch July 25, 2026 15:58
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.

Remove endgame hedging from multi-source fetch (ADR 039)

3 participants