Skip to content

fix(transport/fc): prevent auto-tuning to decrease max_active - #3314

Merged
larseggert merged 5 commits into
mozilla:mainfrom
mxinden:max-active-no-decrease
Jan 16, 2026
Merged

larseggert merged 5 commits into
mozilla:mainfrom
mxinden:max-active-no-decrease

Conversation

@mxinden

@mxinden mxinden commented Jan 12, 2026 •

Copy link
Copy Markdown
Member

A user can configure the initial receive window size. Given a user that sets the initial receive window size to a value larger than the maximum auto-tuning value, the auto-tuning logic should not decrease max_active below the user-configured value.

Note that Firefox currently sets a larger initial receive window size than the maximum auto-tuning value. (As an aside, effectively disabling auto-tuning.)

# Stream-level flow control limit
- name: network.http.http3.max_stream_data
  type: RelaxedAtomicUint32
  value: 12582912
  mirror: always

https://github.com/mozilla-firefox/firefox/blob/e1eada69e2ddd86a398ccb141dcbf772254162eb/modules/libpref/init/StaticPrefList.yaml#L15423-L15427

pub const MAX_LOCAL_MAX_STREAM_DATA: u64 = 10 * 1024 * 1024;

While a bug in Firefox release, it is minor only, reducing the receive window from 12 MB to 10 MB.

I will consider removing the initial window override in Firefox as a next step.


Fixes #3208

Thanks to @mb for the help with Pernosco and @tysmith for the report via site scout.

A user can configure the initial receive window size. Given a user that sets the
initial receive window size to a value larger than the maximum auto-tuning
value, the auto-tuning logic should not decrease the max_active value below the
user-configured value.

Note that Firefox currently sets a larger initial receive window size than
the maximum auto-tuning value.

https://github.com/mozilla-firefox/firefox/blob/e1eada69e2ddd86a398ccb141dcbf772254162eb/modules/libpref/init/StaticPrefList.yaml#L15423-L15427

https://github.com/mozilla/neqo/blob/0798e0ac28b31d6a18e3f43801336abeeca195c7/neqo-transport/src/connection/params.rs#L80
@mxinden
mxinden force-pushed the max-active-no-decrease branch from 12310c9 to 799147b Compare January 12, 2026 15:20
@codecov

codecov Bot commented Jan 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.10%. Comparing base (fb21387) to head (b5d2203).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3314      +/-   ##
==========================================
- Coverage   94.14%   94.10%   -0.04%     
==========================================
  Files         124      124              
  Lines       37500    37515      +15     
  Branches    37500    37515      +15     
==========================================
+ Hits        35304    35305       +1     
- Misses       1334     1346      +12     
- Partials      862      864       +2     
Components Coverage Δ
neqo-common 98.47% <ø> (ø)
neqo-crypto 86.38% <ø> (-0.57%) ⬇️
neqo-http3 93.86% <ø> (ø)
neqo-qpack 94.67% <ø> (ø)
neqo-transport 94.88% <92.85%> (-0.02%) ⬇️
neqo-udp 82.84% <ø> (+0.41%) ⬆️
mtu 89.41% <ø> (ø)

@codspeed

codspeed Bot commented Jan 12, 2026 •

Copy link
Copy Markdown
Contributor

CodSpeed Performance Report

Merging this PR will degrade performance by 13.15%

Comparing mxinden:max-active-no-decrease (b5d2203) with main (590062c)

Summary

⚡ 3 improved benchmarks
❌ 2 regressed benchmarks
✅ 41 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory client 6 MB 6.5 MB -7.47%
⚡ Memory client 4.4 MB 2.6 MB +67.7%
⚡ Memory walltime 28.2 KB 20.1 KB +40.49%
⚡ Memory walltime 11.9 MB 11.1 MB +7.51%
❌ Memory walltime 9.5 MB 11 MB -13.15%

@mxinden
mxinden marked this pull request as ready for review January 13, 2026 11:45
Copilot AI review requested due to automatic review settings January 13, 2026 11:45

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.

