Repository navigation
Remember the gaps inside frames for 10 s, and add two clumped benchmark networks (851-4477) - #1517
Merged
Merged
Conversation
N8 and N9 are the lossy network with a 4 ms and a 10 ms release tick: a packet leaves the link at the next tick, so packets arrive in clumps as they do behind Wi-Fi or a busy receiver. Both the Rust simulation and the Tier 1 relay model them, and the nightly matrix plan runs them. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The viewer's wait before it asks for a frame's tail followed the longest recent gap between a frame's packets, but forgot it within a second. On a link that delivers in clumps the gap to the next clump then passed for a lost tail, the viewer asked for packets still on their way, and the host took the requests for heavy loss and cut its estimate. Co-Authored-By: Claude Fable 5.2 <[email protected]>
… (851-4477) Review fixes: the 10 s window only dropped old gaps when a new one was pushed, so a quiet stream kept a stale gap; and the Rust network model divided by a zero tick. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…eir share of fewer resends (851-4477) With the gap memory the slow-link sim resends 19–25 packets instead of 29–35, and the one request per seed for a packet still on the link, the same as on main, became more than 5% of them. The test now bounds that count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…te ticks, and write down the jitter trade-off (851-4477) From the code review: - ImpairedTransport's round trip leaves out the tick's hold; it now adds half a tick each way. - A tick too small to count in nanoseconds (Swift) or too large to represent (Rust) leaves arrivals as they are. - The README gives the gap memory's cost on a jittery link with no queue: an estimate about 7% lower (26–29 against 30–31 Mbit/s) with resends down from 19–45 to 4–7, and why. - Docs and help name N0–N9. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…helper, and guard the Swift tick (851-4477) From the review of 081533e: - One stall inside a frame set the tail wait for 10 s; each gap now counts at most twice the round trip (or eight packet paces). Clump gaps are within that; the clumped and jitter sim results are unchanged. - The jitter test's floor is 26 Mbit/s, just under the new measured low. - The Swift model leaves arrivals as they are for a tick too small, too large or infinite, and checks for overflow. - One release_tick() helper for the sim and ImpairedTransport; the sim's next tick falls back when it doesn't fit. - The ScreenSharing README says matrix is N0–N7 and all adds N8 and N9. Co-Authored-By: Claude Opus 5.5 <[email protected]>
pondorasti
force-pushed
the
alexandru/851-4477-clumped-delivery
branch
from
November 28, 2026 06:17
081533e to
1516759
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.
Part of 851-4477 (screen sharing freezes briefly while scrolling on a lossy network). This is the clumped-delivery part (Part A). #1510 and #1515 covered the slow-link start and the 50 Mbit/s collapse.
What was wrong
Some links deliver in clumps: Wi-Fi, or a busy receiver, holds packets and lets them out together. The viewer waits a little for a frame's tail (1.5 × the longest recent gap between a frame's packets). That gap faded within about 0.7 s, and most frames are a few packets inside one clump, so they show no gap. By the next large frame the wait was back at 1 ms. The gap to the next clump then passed for a lost tail, and the viewer asked for the packets it expected by then, 28 at a time, every millisecond.
The host resent them and took the requests for loss. In the sim (N3 with a 4 ms or 10 ms release tick), main resent 215–460 packets that were still on their way. The loss window read 16–19% and cut the estimate, which then sat near 11 Mbit/s on a 1 Gbit/s link in 2 of 3 seeds, with captures refused.
#1515 doesn't cover this. A clump holds a packet longer than half of N3's 2 ms round trip, so it isn't recognised as a late original.
What changes
netsim) and the Tier 1 relay (BenchNetworkModel) model them the same way, and the nightly matrix runs them. The impaired transport's round trip includes half a tick each way. A tick too small or too large to represent leaves arrivals unchanged.What the earlier plan had that this drops
Lab (tamale, same slot)
Main plus only the networks commit (6aa7333) against this branch (081533e).
Sums over the repetitions, main → this PR:
Tests
a_link_that_delivers_in_clumps_isnt_asked_for_packets_still_on_their_waycovers N8 and N9 with 3 seeds each: at most 3 early requests, at most 20 resends, no refused captures, and the estimate stays at or above 100 Mbit/s. It fails on main.Two existing assertions changed:
a_slow_link_doesnt_ask_again_for_packets_still_on_their_wayrequired early requests to be at most 5% of resends. The early count is the same as on main (1 per seed), but resends dropped from 29–35 to 19–25, so 1 of 19 failed the ratio. It now requires at most 1 early request.jitter_without_a_queue_doesnt_pull_the_estimate_downis loosened: one seed over 30 Mbit/s became five seeds over 26, just under the new measured low (26.4). On N3 with 1 ms jitter the estimate's low is 26–29 Mbit/s against 30–31 on main, while resends drop from 19–45 to 4–7. Main's early requests cut the jitter-delayed packets out of each frame's first-time bytes, which shortened the frame's spread and raised its rate sample. Now they count where they arrived. The stream needs 2.9 Mbit/s, and admission never refuses. The crate README has these numbers.Run locally (M1 Pro, with timeouts):
cargo test -p codevisor-media(83 unit, 65 sim, 6 session tests), plus clippy.ScreenSharingV2Tests206,ScreenSharingBenchTests100,CodevisorBenchTests61, plusswift:format:checkandswift:lint.Code review
Four findings:
Your review at 081533e.
NetworkConditions::release_tick()is used by both the sim andImpairedTransport::rtt().matrixis N0–N7 andalladds N8 and N9.matrix-v2stays. Baselines are looked up per cell (system, scene, network) from nightlies of the same tier and method, not by plan name. A cell with no nightlies has no reference, so the gate doesn't judge it except for errors;BenchRegressionGateTestscovers that. The results table shows "–" against nightlies until they exist, and the existing cells' baselines are unchanged.Left
🤖 Generated with Claude Code