feat(routing-policy): add experimental 'coupled' preset (MPTCP-style coupled congestion control) - #4113
Merged
Merged
Conversation
…coupled congestion control)
A new opt-in preset inspired by MPTCP's coupled congestion control (LIA/OLIA).
It provisions a modest symmetric mux (4) over the multi-hop overlay and weights
bytes toward the best legs (Distribution "auto"), then couples the aggregate in
on_tick using per-leg retransmit-delta (loss) and EWMA latency:
- coupled INCREASE (LIA-cautious): promote at most one warm spare per tick,
and only when NO active leg shows rising loss.
- coupled DECREASE: the instant any active leg's loss rises, shed the worst
leg (highest loss, latency-tiebroken; never leg 0, never below a floor of 2)
so aggregate aggressiveness stays bounded and traffic concentrates on the
good legs rather than equal-spreading across a lossy one.
Deterministic (no time.Now/rand) so the native and wazero paths stay
byte-identical. Registered in preset dispatch, names, and the bundle manifest;
bundle.wasm rebuilt. No existing default changes - decideAdaptive untouched.
Adds native unit tests (loss->shed-worst, clean->cautious-promote,
coupling-forbids-grow-under-loss) and coupled decide+tick cases to the
native<->wazero parity suite.
0pcom
force-pushed
the
feat/policy-preset-coupled
branch
from
August 23, 2026 02:05
7f71242 to
39191ab
Compare
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 a new experimental routing-policy preset,
coupled, inspired by MPTCP'scoupled congestion control (LIA/OLIA). It is opt-in and changes no existing
default (
adaptiveand the shipped default are untouched).decidereturns a modest symmetric mux (4) over the multi-hop overlay and asksthe host to weight bytes toward the best legs (
Distribution: "auto"), ratherthan round-robin's equal spread across a congested leg. The
on_tickcontrollerthen couples the aggregate using two per-leg signals — the retransmit delta since
last tick (loss, packet-normalized by the sent-bytes delta) and EWMA latency:
only when NO active leg shows rising loss.
(highest loss, latency-tiebroken; never leg 0, never below a floor of 2), so
aggregate aggressiveness stays bounded and traffic concentrates on the good
legs.
The logic lives in the single source of truth (
pkg/router/policy/preset) and isdeterministic (no
time.Now/rand), so the native path and the recompiledbundle.wasmrun byte-identically. The bundle was rebuilt with TinyGo.Testing:
go test ./pkg/router/policy/...passes, including the native<->wazeroparity suite (decide + a multi-tick shed/promote sequence added for
coupled).New native unit tests cover loss->shed-worst, clean->cautious-promote, and the
coupling property that rising loss forbids growth even when a spare is available.