Pull request overview

This PR fixes a bug where the flow control auto-tuning logic could incorrectly decrease the maximum receive window below a user-configured value. The issue occurred when users set an initial receive window larger than the maximum auto-tuning value (e.g., Firefox configures 12 MB vs. the 10 MB auto-tuning maximum).

Changes:

  • Modified auto-tuning logic to prevent decreasing max_active below its previous value
  • Replaced debug assertion with early return when new value would decrease the window
  • Added test coverage for the fix

Comment thread neqo-transport/src/fc.rs Resolved
larseggert and others added 3 commits January 16, 2026 11:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Lars Eggert <lars@eggert.org>
Signed-off-by: Lars Eggert <lars@eggert.org>
@github-actions

Copy link
Copy Markdown
Contributor

Failed Interop Tests

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

neqo-pr as clientneqo-pr as server
neqo-pr vs. aioquic: A C1
neqo-pr vs. go-x-net: A BP BA
neqo-pr vs. haproxy: A ⚠️C1 BP BA
neqo-pr vs. kwik: ⚠️C1 BP BA
neqo-pr vs. linuxquic: A L1 ⚠️C1
neqo-pr vs. lsquic: L1 C1
neqo-pr vs. msquic: A L1 C1
neqo-pr vs. mvfst: A L1 🚀C1
neqo-pr vs. nginx: A ⚠️L1 BP BA
neqo-pr vs. ngtcp2: A L1 🚀C1 CM
neqo-pr vs. picoquic: A
neqo-pr vs. quic-go: A 🚀L1 ⚠️C1
neqo-pr vs. quiche: A L1 🚀C1 BP BA
neqo-pr vs. quinn: A 🚀L1 C1
neqo-pr vs. s2n-quic: A L1 ⚠️C1 BP BA CM
neqo-pr vs. tquic: S A BP BA
neqo-pr vs. xquic: A L1 🚀BP
aioquic vs. neqo-pr: CM
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: BP BA CM
msquic vs. neqo-pr: CM
mvfst vs. neqo-pr: Z A L1 C1 CM
openssl vs. neqo-pr: LR M A CM
quic-go vs. neqo-pr: CM
quiche vs. neqo-pr: CM
quinn vs. neqo-pr: 🚀L1 V2 CM
s2n-quic vs. neqo-pr: ⚠️BP CM
tquic vs. neqo-pr: CM
xquic vs. neqo-pr: M CM
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

@github-actions

Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to 590062c.

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

Client vs. server (params) Mean ± σ Min Max MiB/s ± σ Δ main Δ main
neqo-google-cubic 769.2 ± 5.4 759.3 784.8 41.6 ± 5.9 💔 2.9 0.4%
neqo-neqo-cubic 96.0 ± 4.7 88.1 113.3 333.5 ± 6.8 💚 -1.5 -1.5%
neqo-quiche-cubic 194.2 ± 4.7 188.0 205.1 164.8 ± 6.8 💔 1.8 0.9%
neqo-s2n-cubic 222.2 ± 3.6 213.4 230.7 144.0 ± 8.9 💚 -1.9 -0.8%
s2n-neqo-cubic 172.4 ± 5.0 163.9 184.7 185.6 ± 6.4 💚 -1.6 -0.9%

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 (params) Mean ± σ Min Max MiB/s ± σ Δ main Δ main
google-google-nopacing 460.0 ± 3.9 453.7 469.2 69.6 ± 8.2
google-neqo-cubic 271.2 ± 4.2 263.1 280.4 118.0 ± 7.6 0.4 0.1%
msquic-msquic-nopacing 216.9 ± 78.3 141.7 450.3 147.6 ± 0.4
msquic-neqo-cubic 218.8 ± 62.5 161.2 494.5 146.2 ± 0.5 -17.6 -7.5%
neqo-google-cubic 769.2 ± 5.4 759.3 784.8 41.6 ± 5.9 💔 2.9 0.4%
neqo-msquic-cubic 160.1 ± 4.3 153.1 168.2 199.9 ± 7.4 0.8 0.5%
neqo-neqo-cubic 96.0 ± 4.7 88.1 113.3 333.5 ± 6.8 💚 -1.5 -1.5%
neqo-neqo-cubic-nopacing 96.0 ± 4.3 88.7 104.3 333.4 ± 7.4 -1.1 -1.2%
neqo-neqo-newreno 97.4 ± 4.8 87.0 106.8 328.5 ± 6.7 -0.7 -0.7%
neqo-neqo-newreno-nopacing 96.3 ± 4.4 89.0 106.3 332.4 ± 7.3 0.2 0.2%
neqo-quiche-cubic 194.2 ± 4.7 188.0 205.1 164.8 ± 6.8 💔 1.8 0.9%
neqo-s2n-cubic 222.2 ± 3.6 213.4 230.7 144.0 ± 8.9 💚 -1.9 -0.8%
quiche-neqo-cubic 155.2 ± 5.7 144.8 194.0 206.2 ± 5.6 0.6 0.4%
quiche-quiche-nopacing 142.6 ± 4.7 135.4 154.5 224.5 ± 6.8
s2n-neqo-cubic 172.4 ± 5.0 163.9 184.7 185.6 ± 6.4 💚 -1.6 -0.9%
s2n-s2n-nopacing 252.9 ± 32.1 233.3 413.6 126.6 ± 1.0

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

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

