Skip to content

fix(bench): the moq-net track benches run every group to the end again - #9635

Merged
moq-bot[bot] merged 4 commits into
mainfrom
quest/m0/nightly/track-bench-fixtures
Nov 26, 2026
Merged

moq-bot[bot] merged 4 commits into
mainfrom
quest/m0/nightly/track-bench-fixtures

Conversation

@kixelated

@kixelated kixelated commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/nightly/track-bench-fixtures.md.

Problem

cargo bench -p moq-net --all-features --bench track -- --test panicked in three fixtures, and each panic stopped every group after it in the target:

  • track_empty_run/stale/*: 2 != 66. Still panics on main, and Nightly's measured run reports it on every night through 45667362304 (2026-11-25, head and paired base).
  • track_fill/1r/64 and track_range_filling/span_1/16: reproduce at 85ab682, but already pass on main. Nightly can't show that, because track_empty_run runs first and aborts the target.

Approach

For each one I decided whether the fixture or the code was wrong, and bisected it:

  • track_empty_run: the fixture was wrong. moq-dev/moq#9409 translated its Delay::max(HOUR) into Start::Live { min: HOUR, max: HOUR }. That is a join an hour behind the 4h live edge, so it starts at the 2h group. The faithful translation is min: None (what Start::within documents). This PR carries the maintainer's commit from moq-dev/moq#9547 unchanged, cherry-picked with its authorship. The run + 2 expectation is right: an empty group's successor that holds no frame leaves its reach unbounded (TrackState::reach), so only the run's last group, whose successor is stamped at 2h, is written off. That matches the fixture's doc comment.
  • track_fill and track_range_filling: the code was wrong, and main already fixed it. The benches are unchanged since they last passed.
    • track_fill broke at moq-dev/moq#9409 (b29b90b). A reader with 14 or more bounded time ranges below the feed's start stopped refreshing its fills' priority on update. It also never asked a range as a miss after the handler closed that range's time lookup.
    • track_range_filling broke at moq-dev/moq#9468 (ed1d0b0). The same many-range shape read none of the groups the handler filled.
    • Both were fixed by moq-dev/moq#9422 (35e6841), the miss allowance and fill-front rework. Bisected on both benches. I did not narrow down which of that PR's sub-changes did it.
  • Two unit tests guard the many-range shapes in the PR gate, so a repeat doesn't wait for Nightly's bench run. They are an_update_reaches_every_lookup_and_miss_below_the_start and many_ranges_below_the_start_read_every_filled_group, with 16 ranges each. The unit suite had only tried these with one or two ranges, and the old code broke from 14. Both fail at 85ab682 and pass on main. They take under 10 ms together.

Caused by

Impact

None. The changes are a bench fixture and two unit tests. Public API: none. Wire: none.

Validation

  • The full track target in test mode passes on the merged head: 325 cells, none panic. Before the fix, track_empty_run/stale/1/64 panicked 2 != 66 on the same tree.
  • Bisects ran with the bench as the oracle: the culprits and the fix commit listed above.
  • The two new unit tests fail at 85ab682 (priority 0 != 1, and [] read of 16 filled groups) and pass on main.
  • just ci passes on the merged head.

Alternatives

  • For track_empty_run, keeping min: HOUR and expecting 2 groups would drop the walk over the empty run, which is what the bench measures.
  • I could have added no unit tests and left these breaks to Nightly's bench run. The maintainer chose that for bench breaks themselves (2026-11-05). These were library regressions, though, and the unit suite had no shape that caught them.

Decisions

  • Close moq-dev/moq#9547 as superseded (maintainer): ✅ close it once this PR merges (rejected: keep it open). The coordinator closes it after the merge.
  • Add two unit tests for the many-range fill shapes (mine; review can undo): they put these library breaks in the PR gate instead of leaving them to Nightly's bench run.

Follow-ups

None. Nightly's other red jobs on 2026-11-25 (supplemental benchmarks' 55-minute timeout, Benchmark site) belong to the Nightly epic's triage.

Models

Size: M
Implementer: Claude Code, claude-opus-5-5, unknown

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 0e3fc34
  • Base: origin/main at 28d8eb8
  • Risk: low, The change only touches a deleted quest plan file, a bench fixture's `min` budget, and new unit tests inside the `mod test` block of `rs/moq-net/src/model/track.rs`, so nothing a consumer or peer relies on changes and a revert fully undoes it.
  • Classified: low by Claude Code, claude-haiku-5-5, low effort, session dc58b0b1-90e2-477c-8fb4-3c7445c36021
  • Risk file: bb7b1c0de60b
  • Local review: none, since the head is low risk

kixelated and others added 4 commits November 25, 2026 13:21
…#9409

#9409 translated this fixture's subscription-wide max delay into a live join
an hour behind the live edge, so the stale case joined at the 2h group and
handed out 2 groups instead of walking the run. A join with no lag limit is
the faithful translation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
track_fill and track_range_filling panicked on main after #9409 and #9468
broke fills for readers with 14 or more ranges below the feed's start;
#9422 fixed the library. These two unit tests reproduce both breaks at
85ab682 and pass on main, so the PR gate catches a repeat instead of
Nightly's bench run. Finishes quest/m0/nightly/track-bench-fixtures.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The moq-net track benches' empty-run and fill fixtures pass fix(bench): the moq-net track benches run every group to the end again Nov 26, 2026
@kixelated
kixelated marked this pull request as ready for review November 26, 2026 00:57
@kixelated
kixelated added this pull request to the merge queue Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The benchmark live range no longer uses the selected budget as its minimum delay; its maximum delay is unchanged. The track benchmark fixture investigation document was deleted. Two async tests were added for fills associated with time-based and disjoint subscription ranges below the feed start.

Merge Risk: Minimal · up to 0e3fc

This change fixes a benchmark fixture and adds regression tests, with no public API or wire behavior change. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names a fix to the moq-net track benchmarks, and the changeset edits the track_empty_run bench fixture (EmptyRun::new min delay) and adds unit tests in rs/moq-net/src/model/track.rs. The tit…
Description check Passed The description is specific and related to the changeset. It explains the track_empty_run fixture fix (min: None instead of min: HOUR), the cherry-picked maintainer commit, the two new unit tests for …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names a fix to the moq-net track benchmarks, and the changeset edits the track_empty_run bench fixture (EmptyRun::new min delay) and adds unit tests in rs/moq-net/src/model/track.rs. The title says the benches ran every group to the end again, which matches the stated fixture fix for the panic that stopped later groups in the target. The title is specific enough for a reader scanning history to see the main change.

Full details: Description check

Explanation

The description is specific and related to the changeset. It explains the track_empty_run fixture fix (min: None instead of min: HOUR), the cherry-picked maintainer commit, the two new unit tests for many-range fill shapes, the bisected culprit PRs, and the validation steps. It describes the deleted quest plan file and the one-line bench change, so it covers the changeset.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a37b114f-46f5-4b16-b3b2-5279e603d407
Commits

Reviewing files that changed from the base of the PR and between 7de1816 and 0e3fc34.

Files selected for processing: 3

  • quest/m0/nightly/track-bench-fixtures.md
  • rs/moq-net/benches/track.rs
  • rs/moq-net/src/model/track.rs
Files with no reviewable changes: 1

  • quest/m0/nightly/track-bench-fixtures.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2026
@moq-bot

moq-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

quest land watch: the merge queue removed this pull request at 0e3fc34 because its merge_group build failed (failed_checks).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

Queue / Queue (job) failure at step Check:

…::tests::egress::{closure#0}::{closure#1}>>, alloc::sync::Arc<tokio::runtime::scheduler::current_thread::Handle>>::{closure#0}>, core::task::poll::Poll<core::result::Result<(), moq_srt::error::Error>>>
      28: __rust_try
      29: std::panic::catch_unwind::<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future<core::pin::Pin<alloc::boxed::Box<moq_srt::server::tests::egress::{closure#0}::{closure#1}>>, alloc::sync::Arc<tokio::runtime::scheduler::current_thread::Handle>>::{closure#0}>, core::task::poll::Poll<core::result::Result<(), moq_srt::error::Error>>>
      30: tokio::runtime::task::harness::poll_future::<core::pin::Pin<alloc::boxed::Box<moq_srt::server::tests::egress::{closure#0}::{closure#1}>>, alloc::sync::Arc<tokio::runtime::scheduler::current_thread::Handle>>
      31: <tokio::runtime::task::harness::Harness<core::pin::Pin<alloc::boxed::Box<moq_srt::server::tests::egress::{closure#0}::{closure#1}>>, alloc::sync::Arc<tokio::runtime::scheduler::current_thread::Handle>>>::poll_inner
      32: <tokio::runtime::task::harness::Harness<core::pin::Pin<alloc::boxed::Box<moq_srt::server::tests::egress::{closure#0}::{closure#1}>>, alloc::sync::Arc<tokio::runtime::scheduler::current_thread::Handle>>>::poll
      33: tokio::runtime::task::raw::poll::<core::pin::Pin<alloc::boxed::Box<moq_srt::server::tests::egress::{closure#0}::{closure#1}>>, alloc::sync::Arc<tokio::runtime::scheduler::current_thread::Handle>>
      34: <tokio::runtime::task::raw::RawTask>::poll
      35: <tokio::runtime::task::LocalNotified<alloc::sync::Arc<tokio::runtime::scheduler::current_thread::Handle>>>::run
      36: <tokio::runtime::scheduler::current_thread::Context>::run_task::{closure#0}::{closure#0}
      37: <tokio::runtime::scheduler::current_thread::Context>::run_task::{closure#0}
      38: <tokio::runtime::scheduler::current_thread::Context>::enter::<(), <tokio::runtime::scheduler::current_thread::Context>::run_task::{closure#0}>
      39: <tokio::runtime::scheduler::current_thread::Context>::run_task
      40: <tokio::runtime::scheduler::current_thread::CoreGuard>::block_on::<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}
      41: <tokio::runtime::scheduler::current_thread::CoreGuard>::enter::<<tokio::runtime::scheduler::current_thread::CoreGuard>::block_on<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}, core::option::Option<()>>::{closure#0}
      42: <tokio::runtime::context::scoped::Scoped<tokio::runtime::scheduler::Context>>::set::<<tokio::runtime::scheduler::current_thread::CoreGuard>::enter<<tokio::runtime::scheduler::current_thread::CoreGuard>::block_on<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}, core::option::Option<()>>::{closure#0}, (alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core>, core::option::Option<()>)>
      43: tokio::runtime::context::set_scheduler::<(alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core>, core::option::Option<()>), <tokio::runtime::scheduler::current_thread::CoreGuard>::enter<<tokio::runtime::scheduler::current_thread::CoreGuard>::block_on<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}, core::option::Option<()>>::{closure#0}>::{closure#0}
      44: <std::thread::local::LocalKey<tokio::runtime::context::Context>>::try_with::<tokio::runtime::context::set_scheduler<(alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core>, core::option::Option<()>), <tokio::runtime::scheduler::current_thread::CoreGuard>::enter<<tokio::runtime::scheduler::current_thread::CoreGuard>::block_on<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}, core::option::Option<()>>::{closure#0}>::{closure#0}, (alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core>, core::option::Option<()>)>
      45: <std::thread::local::LocalKey<tokio::runtime::context::Context>>::with::<tokio::runtime::context::set_scheduler<(alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core>, core::option::Option<()>), <tokio::runtime::scheduler::current_thread::CoreGuard>::enter<<tokio::runtime::scheduler::current_thread::CoreGuard>::block_on<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}, core::option::Option<()>>::{closure#0}>::{closure#0}, (alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core>, core::option::Option<()>)>
      46: tokio::runtime::context::set_scheduler::<(alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core>, core::option::Option<()>), <tokio::runtime::scheduler::current_thread::CoreGuard>::enter<<tokio::runtime::scheduler::current_thread::CoreGuard>::block_on<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}, core::option::Option<()>>::{closure#0}>
      47: <tokio::runtime::scheduler::current_thread::CoreGuard>::enter::<<tokio::runtime::scheduler::current_thread::CoreGuard>::block_on<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}, core::option::Option<()>>
      48: <tokio::runtime::scheduler::current_thread::CoreGuard>::block_on::<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>
      49: <tokio::runtime::scheduler::current_thread::CurrentThread>::block_on::<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}
      50: tokio::runtime::context::runtime::enter_runtime::<<tokio::runtime::scheduler::current_thread::CurrentThread>::block_on<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>::{closure#0}, ()>
      51: <tokio::runtime::scheduler::current_thread::CurrentThread>::block_on::<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>
      52: <tokio::runtime::runtime::Runtime>::block_on_inner::<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>
      53: <tokio::runtime::runtime::Runtime>::block_on::<core::pin::Pin<&mut dyn core::future::future::Future<Output = ()>>>
      54: moq_srt::server::tests::a_stitched_replacement_keeps_the_srt_connection
      55: moq_srt::server::tests::a_stitched_replacement_keeps_the_srt_connection::{closure#0}
      56: <moq_srt::server::tests::a_stitched_replacement_keeps_the_srt_connection::{closure#0} as core::ops::function::FnOnce<()>>::call_once
      57: test::__rust_begin_short_backtrace::<core::result::Result<(), alloc::string::String>, fn() -> core::result::Result<(), alloc::string::String>>
      58: test::run_test::{closure#0}
      59: std::sys::backtrace::__rust_begin_short_backtrace::<test::run_test::{closure#1}, ()>
      60: <std::thread::lifecycle::spawn_unchecked<test::run_test::{closure#1}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
      61: <std::sys::thread::unix::Thread>::new::thread_start
      62: start_thread
      63: __clone3


    (test aborted with signal 6: SIGABRT)

warning: 1439/11589 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed
mbx[cache]: object cache: 0 hits, 99 misses, 74 bypassed; 0 B downloaded, 0 B uploaded, 593.7 MiB stored locally
mbx[cache]: 5m 41s session; 0s estimated compiler time avoided (summed across compilations)
mbx[cache]: bypass reasons: 74 unsupported-crate-type
mbx[cache]: Cargo artifact reuse and CI cache archive transfers are not included above
mbx[savings]: 1.1 TiB of target/ is an elaborate illusion. the disk is in on it.
error: recipe `test` failed on line 365 with exit code 100
error: recipe `test-changed` failed on line 118 with exit code 100
##[endgroup]
##[error]ci: test rs failed
ci: wall and CPU seconds per module
   190     355  check rs
   342    2288  test rs (failed)
   161     741  check rs_cross
     7      40  check biome
    65     103  check carla_bridge
    54      20  check markdown
    19      36  check gh
     0       0  check drill
     5       5  check quest
    13      52  check shell
     0       0  check large_files
     0       0  check text
     3       3  check coverage_tables
     2       0  check toml
     3       3  check nix
     1       0  check justfile
   532    3655  whole run
error: recipe `ci` failed on line 121 with exit code 100
##[error]Process completed with exit code 100.
##[group]Run actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
  name: cargo-timings
  path: target/cargo-timings/cargo-timing-*.html
  if-no-files-found: ignore
  retention-days: 14
  compression-level: 6
  overwrite: false
  include-hidden-files: false
  archive: true
env:
  BASE: 28d8eb84d640c2db6b516e1a1115c34400975787
  CHECK_FAIL_FAST: 1
  NEXTEST_TEST_THREADS: 24
  MBX_CACHE_LINKS: 1
  MBX_REMOTE_URL: 
##[endgroup]
With the provided path, there will be 5 files uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: cargo-timings.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 311898
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 71e71ebb141b79abfe5102f7f449b85fd10574c570548e7599b68b4b5e1f1a26
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 15076909000
Artifact cargo-timings has been successfully uploaded! Final size is 311898 bytes. Artifact ID is 15076909000
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/45732727750/artifacts/15076909000
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@88acf2bb50552c7c508cbac13e5f8c576b95b1de;id=__ff9fb38c-abcf-4a4d-83c9-7ce354213ae4.mbx]
##[end-action id=__ff9fb38c-abcf-4a4d-83c9-7ce354213ae4.mbx;outcome=skipped;conclusion=skipped;duration_ms=0]
Post job cleanup.
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git version
git version 2.56.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/fafad69b-0336-40b5-83c7-b4ae4e74e891' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/moq/moq
Removing SSH command configuration
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
A job completed hook has been configured by the self-hosted runner administrator
##[group]Run '/nix/store/ajk9j3ljl36w9dicih57gyvbl3v6m72q-ci-cache-gc.sh/bin/ci-cache-gc.sh'
shell: /nix/store/lfm00fnq66xfgbn099vqckabyl5jllz6-bash-interactive-5.3p20/bin/bash --noprofile --norc -e -o pipefail {0}
##[endgroup]
evicted 192 objects and 54 action results (620.4 MiB logical); 50.0 GiB logical remain
dropped 4 session event streams
evicted 0 objects and 0 action results (0 B logical); 50.0 GiB logical remain
Cleaning up orphan processes

(written by quest land watch)

@moq-bot
moq-bot Bot added this pull request to the merge queue Nov 26, 2026
@moq-bot

moq-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

claude, claude-opus-5-5, medium effort land fixer note:

The queue failure was moq-srt server::tests::a_stitched_replacement_keeps_the_srt_connection. It aborted because a roughly 100ms moq-mux jitter timer fired on the host clock while KIO_DENY_HOST_TIMERS=1 was set. This PR only changes moq-net tests and the track bench, so it doesn't touch that code path.

The test passed 30 times out of 30 on base with cargo nextest run --stress-count 30. just ci on a scratch merge of this PR with base also passed: all 11589 tests, that one included.

The test drives real SRT sockets but never calls kio::clock::host_time(), unlike the test next to it, a_caller_hanging_up_during_the_follow_ends_the_egress. That likely makes it timing-sensitive when the runner is under load. Requeued unchanged.

(written by claude, claude-opus-5-5, medium effort)

@moq-bot

moq-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

quest land watch: re-enqueued this pull request at 0e3fc34, at the back of the merge queue, unchanged, since the land fixer judged the failure flaky: moq-srt server::tests::a_stitched_replacement_keeps_the_srt_connection.

(written by quest land watch)

Merged via the queue into main with commit 348692a Nov 26, 2026
14 checks passed
@moq-bot
moq-bot Bot deleted the quest/m0/nightly/track-bench-fixtures branch November 26, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant