Repository navigation
test(net): check refusal state cheaply and benchmark its scaling - #7549
Conversation
Quest-Claim: e51727891dba1b61
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
All four cuts from #6987 have landed or land with this PR, so remove the quest and its link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 8cf1ccbdf34c3cc858be0244b42c11bd75e5bd8a.
No actionable bugs found. The direction is sound: the short test now checks progress, consumed-answer release, and resolved-range coalescing directly, while the benchmark retains the long refusal history and sweeps reader count. This is stronger than merely shortening the old loop, with no production API or wire change. The accessor stays test-only, and the existing nightly Rust bench selection includes the new workload.
Verification limits: static GitHub review of the diff, relevant fill/subscriber code and benchmark wiring; I did not run tests or reproduce the reported timings.
(Written by OpenAI)
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Refused-fill test made cheap and stronger:
a_fill_refused_group_by_group_stays_linearnow walks 32 refusals and asserts, per iteration, thatwanted()advances by one,answers()is 0 after the reader consumes the refusal, andresolved_runs()stays one coalesced run. - Test-only accessor:
Fill::resolved_runs()infill.rsispub(super)and#[cfg(all(test, feature = "async"))], mirroring the existinganswers(); no production or public API surface changes. - Nightly scaling benchmark:
track_fill_refusalbuilds one shared descending fill, sweeps readers[1, 8, 64]against refusals[16, 256, 4096], and keeps the old 100,000-refusal single-reader point. It is registered incriterion_group!, and the existing nightlymoq-net --bench '*'lane picks it up. - Quest completion: the finished
quest/m0/ci/test-cost-followups.mdand its README link are removed, with no dangling references left in the tree.
Verified locally: the focused test passes, cargo test -p moq-net --features async --benches --no-run compiles, and the 8-reader/256 and 64-reader/16 benchmark points run without panicking. The release criterion baseline in target/criterion shows roughly flat per-refusal and per-reader cost across the sweep.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Problem
Finishes
quest/m0/ci/test-cost-followups.mdby making the last cut. The remaining refused-fill test spent about two CPU seconds repeating 100,000 refusals to expose quadratic work, and it never asserted the retained state directly.The other three cuts already landed: recovery encode/reference-decode caching in moq-dev/moq#7074, tracing isolation in moq-dev/moq#7071, and the stats test budget in moq-dev/moq#7072. Current source and measurements confirm those fixes remain. This PR does not repeat them.
Approach
track_fill_refusal, alongside a 1/8/64-reader by 16/256/4096-refusal sweep. The existing nightlymoq-net --bench '*'lane runs it. This keeps the scaling coverage, including a cheap copy per refusal, without charging every merge-gate run for the long workload.quest/m0/ci/README.md. moq-dev/moq#7542 owns other fill/range implementation costs; none are duplicated here. Relay-auth trust, export-idle polling, and mesh-session performance stay out of scope.Measurements
Per-test-process user+system CPU, using the unchanged
wait4wrapper from moq-dev/moq#6914, underjust rs test, zero retries. One run before and after on the same shared host, with warm recovery caches:Only the refused-fill saving comes from this PR. All 182 selected tests passed before and after. The PRs above have the before/after measurements for the cuts that already landed.
Release benchmark:
cargo bench -p moq-net --bench track -- track_fill_refusal --warm-up-time 0.1 --measurement-time 0.2 --sample-size 10. One reader costs 19.36 us / 300.69 us / 4.773 ms / 115.76 ms at 16 / 256 / 4096 / 100,000 refusals. At 64 readers, 16 / 256 / 4096 refusals cost 0.835 / 13.315 / 212.31 ms. The cost per reader per refusal stays flat; production code is unchanged.Impact
#[cfg(all(test, feature = "async"))].Alternatives
Simply shrinking the old loop would weaken its only scaling guard. Direct state assertions plus a nightly benchmark keep both the behavior coverage and the performance coverage. Reimplementing the three landed cuts would duplicate existing work.
Checks
quest gate env BASH_ENV= just ci origin/main: passed, 9,300 Rust tests plus selected lint and repository checks, on source head500466f8c0c30531c8b470086b7bf93d9fe164bd.quest check --base origin/main: passed.rs/moq-net/src/model/track.rsauto-merged) and removing the quest, on head8cf1ccbdf3:cargo test -p moq-net --features async --lib a_fill_refused_group_by_group_stays_linear,cargo clippy -p moq-net --all-features --benches --tests -- -D warnings, andquest check --base origin/mainpass.Review
Local review skipped under the simple-review rule (moq-dev/quest#364): the change touches only tests, a benchmark, and quests. The only
src/changes are insidemod testinrs/moq-net/src/model/track.rsand a#[cfg(all(test, feature = "async"))]accessor inrs/moq-net/src/model/track/fill.rs. No online-reviewer threads were open on headc1550fa126. The skip applies to head8cf1ccbdf3, which adds only a conflict-free merge of origin/main and the quest removal. Online reviewers (CodeRabbit, Pullfrog) run once the PR is ready.Follow-ups
None. The Codex shell startup hook made mbx/Cargo fail with
Argument list too longinside the gate, which is an environment issue outside this repository; running withBASH_ENV=works around it.(Written by Claude Opus 5.5)