neqo icon indicating copy to clipboard operation
neqo copied to clipboard

feature(transport/cubic): dynamic changing of alpha value

Open omansfeld opened this issue 3 months ago • 7 comments

This implements changing CUBIC_ALPHA to 1.0 when w_est >= cwnd_prior as per https://datatracker.ietf.org/doc/html/rfc9438#section-4.3-11.

  • added self.alpha field
  • added self.cwnd_prior field
  • existing functions now use self.alpha instead of constant value
  • self.alpha changes and resets as per RFC
  • added test helpers
  • added test for alpha
  • made tests pass

We had decided that this is one of the CUBIC RFC9438 parts where we aren't as confident to land it right now and will defer de-risking to later. Thus this PR stays a draft.

It is in a review-ready state though and can easily be picked back up when time comes.

See https://ntap.github.io/rfc8312bis/issues.html#n(2) for some context and discussions on why this was added to the spec. In there it was said that this will also be added to the Linux TCP CUBIC implementation, but as far as I can see that was never done (link to Linux Reno-friendly region)

Part of #3053

omansfeld avatar Sep 15 '25 16:09 omansfeld

Codecov Report

:x: Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 93.35%. Comparing base (737d97e) to head (d4fc13c). :warning: Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2985      +/-   ##
==========================================
- Coverage   93.39%   93.35%   -0.04%     
==========================================
  Files         124      124              
  Lines       35972    35989      +17     
  Branches    35972    35989      +17     
==========================================
+ Hits        33595    33599       +4     
- Misses       1532     1545      +13     
  Partials      845      845              
Components Coverage Δ
neqo-common 97.50% <ø> (ø)
neqo-crypto 83.25% <ø> (-0.48%) :arrow_down:
neqo-http3 93.34% <ø> (ø)
neqo-qpack 94.18% <ø> (ø)
neqo-transport 94.41% <95.23%> (-0.02%) :arrow_down:
neqo-udp 79.32% <ø> (+0.48%) :arrow_up:
mtu 85.57% <ø> (-0.20%) :arrow_down:

codecov[bot] avatar Sep 15 '25 17:09 codecov[bot]

#2973 is in, will this progress now?

larseggert avatar Oct 09 '25 12:10 larseggert

#2973 is in, will this progress now?

In #2973 we split off #3043 which was the part the test here depends on.

Because we don't increase our w_est value every ACK but rather wait until we have accumulated enough bytes across multiple ACKs to increase by at least 1 * mss it is very hard to assert correct growth of w_est in the test for this change here.

Apart from that I believe we also decided that this is one of the CUBIC parts that we will rather defer to later, similar to #3043. It would make sense to rebase all the changes in here so it is in a similar state as #3043, ready to be picked up again when time comes.

I will update the description and rebase once all CUBIC changes that can be merged now are in.

omansfeld avatar Oct 14 '25 10:10 omansfeld

In https://github.com/mozilla/neqo/pull/2973 we split off https://github.com/mozilla/neqo/pull/3043 which was the part the test here depends on.

I added our byte-tracking logic to the test and thus made it not depend on #3043 anymore. This can easily be removed again if at some point they are both supposed to land.

The description has been updated and the PR is theoretically now in a review-ready state and ready to be picked up again later when we want to get back to the task of de-risking landing it.

omansfeld avatar Oct 15 '25 17:10 omansfeld

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to 7334a182a2deffea338e1c4d5c59c8b88f3adbac.

neqo-latest as client

neqo-latest as server

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

github-actions[bot] avatar Oct 15 '25 18:10 github-actions[bot]

Client/server transfer results

