Skip to content

Add opt-in bounded receive-window auto-tuning - #101

Open
DeveloperKubilay wants to merge 1 commit into
ptrd:masterfrom
DeveloperKubilay:receive-window-autotuning
Open

DeveloperKubilay wants to merge 1 commit into
ptrd:masterfrom
DeveloperKubilay:receive-window-autotuning

Conversation

@DeveloperKubilay

@DeveloperKubilay DeveloperKubilay commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Proposes an optional receive-window controller for applications with changing receive demand. Applications explicitly enable it per readable stream and choose minimum/maximum byte bounds; existing applications keep their fixed sliding window.

The controller estimates a target from application-consumed bytes and smoothed RTT, with a minimum sample period, bounded growth/shrinkage and idle handling. It never revokes previously advertised offsets or increases the configured connection budget. Credit callbacks run outside the receive monitor to avoid blocking a producer that immediately delivers more data. The accompanying document describes API behavior, estimator limits and flow-control semantics.

This is a consumption-rate heuristic, not a physical bandwidth measurement. It does not add pacing, BBR, PMTU discovery or application packet buffering. The two reliability fixes are submitted separately so this API/algorithm proposal can be reviewed independently.

Validation on current master (101c733d), JDK 21 / Windows:

  • All 27 focused tests pass: new tuner and input tests, existing input-stream tests, and the congestion-avoidance test.
  • The unfiltered core suite ran 1178 tests: 1174 passed, 3 failed, 1 pre-existing disabled test skipped. All three failures reproduce on clean master (1168 tests: 1164 passed, 3 failed, 1 skipped): two IPv6/DNS cases and the existing timing-sensitive NewRenoCongestionControllerTest.congestionAvoidance. The congestion-avoidance case passes in the focused run.
  • Re-running the suite excluding only the two DNS-dependent cases produced 1174 passes, the same intermittent congestion-avoidance failure and one skipped test. Production congestion-control code and its tests are unchanged.

The public API and estimator policy are proposed for review before considering release inclusion. No library version or release workflow changes are included.

Fork CI: the complete ./gradlew build passed on Linux / JDK 17 with the upstream workflow and no test exclusions: https://github.com/DeveloperKubilay/kwik/actions/runs/39651942299. Upstream PR checks remain separate.

@DeveloperKubilay
DeveloperKubilay marked this pull request as ready for review October 21, 2026 18:24
Copilot AI balanced review requested due to automatic review settings October 21, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants