Skip to content

fix(http3): use fair streams in connect-udp sessions - #4337

Merged
mxinden merged 1 commit into
mozilla:mainfrom
aochagavia:connect-udp-streamm-fairness
Nov 20, 2026
Merged

mxinden merged 1 commit into
mozilla:mainfrom
aochagavia:connect-udp-streamm-fairness

Conversation

@aochagavia

Copy link
Copy Markdown
Collaborator

This matches what we do in WebTransport and ensures a session cannot starve others when capsules are used.

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.62%. Comparing base (e166635) to head (31f6334).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4337      +/-   ##
==========================================
- Coverage   96.73%   96.62%   -0.12%     
==========================================
  Files         113      118       +5     
  Lines       43491    43894     +403     
  Branches    43491    43894     +403     
==========================================
+ Hits        42073    42413     +340     
- Misses       1406     1460      +54     
- Partials       12       21       +9     
Flag Coverage Δ
freebsd 94.12% <40.00%> (-0.11%) ⬇️
linux 96.77% <100.00%> (+<0.01%) ⬆️
macos 94.50% <40.00%> (-0.01%) ⬇️
windows 94.56% <40.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
neqo-common 99.33% <ø> (ø)
neqo-http3 96.00% <100.00%> (+<0.01%) ⬆️
neqo-qpack 96.55% <ø> (ø)
neqo-transport 97.13% <ø> (+<0.01%) ⬆️
neqo-udp 87.63% <ø> (ø)
mtu 91.31% <ø> (ø)

@codspeed

codspeed Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 3.7%

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 3 improved benchmarks
✅ 98 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Walltime 1-conn/1-100mb-resp (aka. Download) 61.7 ms 59.2 ms +4.35%
⚡ Walltime 1-conn/1-100mb-req (aka. Upload) 62.1 ms 59.6 ms +4.26%
⚡ Walltime neqo-neqo-cubic 26.9 ms 26.3 ms +2.48%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing aochagavia:connect-udp-streamm-fairness (31f6334) with main (e166635)

Open in CodSpeed

Copilot AI 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.

🟢 Approval recommended

No active review issues remain for the CONNECT-UDP stream-fairness changes.

No open issues 🎉

What changed in this PR

This PR enables fair stream scheduling for CONNECT-UDP sessions, matching WebTransport so one session’s capsule traffic cannot starve others.

Changes:

  • Centralizes transport configuration for created and accepted sessions, enabling fairness while preserving datagram buffering limits.
  • Adds fairness tests for QUIC datagrams and HTTP capsules across different queueing patterns and payload sizes.
File Description
neqo-http3/​tests/​connect_udp.rs Adds multi-session fairness tests and shared setup helpers.
neqo-http3/​src/​connect_udp.rs Applies shared transport settings, including stream fairness, to CONNECT-UDP sessions.

Review effort: Balanced

@aochagavia
aochagavia force-pushed the connect-udp-streamm-fairness branch from 99eb47c to 8526011 Compare November 16, 2026 15:25

@mxinden mxinden left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good to have this tested. One nit. Otherwise ready to merge.

As discussed elsewhere, capsule path is not a priority for now. I expect most Firefox MASQUE connections to have QUIC datagrams support available.

Comment thread neqo-http3/tests/connect_udp.rs Resolved
@aochagavia
aochagavia force-pushed the connect-udp-streamm-fairness branch from 8526011 to 147fa2d Compare November 18, 2026 12:45
This matches what we do in WebTransport and ensures a session cannot
starve others when capsules are used.
@aochagavia
aochagavia force-pushed the connect-udp-streamm-fairness branch from 147fa2d to 31f6334 Compare November 18, 2026 12:50
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

No significant performance differences relative to e166635.

All results
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500
       time:   [61.500 ms 61.536 ms 61.572 ms]
       thrpt:  [1.5861 GiB/s 1.5870 GiB/s 1.5879 GiB/s]
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500
       time:   [61.584 ms 61.663 ms 61.753 ms]
       thrpt:  [1.5814 GiB/s 1.5837 GiB/s 1.5857 GiB/s]
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) high mild
2 (2.00%) high severe
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500
       time:   [3.8179 ms 3.8189 ms 3.8198 ms]
       thrpt:  [261.79   B/s 261.85   B/s 261.92   B/s]
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500
       time:   [87.971 ms 88.105 ms 88.239 ms]
       thrpt:  [113.33 Kelem/s 113.50 Kelem/s 113.67 Kelem/s]
