feat(routing-policy): experimental 'ledbat' delay-based scavenger preset - #4112
Merged
Conversation
… preset
A new opt-in routing-policy preset inspired by LEDBAT (RFC 6817). It changes
no default — you get it only via preset:ledbat.
decideLedbat provisions a lean symmetric mux=3 over multi-hop with "auto" byte
distribution, re-evaluated every 20s (chat stays single-route). tickLedbat is
the scavenger: it tracks each leg's EWMA-smoothed delay and a per-leg base
(running-min) delay, then acts on the queuing delay = smoothed - base.
- Back off (yield): if any active leg's queuing delay exceeds 60ms, demote the
highest-queuing-delay non-primary active leg to warm standby, shrinking the
active set toward 1 (never parks leg 0, never tears down).
- Grow: while every active leg reads within 60ms of its base and the active set
is below the mux cap of 3, re-promote one parked leg (reserve only, no fresh
dial).
One arbitrated action per tick, integer/float + map state only (no time/rand),
so it is deterministic and byte-identical under wazero and native compilation.
Registered in preset.Names, OnTick/Decide dispatch, and the wasm manifest; the
bundle.wasm is rebuilt so the wazero path carries it. Native unit tests cover
the decide shape and the back-off / floor / grow tick rules, and the
native<->wazero decide+tick parity test is extended to ledbat.
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.
Adds an opt-in routing-policy preset
ledbat, a delay-based background/scavenger multipath policy inspired by LEDBAT (RFC 6817). It changes no default — selectable only viapreset:ledbat.decideLedbatprovisions a lean symmetricmux=3over multi-hop withautobyte distribution, re-evaluated every 20s (chat stays single-route).tickLedbattracks each leg's EWMA-smoothed delay and a per-leg base (running-min) delay and acts on the queuing delay = smoothed − base:One arbitrated action per tick, integer/float + map state only (no
time/rand), so it is deterministic and byte-identical under wazero and native compilation.Registered in
preset.Names, theDecide/OnTickdispatch, and the wasm manifest;bundle.wasmis rebuilt (TinyGo) so the wazero path carries it. Native unit tests cover the decide shape and the back-off / floor / grow tick rules; the native↔wazero decide+tick parity test is extended toledbat.go test ./pkg/router/policy/...passes, including the wazero parity test;go build .passes.