feat: erasure-aware FEC v2 - #1
Draft
tookdes wants to merge 49 commits into
Draft
Conversation
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.
Draft implementation of the erasure-aware fecraw v2 data plane.
Stage 1 — validated Loss Model + adaptive RS
Confirmed WAN result
Beijing Ali-Cloud <-> GCP US-West, ~16.6% physical loss:
The codec remained the original UDPspeeder RS implementation, proving the loss model / redundancy controller has value independently of a new codec.
Stage 2 — sliding-window RLNC + pacing liveness
Added GF(256) sliding-window RLNC (
0x11d), deterministic RID/index coefficients, up to 256 source symbols/window, 512-symbol decoder width, large-TUN-packet fragmentation/reassembly, and--fec-codec rs|rlnc|auto.Confirmed WAN result on
be38b078c9a236b57fa9cdca33ee2085b6fbd574Stage 2 solved pacing liveness but exposed a separate bandwidth-estimation collapse.
Stage 3 — validated WindowRate + diagnostic pacing sampler
RLNC WindowRate
Stage 3 separates RS block sizing from RLNC continuous WindowRate and ports Queqiao's
windowChaining=2.5model. At the originalfloor=0.175, RTT~200ms, window=64 point it computes about 0.3187 repair/source instead of the Stage-2 inherited 20:13 = 0.65 repair/source.Deterministic CI regression:
window-rate: floor=0.175 RS=20:11 RLNC=0.3187 residual=0.0000 recovered=516Confirmed WAN result on
7c035e4fb81b0faf0f3ac7c4597189e881cd0fc2The path had changed by Aug 25: RTT ~190–230ms and erasure floor was mostly ~0, with one short loss window. A same-time RS control was therefore added.
Results:
Pacing Stage-3 WAN result
RS adaptive + pacing, no
--max-bandwidthcap:This improved the old D1 0.42 Mbps but remained far below the unpaced path. The new logs exposed two control-loop problems:
burst_factor > 1.6as congestion, independently of the erasure floor. In PROBE_BW that could produce0.85 * 0.50 = 0.425of the current wire estimate, matching the observedrate/wire_bwratio even whenfloor=0.Stage 4 — RLNC protectBurst + RTT-scale pacing startup
Current head:
704541270151759baa210daf45de689db8111782.RLNC tail / producer-drain protection
Ported the relevant Queqiao
protectBurst()behavior without changing fecraw's wire format:The tail planner follows the block residual model used by Queqiao
ShardsFor: burst correlation reduces the effective independent-trial count, so correlated tails receive more repair without increasing the continuous WindowRate.x86_64 deterministic tests currently report:
tail-protect: floor=0.030 k=4 want=2; burst2 k=8 want=3Pacing startup / estimator
Stage 4 changes the controller rather than tuning a cap:
burst_factoris removed from congestion-rate reduction; only trusted excesscongestiveloss above the erasure floor may lowercongestion_scale;Diagnostic log now includes:
delivered / wire_bw / rate / state / ready / floor / recent / cong / burst / scale / rttx86_64 regression confirms a 20 Mbps retained wire sample produces a 40 Mbps STARTUP rate and burst correlation alone leaves
scale ~= 1.0.Current validation
Build #74 (
704541270151759baa210daf45de689db8111782):make test && make; no failure reported yetProtocol v2 remains intentionally wire-incompatible with master. PR remains draft pending Stage-4 WAN validation.
Recommended Stage-4 WAN matrix
--fec 20:10 --fec-codec rlnc --rlnc-window 64 --adaptive-fecRLNC window rateandRLNC tail protect symbols=... have=... want=... added=...logs--fec 20:10 --fec-codec rs --adaptive-fec --enable-pacing--max-bandwidthunset/0startuprateabove retainedwire_bw(nominally 2x before any true congestion scale), not the old ~0.425x self-lockcong ~= 0,burstalone must not reducescale.Full design/status notes:
docs/ERASURE-AWARE-V2.md(Stage-4 WAN results should be added after live validation).