Skip to content

feat(quic): per-algorithm congestion-control tuning#47

Merged
Itsusinn merged 1 commit into
mainfrom
feat/cc-per-algorithm-tuning
Jun 25, 2026
Merged

feat(quic): per-algorithm congestion-control tuning#47
Itsusinn merged 1 commit into
mainfrom
feat/cc-per-algorithm-tuning

Conversation

@Itsusinn

Copy link
Copy Markdown
Member

Summary

Today each backend only exposes a congestion-control algorithm name. This PR threads a backend-neutral CongestionTuning through TransportConfig so each backend can apply per-algorithm knobs, surfacing quiche's flow-control / CC tuning (including the full experimental BBR parameter set) and quinn's NewReno loss factor.

These types back the breeze tuic-server's new [backend.<backend>.cc] config sections (algo + per-algorithm sub-tables).

What's added

patches/tokio-quiche

  • QuicSettings: new enable_cubic_idle_restart_fix: bool and custom_bbr_params: BbrParamsField, applied in make_quiche_config.
  • BbrParamsField is a thin newtype over Option<quiche::BbrParams> — the #[settings] macro requires every field to impl Settings, which quiche::BbrParams doesn't (no serde), so the wrapper supplies trivial impls (the field is #[serde(skip)]).
  • set_custom_bbr_params is gated behind quiche's internal feature; the call is guarded by #[cfg(feature = "quiche_internal")].

wind-quic

  • Backend-neutral, serde-able Bbr2gcConfig (full ~26-field quiche BbrParams surface) + BbrBwLoReductionStrategy.
  • CongestionTuning aggregate (initial cwnd packets, pacing, max pacing rate, HyStart++, CUBIC idle-restart-fix, BBR params) added to TransportConfig.
  • quiche backend maps it onto QuicSettings (converting the neutral BBR config to quiche::BbrParams).
  • Enables the tokio-quiche quiche_internal feature so set_custom_bbr_params is available.

wind-tuic

  • quiche ConnectionOpts carries CongestionTuning (passed through to_transport).
  • quinn inbound opts gain newreno_loss_reduction_factor.
  • Re-exports the neutral config types for config front-ends.

Compatibility

No behavior change for existing callers: every new knob is Option-typed and defaults to leaving the backend default in place. The vendored crates/tuic-server adapter is updated for the new ConnectionOpts field (cc: Default::default()).

Test plan

  • cargo check -p tuic-server --features quiche --all-targets (wind workspace) — green.
  • cargo clippy -p wind-quic -p wind-tuic --features wind-tuic/quiche,wind-tuic/server — clean.
  • cargo tree confirms quiche_internal is enabled on the resolved tokio-quiche, so set_custom_bbr_params is compiled in.

🤖 Generated with Claude Code

Thread a backend-neutral `CongestionTuning` through `TransportConfig`
so each QUIC backend can apply per-algorithm knobs, instead of only
selecting an algorithm name.

- tokio-quiche patch: add `enable_cubic_idle_restart_fix` and a
  `BbrParamsField` (`Option<quiche::BbrParams>`) to `QuicSettings`,
  applied in `make_quiche_config`. The latter wraps the quiche type in
  a newtype because the `#[settings]` macro requires every field to
  impl `Settings` (which `quiche::BbrParams` does not). Guard the
  `set_custom_bbr_params` call behind `quiche_internal`.
- wind-quic: add a serde-able, backend-neutral `Bbr2gcConfig` (the full
  experimental quiche `BbrParams` surface), `BbrBwLoReductionStrategy`,
  and a `CongestionTuning` aggregate (initial cwnd packets, pacing, max
  pacing rate, HyStart++, CUBIC idle-restart-fix, BBR params) on
  `TransportConfig`. Map them onto `QuicSettings` in the quiche backend
  (converting the neutral BBR config to `quiche::BbrParams`). Enable the
  tokio-quiche `quiche_internal` feature.
- wind-tuic: carry `CongestionTuning` on the quiche `ConnectionOpts`
  (passed through `to_transport`) and add `newreno_loss_reduction_factor`
  to the quinn inbound opts; re-export the neutral config types.

These are consumed by the breeze tuic-server's new `[backend.<b>.cc]`
config sections. No behavior change for existing callers: every new
knob is optional and defaults to leaving the backend default in place.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Itsusinn Itsusinn force-pushed the feat/cc-per-algorithm-tuning branch from 9e7040b to 7f57eb9 Compare June 25, 2026 00:03
@codspeed-hq

codspeed-hq Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 22 untouched benchmarks
⏩ 11 skipped benchmarks1


Comparing feat/cc-per-algorithm-tuning (7f57eb9) with main (b2ffb86)

Open in CodSpeed

Footnotes

  1. 11 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Itsusinn Itsusinn merged commit af48d0b into main Jun 25, 2026
21 checks passed
@Itsusinn Itsusinn deleted the feat/cc-per-algorithm-tuning branch June 25, 2026 00:29
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