Skip to content

Keep the tunnel loss estimate moving when the tunnel stalls - #6

Merged
TaJirax merged 1 commit into
mainfrom
adaptive-duplication-stall
Aug 4, 2026
Merged

Keep the tunnel loss estimate moving when the tunnel stalls#6
TaJirax merged 1 commit into
mainfrom
adaptive-duplication-stall

Conversation

@TaJirax

@TaJirax TaJirax commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • retransmits now close the loss window on their own once there is a window's worth of them
  • a window is still a window of fresh data in the normal case, so the measured ratio is unchanged for healthy traffic

Why

tunnelLossMeter closed its window only on fresh STREAM_DATA. A tunnel losing badly does the opposite of that: new data slows to a trickle while STREAM_RESEND piles up, so the window never completed and lastPerMille stayed frozen at whatever the last healthy period measured — usually zero.

adaptiveDuplicationCount derives the copy count from that estimate. With the floor at one copy, which is what the speed preset configures, duplication could not rise during exactly the loss it exists to answer: the tunnel sat at a single copy per packet while retransmitting nearly everything.

Validation

  • new test drives a healthy window, then a stall of mostly retransmits, and asserts the estimate moves and that duplicationForLoss lifts the count off its floor
  • the existing TestTunnelLossMeter_UploadRetransmitRate still passes unchanged, which is the check that the healthy-traffic ratio was not redefined
  • go build ./..., go vet ./..., and go test ./... pass

🤖 Generated with Claude Code

The loss window closed only on fresh data, so a tunnel losing badly never
closed one: new data slows to a trickle while retransmits pile up, and the
estimate stayed frozen at whatever the last healthy period measured, often
zero. Adaptive duplication derives its copy count from that estimate, so it
could not rise during exactly the loss it exists to answer, and the tunnel sat
at one copy per packet while retransmitting everything.

Retransmits now close the window on their own once there is a window's worth
of them. A window is still a window of fresh data in the normal case, so the
measured ratio is unchanged for healthy traffic.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@TaJirax
TaJirax merged commit 28c5f33 into main Aug 4, 2026
12 checks passed
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.

1 participant