Repository navigation
fix(moq-net): whether drops cover a span is one lookup, not a walk of every run - #9020
Conversation
… every run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 6eed4f45f5ed538129fe508383af68634f43bf51
No blocker found. The coalesced index removes the reason-by-reason walk without changing the reason map. Recreated groups, stale reversal, expiry, and pool shedding all update the index through change_drops. Billing one extra range per reasoned run is conservative because the union can never have more runs than the reason map.
The differential proptest checks both lookups against the old walk. Static review; I did not rerun tests or independently measure the benchmark speedup.
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. It keeps a coalesced RangeSet next to drops and updates it in the one function that writes drops. That turns the O(drops) coverage walk into a single lookup and fixes the cause of the bench timeout without trimming the bench.
Reviewed changes
I reviewed the full diff to rs/moq-net/src/model/track.rs.
TrackState::dropped: a coalesced union of everydropskey, written only inchange_drops. A grep confirmschange_dropsholds the onlyinsert/removeonTrackState::drops; thedropsinresume.rsbelongs to a different struct.dropped_coverreplacesholes_cover:containingandcontaining_receivednow do oneRangeSet::geton the span start.never_produced: oneget_key_valuelookup. This is correct because equalHole::Skipruns always coalesce in theRangeMap, so a skip-only cover is always a single run.RUN_OVERHEAD: now also bills oneRange<u64>perdropsrun. That boundsdropped, which never has more runs thandrops.- Proptest: checks after every drop, skip, and forget that
droppedequals the union ofdrops, and that both lookups agree with the old walk.
claude-opus-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughTrackState now maintains a coalesced index of ranges covered by drops and includes its range entries in RUN_OVERHEAD accounting. Coverage checks use the index, while Merge Risk:
|

Problem
The nightly "Rust bench targets" job has timed out at 55 minutes since 11-15 (run 43909101837, and again today in run 44127032469).
moq-net/publisherstops printing atpublisher_covered_before_start/wake/8192, and the harness kills it after 600 silent seconds on each side of the pair. That is 20 of the 55 minutes. This is too much work, not a hang: building the fixture's 8192 drops took about 17 minutes locally.TrackState::containingasksholes_cover(0..time + 1)when no held group starts at or beforetime.holes_coverwalks every drop run in the span, so each call costs O(drops). A window resolves every unresolved range on each step, so the cost grows as ranges × drops on every step, and as roughly drops³ across the fixture. A relay hits the same cost when a subscription holds many ranges while its upstream gives up many separately-reasoned runs.Approach
TrackStatekeepsdropped, a coalescedRangeSetof every key indropsregardless of reason.change_dropsis the only place that writesdrops, and it updates both. "Drops cover this span" is now one lookup.never_producedasks the same question for skips only. Equal skip runs already coalesce in theRangeMap, so that is oneget_key_value. The old walk (holes_cover) is gone.RUN_OVERHEADnow also bills the coalesced run, at most one perdropsrun, so the pool still bounds what a peer fragmenting its drops can make the track hold.Impact
size_of::<Range<u64>>()× 2 more pool bytes per drop run.Validation
publisherbench (cargo bench -p moq-net --features fuzz --bench publisher), locally:wake/8192alone took 17m42s (wall time).wake/1throughwake/8192.<TrackState as Holdings>::containing, all of it in the drop walk.dropped_cover_matches_a_walk_of_the_drops, applies random drops (two errors), skips, and forgets. After each one it checks thatdroppedequals the union ofdrops, and that both lookups agree with the old walk on random spans.cargo test -p moq-net --all-featurespasses.just checkpasses.Caused by
containinganswer the no-group-held case withholes_cover(0..time + 1), a walk of every drop run belowtime. That turned each time-anchor resolution into an O(drops) call (found by check: the nightly bench's 600 s silence guard).Alternatives
containingbut notcontaining_received, which asks about spans starting past a held group.SKIPPEDsweep. This hides the cost a relay pays.Follow-ups
None.
Models
Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 6eed4f4
Base: origin/main at 2dcb5f8
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1eadb-10d4-7911-a362-a4bc3a36f130, round 1Score: 9/10,
Source inspection found no actionable defects: the coalesced index stays synchronized, preserves coverage behavior, and accounts for memory overhead, though tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none