Skip to content

feat!: congestion control is chosen by algorithm name - #8944

Merged
kixelated merged 8 commits into
mainfrom
quest/m2/congestion-names
Nov 17, 2026
Merged

kixelated merged 8 commits into
mainfrom
quest/m2/congestion-names

Conversation

@kixelated

@kixelated kixelated commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m2/congestion-names.md and deletes it.

Problem

Congestion control was picked by family (loss, delay, none), which stops naming one thing once a second delay-based algorithm (GCC or SCReAM from the realtime bake-off) exists. moq-tokio and moq-uring each had their own copy of the enum and its factory mapping, and moq-relay mapped one onto the other variant by variant, so a new algorithm took three edits. quic::Config::controller published moq_congestion::Controller as a plugin interface while that trait is still moving, and nothing outside moq-tokio's own tests set it.

Approach

  • moq_tokio::quic::CongestionControl is Bbr (default), Cubic, Unlimited, spelled bbr, cubic, unlimited, still #[non_exhaustive]. It now converts into the Arc<dyn moq_congestion::Factory> a QUIC transport config holds, so the tokio backend and the relay's io_uring workers both build their controller through that one From impl. Adding an algorithm is one variant plus one match arm.
  • quic::Controller, Config::controller, Resolved::controller and moq_uring::quic::Congestion are deleted. moq-uring's transport::Config already takes a factory and defaults to BBR v3 directly. The relay's variant-by-variant match and its bail! for an unknown family are gone.
  • Resolved::congestion_control is now a plain CongestionControl with the default applied, not an Option.
  • The released family names are refused, not aliased. --quic-congestion-control delay, MOQ_QUIC_CONGESTION_CONTROL=none, and congestion_control = "loss" in TOML each fail at startup with an error that lists bbr, cubic, unlimited. The hidden --client-/--server-quic-congestion-control legacy fields now take any string, so the deprecation report still names them whatever value they carry.
  • moq-ffi MoqCongestionControl::{bbr, cubic, unlimited}, plus every wrapper: Go BBRCongestionControl / CubicCongestionControl / UnlimitedCongestionControl, Python / Swift / Kotlin / Dart CongestionControl.bbr() / .cubic() / .unlimited(), C quic_congestion_control = "bbr" | "cubic" | "unlimited", and C++ through the generated moq::CongestionControl. The Dart bindings are regenerated. The OBS plugin's dropdown stores bbr / cubic.
  • Docs: doc/bin/relay/config.md, the TS harness README and run script, and the ts.yml overflow jobs (MOQ_QUIC_CONGESTION_CONTROL: cubic).

Impact

  • Breaking, moq_tokio::quic: the CongestionControl variants are renamed. Change Loss to Cubic, Delay to Bbr, and None to Unlimited. Controller and Config::controller are removed with no replacement, since the built-in algorithms are the only choice. Resolved::congestion_control is CongestionControl (default applied), not Option<CongestionControl>. New: From<CongestionControl> for Arc<dyn moq_congestion::Factory + Send + Sync>.
  • Breaking, moq_uring::quic: Congestion is removed. Build the factory from moq_tokio::quic::CongestionControl with .into(), or from moq_congestion directly.
  • Breaking, config and CLI (moq-relay, moq-cli, every moq-tokio binary): quic.congestion_control, --quic-congestion-control, and MOQ_QUIC_CONGESTION_CONTROL take bbr, cubic, or unlimited. Change delay to bbr, loss to cubic, and none to unlimited. The old words fail at startup.
  • Breaking, moq-ffi and every binding: MoqCongestionControl::delay() / loss() / none() are bbr() / cubic() / unlimited(), and the C string field takes the new words. Go's DelayCongestionControl / LossCongestionControl / NoneCongestionControl are BBRCongestionControl / CubicCongestionControl / UnlimitedCongestionControl.
  • OBS plugin: a saved delay or loss setting makes the output refuse to start with Invalid advanced MoQ settings: congestion control 'delay' is not supported: pick BBR or CUBIC for Congestion control in the output's Advanced settings. Pick BBR or CUBIC again in the settings.
  • @moq/net: unchanged. It has no QUIC stack to configure and passes the browser's own congestionControl hint.
  • Wire: none.

Decisions

These are the choices I made; each can be undone in review.

  • Refusal message: an old family name is refused by the parser's own invalid-value error, which lists bbr, cubic, unlimited (invalid value 'delay' for '--quic-congestion-control' [possible values: bbr, cubic, unlimited], and serde's unknown variant 'loss', expected one of 'bbr', 'cubic', 'unlimited'). It is not a cli::Deprecated line mapping delay -> bbr. usage-rs's ValueEnum has no deprecated-value hook, so a per-word mapping would need hidden variants on the public enum or a hand-written parser that loses the generated choices in help and completion. The quest only recommended this behavior; the maintainer had not decided it.
  • No MIGRATE.md edits: the quest's Plan asked for them, but AGENTS.md (and #8424) says the release cut writes MIGRATE.md from each PR's Impact section. The notes are in Impact above.
  • Go names: I used BBRCongestionControl, with Go's capitalized initialism, following the wrapper's GSO / MTUDiscovery / QUIC.
  • OBS stored values: saved scenes are renamed to bbr / cubic and refuse the old words, rather than mapping delay / loss silently. This matches the quest's "no silent alias" reasoning.
  • OBS refusal message (maintainer decision): ✅ a scene saved with delay or loss keeps failing to start, and its error names the fix: pick BBR or CUBIC for Congestion control in the output's Advanced settings (rejected: mapping old values to bbr with a warning; refusing with the old unknown congestion control ... (expected bbr or cubic) message unchanged). An unknown word that never existed gets the same message, since the fix is the same.
  • No unlimited in OBS: the dropdown stays Automatic / BBR / CUBIC, since unlimited is for tests and controlled links.

Validation

  • Real binary (moq-relay): --quic-congestion-control delay, a TOML file with congestion_control = "loss", and MOQ_QUIC_CONGESTION_CONTROL=none each refuse at startup, and each message lists bbr, cubic, unlimited.

  • Live loopback, tokio runtime (moq-tokio cubic_reaches_the_live_connection, default_reaches_the_live_connection): with cubic, both ends' live controllers report an ssthresh, cannot probe, and offer moq-net no probe target. With the knob unset, both ends probe and the client has a probe target (BBR v3).

  • Live io_uring relay, checked a second way by reading the qlog traces (uring_workers_run_the_configured_congestion_control, run with CI_STRICT=1 so it cannot skip): a relay given cubic writes ssthresh and no pacing_rate in its recovery metrics, and an unset relay writes the reverse. Mutating the relay to always install BBR makes this test fail.

  • Parsing: every name parses from flag, TOML, and FromStr (case-insensitive); the environment variable through the relay's merge (congestion_control_from_the_environment); every family name is refused on the flag, in TOML, through FromStr, from a relay config file, and through the C API.

  • just check: all green except py/moq-rs/tests/test_socket.py::test_abort_and_endpoint_close_are_errors, a flaky socket-close race that fails 4 runs in 6 here and does not touch QUIC congestion control; it is fixed by #8900. Swift is skipped on Linux.

  • just test interop --all: 210 passed, with 1 pre-existing skip (Chromium route key).

  • cargo test for moq-tokio, moq-uring, moq-relay, moq-ffi, and moq-c: all pass.

  • After merging main (conflicts in quest/m2/README.md, the deleted quest files, and rs/moq-tokio/src/quic/backend.rs's tests, resolved to this PR's side): cargo nextest for moq-tokio, moq-relay, moq-ffi, moq-c, and moq-uring, 1760 passed; just rs test, 11713 passed. One just check run timed out four moq-mux container::consumer tests together under load; they pass alone and in the full rerun, and this PR does not touch moq-mux.

  • OBS refusal message: just obs compile passes, and the moq-settings unit test (plain build, real moq-ffi) checks that delay, loss, and fast are each refused with a message naming the word and pick BBR or CUBIC. just obs test (ThreadSanitizer) failed 5 reconnect-timing checks in moq-output-test.cpp (lines 526, 999-1003) on this loaded host, before reaching the settings test; this commit doesn't touch moq-output, and the PR's plain-build OBS CI passed them on the previous head.

Alternatives

  • Accept loss / delay / none as hidden aliases. Rejected: a silent alias keeps the family names alive in every deployed config.
  • Keep quic::Config::controller as an application hook. Rejected by the maintainer: it publishes a trait that is still changing.
  • Give moq-uring the moq-tokio enum. Not needed, since its transport config already takes a factory.

Follow-ups

None.

Models

Size: M
Implementer: Claude, claude-opus-5-5, medium effort (arm A)
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, S, arm A)
Implementer: Claude Code, claude-opus-5-5, low effort (iterate, XS, arm A)

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with medium)

Review

Rewritten by quest review after each round.

  • Head: 5696c00

  • Base: origin/main at f88e8f5

  • Risk: high, it changes .github/workflows/ts.yml, which is always high: workflows run with the repository's secrets and decide what merges and ships

  • Classified: high by the always-high paths

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

  • Session: 01a1eb6a-6468-7c93-9064-eaf017b4e307, round 2

  • Score: 9/10, The incremental OBS error-message and assertion changes are consistent with the available settings, with no actionable defects found; builds and tests were not run as instructed.

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

  • Findings: none

kixelated and others added 4 commits November 16, 2026 06:25
moq_tokio::quic::CongestionControl is Bbr, Cubic, Unlimited (spelled bbr,
cubic, unlimited), and converts into the factory both runtimes install.
quic::Controller, Config::controller, and moq_uring::quic::Congestion are gone.
moq-ffi's MoqCongestionControl constructors and every wrapper follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Congestion control is chosen by algorithm name, from one enum feat!: congestion control is chosen by algorithm name Nov 16, 2026
@kixelated
kixelated marked this pull request as ready for review November 16, 2026 15:36
@coderabbitai

coderabbitai Bot commented Nov 16, 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 2 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: 97eacfa5-1247-4385-b0ac-b824b32676c5
Commits

Reviewing files that changed from the base of the PR and between 2dcb5f8 and 5696c00.

Files selected for processing: 35

  • .github/workflows/ts.yml
  • cpp/obs/src/moq-settings.cpp
  • cpp/obs/test/moq-settings-test.cpp
  • dart/moq/lib/src/aliases.dart
  • dart/moq/lib/src/client.dart
  • dart/moq/test/moq_test.dart
  • doc/bin/relay/config.md
  • go/wrapper/client.go
  • go/wrapper/reconnect_test.go
  • go/wrapper/types.go
  • kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/Aliases.kt
  • kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/SmokeTest.kt
  • py/moq-rs/README.md
  • py/moq-rs/moq/_records.py
  • py/moq-rs/tests/test_server.py
  • quest/m2/README.md
  • quest/m2/congestion-names.md
  • quest/m4/quic-realtime.md
  • rs/moq-c/src/api.rs
  • rs/moq-c/src/client.rs
  • rs/moq-c/src/test.rs
  • rs/moq-congestion/README.md
  • rs/moq-ffi/src/session.rs
  • rs/moq-ffi/src/test.rs
  • rs/moq-ffi/src/test/rung.rs
  • rs/moq-relay/src/config.rs
  • rs/moq-relay/src/uring.rs
  • rs/moq-relay/tests/integration/runtime_uring.rs
  • rs/moq-tokio/src/quic.rs
  • rs/moq-tokio/src/quic/backend.rs
  • rs/moq-uring/src/quic/mod.rs
  • rs/moq-uring/src/quic/transport.rs
  • swift/Sources/Moq/Aliases.swift
  • test/ts/README.md
  • test/ts/run.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

@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 correctness issues found. One stale doc line outside the diff.

Reviewed changes