streams-flow-controlled/walltime/1-streams/each-4194304-bytes
       time:   [13.102 ms 13.116 ms 13.129 ms]
       thrpt:  [304.67 MiB/s 304.96 MiB/s 305.30 MiB/s]
Found 12 outliers among 100 measurements (12.00%)
10 (10.00%) low severe
1 (1.00%) low mild
1 (1.00%) high mild
streams-flow-controlled/walltime/10-streams/each-1048576-bytes
       time:   [35.002 ms 35.048 ms 35.093 ms]
       thrpt:  [284.96 MiB/s 285.32 MiB/s 285.70 MiB/s]
streams/walltime/1-streams/each-1000-bytes
       time:   [162.38 µs 163.04 µs 163.88 µs]
       thrpt:  [5.8193 MiB/s 5.8493 MiB/s 5.8729 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1000-streams/each-1-bytes
       time:   [4.7563 ms 4.7584 ms 4.7605 ms]
       thrpt:  [205.14 KiB/s 205.23 KiB/s 205.32 KiB/s]
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) low mild
2 (2.00%) high mild
streams/walltime/1000-streams/each-1000-bytes
       time:   [15.219 ms 15.230 ms 15.241 ms]
       thrpt:  [62.573 MiB/s 62.616 MiB/s 62.662 MiB/s]
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) low mild
transfer/walltime/pacing-false/same-seed
       time:   [3.2372 ms 3.2393 ms 3.2410 ms]
       thrpt:  [1.2052 GiB/s 1.2059 GiB/s 1.2067 GiB/s]
