Skip to content

fix(moq-congestion)!: BBR3 counts Startup loss events per lost packet - #8848

Merged
moq-bot[bot] merged 4 commits into
mainfrom
quest/m2/bbr3-startup-loss
Nov 15, 2026
Merged

moq-bot[bot] merged 4 commits into
mainfrom
quest/m2/bbr3-startup-loss

Conversation

@kixelated

@kixelated kixelated commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m2/bbr3-startup-loss.md and deletes it.

Summary

BBR3's Startup high-loss exit now counts every lost packet toward STARTUP_FULL_LOSS_CNT, as draft-07 section 5.3.1.3 specifies, instead of counting discontiguous lost ranges as draft-06 read. A media sender bursting a frame into a tail-drop link loses one run per frame, so a round saw one to three events and the exit never fired; its application-limited rounds also block the plateau exit, so Startup never ended.

  • rs/moq-congestion/src/bbr3/mod.rs: note_loss adds one per lost packet. loss_events_in_round resets where draft-07 does: in advance_latest_delivery_signals (the loss-round boundary, after check_startup_high_loss ran, as AdvanceLatestDeliverySignals does), in reset_congestion_signals, and in on_spurious_loss. Before, it was reset inside check_startup_high_loss and nowhere else.
  • Lost::new_burst is removed (rs/moq-congestion/src/lib.rs), with its computation in rs/moq-quic/src/connection/mod.rs and its fixtures in SCReAM, GoogCC, and BBR3's test driver. lost_packets in moq-quic stays: spurious-loss detection uses it.
  • startup_exits_to_drain_on_loss_when_app_limited now drives a tail-drop bottleneck instead of an even 1-in-25 drop. A new test, loss_events_count_packets_and_reset_per_round_and_undo, covers the count and its resets.
  • The quest is deleted, with its link in the bbr3-references README.

Public API and wire impact

Public API: removes moq_congestion::Lost::new_burst; a Controller implementation that builds Lost drops the field. Wire: none.

Migration: delete the new_burst field wherever a Lost is built.

Decisions

Mine, made while the maintainer was away; a review can undo any of them.

  • Reset in advance_latest_delivery_signals, as draft-07 puts it, rather than keeping the reset inside check_startup_high_loss. The old placement skipped the reset once Startup had ended, so the count could carry stale losses; the new one resets on every loss round.
  • Test scenario: 3 Mbit/s link, 6-packet tail-drop queue, 30 fps frames of 14 packets, 60 ms RTT, matching the quest's example (50 to 3 Mbit/s, about 14 packets per frame).
  • Scoped away from #8807, which changes how Startup's high-loss exit counts the rounds spent in recovery (recovery_start_round). This change does not need it: the new test passes on main as is. I trial-merged fix(quic): controllers hear an ACK's losses before the ACK #8807 into this branch: no conflicts, and moq-congestion tests, the tests::sim, tests::probe, and tests::scream suites pass.

Validation

  • startup_exits_to_drain_on_loss_when_app_limited fails on the unchanged code ("BBR never left STARTUP on loss") and passes now. It asserts the samples stay application-limited, so only loss ends Startup.
  • Mutation checks: removing the reset in on_spurious_loss, or the one in advance_latest_delivery_signals, fails loss_events_count_packets_and_reset_per_round_and_undo. The reset_congestion_signals reset has no direct test.
  • just check passes: 8482 tests.
  • Release sims with debug assertions: tests::sim:: (seed 12345, 1024 cases) passes; the ignored tests::probe::, tests::scream::, and tests::realtime:: suites pass (17 tests).
  • Differential: tests::realtime::compare (cellular presets) prints an identical table before and after, since those runs drop no packets in Startup; the change only matters under tail-drop loss, which the unit test exercises.
  • Trial merges against open PRs, by git merge-tree: no conflicts with #8805, #8806, #8807, #8810. #8809 conflicts in five adjacent hunks of rs/moq-congestion/src/bbr3/mod.rs (its check_probe_loss rename, note_loss(new_burst) and the comments that describe range counting, an undo line, a doc link); whichever lands second resolves them by taking this PR's counting and fix(moq-congestion): BBR3 schedules ProbeRTT as draft-07 does #8809's naming.

Caused by

  • moq-dev/moq#4921 - ported BBR3 with the loss-event count as discontiguous ranges, as draft-06 read (found by person, in the 2026-11-14 reference comparison).

Follow-ups

None.

Models

Size: S
Implementer: Claude Code, claude-sonnet-5-5, high effort (iterate, S, arm B)

🤖 Generated with Claude Code

(Written by Claude Sonnet 5.5)

Review

mechanical fix by codex, gpt-6.1-sol, medium effort: Merged base and mechanically re·solved BBR3 conflicts preserving packet loss counting, the check_probe_loss guard, and ProbeRTT undo; passed git diff --check and nix develop --no-update-lock-file --command just ci base (8488 tests passed). (head 41f9c56)

Rewritten by quest review after each round.

  • Head: 863df06

  • Base: origin/main at ca88fc1

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

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

  • Session: 01a1dfba-f789-7ef2-a196-b1c604baac9d, round 1

  • Score: 9/10, No actionable regressions were found; packet-based loss counting and reset placement match the intended behavior, though builds and tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

Re-review skipped for 33245c4: it only rewords one test comment (Pullfrog finding), no code changed; the round-1 review of 863df06 stands.

kixelated and others added 2 commits November 15, 2026 06:38
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title BBR3 counts Startup loss events per lost packet fix(moq-congestion)!: BBR3 counts Startup loss events per lost packet Nov 15, 2026
@kixelated
kixelated marked this pull request as ready for review November 15, 2026 15:03

@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 critical issues — one test comment nit inline.

Reviewed changes

