From 434d79c73c29b40a6ca85f29926d4ac374b35d72 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 03:07:50 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m1/bbr3-references/idle-aggregation.md Quest-Claim: ed52c7ae67889353 From 3de8b92022605fa55f26ed3669bd3f9cb1efb1bc Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 03:18:43 -0800 Subject: [PATCH 2/2] fix(moq-congestion): BBR3's ACK aggregation epoch restarts from idle with its delivered bytes Co-Authored-By: Claude Sonnet 5.5 --- quest/m1/bbr3-references/idle-aggregation.md | 23 --------------- rs/moq-congestion/src/bbr3/mod.rs | 31 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 23 deletions(-) delete mode 100644 quest/m1/bbr3-references/idle-aggregation.md diff --git a/quest/m1/bbr3-references/idle-aggregation.md b/quest/m1/bbr3-references/idle-aggregation.md deleted file mode 100644 index 4ab05c63538..00000000000 --- a/quest/m1/bbr3-references/idle-aggregation.md +++ /dev/null @@ -1,23 +0,0 @@ -# [XS] BBR3's ACK aggregation estimate stays bounded across idle - -## Goal - -A sender that goes idle between bursts, as media does when the RTT is -shorter than the frame interval, keeps `extra_acked` and the window it adds -bounded by the aggregation it actually sees. - -## Plan - -`handle_restart_from_idle` (`rs/moq-congestion/src/bbr3/mod.rs`) resets -`extra_acked_interval_start` but not `extra_acked_delivered`, so each -resumed burst counts every earlier epoch's bytes as aggregation. The cap at -cwnd is circular, since `set_cwnd` grows cwnd toward `2·BDP + extra_acked`. -Simulated in the 2026-11-14 audit: 8 Mbit/s media at 30 fps over 20 ms grew -cwnd to 11 MB in 18 s (74 KB with the fix). Draft-06's -`BBRHandleRestartFromIdle` has the same omission; Linux zeroes -`ack_epoch_acked` there ([tcp_bbr.c:540-542](https://github.com/google/bbr/blob/90210de4b779d40496dee0b89081780eeddf2a60/net/ipv4/tcp_bbr.c#L540-L542)). - -Zero `extra_acked_delivered` with the interval start, and test that bursts -separated by idle gaps keep `extra_acked` and cwnd bounded. Caused by -[moq-dev/moq#4921](https://github.com/moq-dev/moq/pull/4921), which ported -the draft's omission. diff --git a/rs/moq-congestion/src/bbr3/mod.rs b/rs/moq-congestion/src/bbr3/mod.rs index e6c965b22b5..23872a61e4c 100644 --- a/rs/moq-congestion/src/bbr3/mod.rs +++ b/rs/moq-congestion/src/bbr3/mod.rs @@ -1395,6 +1395,9 @@ impl Bbr3 { fn handle_restart_from_idle(&mut self, now: Instant) { if self.inflight == 0 && self.rate.is_app_limited() { self.idle_restart = true; + // A new epoch: bytes delivered before the idle gap are not aggregation of the burst + // after it, and the window they lift would feed them back. + self.extra_acked_delivered = 0; self.extra_acked_interval_start = Some(now); match self.state { BbrState::ProbeBw(_) => { @@ -7285,6 +7288,34 @@ mod test { assert_eq!(sim.bbr.max_bw, 1_200_000.0); } + /// Media sends a frame as a burst every frame interval, idle in between and acknowledged + /// whole. Each burst is all the aggregation there is: bytes of earlier bursts never count + /// toward `extra_acked`, or the window it lifts feeds back into it. + #[test] + fn idle_gaps_keep_extra_acked_bounded() { + let mut sim = Sim::new(Config::default(), 1200, 1.25e6, 20 * MS); + let burst = 28u64; + let burst_bytes = burst * 1200; + for frame in 0..600u64 { + let sent_ns = frame * 33 * MS; + let first = sim.pn; + sim.send(sent_ns, burst); + sim.starve(); + // The bottleneck serializes the burst, so its ACKs arrive spread out. + for i in 0..burst { + let ack_ns = sent_ns + 20 * MS + i * 960_000; + sim.ack(ack_ns, [first + i], i + 1 == burst); + } + sim.starve(); + assert!( + sim.bbr.extra_acked <= burst_bytes, + "frame {frame}: extra_acked {} exceeds one burst {burst_bytes}", + sim.bbr.extra_acked + ); + } + assert!(sim.bbr.cwnd <= 4 * burst_bytes, "cwnd {}", sim.bbr.cwnd); + } + /// An application sending one packet per burst, idle in between. The transport polls after /// every send and every ACK, both polls come up empty, and each ACK carries that verdict. The /// ACK that ends a limited phase clears the marker instead of renewing it, and with nothing