Performance differences relative to e94d8c6c0f6ecf9df594eeb6fb56136f0d841343.

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 vs. google 452.4 ± 4.6 445.7 466.7 70.7 ± 7.0
google vs. neqo (cubic, paced) 277.6 ± 4.6 268.7 294.8 115.3 ± 7.0 -0.6 -0.2%
msquic vs. msquic 192.7 ± 76.6 141.1 583.6 166.1 ± 0.4
msquic vs. neqo (cubic, paced) 223.0 ± 84.0 151.7 672.1 143.5 ± 0.4 -3.7 -1.7%
neqo vs. google (cubic, paced) 755.5 ± 5.4 745.6 768.1 42.4 ± 5.9 :broken_heart: 1.5 0.2%
neqo vs. msquic (cubic, paced) 155.8 ± 3.8 148.8 165.5 205.3 ± 8.4 :green_heart: -4.0 -2.5%
neqo vs. neqo (cubic) 89.4 ± 4.7 82.9 104.7 357.8 ± 6.8 :green_heart: -1.8 -2.0%
neqo vs. neqo (cubic, paced) 91.1 ± 4.5 82.8 108.8 351.4 ± 7.1 -0.3 -0.3%
neqo vs. neqo (reno) 90.6 ± 5.2 79.5 109.0 353.3 ± 6.2 :broken_heart: 2.8 3.2%
neqo vs. neqo (reno, paced) 90.3 ± 4.1 81.9 97.5 354.4 ± 7.8 0.4 0.5%
neqo vs. quiche (cubic, paced) 195.0 ± 4.5 186.3 206.3 164.1 ± 7.1 :broken_heart: 1.5 0.8%
neqo vs. s2n (cubic, paced) 221.9 ± 5.6 211.7 252.8 144.2 ± 5.7 0.7 0.3%
quiche vs. neqo (cubic, paced) 154.5 ± 5.3 143.1 169.9 207.1 ± 6.0 -0.4 -0.3%
quiche vs. quiche 142.4 ± 4.9 132.7 158.5 224.7 ± 6.5
s2n vs. neqo (cubic, paced) 175.7 ± 5.0 164.3 187.1 182.1 ± 6.4 :broken_heart: 2.2 1.3%
s2n vs. s2n 250.5 ± 23.8 231.9 348.6 127.7 ± 1.3

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

github-actions[bot] avatar Oct 15 '25 18:10 github-actions[bot]

Benchmark results

Performance differences relative to e94d8c6c0f6ecf9df594eeb6fb56136f0d841343.

1-conn/1-100mb-resp/mtu-1504 (aka. Download)/client: No change in performance detected.
       time:   [192.98 ms 193.38 ms 193.88 ms]
       thrpt:  [515.79 MiB/s 517.12 MiB/s 518.18 MiB/s]
change:
       time:   [−0.1993% +0.0432% +0.3243%] (p = 0.76 > 0.05)
       thrpt:  [−0.3233% −0.0432% +0.1997%]

Found 3 outliers among 100 measurements (3.00%) 1 (1.00%) high mild 2 (2.00%) high severe

1-conn/10_000-parallel-1b-resp/mtu-1504 (aka. RPS)/client: No change in performance detected.
       time:   [285.38 ms 287.06 ms 288.72 ms]
       thrpt:  [34.635 Kelem/s 34.836 Kelem/s 35.041 Kelem/s]
change:
       time:   [−1.2028% −0.3932% +0.4380%] (p = 0.36 > 0.05)
       thrpt:  [−0.4361% +0.3947% +1.2174%]
1-conn/1-1b-resp/mtu-1504 (aka. HPS)/client: No change in performance detected.
       time:   [28.317 ms 28.423 ms 28.544 ms]
       thrpt:  [35.034   B/s 35.183   B/s 35.314   B/s]
change:
       time:   [−0.4902% +0.0046% +0.5130%] (p = 0.99 > 0.05)
       thrpt:  [−0.5104% −0.0046% +0.4926%]

Found 23 outliers among 100 measurements (23.00%) 14 (14.00%) low severe 9 (9.00%) high severe

1-conn/1-100mb-req/mtu-1504 (aka. Upload)/client: Change within noise threshold.
       time:   [198.20 ms 198.41 ms 198.63 ms]
       thrpt:  [503.44 MiB/s 504.00 MiB/s 504.54 MiB/s]
change:
       time:   [−0.6511% −0.3911% −0.1689%] (p = 0.00 +0.3926% +0.6553%]
decode 4096 bytes, mask ff: No change in performance detected.
       time:   [11.593 µs 11.632 µs 11.676 µs]
       change: [−0.3928% −0.0382% +0.3103%] (p = 0.84 > 0.05)

Found 14 outliers among 100 measurements (14.00%) 2 (2.00%) low severe 4 (4.00%) low mild 1 (1.00%) high mild 7 (7.00%) high severe