transfer/walltime/pacing-false/varying-seeds
       time:   [3.5430 ms 3.5441 ms 3.5455 ms]
       thrpt:  [1.1018 GiB/s 1.1022 GiB/s 1.1025 GiB/s]
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
transfer/walltime/pacing-true/same-seed
       time:   [3.9089 ms 3.9103 ms 3.9119 ms]
       thrpt:  [1022.5 MiB/s 1022.9 MiB/s 1023.3 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/walltime/pacing-true/varying-seeds
       time:   [3.8320 ms 3.8344 ms 3.8373 ms]
       thrpt:  [1.0180 GiB/s 1.0187 GiB/s 1.0194 GiB/s]

Instructions per cycle

Criterion reported no significant timing changes.

All benchmarks
Benchmark IPC before IPC after ΔIPC
transfer/walltime/pacing-false/same-seed 2.86 2.89 +1.1%
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 3.09 3.06 -0.9%
streams-flow-controlled/walltime/10-streams/each-1048576-bytes 3.11 3.13 +0.7%
transfer/walltime/pacing-false/varying-seeds 2.85 2.87 +0.7%
transfer/walltime/pacing-true/same-seed 2.89 2.87 -0.7%
streams-flow-controlled/walltime/1-streams/each-4194304-bytes 2.94 2.95 +0.3%
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 3.20 3.19 -0.3%
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 3.12 3.11 -0.2%
streams/walltime/1000-streams/each-1000-bytes 2.96 2.96 +0.1%
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 2.25 2.25 -0.1%
transfer/walltime/pacing-true/varying-seeds 2.88 2.88 -0.0%
streams/walltime/1000-streams/each-1-bytes 3.28 3.28 +0.0%
streams/walltime/1-streams/each-1000-bytes 2.57 2.57 -0.0%
Profiles for profiler.firefox.com (64)

Download data for profiler.firefox.com or download performance comparison data.

@github-actions

Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to e166635.

No significant performance differences.

Table above only shows statistically significant changes. See all results below.

All results

Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.

Client vs. server Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
google-google 155.8 ± 0.5 155.0 – 158.0 155.8 ± 0.5 205.4 ± 0.7
google-neqo-cubic 80.7 ± 0.3 79.8 – 81.8 80.6 ± 0.3 396.6 ± 1.7 +0.7 (+0.8%)
neqo-google-cubic 242.5 ± 38.9 200.9 – 328.2 213.7 ± 16.5 132.0 ± 21.1 -3.5 (-1.6%)
neqo-neqo-cubic 23.9 ± 0.2 23.6 – 24.3 23.9 ± 0.2 1336.2 ± 9.8 +0.0 (+0.0%)
neqo-neqo-cubic-nopacing 23.4 ± 0.1 23.0 – 23.7 23.3 ± 0.1 1370.4 ± 7.3 +0.0 (+0.1%)
neqo-neqo-newreno 23.9 ± 0.1 23.6 – 24.3 23.9 ± 0.1 1337.3 ± 8.0 +0.0 (+0.0%)
neqo-neqo-newreno-nopacing 23.3 ± 0.1 23.1 – 23.8 23.3 ± 0.1 1370.6 ± 7.3 +0.0 (+0.0%)
neqo-quiche-cubic 35.3 ± 0.3 34.7 – 36.3 35.4 ± 0.3 905.4 ± 8.9 -0.1 (-0.2%)
neqo-s2n-cubic 45.3 ± 0.2 44.8 – 45.8 45.3 ± 0.3 706.7 ± 3.4 +0.1 (+0.1%)
quiche-neqo-cubic 36.3 ± 0.5 35.1 – 37.5 36.3 ± 0.3 880.4 ± 10.9 +0.0 (+0.1%)
quiche-quiche 42.4 ± 0.3 41.9 – 43.2 42.4 ± 0.2 754.4 ± 4.6
s2n-neqo-cubic 126.3 ± 0.7 124.8 – 128.4 126.3 ± 0.8 253.3 ± 1.4 +0.6 (+0.5%)
s2n-s2n ⚠️ 178.8 ± 32.6 146.0 – 284.3 169.8 ± 1.6 179.0 ± 32.6

Download data for profiler.firefox.com or download performance comparison data.

@github-actions

Copy link
Copy Markdown
Contributor

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to main at e166635.

neqo-pr as clientneqo-pr as server
neqo-pr vs. go-x-net: BP BA
neqo-pr vs. haproxy: BP BA
neqo-pr vs. kwik: 🚀M ⚠️U L1 C1
neqo-pr vs. linuxquic: ⚠️CM
neqo-pr vs. lsquic: L1 C1
neqo-pr vs. msquic: A L1 C1
neqo-pr vs. mvfst: H DC LR C20 M S R Z 3 B U E A L1 L2 C1 C2 6 V2 BP BA CM
neqo-pr vs. neqo: A
neqo-pr vs. nginx: BP BA
neqo-pr vs. ngtcp2: Z L1 C1 CM
neqo-pr vs. picoquic: A 🚀BP ⚠️BA
neqo-pr vs. quic-go: A
neqo-pr vs. quic-zig: baseline result missing
neqo-pr vs. quiche: ⚠️C1 BP BA
neqo-pr vs. s2n-quic: CM
neqo-pr vs. tquic: S BP BA
neqo-pr vs. xquic: Z A ⚠️C1
aioquic vs. neqo-pr: run cancelled after 20 min
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: CM
msquic vs. neqo-pr: run cancelled after 20 min
mvfst vs. neqo-pr: H DC LR C20 M S R Z 3 B U E A L1 L2 C1 C2 6 V2 BP BA CM
neqo vs. neqo-pr: A
openssl vs. neqo-pr: run cancelled after 20 min
quic-go vs. neqo-pr: baseline result missing
quic-zig vs. neqo-pr: CM
quiche vs. neqo-pr: CM
quinn vs. neqo-pr: 🚀C1 V2 CM
rama vs. neqo-pr: run cancelled after 20 min
s2n-quic vs. neqo-pr: 🚀BA CM
tquic vs. neqo-pr: run cancelled after 20 min
xquic vs. neqo-pr: run cancelled after 20 min
All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

@mxinden
mxinden added this pull request to the merge queue Nov 20, 2026
Merged via the queue into mozilla:main with commit 662ec9f Nov 20, 2026
315 of 316 checks passed
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.

3 participants