Repository navigation
perf(net): index sparse arrivals and retire shared gaps together - #6287
Conversation
Quest-Claim: 1c5188ad748fbbdf
Co-Authored-By: GPT-6 <noreply@openai.com>
|
Checkpoint pushed with the indexed ledger, successor-batched retirement, edge coverage, and nightly benchmark sweeps. At 4096 retained gaps, measured steady-state instructions fall 87.1% for a sparse read pair, 84.1% for individual expiry, and 94.9% for a full flush. Public API and wire impact: none. Keeping this draft for the explicit complexity decision: accept O(log gaps + retired entries) per shared successor (recommended), or require logarithmic reclamation of the complete retired batch and broaden the representation design. The quest preserves its original Goal pending that choice. Validation limits are recorded: 2918 moq-net tests pass; 7960 affected tests pass with the known CLI late-stats failure; the local gate cannot build the unchanged runner image under this host's namespace restriction. (Written by GPT-6) |
A shared verdict retires its gaps in O(log gaps + retired entries). Each retired entry is freed exactly once, so the batch is amortized optimal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
|
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 20 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # quest/m1/release-perf/README.md
# Conflicts: # quest/m1/release-perf/README.md
Problem
The live-arrival ledger moves and checks every retained run on each sparse arrival. Gap retirement repeatedly splits the per-reader delivery record even when many gaps share one successor's stale verdict. Both add accidental size-dependent work to the track and subscription-tail consumers.
Approach
track_sparse_expire, additional flush sizes, and profiling boundaries. Add age-index invariant and edge tests for demand reordering, split/merge/remove, leading runs, grace changes, steady individual expiry, and partial wall-clock batches.track_gap_flushas accepted, and this PR retiresquest/m1/release-perf/sparse-gaps.md.Benchmarks
Callgrind 3.27.1, Rust 1.98.1,
--profile profiling(fat LTO, line tables, symbols), re-run after merging b8bb6730b7. Base is thatorigin/mainwith this branch's benchmark file, so both builds run the identical fixture. One--bench --test --exactiteration collects only*read_pair,*Expiring*arrive, or*GapFlush*flush.track_sparse_read/timedtrack_sparse_read/timedtrack_sparse_read/timedtrack_sparse_read/untimedtrack_sparse_read/untimedtrack_sparse_read/untimedtrack_sparse_expiretrack_sparse_expiretrack_sparse_expiretrack_gap_flushtrack_gap_flushtrack_gap_flushAt 16 gaps, index maintenance adds 3.5 to 6% to a read pair and to expiry. These are steady-state counts: both builds warm the same initial cache-queue capacities before collection, and the expiring workload warms two arrivals because the eviction queue trails the arrival queue by one entry. Cold queue growth still occasionally copies O(cached groups) entries; this PR neither fixes that amortized allocation cost nor claims it is logarithmic per operation.
Impact
Alternatives
A vector plus a cached earliest deadline avoids a scan while nothing is due, but still scans every younger gap when deadlines expire singly. The ordered age index handles that workload without a full walk.
Validation
origin/mainwith no textual conflicts. Main's newLedger::end(moq-dev/moq#6111) still read the old vector, so the merge commit ports it to the map.just rs test -p moq-netafter the merge: 3,007 passed, 11 skipped.just check origin/main: Rust lint/docs/wasm and quest pass; the unchanged Nix runner-image build fails because this host denies/proc/self/uid_mapduringsystemd-repart.quest check --base origin/main --branch quest/m1/release-perf/sparse-gapspasses.Follow-ups
None new. The
moq-clilate-stats integration failure seen in the first round reproduces on base (moq-dev/moq#6281) and is unrelated.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)