Skip to content

Add Connection::set_remote_max_streams to raise the incoming stream limit - #4010

Open
jesup wants to merge 2 commits into
users/jesup/expose_queue_capacityfrom
users/jesup/add_remote_max_streams
Open

jesup wants to merge 2 commits into
users/jesup/expose_queue_capacityfrom
users/jesup/add_remote_max_streams

Conversation

@jesup

@jesup jesup commented Sep 20, 2026

Copy link
Copy Markdown
Member

No description provided.

@jesup

jesup commented Sep 20, 2026 •

Copy link
Copy Markdown
Member Author

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.

Copilot review overview

🟡 Changes recommended

The API permits protocol-invalid limits above 2^60, and its core advertisement behavior lacks direct verification.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds runtime control for increasing incoming QUIC stream limits, including compatibility with 0-RTT rejection.

Changes:

  • Adds Connection::set_remote_max_streams.
  • Schedules corresponding MAX_STREAMS updates.
  • Adjusts and tests 0-RTT rejection handling.
File Description
neqo-transport/​src/​streams.rs Implements monotonic stream-limit increases.
neqo-transport/​src/​connection/​mod.rs Exposes the public connection API.
neqo-transport/​src/​connection/​tests/​zerortt.rs Tests raised limits during 0-RTT rejection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread neqo-transport/src/streams.rs
Comment thread neqo-transport/src/connection/mod.rs
@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.96%. Comparing base (f039ffc) to head (3c305f6).

Additional details and impacted files
@@                          Coverage Diff                          @@
##           users/jesup/expose_queue_capacity    #4010      +/-   ##
=====================================================================
+ Coverage                              96.93%   96.96%   +0.03%     
=====================================================================
  Files                                    119      119              
  Lines                                  41584    41603      +19     
  Branches                               41584    41603      +19     
=====================================================================
+ Hits                                   40308    40340      +32     
+ Misses                                  1252     1237      -15     
- Partials                                  24       26       +2     
Flag Coverage Δ
freebsd 94.50% <100.00%> (+0.03%) ⬆️
linux 97.16% <100.00%> (+0.01%) ⬆️
macos 95.31% <100.00%> (+<0.01%) ⬆️
windows 95.41% <100.00%> (+0.01%) ⬆️

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

Components Coverage Δ
neqo-common 99.31% <ø> (ø)
neqo-http3 95.41% <ø> (ø)
neqo-qpack 96.97% <ø> (ø)
neqo-transport 97.95% <100.00%> (+0.05%) ⬆️
neqo-udp 95.37% <ø> (ø)
mtu 89.13% <ø> (ø)

@codspeed

codspeed Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 1.93%

⚡ 1 improved benchmark
❌ 5 regressed benchmarks
✅ 93 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ WallTime quiche-neqo 48.2 ms 50.6 ms -4.74%
❌ WallTime walltime/pacing-true/same-seed 2 ms 2.1 ms -2.71%
❌ WallTime 1-conn/1-100mb-req (aka. Upload) 46.5 ms 47.8 ms -2.57%
❌ WallTime 1-conn/1-100mb-resp (aka. Download) 46.8 ms 48 ms -2.46%
❌ WallTime neqo-s2n 49 ms 50.3 ms -2.42%
⚡ Simulation simulated/pacing-false/same-seed 77.3 ms 74.7 ms +3.5%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing users/jesup/add_remote_max_streams (3c305f6) with users/jesup/expose_queue_capacity (f039ffc)

Open in CodSpeed

@mxinden

mxinden commented Sep 21, 2026

Copy link
Copy Markdown
Member

Is this needed for Interop 2026? If not, I will delay reviewing it.

@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from 1e99e70 to 1cb9ec5 Compare September 23, 2026 06:27
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from 435fa81 to 7c9dbf5 Compare September 23, 2026 06:27
@github-actions

Copy link
Copy Markdown
Contributor

Performance profiles for profiler.firefox.com

Benchmarks (14)
  • neqo-bin-main: pr · base
  • neqo-common-decoder: pr · base
  • neqo-http3-streams_simulated: pr · base
  • neqo-http3-streams_walltime: pr · base
  • neqo-transport-frame_decode: pr · base
  • neqo-transport-min_bandwidth: pr · base
  • neqo-transport-pacer: pr · base
  • neqo-transport-packet_codec: pr · base
  • neqo-transport-range_tracker: pr · base
  • neqo-transport-rx_stream_orderer: pr · base
  • neqo-transport-send_streams: pr · base
  • neqo-transport-sent_packets: pr · base
  • neqo-transport-transfer_simulated: pr · base
  • neqo-transport-transfer_walltime: pr · base
Comparisons (5)

