Repository navigation
Description
Decision (2026-07 ADR simplification audit). Filed under the Protocol simplifications milestone — sibling to #1396, #1394, #1419. Verdict: DROP. BitTorrent needs endgame hedging because it has no incentive layer; we do. Paying for speculative duplicate units to shave tail latency is exactly the kind of thing our payment/scheduling layer should make unnecessary. Note the steelman below actually leaned KEEP (scale-favorable) — the counter-argument is retained in full; this is a deliberate override, and it is spec-only (ADR 039 is unimplemented, so dropping it now costs nothing but a section).
Remove endgame hedging from multi-source fetch (ADR 039)
Status: proposal for discussion, not a decision.
Summary
In the multi-source scheduler, endgame hedging re-requests the last outstanding units from idle faster sources in parallel and pays for the racing duplicates, for a tail-latency win. The base work-stealing scheduler already re-dispatches stalled units on unit_deadline_ms. This proposal removes the endgame sub-feature only; the multi-source scheduler itself (the large-blob / AI-model wedge) is kept.
Motivation
- Base re-dispatch already prevents one slow source from stalling completion (ADR 039:42).
- We have an incentive layer. BitTorrent's endgame mode exists precisely because a leecher has no cost signal — racing duplicate requests is "free" to the requester, so the swarm brute-forces the tail. In deCDN every byte is paid, so speculative duplicate fetches spend real money for a marginal tail-latency win. The mechanisms that should keep the tail short here are source selection and deadline-based re-dispatch, not paying twice.
- Cost is bounded by design (
endgame_hedge1–2 duplicates per unit, paid only for verified bytes delivered before cancellation, ADR 039:49) — but "bounded extra spend for a marginal win" is still extra spend the incentive layer is supposed to avoid.
What removal touches (blast radius)
Spec-only. ADR 039 is Draft and entirely unimplemented — no scheduler, no work_unit, no endgame anywhere in crates/ (confirm: grep -rni 'endgame\|work_unit\|unit_deadline' crates/ → nothing). Dropping = deleting §Endgame hedging + the endgame_hedge param row from ADR 039. Applies to the sub-feature ONLY, not ADR 039 (multi-source parallel fetch stays for the wedge).
What we keep
The whole multi-source scheduler, work-stealing, and deadline-based re-dispatch.
Counter-argument (the steelman's original lean — retained honestly)
Re-dispatch is sequential (wait unit_deadline_ms, then reassign), whereas hedging is speculative-parallel (race before the deadline). Its benefit grows with scale — more idle fast sources to race — which reads as scale-favorable, not scale-deferral, and it directly serves the large-blob / AI-model wedge where the last few units set total download time. On that reasoning the audit's default verdict was KEEP (cost bounded, spec-only). [your call]: the override reasoning is that our incentive layer makes duplicate-paying the wrong tool for the tail, and that deadline-based re-dispatch plus better source selection should carry it — so the section comes out now, and if a concrete tail-latency problem shows up in implementation we design the fix against real data rather than pre-committing to torrent-style hedging.
Open questions
- If the tail turns out to be a real problem for very large blobs, is the right fix tighter
unit_deadline_ms+ smarter source ranking (no double-pay), or a capped, opt-in hedge — and should ADR 039 note that explicitly so the option isn't lost?
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
docs(adr): remove endgame hedging from multi-source fetch (#1448)