Cubic pacing rate tolerates a zero smoothed RTT - #109
Open
rnro wants to merge 3 commits into
Open
Conversation
`Cubic.updatePacerState` divides by the smoothed RTT in microseconds, so a smoothed RTT of zero traps. `Prague.updatePacerState` already uses its initial estimate in the case of a zero smoothed RTT, so this change mirrors that approach.
rnro
requested review from
agnosticdev,
kkuk24,
rpaulo and
tfpauly
as code owners
August 21, 2026 16:08
Cubic pacing rate tolearates a zero smoothed RTTCubic pacing rate tolerates a zero smoothed RTT
rpaulo
reviewed
Aug 21, 2026
| @@ -312,7 +315,7 @@ struct Prague: CongestionControlProtocol, CubicLikeProtocol { | |||
| } | |||
|
|
|||
| // Multiply by USEC_PER_SEC as sRTT is in microseconds | |||
Contributor
There was a problem hiding this comment.
Suggested change
| // Multiply by USEC_PER_SEC as sRTT is in microseconds | |
| // Multiply by USEC_PER_SEC as smoothedRTTInMicroseconds is in microseconds |
rpaulo
reviewed
Aug 21, 2026
| if congestionWindow < slowStartThreshold { | ||
| rate *= 2 | ||
| } | ||
| // Multiply by USEC_PER_SEC as srtt is in microseconds |
Contributor
Author
There was a problem hiding this comment.
So I've taken a slightly different approach here. I think the underlying issue once I called it smoothedRTTInMicroseconds is that the units of rate were not clear. I've changed that and I think then the comment is not needed because the code is self-evident.
rpaulo
reviewed
Aug 21, 2026
| return | ||
| } | ||
|
|
||
| // Zero microseconds means either that no measurement has landed yet or that one rounded |
Contributor
There was a problem hiding this comment.
How can this happen when we are called after ackEnd? At that time I expect we should have an RTT estimate.
Contributor
Author
There was a problem hiding this comment.
You're right, I don't think the "no measurement has landed yet" part can happen. I've updated the comment.
rpaulo
approved these changes
Aug 26, 2026
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.
Cubic.updatePacerStatedivides by the smoothed RTT in microseconds, so a small smoothed RTT is rounded to zero and traps.Prague.updatePacerStatealready uses its initial estimate in the case of a zero smoothed RTT, so this change mirrors that approach.