Skip to content

fix(moq-congestion): BBR3 skips ProbeRTT when congestion left no queue - #9381

Merged
kixelated merged 6 commits into
mainfrom
quest/m1/peer-link-steady-lag
Nov 22, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m1/peer-link-steady-lag

Conversation

@kixelated

@kixelated kixelated commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

moq-dev/moq#9329 saw a 16 Mbps track on a warm cross-region peer link settle about 385 ms behind live in some runs, instead of about 145 ms. I rebuilt that measurement and it reproduces on its own. The cause is BBR3's ProbeRTT, not a window or host load: the writer's timer overshoot stayed at 1 to 2 ms. #9329's windows have nothing to do with it; it shows at 1, 4, and 64 MiB stream windows.

Sender-side BBR3 trace of a bad run (200 Mbps bottleneck, 125 ms each way, 250 ms drop-tail queue):

  1. The 32 MiB warm-up overflows the bottleneck queue. That loss marks the min_rtt window "congested", which denies the application-limited ProbeRTT skip.
  2. 10 s later, min_rtt expires and BBR3 enters ProbeRTT. By then its bandwidth estimate has aged to the track's own rate (17.3 Mbps). So ProbeRTT's window, 0.5 × BDP = 270 KB, sits below the 500 KB the 16 Mbps track keeps in flight, and the sender stalls for about 250 ms.
  3. It leaves ProbeRTT pacing at 17.1 Mbps, barely above the track. The ~240 ms backlog then drains at about 3% per second until the next bandwidth probe, 3.5 to 4 s later.

So the "steady" 385 ms was a one-off 4 s episode, about 10 s after any congestion. #9329's last-3 s window happened to catch it. Yet the flow's RTT samples stayed within 0.2% of min_rtt the whole time: there was no queue for ProbeRTT to drain.

Approach

An application-limited flow now skips a due ProbeRTT despite congestion when every RTT sample since the latest loss or CE sat within 1.125 × BBR.min_rtt. This is QUICHE's probe_rtt_skipped_if_similar_rtt_ (kSimilarMinRttThreshold).

  • probe_rtt_skip_congested: bool becomes probe_rtt_congested: Option<Duration>: set by a congestion signal, it holds the lowest RTT sample since the latest signal. Spurious-loss undo restores it, keeping the lower of the saved and current values.
  • A flow beside a loss-based flow's full queue still measures that queue, so it still enters ProbeRTT. Bulk (non-application-limited) flows are unchanged, so competing BBR flows still converge.
  • congested_interval_enters_probe_rtt now covers samples at 1.0, 1.12, 1.13, and 2 × min_rtt for loss and CE. spurious_loss_keeps_the_probe_rtt_skip now uses queued samples, so it still tests the undo.
  • New nightly benchmark benchmark_join_lag (rs/moq-tokio/tests/integration/receive_credit.rs, wired in sh/gh/nightly.sh). It rebuilds fix: peer links default to 64 MiB windows, every stream to 4 MiB #9329's measurement as a peer link: 64 MiB connection windows, 125 ms each way, a 250 ms drop-tail queue, and a 32 MiB warm-up, then a 2 s mid-group join watched for 12 s. It runs at 1 Gbps and 200 Mbps, with the default 4 MiB stream window and with 64 MiB. It reports caught-up time, median and worst lag after catch-up, and queue drops.
  • .config/nextest.toml gives the benchmark a 300 s budget, as it does benchmark_receive_windows.
  • The rs/moq-quic/README.md divergence note describes the new skip rule.
  • Deletes quest/m1/peer-link-steady-lag.md.

Impact

  • Public API: none. Wire: none.
  • Behavior: an application-limited BBR3 sender that saw loss or CE without a lasting queue no longer enters ProbeRTT 10 s later. That means no ~250 ms stall and no seconds-long lag episode for live media.
  • Nightly gains one benchmark, about 3.7 min of a release run. The merge gate is unchanged.

Alternatives

  • Floor ProbeRTT's window at the application's own in-flight need. This keeps ProbeRTT's RTT measurement but lets the flow keep its own queue, which defeats the probe. Rejected.
  • Leave ProbeRTT for a pacing-gain boost after it exits to drain the backlog. This treats the symptom, and the ~250 ms stall would remain. Rejected.
  • Ignore loss during Startup only. This is narrower than the RTT evidence, which covers any congestion signal that left no queue. The 1 Gbps runs hit ProbeRTT with no shaper drops, and I didn't trace which signal set it there. Rejected.

Decisions

Choices I took without the maintainer (a review can undo each):

  • The 1.125 threshold is QUICHE's constant, not tuned here.
  • The skip stays limited to application-limited flows. QUICHE applies the similar-RTT skip to every flow, but this repo's bulk-flow ProbeRTT (bulk_flow_at_min_rtt_enters_probe_rtt) exists for convergence between BBR flows.
  • The measurement is committed as a nightly benchmark that reports numbers only, with no lag threshold, so it sets no arbitrary acceptance bar. The BBR3 unit test guards the fix in the merge gate.

Validation

  • just check passes. cargo test -p moq-congestion --lib: 131 passed.

  • benchmark_join_lag, release, on desktop (loaded: load 14 on 24 cores; writer timer overshoot ≤ 9 ms). Median of 3 runs per row; 1000 and 200 are Mbps:

    rate stream window caught up (before → after) lag p50 lag max (before → after)
    1000 4 MiB 787 → 1286 ms 136 → 133 ms 402 → 187 ms
    1000 64 MiB 572 → 573 ms 147 → 146 ms 399 → 179 ms
    200 4 MiB 574 → 560 ms 140 → 142 ms 213 → 183 ms
    200 64 MiB 556 → 446 ms 148 → 148 ms 400 → 170 ms

    "Before" is this branch with the threshold set to 0, which restores main's rule. The caught-up time at 1 Gbps with 4 MiB varies run to run (catch-up is stream-credit-bound, as fix: peer links default to 64 MiB windows, every stream to 4 MiB #9329 measured).

  • Independent check with an instrumented (uncommitted) BBR3 state trace on the scratch version of the measurement. This used the same path with an 8 s watch, 6 runs per cell, at 1, 4, and 64 MiB windows:

    • Before: nearly every 200 Mbps run spiked to about 400 ms, and 4 of 8 runs at 64 MiB had a steady p50 of 280 to 380 ms.
    • After: 0 ProbeRTT entries across 36 runs. Every 200 Mbps run held p50 at 129 to 150 ms and max at ≤ 167 ms.
    • A 20 s watch before the fix showed one ProbeRTT per run, a 3.5 to 4 s episode about 240 ms behind, then 143 to 150 ms with no further ProbeRTT.
  • Not run on a quiet host: nixos and fedora were as loaded as desktop. The trace attributes the lag to ProbeRTT directly, and timer overshoot rules out the host.

Caused by

  • moq-dev/moq#6755: any loss or CE in the min_rtt window denied the application-limited ProbeRTT skip, even when the flow's samples showed no queue. A one-off overflow then put a live track ~240 ms behind live for seconds (found by person: measurement on moq-dev/moq#9329).

Follow-ups