No significant performance differences relative to 590062c.

All results
1-conn/1-100mb-resp/mtu-1504 (aka. Download)/client: Change within noise threshold.
       time:   [199.50 ms 200.07 ms 200.75 ms]
       thrpt:  [498.13 MiB/s 499.82 MiB/s 501.26 MiB/s]
change:
       time:   [+0.1269% +0.5826% +1.0223] (p = 0.01 < 0.05)
       thrpt:  [-1.0119% -0.5793% -0.1267]
       Change within noise threshold.
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) high mild
1 (1.00%) high severe
1-conn/10_000-parallel-1b-resp/mtu-1504 (aka. RPS)/client: No change in performance detected.
       time:   [277.88 ms 280.06 ms 282.26 ms]
       thrpt:  [35.429 Kelem/s 35.707 Kelem/s 35.987 Kelem/s]
change:
       time:   [-1.3833% -0.4351% +0.4800] (p = 0.37 > 0.05)
       thrpt:  [-0.4777% +0.4370% +1.4027]
       No change in performance detected.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
1-conn/1-1b-resp/mtu-1504 (aka. HPS)/client: Change within noise threshold.
       time:   [38.274 ms 38.386 ms 38.508 ms]
       thrpt:  [25.969   B/s 26.051   B/s 26.127   B/s]
change:
       time:   [-1.6083% -0.9988% -0.3809] (p = 0.00 < 0.05)
       thrpt:  [+0.3824% +1.0089% +1.6346]
       Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
1-conn/1-100mb-req/mtu-1504 (aka. Upload)/client: No change in performance detected.
       time:   [206.55 ms 206.99 ms 207.56 ms]
       thrpt:  [481.79 MiB/s 483.11 MiB/s 484.15 MiB/s]
change:
       time:   [-0.5248% -0.2694% +0.0337] (p = 0.05 > 0.05)
       thrpt:  [-0.0337% +0.2702% +0.5276]
       No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
decode 4096 bytes, mask ff: No change in performance detected.
       time:   [5.2707 µs 5.2789 µs 5.2874 µs]
       change: [-1.4191% -0.4274% +0.1885] (p = 0.43 > 0.05)
       No change in performance detected.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
decode 1048576 bytes, mask ff: Change within noise threshold.
       time:   [1.3409 ms 1.3429 ms 1.3450 ms]
       change: [-0.9236% -0.6755% -0.4345] (p = 0.00 < 0.05)
       Change within noise threshold.
decode 4096 bytes, mask 7f: No change in performance detected.
       time:   [7.2201 µs 7.2303 µs 7.2409 µs]
       change: [-0.4509% -0.1086% +0.2750] (p = 0.58 > 0.05)
       No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) high mild
2 (2.00%) high severe
decode 1048576 bytes, mask 7f: No change in performance detected.
       time:   [1.8416 ms 1.8443 ms 1.8472 ms]
       change: [-0.4681% -0.1619% +0.1023] (p = 0.28 > 0.05)
       No change in performance detected.
decode 4096 bytes, mask 3f: No change in performance detected.
       time:   [6.9062 µs 6.9229 µs 6.9459 µs]
       change: [-0.4993% -0.0527% +0.4074] (p = 0.82 > 0.05)
       No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) high mild
2 (2.00%) high severe
decode 1048576 bytes, mask 3f: No change in performance detected.
       time:   [1.7650 ms 1.7674 ms 1.7699 ms]
       change: [-0.7887% -0.2896% +0.0679] (p = 0.21 > 0.05)
       No change in performance detected.
1-streams/each-1000-bytes/simulated-time: No change in performance detected.
       time:   [118.81 ms 119.02 ms 119.23 ms]
       thrpt:  [8.1903 KiB/s 8.2049 KiB/s 8.2194 KiB/s]
change:
       time:   [-0.1280% +0.1144% +0.3752] (p = 0.38 > 0.05)
       thrpt:  [-0.3738% -0.1142% +0.1281]
       No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
1000-streams/each-1-bytes/simulated-time: No change in performance detected.
       time:   [2.3301 s 2.3334 s 2.3366 s]
       thrpt:  [427.97   B/s 428.56   B/s 429.17   B/s]
change:
       time:   [-0.2004% -0.0023% +0.1891] (p = 0.98 > 0.05)
       thrpt:  [-0.1888% +0.0023% +0.2008]
       No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild
1000-streams/each-1000-bytes/simulated-time: No change in performance detected.
       time:   [7.1830 s 7.2335 s 7.2850 s]
       thrpt:  [134.05 KiB/s 135.01 KiB/s 135.95 KiB/s]
change:
       time:   [-0.5622% +0.4394% +1.4387] (p = 0.40 > 0.05)
       thrpt:  [-1.4183% -0.4375% +0.5654]
       No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
1-streams/each-1000-bytes/walltime: No change in performance detected.
       time:   [583.69 µs 584.72 µs 585.99 µs]
       change: [-0.0583% +0.3976% +0.8124] (p = 0.08 > 0.05)
       No change in performance detected.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
1000-streams/each-1-bytes/walltime: No change in performance detected.
       time:   [12.340 ms 12.395 ms 12.463 ms]
       change: [-0.2916% +0.2508% +0.8882] (p = 0.42 > 0.05)
       No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
1000-streams/each-1000-bytes/walltime: Change within noise threshold.
       time:   [50.912 ms 51.024 ms 51.140 ms]
       change: [-0.8814% -0.5616% -0.2702] (p = 0.00 < 0.05)
       Change within noise threshold.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
coalesce_acked_from_zero 1+1 entries: No change in performance detected.
       time:   [89.249 ns 89.557 ns 89.868 ns]
       change: [-0.5902% -0.1435% +0.3039] (p = 0.53 > 0.05)
       No change in performance detected.
Found 9 outliers among 100 measurements (9.00%)
7 (7.00%) high mild
2 (2.00%) high severe
coalesce_acked_from_zero 3+1 entries: No change in performance detected.
       time:   [105.79 ns 106.16 ns 106.54 ns]
       change: [-0.9234% -0.3052% +0.2538] (p = 0.34 > 0.05)
       No change in performance detected.
Found 11 outliers among 100 measurements (11.00%)
11 (11.00%) high severe
coalesce_acked_from_zero 10+1 entries: No change in performance detected.
       time:   [105.17 ns 105.98 ns 107.13 ns]
       change: [-1.7700% +3.4768% +12.612] (p = 0.64 > 0.05)
       No change in performance detected.
