Skip to content

fix(router): adaptive tick converges the mux to the fastest N legs in one tick - #4200

Merged
0pcom merged 1 commit into
skycoin:developfrom
0pcom:fix/adaptive-fast-converge
Aug 26, 2026
Merged

fix(router): adaptive tick converges the mux to the fastest N legs in one tick#4200
0pcom merged 1 commit into
skycoin:developfrom
0pcom:fix/adaptive-fast-converge

Conversation

@0pcom

@0pcom 0pcom commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Under the mux uncap (adaptStandbyMax=60) the router brings up ~60 legs all born active, and the adaptive tick parked only one leg per tick, newest-first — it could never catch up. The active mux hovered 25-30 wide across latencies from <1ms to >1s, and the no-skip reorder buffer head-of-line-stalled on the slowest active leg (measured live: 335 B took 22 s over a 28-wide idle mux; a 10 MB download stalled out).

Two changes, both driven by the live end-to-end route latency (snapshotLegs already sources LegInfo.LatencyMs from legEndToEndLatencyMs, not the stale first-hop transport RTT):

  • Rule (3) proactive-park now parks the whole surplus above the active target in a single tick, slowest-first, so the active set is always the fastest desiredActive legs and a wide idle mux collapses to lean immediately.
  • Growth now promotes the fastest measured-healthy standby instead of the lowest-index, so a widening download grows onto the fastest reserve legs.

bundle.wasm regenerated (TinyGo); parity_test (wazero) green. New unit test asserts slowest-first bulk park.

… one tick

Under the mux uncap (adaptStandbyMax=60) the router brings up ~60 legs all
born active, and the adaptive tick's proactive-park parked only ONE leg per
tick, newest-first. It could never catch up: the active mux hovered 25-30 wide
across latencies from <1ms to >1s, and the no-skip reorder buffer head-of-line-
stalled on the slowest active leg (measured live: 335 bytes took 22s over a
28-wide idle mux; a 10MB download stalled out entirely).

Two changes, both driven by the LIVE end-to-end route latency (snapshotLegs
already sources LegInfo.LatencyMs from legEndToEndLatencyMs, not the stale
first-hop transport RTT):

- Rule (3) proactive-park now parks the WHOLE surplus above the active target
  in a single tick, SLOWEST-first, so the set kept active is always the fastest
  desiredActive legs and the wide idle mux collapses to lean immediately.
- Growth (healthyPromotable) now promotes the FASTEST measured-healthy standby
  instead of the lowest-index one, so a widening download grows onto the fastest
  reserve legs, never pulling a slow leg in ahead of a fast one.

bundle.wasm regenerated (TinyGo); parity_test (wazero) green. New unit test
asserts slowest-first bulk park; the warm-standby test now expects the one-tick
bulk park.
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