I reviewed the switch from draft-06's per-run loss counting to draft-07's per-packet counting in BBR3, along with the removal of Lost::new_burst from the public API.

  • Per-packet loss events: note_loss now adds one for every lost packet. The count resets in advance_latest_delivery_signals (after check_startup_done), in reset_congestion_signals, and in on_spurious_loss. I checked these four sites against the draft-07 pseudocode for NoteLoss, AdvanceLatestDeliverySignals, ResetCongestionSignals, and HandleSpuriousLossDetection, and they match.
  • Lost::new_burst removed: the field and its computation in moq-quic's detect_lost_packets are gone. moq-quic keeps the lost_packets map because spurious-loss detection uses it. No new_burst references remain in the repo, and the migration note is in the PR's impact section.
  • Tail-drop Startup test: startup_exits_to_drain_on_loss_when_app_limited now drives an application-limited frame sender into a 6-packet tail-drop queue. It asserts that loss arrives in runs, so the old run-based count could not have ended Startup.
  • Reset coverage test: loss_events_count_packets_and_reset_per_round_and_undo covers the per-packet count, the reset at a loss-round boundary, and the reset on spurious-loss undo.
  • Quest cleanup: deletes quest/m2/bbr3-startup-loss.md and its link in the bbr3-references README.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread rs/moq-congestion/src/bbr3/mod.rs Resolved
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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 16 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: a84b6e47-6102-40b4-85c4-9333860b4a6a
Commits

Reviewing files that changed from the base of the PR and between 33245c4 and 41f9c56.

Files selected for processing: 7

  • quest/m1/bbr3-references/README.md
  • quest/m2/bbr3-startup-loss.md
  • rs/moq-congestion/src/bbr3/mod.rs
  • rs/moq-congestion/src/gcc/tests.rs
  • rs/moq-congestion/src/lib.rs
  • rs/moq-congestion/src/scream.rs
  • rs/moq-quic/src/connection/mod.rs

No actionable comments were generated in the recent review.

Walkthrough

The Lost struct no longer includes new_burst, and its construction sites no longer calculate or set that field. BBR3 now increments its Startup loss count for each lost packet. The count resets when the loss round advances and during congestion-signal reset and spurious-loss handling. The A.2 test now models frame bursts into a tail-drop queue. A new test checks packet counting and resets.

Merge Risk: Minimal · previous review 33245

This PR changes how BBR3 Startup counts loss, so each lost packet now counts toward the high-loss exit, as in the current IETF draft. It also removes an unused loss-burst field from Lost. The change is well covered by tests and I found no concrete merge-blocking risk. External code that builds Lost must drop the new_burst field.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: BBR3 Startup loss events are now counted per lost packet. The changeset counts each lost packet toward STARTUP_FULL_LOSS_CNT in rs/moq-congestion/src/bbr3/mod.rs, a…
Description check Passed The description matches the changeset. It explains the switch from counting discontiguous lost ranges to counting each lost packet, the reset placement, the removal of Lost::new_burst and its fixtures…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the primary change: BBR3 Startup loss events are now counted per lost packet. The changeset counts each lost packet toward STARTUP_FULL_LOSS_CNT in rs/moq-congestion/src/bbr3/mod.rs, and it also removes the public Lost::new_burst field. The title omits the public API removal, which is a secondary aspect, so it is accepted as a concise summary.

Full details: Description check

Explanation

The description matches the changeset. It explains the switch from counting discontiguous lost ranges to counting each lost packet, the reset placement, the removal of Lost::new_burst and its fixtures, the new and updated tests, and the deletion of the quest document and its README link. It also lists public API impact and validation results.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

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: f413141e-2ece-4d47-8bf8-2e91d86b811b
Commits

Reviewing files that changed from the base of the PR and between 863df06 and 33245c4.

Files selected for processing: 1

  • rs/moq-congestion/src/bbr3/mod.rs
Files skipped from review as they are similar to previous changes: 1

  • rs/moq-congestion/src/bbr3/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pullfrog[bot]
pullfrog Bot previously approved these changes Nov 15, 2026

@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

I reviewed the one commit added since the prior Pullfrog review.

  • Test comment fix: reworded the loss-round boundary comment in loss_events_count_packets_and_reset_per_round_and_undo as suggested. No code changed.

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

@kixelated
kixelated added this pull request to the merge queue Nov 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 15, 2026
@moq-bot

moq-bot Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

quest land watch: the merge queue removed this pull request at 33245c4 because it conflicts with main (merge_conflict).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

(written by quest land watch)

@moq-bot

moq-bot Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

quest land watch: armed auto-merge on this pull request at 41f9c56, so it joins the back of the merge queue once its required checks pass, with the land fixer's fix (codex, gpt-6.1-sol, medium effort): Merged base and mechanically re·solved BBR3 conflicts preserving packet loss counting, the check_probe_loss guard, and ProbeRTT undo; passed git diff --check and nix develop --no-update-lock-file --command just ci base (8488 tests passed)..

(written by quest land watch)

@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

I reviewed the merge commit added since the prior Pullfrog review. It brings in main and resolves the conflicts in rs/moq-congestion/src/bbr3/mod.rs.

  • Conflict resolution: kept the PR's per-packet note_loss(), under base's check_probe_loss guard in process_lost_packet.
  • Resets preserved: loss_events_in_round still resets in advance_latest_delivery_signals, reset_congestion_signals, and on_spurious_loss. Base's probe_rtt_skip_congested undo line now sits beside the on_spurious_loss reset.
  • Doc links: took base's draft-07 links. No new_burst references remain in rs/.

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

@moq-bot
moq-bot Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 13f4a04 Nov 15, 2026
8 checks passed
@moq-bot
moq-bot Bot deleted the quest/m2/bbr3-startup-loss branch November 15, 2026 18:33
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