@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from 1cb9ec5 to b172928 Compare September 23, 2026 23:55
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from 7c9dbf5 to 88e5d12 Compare September 23, 2026 23:55
@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from b172928 to c0707d8 Compare September 25, 2026 10:28
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from 88e5d12 to df2d12a Compare September 25, 2026 10:28
@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from c0707d8 to c245d30 Compare September 25, 2026 12:35
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from df2d12a to fc849cf Compare September 25, 2026 12:35
@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from c245d30 to 419a6ae Compare September 25, 2026 15:05
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from fc849cf to 8d821a6 Compare September 25, 2026 15:05
@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from 419a6ae to 5a2f7b1 Compare September 30, 2026 03:30
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from 8d821a6 to 17bfe24 Compare September 30, 2026 03:30
@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from 5a2f7b1 to 41cc958 Compare September 30, 2026 15:32
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from 17bfe24 to e70b51b Compare September 30, 2026 15:32
Comment thread neqo-transport/src/streams.rs
@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from 41cc958 to f333aef Compare October 2, 2026 21:48
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from e70b51b to 43e88a6 Compare October 2, 2026 21:49
jesup added 2 commits October 3, 2026 02:08
…imit

Lets a caller raise the connection's own MAX_STREAMS advertisement
above the transport-parameter-configured default, for cases like
WebTransport's anticipated-streams API where an application knows
ahead of time that it wants more concurrency than the default allows.
Monotonic: lowering the value later has no effect, since QUIC stream
limits can only increase.

zero_rtt_rejected's assertion that the limit matches the configured
transport parameter no longer holds once a caller can raise it before
the handshake confirms, which is exactly when the anticipated-streams
API supplies it; relax it to allow anything at or above the default.
@jesup

jesup commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Is this needed for Interop 2026? If not, I will delay reviewing it.

Not for Interop 2026 scoring: anticipated-streams.https.any.js isn't in the Interop 2026 WebTransport set. Firefox needs it for anticipatedConcurrentIncoming{Uni,Bi}directionalStreams (Bug 2007825), so after the Interop-related PRs is fine.

@jesup
jesup force-pushed the users/jesup/expose_queue_capacity branch from f333aef to f039ffc Compare October 3, 2026 03:08
@jesup
jesup force-pushed the users/jesup/add_remote_max_streams branch from 43e88a6 to 3c305f6 Compare October 3, 2026 03:08
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to f039ffc.

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-neqo-cubic 72.2 ± 0.4 71.2 – 73.0 72.3 ± 0.4 443.1 ± 2.4 💔 +1.5 (+2.1%)
neqo-google-cubic 227.8 ± 35.2 180.0 – 449.2 225.3 ± 32.0 140.5 ± 21.7 💚 -8.6 (-3.7%)

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 132.3 ± 0.5 130.9 – 133.3 132.3 ± 0.5 242.0 ± 1.0
google-neqo-cubic 72.2 ± 0.4 71.2 – 73.0 72.3 ± 0.4 443.1 ± 2.4 💔 +1.5 (+2.1%)
neqo-google-cubic 227.8 ± 35.2 180.0 – 449.2 225.3 ± 32.0 140.5 ± 21.7 💚 -8.6 (-3.7%)
neqo-neqo-cubic 19.2 ± 0.2 18.8 – 19.6 19.2 ± 0.2 1666.2 ± 14.2 +0.0 (+0.0%)
neqo-neqo-cubic-nopacing 19.2 ± 0.2 18.7 – 19.8 19.1 ± 0.1 1669.8 ± 15.7 +0.1 (+0.5%)
neqo-neqo-newreno 19.8 ± 0.2 19.4 – 20.3 19.8 ± 0.1 1614.9 ± 13.6 +0.1 (+0.4%)
neqo-neqo-newreno-nopacing 19.0 ± 0.2 18.5 – 19.7 19.0 ± 0.2 1684.8 ± 17.9 +0.0 (+0.2%)
neqo-quiche-cubic 33.0 ± 0.3 32.4 – 33.7 33.0 ± 0.4 969.5 ± 9.9 +0.2 (+0.6%)
neqo-s2n-cubic 38.4 ± 0.3 37.9 – 39.1 38.3 ± 0.3 834.4 ± 5.5 -0.1 (-0.4%)
quiche-neqo-cubic 38.2 ± 0.4 37.1 – 39.5 38.1 ± 0.3 838.7 ± 8.2 -0.1 (-0.2%)
quiche-quiche 39.3 ± 0.2 38.8 – 40.0 39.3 ± 0.2 814.0 ± 4.6
s2n-neqo-cubic 112.2 ± 0.3 111.6 – 113.4 112.1 ± 0.3 285.2 ± 0.9 +0.1 (+0.1%)
s2n-s2n ⚠️ 162.7 ± 21.5 135.0 – 261.4 159.2 ± 1.0 196.7 ± 26.0

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

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to users/jesup/expose_queue_capacity at f039ffc.

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: ⚠️H LR R Z ⚠️A L1 🚀L2 C1 ⚠️V2
neqo-pr vs. lsquic: L1 C1
neqo-pr vs. msquic: Z A L1 C1
neqo-pr vs. mvfst: A
neqo-pr vs. neqo: run cancelled after 20 min
neqo-pr vs. nginx: BP BA
neqo-pr vs. ngtcp2: Z 🚀L1 C1 CM
neqo-pr vs. picoquic: Z A
neqo-pr vs. quic-go: A
neqo-pr vs. quiche: BP BA
neqo-pr vs. s2n-quic: CM
neqo-pr vs. tquic: S BP BA
neqo-pr vs. xquic: S R Z A L1 C1
aioquic vs. neqo-pr: 🚀L1 CM
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: BP BA CM
linuxquic vs. neqo-pr: ⚠️CM
msquic vs. neqo-pr: CM
mvfst vs. neqo-pr: Z L1 C1 CM
neqo vs. neqo-pr: Z A
openssl vs. neqo-pr: LR M A CM
quic-go vs. neqo-pr: CM
quic-zig vs. neqo-pr: CM
quiche vs. neqo-pr: CM
quinn vs. neqo-pr: 🚀C1 V2 CM
s2n-quic vs. neqo-pr: 🚀BP CM
tquic vs. neqo-pr: ⚠️BA 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

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Benchmark results

