Repository navigation
feat(moq-quic): port BBR3 and the controller callbacks as the default controller - #4921
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry for some delay based algorithms such as BBRv3
… adjust the burst size and the overall pacing rate of the connection
Ports moq-dev/noq#12: CE exits Startup, stops a bandwidth probe, or lowers the short-term model, once per recovery episode, and no longer counts as a loss. Also adapts a cubic test quinn added after quinn#2481's base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At a high pacing rate a few bytes of shortfall take under a nanosecond to earn. Truncating that wait to zero re-armed the pacing timer at the current instant forever. Earn and wait in integer nanoseconds, rounding the wait up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lockstep handshake and GSO tests script exact packet schedules that the window-derived pacer meets at the harness's zero RTT; pin them to Cubic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Controllers report their pacing rate in bytes per second, which the pacer consumes; qlog's field is bits per second. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reworks the fork's connection-level regressions onto quinn's Pair harness: packet identity across spaces and through a Retry, CE reported only on a count increase and never for invalid feedback, starvation reported before a resumed send but not for a window- or pacing-blocked backlog, and BBR's classic ECN response at a bottleneck. The harness gains an ECN rewrite and a client-to-server bottleneck queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They script lockstep packet schedules at zero RTT, which BBR3's rate pacing meets only as far as the randomly sized handshake left budget, so about one run in ten failed somewhere. Run them on Cubic as upstream does, and opt the BBR3 tests in. A new test checks BBR3 stays the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Outcome of the unattended
Not done: the benchmark against (Written by Claude Opus 5.5) |
Co-Authored-By: GPT-6 <noreply@openai.com>
Guard the bytes-per-second controller contract at the qlog boundary, which emits bits per second. Co-Authored-By: GPT-6 <noreply@openai.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (25)
💤 Files with no reviewable changes (5)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthroughmoq-quic now uses BBR3 as its default congestion controller. The controller API and connection code pass packet numbers and packet-number spaces to congestion events and support send-quantum and application-limited callbacks. The pacer uses controller metrics, including an optional pacing rate. Tests cover the updated callbacks, pacing, ECN behavior, and BBR3 behavior. Quest plans and repository notes now describe BBR3 as present in moq-quic. Estimated code review effort Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This change makes BBR3 the default congestion controller for the unpublished moq-quic crate and updates pacing and controller callbacks. No concrete defects remain open, and the crate is not yet used elsewhere in the workspace, so it appears ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 59.12% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 159 functions across 14 files. (5 skipped: 5 unsupported.)
✨ Finishing Touches✨ Simplify code
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. Comment |
kixelated
left a comment
There was a problem hiding this comment.
Independent Codex review of final head 3fab9b4. No blocking finding in the transport integration, packet-space callback identities, controller pacing and send-quantum enforcement, classic ECN handling, default-controller selection, or final qlog regression.
Rates consistently use bytes/s in the controller, pacer and PathStats; the qlog boundary converts to bits/s with saturating multiplication. Pacing waits earn only the token deficit and round up rather than rearming at the current instant. The packet-space and congestion simulations exercise callback identities and ECN without relying on wall-clock sleeps. The final regression observes 125,000 bytes/s as 1,000,000 bits/s in an actual qlog event; the iteration report documents its failing negative control and 437 default/439 qlog tests passing.
This was a focused review of integration, carried behavior and regression coverage, not an exhaustive independent derivation of the imported BBR state machine. The user confirmed the upstream quinn#2481 base, BBR3 crate default and bytes/s contract. Relay/noq throughput and latency comparison remains in the existing consumer-switch quest; this PR alone does not establish production relay performance. Final-head CI remains the merge gate.
Public API: replaces Bbr/BbrConfig with Bbr3/Bbr3Config, expands Controller callbacks, exposes SpaceId and send_quantum, and makes BBR3 the crate default. No wire format change.
(Written by GPT-6)
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 3fab9b4
No additional actionable regression found in this focused source review. This agrees with the existing independent review; no duplicate inline comments.
Provenance checked against quinn-rs/quinn@55f74c0 and moq-dev/noq@c85041b: max_filter.rs matches upstream; the BBR module's upstream delta carries classic ECN, while the noq comparison retains the documented draft-06 bandwidth-bound changes. All 68 noq BBR test names are present, with four additional bandwidth-bound regressions.
Direction: keeping the upstream-derived controller and isolating transport adaptations is reasonable. Checked packet-space/Retry callbacks, ACK/loss/CE ordering, app- versus cwnd-limited signals, explicit-rate pacing and GSO bounds, plus API/unit changes. The qlog conversion is correctly confined to connection/paths.rs:215–219; no dependency-manifest or wire-parser changes are introduced.
Remaining validation matters before the consumer switch: the BBR3 default at config/transport.rs:410 is not broadly exercised by the Cubic-pinned scripted harness. Retain the relay/noq throughput-and-latency comparison in quest/m1/quic/fork/switch.md and the bytes/s-to-bits/s consumer conversion. The full-flight scans at congestion/bbr3/mod.rs:1875–1882 remain a scaling concern already tracked by the ACK-cleanup quest, not a newly discovered port defect.
Limits: source/provenance and regression-coverage review, not an exhaustive BBR state-machine or security audit; I did not rerun builds, tests, or network benchmarks. GitHub's Check and Platform runs for this head report success. This comment does not establish production performance or merge readiness.
# Conflicts: # quest/m1/quic/fork/README.md # quest/m1/quic/fork/switch.md # rs/moq-quic/README.md
|
Merged current main into final head The confirmed decisions remain quinn#2481 plus classic ECN, BBR3 as the default, and bytes/s in controller and PathStats metrics with conversion at qlog. Public API impact remains the Bbr3/Bbr3Config replacement, expanded Controller callbacks, public SpaceId and send_quantum, and BBR3 default. Wire format is unchanged. Clean-Nix (Written by GPT-6) |
Automated review:
|
kixelated
left a comment
There was a problem hiding this comment.
Independent final-head review of ef090c6 following the previously reviewed 3fab9b4.
No actionable finding in the integration delta. All rs/moq-quic/src files are byte-for-byte unchanged from the reviewed implementation. The merge preserves both BBR3 and main's UDP carried-change documentation and removes prerequisites that main already completed. The relay/noq benchmark and bytes/s consumer conversion remain in the switch quest.
Verified the final merge diff and current main's quest context. The merge agent reports clean-Nix just check (437 tests) and the qlog suite (439 tests) passing; I did not independently rerun them. Final-head CI must pass before landing. The public API and wire impact remain as documented in the PR.
(Written by GPT-6)
Problem
moq-quic(quinn-proto, #4879) still carried quinn's old BBR. MoQ's corrected BBR3 and theControllercallbacks it needs lived only in moq-dev/noq, which is frozen. Questquest/m1/quic/fork/bbr3.md.Approach
bbr3/over by hand, because Merge iroh-live's native media stack into moq-video/moq-audio (upstreaming plan) #2481 lacked the fork's fixes. Since then (2026-09-25) its author has ported moq-dev/noq's BBR fixes and regressions into Merge iroh-live's native media stack into moq-video/moq-audio (upstreaming plan) #2481. Its head (55f74c0d) is quinn-native, so I rebased its four commits onto the fork point with authorship kept. That brings in theControllercallbacks (packet number +SpaceId, sent/lost, cwnd-limited, app-limited, ACK frequency), the rate pacer that usespacing_rateandsend_quantum, andbandwidth_estimate. Diffed against noq'sbbr3/mod.rs, the only fork change missing was classic ECN. Merge iroh-live's native media stack into moq-video/moq-audio (upstreaming plan) #2481 also has a few draft-06 changes noq lacks (window and Drain exit sized byBBR.bw).Simtests are present (Merge iroh-live's native media stack into moq-video/moq-audio (upstreaming plan) #2481 adds 4 more).Pair. They check packet identity across spaces and through a Retry, that CE is reported only when the count rises and never for invalid feedback, that starvation is reported before a resumed send but not for a backlog blocked by the window or pacer, and that BBR responds to marking at a bottleneck.Pairgained an ECN rewrite and a client-to-serverBottleneckqueue.nowforever. This hung about 50 tests once BBR3 was the default. It now uses integer nanoseconds and rounds up. The regression test fails without the fix.TransportConfigcontroller. Quinn's connection tests run Cubic through the harness helpers, as upstream's do. They script lockstep schedules at zero RTT that BBR3's rate pacer met only about 9 runs in 10. BBR3 tests opt in, anddefault_controller_is_bbr3guards the default.rs/moq-quic/README.mdlists the carried changes. The quest is deleted, its references updated, and the benchmark againstmoq-noqmoves to the switch quest.Validation: clean-Nix
just checkpasses after merging currentmain(437 moq-quic tests, format, rustdoc, dependency, quest, Markdown, and Nix checks). The qlog-feature suite also passes (439 tests). Its new regression verifies that a controller pacing rate of 125,000 bytes/s is emitted as 1,000,000 bits/s, and fails when the conversion is removed. Existing tests guard the BBR3 default, unchanged bytes/sPathStatsestimate, rate pacing, packet-space callbacks, and classic ECN. The previous session ran the scripted connection tests 60 times without flakes.Impact
moq-quicis unpublished, and nothing in the workspace consumes it yet.congestion::Bbr/BbrConfigare removed.congestion::Bbr3/Bbr3Configare added, with the same names noq uses.Controller:on_ackgainspn, space,on_end_acksgainsspace, andon_congestion_eventgainslargest_lost, space. New defaulted methods:on_packet_sent,on_packet_lost,on_cwnd_limited,on_app_limited,on_ack_frequency_update.ControllerMetrics::send_quantumis new.pacing_rateandbandwidth_estimateare now bytes/s, and so isPathStats::bandwidth_estimate.SpaceIdis public (moq_quic::SpaceId,congestion::SpaceId) and#[non_exhaustive].TransportConfig::default()now uses BBR3.Decisions
Confirmed by @kixelated in this session:
55f74c0d.TransportConfig::default(). Alternative: keep Cubic as the crate default because MoQ selects a controller family explicitly. The scripted zero-RTT connection harness keeps Cubic; dedicated BBR3 transport and simulation tests use BBR3.ControllerMetrics::{pacing_rate, bandwidth_estimate}andPathStats::bandwidth_estimate. Alternative: adopt quinn#2802's bits/s contract. Convert to bits/s only at the qlog boundary now and theweb-transport-traitboundary during the existing switch quest.Alternatives
bbr3/by hand as the quest planned. This gives the same code minus Merge iroh-live's native media stack into moq-video/moq-audio (upstreaming plan) #2481's draft-06 changes, but a version that is not quinn-native and costs more to re-sync.moq-quic's default, as quinn and Merge iroh-live's native media stack into moq-video/moq-audio (upstreaming plan) #2481 do. MoQ already picks a controller explicitly per family (Loss,Delay). This would avoid the test-harness change.Follow-ups
moq-noq1.3.x (could not run here without a relay onmoq-quic), and multiplybandwidth_estimateby 8 forweb-transport-trait.bbr_marking_versus_droppingmargins are looser than in noq's harness: in this harness, marking holds about 0.55x the queue time, against about 0.3x in noq's.(Written by GPT-6)