Skip to content

fix(quic): sync Quinn and BBR3 correctness fixes - #7458

Merged
kixelated merged 9 commits into
mainfrom
quest/m1/vendor-sync/quinn
Nov 2, 2026
Merged

kixelated merged 9 commits into
mainfrom
quest/m1/vendor-sync/quinn

Conversation

@kixelated

@kixelated kixelated commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The Quinn fork ledger had not recorded the latest upstream comparison, and the carried BBR3 lacked several fixes from the force-pushed quinn-rs/quinn#2481.

Approach

  • Compare Quinn main through 2c575013, 0.11.x through 4b84837d, BBR3 quinn-rs/quinn#2481 through 01b8848d, and all 13 published advisories. Record the heads and dispositions in rs/moq-quic/README.md.
  • BBR3 (moq-congestion): keep Startup's per-round ACK aggregation maximum, restore the saved window once when recovery ends, preserve it into ProbeRTT (save_cwnd keys on recovery, as draft-06 does), renew application-limited markers, saturate probe growth, and stop a probe at the previous loss bound (precautionary probing) before accelerating again on clean feedback. Spurious-loss undo restores that probe history, including a precautionary stop still waiting on its feedback round.
  • Apple's IP_PKTINFO source-address fix (a2c55b36) landed on main separately in moq-dev/moq#7418. The ledger credits that PR, and this PR does not touch moq-sock.
  • The quinn run of the vendor sync is complete, so quest/m1/vendor-sync/quinn.md is deleted with quest rm. Its standing sync guidance (check the fork's reworked code first, where Endpoint fixes land, compare 0.11.x by subject, check quinn#2481 each run) moves into the moq-quic README's Upstream section, as the other vendor-sync children recorded theirs. The vendor-sync README re-creates the child for the next cycle.

Impact

  • Public API: none.
  • Wire format: none. BBR3 congestion-control behavior changes.
  • Interaction with moq-dev/moq#7429, now on main: the marker renewal labels the round sent right after an idle ACK application-limited, as draft-06 labels every packet sent while C.app_limited is set. Startup's probe fill therefore lasts one round longer, ending on the sender's next round of its own. probe_inflight_fills_one_up_per_probe_wait now expects that.

Alternatives

The idle-accept, reset-credit, IPv6 binding, GSO, and release-branch receive-error fixes already hold in the fork; reapplying them would add no behavior. Dependency bumps are skipped. Batched read_datagrams stays out until the planned lock profile shows a consumer worth changing the API for.

Decisions

  • Applied the recommended small correctness ports without adding API or merging upstream. Keep the fork's bytes/s metrics and transport-owned packet snapshots rather than upstream's bits/s conversion and packet-discard callback.
  • 2026-11-01 (user): review only. Do the required Claude review, merge main (no rebase), reconcile with moq-dev/moq#7429 if it landed, run Linux checks.
  • 2026-11-02 (maintainer): drop the macOS-validation item. After merging main, this PR changes no Apple or moq-sock code, so nothing needs a Mac. This supersedes the 2026-11-01 instruction to keep the PR a draft for it.
  • moq-dev/moq#7429 landed. Merging main (merge commit, no rebase) resolved one conflict in rs/moq-quic/README.md (main's ControllerMetrics → Metrics rename) and auto-merged bbr3/mod.rs. Its Startup-fill test needed the update under Impact.
  • Kept, not changed: after a precautionary stop, the resumed ProbeBW_UP still uses the earlier bw_probe_fill, as main's spurious-loss undo already does through start_probe_bw_refill. It fires only after a probe hit loss, so the extra fill stays bounded.
  • Dropped this PR's earlier Recovery benchmark mode: only its first ACK differed from Steady (review round 1).

Checks

On af9218d6, Linux, inside nix develop:

  • quest gate nix develop -c just ci origin/main: passed (exit 0). 6526 tests run, 6526 passed, 110 skipped; Rust, JS, workers, Markdown, gh, drill, quest, shell, large-files, toml, nix, and justfile checks all passed.
  • quest check --base origin/main --branch quest/m1/vendor-sync/quinn: 616 documents ok.
  • cargo nextest run -p moq-congestion -p moq-quic: 812 passed, 16 skipped.
  • The new spurious_loss_keeps_the_precautionary_refill fails without the undo restore and passes with it.
  • Earlier checkpoint (Codex, pre-merge): four BBR regressions reproduced before their fixes; extended per-packet benchmark passed across 45 flight/batch/mode combinations.

Review

Reviewer: Claude Code (quest review --harness claude, other vendor to the Codex author), model Claude Opus 5.5 (claude-opus-5-5), medium effort, session 2255062e, against origin/main.

Reviewed head: af9218d6, round 4: no findings.

  • Round 1 (3c02c70f, the merge of main): three findings, all fixed in 26263090.
    1. Fixed: spurious-loss undo dropped a precautionary stop's early refill (on_spurious_loss forced prev_probe_precautionary false). It is now snapshotted and restored while ProbeBW_DOWN's feedback round is still running, and cleared when that round ends. Regression test added.
    2. Fixed: the bench's Recovery mode repeated Steady; bench.rs is back to main's.
    3. Fixed: deleting quinn.md lost its sync hints; they now live in the moq-quic README.
  • Rounds 2 and 3 (e6261bc0, then 26263090 after cargo fmt): no findings.
  • Round 4 (af9218d6): no findings on the moq-dev/moq#7429 test update, which followed a local CI failure verified against main's rate.rs. That was the fourth round: no findings remained, so the approach stands.

Follow-ups

  • Consider a release backport of the BBR correctness fixes after main lands.
  • Existing lock-profile work owns the evidence needed to consider batched datagram reads.

No upstream posts were made.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 4 commits October 31, 2026 15:23
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated kixelated changed the title moq-quic has every quinn fix it needs fix(quic): sync Quinn and BBR3 correctness fixes Oct 31, 2026
kixelated and others added 2 commits October 31, 2026 22:47
# Conflicts:
#	quest/m1/vendor-sync/quinn.md
#	rs/moq-quic/README.md
#	rs/moq-sock/src/udp/apple_fast.rs
#	rs/moq-sock/tests/udp/main.rs
The Apple source-address fix landed on main in #7418, so the
merge keeps main's moq-sock and the fork ledger credits it. With the BBR3
refresh ported and the ledger checked through 2c575013, this run is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated and others added 3 commits November 1, 2026 20:56
Snapshot the precautionary-stop flag with the other loss-undo state and
restore it while its feedback round is still running, so a spurious loss in
that round no longer delays the next probe by a full bw_probe_wait. Clear the
flag once the feedback round ends, so it never outlives the probe it marks.

Drop the bench's Recovery mode: only its first ACK differed from Steady.
Move the deleted quinn quest's sync hints into the moq-quic README, so the
next run finds them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since an idle ACK renews the application-limited marker, the round sent
right after it is application-limited, as draft-06 labels every packet sent
while C.app_limited is set. Startup's probe fill therefore ends one round
later, on the sender's next round of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 2, 2026 06:08
@coderabbitai

coderabbitai Bot commented Nov 2, 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 1 minute.

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: e6471b25-b22f-47ac-b59d-5b1232236ec8
Commits

Reviewing files that changed from the base of the PR and between a546cac and af9218d.

Files selected for processing: 5
  • quest/m1/vendor-sync/README.md
  • quest/m1/vendor-sync/quinn.md
  • rs/moq-congestion/src/bbr3/mod.rs
  • rs/moq-congestion/src/rate.rs
  • rs/moq-quic/README.md
  • 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

@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.

Reviewed changes

  • BBR3 recovery-window restore — check_recovery_done now restores the saved prior_cwnd on the recovery-exit transition, and save_cwnd keys on in_recovery; this matches upstream 01b8848d.
  • BBR3 Startup ACK aggregation — update_ack_aggregation holds the per-round maximum in Startup rather than overwriting it on each ACK.
  • BBR3 precautionary probe — maybe_go_down stops a probe at inflight_longterm when the prior probe found excess loss, adapt_long_term_model restarts a refill on clean feedback, and spurious-loss undo snapshots/restores prev_probe_precautionary; probe-bound growth is saturated.
  • Application-limited renewal — rate.rs clears and renews app_limited as two independent steps, so an idle ACK crossing the old marker still renews the label (matches upstream on_end_acks).
  • Vendor-sync ledger — the completed quest/m1/vendor-sync/quinn.md is deleted, its sync guidance folds into rs/moq-quic/README.md, and the README records the advisories and new upstream heads (2c575013 / 4b84837d) with the ported/held commits.

I read the diff end to end and verified it independently: the port tracks the actual quinn#2481 head 01b8848d, cargo test -p moq-congestion --lib reports 102 passed / 1 ignored, and clippy --all-targets -D warnings plus fmt --check are clean. Two divergences from upstream are deliberate and benign: on_spurious_loss restores the precautionary history conditionally (documented in the PR body, with a regression test), and check_recovery_done adds an in_recovery guard (restore is max, so idempotent). No public API or wire changes; congestion-control behavior only.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 96244dd Nov 2, 2026
8 checks passed
@kixelated
kixelated deleted the quest/m1/vendor-sync/quinn branch November 2, 2026 17:24
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