None.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort (arm A)

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 38bfd02

  • Base: origin/main at 142769f

  • Risk: medium, The BBR3 congestion change in `rs/moq-congestion` alters when application-limited flows skip ProbeRTT and what min_rtt they adopt, so relays and clients running that controller could see different throughput and lag, but the API, wire format, and auth are unchanged and a revert undoes all of it. The other files are tests, a benchmark, a README, a deleted quest plan, and a nightly benchmark selection, none of which consumers rely on.

  • Classified: medium by Claude Code, claude-haiku-5-5, low effort, session 97b6b03b-e3f7-4b46-8e9c-4b853204f17e

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a202b7-14ed-7511-82a7-cfb3b1240fe5, round 2

  • Score: 10/10, The timeout override fixes the earlier finding, and the incremental change introduces no new findings.

  • Rounds: 2; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0

  • Findings: none

  • The last round's findings, at 827cb39:

    • Fixed: medium, rs/moq-tokio/tests/integration/receive_credit.rs:1502: Split the benchmark sweep to fit the nightly runner budget; The head adds an exact-match override for receive_credit::benchmark_join_lag in .config/nextest.toml, increasing its inherited benchmark timeout to 300 seconds and accommodating the reported 224-second run.

kixelated and others added 5 commits November 22, 2026 00:09
An application-limited flow whose RTT samples since its latest loss or CE
stayed within 1.125x of BBR.min_rtt skips a due ProbeRTT, as QUICHE's
probe_rtt_skipped_if_similar_rtt_ does. A one-off overflow, such as a warm-up
burst, no longer cuts a live track below its own rate and leaves it ~240 ms
behind live for seconds.

Adds benchmark_join_lag to nightly and deletes quest/m1/peer-link-steady-lag.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Explain the extra steady lag on a warm peer link fix(moq-congestion): BBR3 skips ProbeRTT when congestion left no queue Nov 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 22, 2026 10:30
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 27fc9d67-bc8d-43ba-909e-d83763607979
Commits

Reviewing files that changed from the base of the PR and between 0c5b90d and 38bfd02.

Files selected for processing: 6

  • .config/nextest.toml
  • quest/m1/peer-link-steady-lag.md
  • rs/moq-congestion/src/bbr3/mod.rs
  • rs/moq-quic/README.md
  • rs/moq-tokio/tests/integration/receive_credit.rs
  • sh/gh/nightly.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated
kixelated enabled auto-merge November 22, 2026 10:30

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Approach: Sound. Swapping the boolean congestion veto for a per-signal minimum RTT fixes the cause: a one-off overflow with no lasting queue no longer forces ProbeRTT. A flow sitting beside a real queue still enters ProbeRTT.

Reviewed changes: I reviewed the BBR3 ProbeRTT skip rule, its tests, the new nightly join-lag benchmark and how it is wired in, and the README divergence note.

  • SIMILAR_MIN_RTT skip in update_min_rtt: a congestion signal now starts a lowest-sample tracker at infinity, and each fresh rs sample lowers it. An application-limited flow skips a due ProbeRTT once that tracker sits within 1.125 × min_rtt. This is stricter than QUICHE's whole-window minimum, because a renewed loss erases the earlier evidence.
  • Spurious-loss undo: this restores the pre-episode tracker, keeping the lower of the saved and current values. A None undo correctly clears the episode's lone signal. set_min_rtt_stamp still resets both fields.
  • CE ordering: the CE-marked ACK's own sample is processed before on_ce, so it never counts as post-signal evidence. The 20 ms CE case in congested_interval_enters_probe_rtt pins this.
  • Tests: congested_interval_enters_probe_rtt sweeps samples on both sides of the 1.125 threshold, for loss and for CE. spurious_loss_keeps_the_probe_rtt_skip now uses queued samples, so only the undo decides the outcome.
  • benchmark_join_lag: a new ignored nightly benchmark covering 2 rates × 2 stream windows × 3 runs. It has a 300 s nextest budget and is added to the nightly filter as a plain name, which the JUnit match check verifies. setup_through now delegates to the new setup_served, which takes the server's QUIC config.
  • Docs and cleanup: the rs/moq-quic/README.md divergence note describes the new skip condition, and the PR deletes the finished quest file.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 3ac9f31 Nov 22, 2026
9 checks passed
@kixelated
kixelated deleted the quest/m1/peer-link-steady-lag branch November 22, 2026 11:52
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.

1 participant