Repository navigation
feat(network): Repair datagram loss with adaptive redundancy - #659
Open
tintinhamans wants to merge 6 commits into
Open
tintinhamans wants to merge 6 commits into
tintinhamans wants to merge 6 commits into
Conversation
tintinhamans
force-pushed
the
arctic/go/stack2/04-loss-repair
branch
4 times, most recently
from
October 26, 2026 15:39
d4161d5 to
8a49653
Compare
tintinhamans
force-pushed
the
arctic/go/stack2/04-loss-repair
branch
from
October 28, 2026 01:47
8a49653 to
6ecc67e
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.
Merge after #658.
With reliable GNS delivery a lost packet holds up every packet behind it until GNS resends it, and the match stalls for that whole time. More input delay does not help, because the stalls come from the resend wait.
send.modecan now be "datagram" (the default, "reliable" keeps the old behavior), which sends game packets as unreliable datagrams and lets the game layer repair loss.With
send.redundancy(true) a command that is not acked yet is repeated in the packets that go out anyway, as deep as the measured loss asks for. The depth is capped bysend.redundancy_burst_ms(150) and decays when the loss stops, andsend.redundancy_window_mssets how long a command waits before it is repeated. A repeating connection sends every frame (send.frames_per_packet_lossy). When the round trip climbs to twice its low while packets are lost, the loss comes from a full queue and the depth steps down instead of up. Withsend.fast_resend(true) an unacked command is resent after the smoothed round trip plus 2 x jitter (at most 400 ms) instead of 4 x jitter (at most 1 s). Redundant copies are counted once and acked again.All three are on by default, as in the tester build, and the service can turn each off. LAN uses the same defaults. Redundancy costs upload by design: it grows with the loss and is zero on a clean link. The traffic was not measured separately.
It also ports TheSuperHackers#3564. A repeat command in a packet with no command before it to repeat dereferenced a null pointer in release builds, and the last command stayed set after an unrecognized packet entry. The repeat is now skipped, and the last command is cleared after an unrecognized entry. No wire change.
Tested: builds x86 Release
z_generals. The full stack had 0 CRC mismatches in 3 player rig runs, n=1.