fix: stop adaptive pacing from compounding its own rate limit - #21
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Adjust the pacing-sleep test fixture so its delay is strictly beyond half the observation interval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Fixes adaptive QUIC pacing so self-imposed token waits do not recursively reduce estimated capacity.
Changes:
- Tracks pacing sleep using the controller clock.
- Preserves capacity history during pacing-limited intervals.
- Adds regression tests and documents the heuristic and limitations.
| File | Summary |
|---|---|
internal/tunnel/pacing_feedback_integration_test.go |
Adds QUIC pacing and recovery regressions. |
internal/accel/pacing_sleep_test.go |
Tests sleep accounting; critical issue at line 232: the fixture is exactly half pacing time, so the expected classification fails. |
internal/accel/pacer.go |
Adds pacing-sleep accounting and classification. |
internal/accel/adaptive.go |
Preserves capacity history for pacing-limited samples. |
internal/accel/adaptive_feedback_test.go |
Tests estimator history and penalty behavior. |
docs/ARCHITECTURE.md |
Documents adaptive pacing behavior. |
docs/ACCELERATION.md |
Documents the heuristic and limitations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| var externalWork time.Duration | ||
| switch condition { | ||
| case "mostly_transport": | ||
| externalWork = time.Second |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fix sustained native QUIC transfers progressively reducing their own adaptive pacing target under a persistent RTT penalty.
No wire protocol, authentication, dependency, configuration default, minimum rate, gain, version or release change.
Verification
make checkandmake race: passed on the final source.make stealth-tools-check: passed; no packet-capture campaign was run.Waitand independently advance synthetic wire time. They verify lower path-capacity samples reenter history after a step-down, and RTT/path recovery remains possible.57e431ffails the sustained-download test at the default 65,536 bytes/s floor. Its test-only deadline is 12 s instead of the formal fixture's 15 s to allow bounded cleanup; this is not a same-budget throughput benchmark.Evidence limits
The real QUIC fixtures test the adapter/controller, not native authentication or serverCore. Sleep share is an application-level heuristic, not transport-level proof of uncongested capacity. Sustained RTT penalties can still limit discovery of spare capacity; this change does not add a full bandwidth-probing state machine. No passive-traffic, browser-equivalence, separate remote-host or comparative-performance claim is made. Raw diagnostics remain ignored and local.
Exact PR head
aa02a4d6e433d6c02b47270e13d3e46b39f7a1a2passed CI, CodeQL, and Linux namespace/netem integration. CI includes Linux/macOS tests, race detection, reachable vulnerability scanning, four-platform builds, actual Docker integration and a multi-platform OCI image build. No open review threads or change requests were present at merge preparation.Post-merge verification: main commit
87d199982916f73452678869466249edafa7ed65has the identical source tree2b8e3b95ffb63bc3b00f6651b2175c4b74ab7a62and passed its own push-triggered CI, CodeQL and Linux namespace/netem integration. No tag or release was created.