No significant performance differences relative to f039ffc.

All results
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500
       time:   [50.746 ms 50.824 ms 50.941 ms]
       thrpt:  [1.9170 GiB/s 1.9215 GiB/s 1.9244 GiB/s]
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500
       time:   [50.618 ms 50.677 ms 50.738 ms]
       thrpt:  [1.9247 GiB/s 1.9270 GiB/s 1.9293 GiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500
       time:   [3.0134 ms 3.0143 ms 3.0151 ms]
       thrpt:  [331.66   B/s 331.75   B/s 331.85   B/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500
       time:   [67.060 ms 67.338 ms 67.622 ms]
       thrpt:  [147.88 Kelem/s 148.50 Kelem/s 149.12 Kelem/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
streams-flow-controlled/walltime/1-streams/each-4194304-bytes
       time:   [10.608 ms 10.610 ms 10.612 ms]
       thrpt:  [376.93 MiB/s 377.01 MiB/s 377.09 MiB/s]
streams-flow-controlled/walltime/10-streams/each-1048576-bytes
       time:   [28.028 ms 28.038 ms 28.049 ms]
       thrpt:  [356.52 MiB/s 356.65 MiB/s 356.78 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1-streams/each-1000-bytes
       time:   [130.27 µs 130.70 µs 131.25 µs]
       thrpt:  [7.2662 MiB/s 7.2969 MiB/s 7.3207 MiB/s]
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
streams/walltime/1000-streams/each-1-bytes
       time:   [3.8585 ms 3.8703 ms 3.8816 ms]
       thrpt:  [251.59 KiB/s 252.32 KiB/s 253.10 KiB/s]
Found 18 outliers among 100 measurements (18.00%)
18 (18.00%) low mild
streams/walltime/1000-streams/each-1000-bytes
       time:   [11.067 ms 11.071 ms 11.074 ms]
       thrpt:  [86.115 MiB/s 86.145 MiB/s 86.175 MiB/s]
Found 6 outliers among 100 measurements (6.00%)
2 (2.00%) low mild
4 (4.00%) high mild
transfer/walltime/pacing-false/same-seed
       time:   [2.0054 ms 2.0064 ms 2.0076 ms]
       thrpt:  [1.9457 GiB/s 1.9469 GiB/s 1.9478 GiB/s]
transfer/walltime/pacing-false/varying-seeds
       time:   [2.0393 ms 2.0403 ms 2.0415 ms]
       thrpt:  [1.9135 GiB/s 1.9146 GiB/s 1.9154 GiB/s]
transfer/walltime/pacing-true/same-seed
       time:   [2.0924 ms 2.0938 ms 2.0955 ms]
       thrpt:  [1.8642 GiB/s 1.8657 GiB/s 1.8669 GiB/s]
transfer/walltime/pacing-true/varying-seeds
       time:   [2.0551 ms 2.0562 ms 2.0575 ms]
       thrpt:  [1.8986 GiB/s 1.8998 GiB/s 1.9008 GiB/s]

Instructions per cycle

Criterion reported no significant timing changes.

All benchmarks
Benchmark IPC before IPC after ΔIPC
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 3.20 3.16 -1.3%
streams/walltime/1000-streams/each-1000-bytes 3.07 3.10 +1.0%
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 3.21 3.24 +0.8%
streams/walltime/1000-streams/each-1-bytes 3.28 3.30 +0.7%
streams-flow-controlled/walltime/1-streams/each-4194304-bytes 3.05 3.03 -0.7%
streams-flow-controlled/walltime/10-streams/each-1048576-bytes 3.21 3.19 -0.7%
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 3.23 3.21 -0.6%
transfer/walltime/pacing-true/same-seed 2.90 2.88 -0.6%
streams/walltime/1-streams/each-1000-bytes 2.52 2.51 -0.2%
transfer/walltime/pacing-true/varying-seeds 2.89 2.90 +0.2%
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 2.24 2.24 +0.2%
transfer/walltime/pacing-false/same-seed 2.88 2.88 -0.2%
transfer/walltime/pacing-false/varying-seeds 2.89 2.89 -0.0%
Profiles for profiler.firefox.com (62)

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

This branch has not been deployed

No deployments
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.

4 participants