decode 1048576 bytes, mask ff: No change in performance detected.
       time:   [3.0219 ms 3.0314 ms 3.0425 ms]
       change: [−0.7213% −0.1190% +0.4766%] (p = 0.70 > 0.05)

Found 9 outliers among 100 measurements (9.00%) 9 (9.00%) high severe

decode 4096 bytes, mask 7f: No change in performance detected.
       time:   [19.931 µs 19.975 µs 20.026 µs]
       change: [−0.3069% +0.0605% +0.4111%] (p = 0.75 > 0.05)

Found 14 outliers among 100 measurements (14.00%) 3 (3.00%) low severe 1 (1.00%) low mild 1 (1.00%) high mild 9 (9.00%) high severe

decode 1048576 bytes, mask 7f: Change within noise threshold.
       time:   [5.0427 ms 5.0536 ms 5.0653 ms]
       change: [−1.2209% −0.6402% −0.1484%] (p = 0.02 Found 12 outliers among 100 measurements (12.00%)
1 (1.00%) low mild
11 (11.00%) high severe
decode 4096 bytes, mask 3f: No change in performance detected.
       time:   [8.2551 µs 8.2822 µs 8.3164 µs]
       change: [−1.3890% −0.6119% +0.0921%] (p = 0.12 > 0.05)

Found 20 outliers among 100 measurements (20.00%) 7 (7.00%) low mild 5 (5.00%) high mild 8 (8.00%) high severe

decode 1048576 bytes, mask 3f: No change in performance detected.
       time:   [1.5892 ms 1.5962 ms 1.6046 ms]
       change: [−0.5329% +0.1607% +0.7735%] (p = 0.67 > 0.05)

Found 10 outliers among 100 measurements (10.00%) 1 (1.00%) high mild 9 (9.00%) high severe

1-streams/each-1000-bytes/wallclock-time: Change within noise threshold.
       time:   [580.57 µs 581.50 µs 582.65 µs]
       change: [−1.8494% −1.2910% −0.7572%] (p = 0.00 Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
1-streams/each-1000-bytes/simulated-time
time:   [118.95 ms 119.16 ms 119.37 ms]
thrpt:  [8.1812 KiB/s 8.1954 KiB/s 8.2098 KiB/s]
change:
time:   [−0.0805% +0.1800% +0.4401%] (p = 0.19 > 0.05)
thrpt:  [−0.4382% −0.1797% +0.0806%]
No change in performance detected.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) low mild
1 (1.00%) high mild
1000-streams/each-1-bytes/wallclock-time: Change within noise threshold.
       time:   [13.640 ms 13.657 ms 13.675 ms]
       change: [+0.8522% +1.0673% +1.2766%] (p = 0.00 
1000-streams/each-1-bytes/simulated-time: No change in performance detected.
       time:   [14.994 s 15.009 s 15.025 s]
       thrpt:  [66.557   B/s 66.625   B/s 66.691   B/s]
change:
       time:   [−0.1418% −0.0068% +0.1358%] (p = 0.92 > 0.05)
       thrpt:  [−0.1356% +0.0068% +0.1420%]

Found 1 outliers among 100 measurements (1.00%) 1 (1.00%) high mild

1000-streams/each-1000-bytes/wallclock-time: :broken_heart: Performance has regressed.
       time:   [49.262 ms 49.416 ms 49.569 ms]
       change: [+1.4701% +1.9490% +2.4264%] (p = 0.00 Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
1000-streams/each-1000-bytes/simulated-time
time:   [18.291 s 18.454 s 18.616 s]
thrpt:  [52.459 KiB/s 52.920 KiB/s 53.389 KiB/s]
change:
time:   [−4.6079% −3.4027% −2.2120%] (p = 0.00 < 0.05)
thrpt:  [+2.2621% +3.5226% +4.8304%]
:green_heart: Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
coalesce_acked_from_zero 1+1 entries: No change in performance detected.
       time:   [88.589 ns 88.949 ns 89.296 ns]
       change: [−0.1860% +0.2697% +0.7209%] (p = 0.25 > 0.05)

Found 10 outliers among 100 measurements (10.00%) 9 (9.00%) high mild 1 (1.00%) high severe

coalesce_acked_from_zero 3+1 entries: No change in performance detected.
       time:   [106.67 ns 107.14 ns 107.72 ns]
       change: [−0.9975% −0.2920% +0.2987%] (p = 0.42 > 0.05)

Found 12 outliers among 100 measurements (12.00%) 1 (1.00%) high mild 11 (11.00%) high severe

coalesce_acked_from_zero 10+1 entries: No change in performance detected.
       time:   [105.95 ns 106.25 ns 106.67 ns]
       change: [−1.7550% −0.1445% +1.1194%] (p = 0.87 > 0.05)

Found 10 outliers among 100 measurements (10.00%) 1 (1.00%) low mild 2 (2.00%) high mild 7 (7.00%) high severe

coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [89.689 ns 89.957 ns 90.399 ns]
       change: [−0.8266% +0.0430% +0.8241%] (p = 0.92 > 0.05)

Found 10 outliers among 100 measurements (10.00%) 4 (4.00%) high mild 6 (6.00%) high severe

RxStreamOrderer::inbound_frame(): :green_heart: Performance has improved.
       time:   [107.48 ms 107.55 ms 107.62 ms]
       change: [−1.8247% −1.6587% −1.5106%] (p = 0.00 Found 27 outliers among 100 measurements (27.00%)
2 (2.00%) low severe
12 (12.00%) low mild
8 (8.00%) high mild
5 (5.00%) high severe
sent::Packets::take_ranges: No change in performance detected.
       time:   [4.5052 µs 4.5920 µs 4.6751 µs]
       change: [−3.2382% −0.6077% +2.0519%] (p = 0.66 > 0.05)

Found 1 outliers among 100 measurements (1.00%) 1 (1.00%) high mild

transfer/pacing-false/varying-seeds/wallclock-time/run: Change within noise threshold.
       time:   [25.177 ms 25.228 ms 25.291 ms]
       change: [−1.4225% −1.1537% −0.8688%] (p = 0.00 Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
transfer/pacing-false/varying-seeds/simulated-time/run: :broken_heart: Performance has regressed.
       time:   [25.512 s 25.550 s 25.589 s]
       thrpt:  [160.07 KiB/s 160.31 KiB/s 160.55 KiB/s]
change:
       time:   [+1.3518% +1.5482% +1.7551%] (p = 0.00 −1.5246% −1.3337%]

Found 1 outliers among 100 measurements (1.00%) 1 (1.00%) high mild

transfer/pacing-true/varying-seeds/wallclock-time/run: No change in performance detected.
       time:   [25.800 ms 25.860 ms 25.921 ms]
       change: [−0.5627% −0.2698% +0.0305%] (p = 0.09 > 0.05)
transfer/pacing-true/varying-seeds/simulated-time/run: Change within noise threshold.
       time:   [25.225 s 25.269 s 25.311 s]
       thrpt:  [161.82 KiB/s 162.10 KiB/s 162.38 KiB/s]
change:
       time:   [+0.9340% +1.1549% +1.3701%] (p = 0.00 −1.1417% −0.9254%]
transfer/pacing-false/same-seed/wallclock-time/run: Change within noise threshold.
       time:   [25.355 ms 25.383 ms 25.412 ms]
       change: [−0.9983% −0.8127% −0.6499%] (p = 0.00 Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
transfer/pacing-false/same-seed/simulated-time/run: Change within noise threshold.
       time:   [25.510 s 25.510 s 25.510 s]
       thrpt:  [160.56 KiB/s 160.56 KiB/s 160.56 KiB/s]
change:
       time:   [−0.7766% −0.7766% −0.7766%] (p = 0.00 +0.7827% +0.7827%]
transfer/pacing-true/same-seed/wallclock-time/run: Change within noise threshold.
       time:   [26.047 ms 26.079 ms 26.125 ms]
       change: [−2.5826% −2.4172% −2.2540%] (p = 0.00 Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe
transfer/pacing-true/same-seed/simulated-time/run: :broken_heart: Performance has regressed.
       time:   [25.964 s 25.964 s 25.964 s]
       thrpt:  [157.76 KiB/s 157.76 KiB/s 157.76 KiB/s]
change:
       time:   [+1.1249% +1.1249% +1.1249%] (p = 0.00 −1.1124% −1.1124%]

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

github-actions[bot] avatar Oct 15 '25 18:10 github-actions[bot]