Found 9 outliers among 100 measurements (9.00%)
3 (3.00%) low mild
6 (6.00%) high severe
coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [90.421 ns 90.572 ns 90.757 ns]
       change: [-0.5708% -0.0531% +0.4865] (p = 0.85 > 0.05)
       No change in performance detected.
Found 16 outliers among 100 measurements (16.00%)
8 (8.00%) high mild
8 (8.00%) high severe
RxStreamOrderer::inbound_frame(): Change within noise threshold.
       time:   [108.61 ms 108.73 ms 108.85 ms]
       change: [+0.6459% +0.8190% +0.9850] (p = 0.00 < 0.05)
       Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
sent::Packets::take_ranges: No change in performance detected.
       time:   [4.5181 µs 4.6281 µs 4.7291 µs]
       change: [-3.7570% -0.4483% +3.0767] (p = 0.80 > 0.05)
       No change in performance detected.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
transfer/pacing-false/varying-seeds/simulated-time: No change in performance detected.
       time:   [23.941 s 23.941 s 23.941 s]
       thrpt:  [171.09 KiB/s 171.09 KiB/s 171.09 KiB/s]
change:
       time:   [+0.0000% +0.0000% +0.0000] (p = NaN > 0.05)
       thrpt:  [+0.0000% +0.0000% +0.0000]
       No change in performance detected.
transfer/pacing-true/varying-seeds/simulated-time: No change in performance detected.
       time:   [23.676 s 23.676 s 23.676 s]
       thrpt:  [173.01 KiB/s 173.01 KiB/s 173.01 KiB/s]
change:
       time:   [+0.0000% +0.0000% +0.0000] (p = NaN > 0.05)
       thrpt:  [+0.0000% +0.0000% +0.0000]
       No change in performance detected.
transfer/pacing-false/same-seed/simulated-time: No change in performance detected.
       time:   [23.941 s 23.941 s 23.941 s]
       thrpt:  [171.09 KiB/s 171.09 KiB/s 171.09 KiB/s]
change:
       time:   [+0.0000% +0.0000% +0.0000] (p = NaN > 0.05)
       thrpt:  [+0.0000% +0.0000% +0.0000]
       No change in performance detected.
transfer/pacing-true/same-seed/simulated-time: No change in performance detected.
       time:   [23.676 s 23.676 s 23.676 s]
       thrpt:  [173.01 KiB/s 173.01 KiB/s 173.01 KiB/s]
change:
       time:   [+0.0000% +0.0000% +0.0000] (p = NaN > 0.05)
       thrpt:  [+0.0000% +0.0000% +0.0000]
       No change in performance detected.
transfer/pacing-false/varying-seeds/walltime: Change within noise threshold.
       time:   [23.259 ms 23.285 ms 23.318 ms]
       change: [-0.4074% -0.2801% -0.1303] (p = 0.00 < 0.05)
       Change within noise threshold.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe
transfer/pacing-true/varying-seeds/walltime: Change within noise threshold.
       time:   [23.700 ms 23.726 ms 23.763 ms]
       change: [-0.9012% -0.7702% -0.5918] (p = 0.00 < 0.05)
       Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
transfer/pacing-false/same-seed/walltime: Change within noise threshold.
       time:   [23.077 ms 23.101 ms 23.129 ms]
       change: [-3.0378% -2.9187% -2.8003] (p = 0.00 < 0.05)
       Change within noise threshold.
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
transfer/pacing-true/same-seed/walltime: Change within noise threshold.
       time:   [23.483 ms 23.516 ms 23.566 ms]
       change: [-2.5292% -2.3382% -2.0958] (p = 0.00 < 0.05)
       Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe

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

@larseggert
larseggert enabled auto-merge January 16, 2026 12:10
@larseggert
larseggert disabled auto-merge January 16, 2026 12:10
@larseggert
larseggert merged commit 8fc67fb into mozilla:main Jan 16, 2026
180 of 183 checks passed
@mxinden

mxinden commented Jan 16, 2026

Copy link
Copy Markdown
Member Author

Thanks for the help @larseggert!

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.

transport/fc.rs: Hit MOZ_CRASH(attempt to subtract with overflow)

3 participants