I reviewed all 36 files: the rename from congestion family to algorithm name across moq-tokio, moq-uring, moq-relay, moq-ffi, moq-c, every binding wrapper, the OBS plugin, the docs, and the TS harness.

  • One enum, one factory mapping: CongestionControl is Bbr (#[default]) / Cubic / Unlimited. The new From<CongestionControl> for Arc<dyn moq_congestion::Factory + Send + Sync> is the only mapping, and both the tokio backend and the relay's io_uring transport() now call .into(). That removes the relay's bail! arm for an unknown family.
  • Removed hook and duplicate: quic::Controller, Config::controller, Resolved::controller, Resolved::congestion(), and moq_uring::quic::Congestion are gone. A repo-wide grep finds no remaining callers.
  • Resolved::congestion_control is non-Option: resolve() applies the default with unwrap_or_default().
  • Old words are refused, not aliased: a family name now fails the CLI, TOML, FromStr, the C API, and OBS with an error that lists bbr, cubic, unlimited. The hidden --client-/--server-quic-congestion-control fields now take Option<String>, so the deprecation report still fires whatever value they carry.
  • Bindings: the moq-ffi constructors are renamed, and Go, Dart (regenerated), Swift, Kotlin, Python, C, and C++ follow.
  • Tests: there are live loopback checks for the default and for cubic on tokio, and a qlog-based check on io_uring (ssthresh against pacing_rate). The relay also gets tests for the environment variable and for refusing a family name in a config file.

ℹ️ rs/moq-congestion/README.md still names the delay family

Line 3 of rs/moq-congestion/README.md says applications pick a controller through moq_tokio::quic::CongestionControl, "where delay is BBR3 and the default". That word is now refused at startup, so the crate README points readers at a spelling that no longer parses. The rest of the repo has no stale references left. The MIGRATE.md entries are left for the release cut, as the PR says.

Technical details
# Stale family name in moq-congestion README

## Affected sites
- rs/moq-congestion/README.md:3 — "where `delay` is BBR3 and the default"

## Required outcome
- The sentence names the algorithm spelling (`bbr`, i.e. `CongestionControl::Bbr`) as the default instead of the removed `delay` family.

Pullfrog  | Fix it ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed 9453e33ace3b6ec71f27b8561022427001187125. No blocker in the controller wiring: Tokio and io_uring now share one conversion, unset still means BBR v3, and the live tests check controller behavior rather than only the parser. I’d keep the names distinct and the startup error explicit.

Carry a concrete rollout step into the cut guide: any managed launcher that passes delay, loss, or none needs its text updated in the same deployment as its relay binary, and rolled back with it. A one-sided rollout can fail before the socket starts. For OBS, I’d prefer a one-time, visible saved-setting migration to the equivalent algorithm rather than making an upgrade break Go Live until the operator reselects it. Static review; I did not run the live tests.

# Conflicts:
#	dart/moq_ffi/lib/src/moq.dart
#	quest/m2/README.md
#	quest/m2/congestion-names.md
#	quest/m2/unused-api/transport.md
#	rs/moq-tokio/src/quic/backend.rs
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merged main to clear the conflict (quest/m2/README.md, the quest files main had edited or deleted, and rs/moq-tokio/src/quic/backend.rs's tests, each resolved to this PR's side; main's Dart bindings are now generated at build time, so the generated moq.dart stays deleted). Head bf63df9ebe: just rs test 11713 passed, and a fresh Codex round found nothing.

  • Pullfrog's stale README line: fixed in bf63df9. rs/moq-congestion/README.md now names bbr (the default), cubic, and unlimited.
  • The automated review's rollout step: the Impact section already says that launchers passing delay, loss, or none fail at startup, and the release cut copies it into MIGRATE.md. Its OBS suggestion, migrating a saved delay/loss to the new name: left as is. Refusing the old words is this PR's recorded "no silent alias" decision, and the merge pick came after that review. If you want the OBS migration instead, it is a small follow-up in cpp/obs/src/moq-settings.cpp.

(Written by Claude Opus 5.5)

pullfrog[bot]
pullfrog Bot previously approved these changes Nov 17, 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. The stale README line from the last review is fixed.

Reviewed changes

Since the last Pullfrog review at 9453e33, the branch merged main and fixed the crate README.

  • README names the algorithms: rs/moq-congestion/README.md now says applications pick bbr (BBR3, the default), cubic, or unlimited through moq_tokio::quic::CongestionControl, not the refused delay family.
  • Merge resolution: the backend.rs tests now gate sim: None on test-support, the feature rs/moq-tokio/Cargo.toml defines. The regenerated dart/moq_ffi/lib/src/moq.dart dropped out of the diff because main no longer tracks that generated file. The other changed hunks come from main.

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

@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision (2026-11-17, asked in the /quest-run m0/m1/m2 coordinating session). Pick: /quest-merge stands.

✅ An OBS scene saved with the old delay or loss congestion setting keeps failing to start, and its error names the fix: pick BBR or CUBIC in the output's settings (rejected: mapping old values to bbr with a warning; refusing with the current message unchanged).

(Written by Claude Opus 5.5 with high)

…r CUBIC

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Applied the maintainer decision in 5696c00: a scene saved with delay or loss still refuses to start, now with Invalid advanced MoQ settings: congestion control 'delay' is not supported: pick BBR or CUBIC for Congestion control in the output's Advanced settings (cpp/obs/src/moq-settings.cpp). The settings unit test checks the message for delay, loss, and fast. Recorded under Decisions; the Codex review of this head found nothing.

(Written by Claude Opus 5.5 with low)

@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

Since the last Pullfrog review at bf63df9, one commit changed the OBS refusal message.

  • OBS refusal message: a saved delay, loss, or unknown quic_congestion_control value is still refused, and the error now reads congestion control '<word>' is not supported: pick BBR or CUBIC for Congestion control in the output's Advanced settings. It names the fix instead of listing accepted words.
  • Test: moq-settings-test.cpp checks that the refusal names the offending word (fast, delay, loss) and contains pick BBR or CUBIC.

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

@kixelated
kixelated added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 6d511a2 Nov 17, 2026
5 checks passed
@kixelated
kixelated deleted the quest/m2/congestion-names branch November 17, 2026 22:47
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