Repository navigation
fix(net): subscribe progress, wakeup, and cache-invariant fixes from the subscribe/fetch audit - #9564
Conversation
Quest-Claim: 5e678c809f9b0f08
A SUBSCRIBE_UPDATE the publisher had no credit for returned the whole serve loop Pending, so it read no responses, served no fetches or fills, and never cancelled or lingered out: a publisher blocked writing responses while it read none of ours deadlocked the Subscribe Stream. The loop now runs every arm while the update flushes, holding back only the next demand or fill change until it is on the wire, so withholding credit still costs one update's buffer. A cancel sends no update and goes at once, resetting rather than FINning a stream whose update is still unsent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tuned wider before its answer is probed An open lite-07 range takes in every group past its time, so its empty answer proves the same as a bounded range's: record it, or a reader waiting on that time stalls once a group past it arrives, with no probe asked since the demand range starts there. A live join range retuned wider before SUBSCRIBE_START may still be answered under the narrower max asked until then, so it answers a reader's join only under both, as an answered range already does; otherwise the join goes out on a probe of its own. Rust and JS alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FeedFetches::poll took the ready queue, then registered its waiter against whatever the queue held by then: a held fetch readied in between, as its waker fires on another thread, sat queued with nothing to poll it. Drain until the queue is seen empty, which alone registers the waiter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A group stream whose group was still arriving on another stream waited unread for that copy to settle while still counted as being read, so its subscription's tail stayed active, pinning the Settle and a Recovery for as long as that other stream stalled. It now parks while it waits, as a stream waiting on a fill's head already does, and holds the end again once it takes the group from a copy that failed. JS gains the same park on its tail's counted stream; an excuse made while parked applies once it resumes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he serving route A switch leaves each gap group a replaced copy still holds to that copy and asks the serving route only from the lowest one none holds, judged once. If the copy's cache then evicted such a group before the reader took it, nothing asked the serving route for it again, so the reader never got it. Each copy left a group now records its track's eviction count, and an eviction since re-arms the backfill, in Rust and JS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cursor forgot a skipped run once no cached group was left in it, though the pool records a debt-evicted group as lost so readers ask for it again. A widened budget then owed it or not depending on whether the cache still held some group in the run. Keep a run while it holds a lost group too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… on it A received copy places a time start inside an open group only once a frame past the time lands or the group ends, which changes the group, not the track. Reads parked on the track for that start (`poll_start`, arrival and ordered reads) now also watch the group held at or before each waiting time, in Rust and JS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The aggregate kept every `Oldest..=end` range apart, so readers ending at different groups each sent a range upstream though the furthest takes in the rest. The incremental union and the full fold now keep only the furthest end, and only it moves the union. Rust and JS alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RangeFills kept a run no fill owed asked while a stream of it was still arriving, whether or not anyone still read the track, so a stalled stream kept the fills non-empty: the upstream SUBSCRIBE stayed open asking for it (and for the demand it held), and the copy never started its idle linger. The draining runs now follow `read`, as recoveries already did. JS also re-polls its fills when the demand changes, so it sees the last reader leave. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it again get its group Record::retire bounded a reader's record by folding each stretch through the gaps its moved ranges left into one handed-out and reported (Settled) run. The gaps were never served nor reported, so ranges that later covered them again never got their groups: the cursor skipped them as handed out, the publisher skipped them as told, and drop_unserved never named them, leaving a lite-07 subscriber waiting on keys the wire never hears of. Retirement now forgets the record's runs in such a stretch outside the ranges, above the handed-out prefix, so ranges covering it again ask for it afresh as a new reader would: the gaps are served, and a group handed out there before may be handed out again. The record stays bounded by its ranges as before. The debt fold is unchanged: it passes only final keys and never a gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FinishedServe::probe skipped a time start at u64::MAX, which no range can ask, without refusing it, so its readers waited for good. They are failed now, as a refused probe's are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The demand change an update held back is applied from the current aggregate once the update flushes, so it counts that aggregate as seen: reported again, it would restart a finishing tail's grace for nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… passes A bounded ordered read waiting on a fill for a group's head parked only on that fill, so a group the clock alone made stale held the read until the fill answered, which it may never do. It now judges the head as the arrival read's `expire_heads` does, parking on a group landing above and the wall deadline, and passes the group as stale once the budget gives it up. JS already wakes for the deadline; its test guards the same case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…me probes leave room for joins `fit_after` takes one probe past a full budget, which fits only while the budget is half a message; a SUBSCRIBE whose fields take more than half left it overflowing MAX_MESSAGE_SIZE. The budget now leaves room for one range past it. The time-start probes went before every live join's, so a flood of time starts the copy's readers wait on kept each join's probe out of every message. The two kinds now take turns. Rust and JS alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every demand range an update added made the copy's declared feed start pending until its SUBSCRIBE_START, a round trip that held whatever waits on the resolved start and restarted the grace of the gaps above it twice. A range that can't start below the start the feed already serves, from a time at or past it, a join placed there, or the latest group, now leaves the declaration standing. Rust and JS alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What a reader got depended on what the cache still held once it evicted a live group: - A group's reach and wall clock skipped an evicted successor for the next cached one, so an unread group below it looked fresher and was delivered. - A local or refused copy with no handler to look a time up placed a time start at an older group the cache kept, though an evicted group between them started at or before the time. - A live join measured the edge from the newest group held, so once a finished track's newest group was evicted it started lower. The track now records each live group it lets go of while it is still the lowest between two cached groups (one per cached group at most, billed in CACHE_OVERHEAD), with its arrival and start, and the newest frame of any evicted group. Reach, supersession, time starts, and the join edge read those. Rust and JS change together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…let go of Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ress-fixes # Conflicts: # js/net/src/track.ts
…y-start Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Forgetting an expired or shed skip on a local track made its keys read like evicted groups, so an ordered read across two still-cached groups found a gap the publisher never left. Keep the dropped run directly above each group a local track still caches, from both the expiry scan and debt shedding, and re-arm its expiry once that group leaves. Each cached group keeps at most one run, so the cache bounds what stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An ended track's sweep ages idle groups out by aborting them in place, since it holds only a read guard, and the successor lookups skipped every aborted slot. A group whose successor went that way before any reader recorded it was judged by a later group, or by none, so it stayed fresh past its budget. Count a live-feed successor freed only by cache policy as still bounding the group before it, as an evicted one does, and have watch_abort re-select only on a failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reverse scan for a join edge expired in place stopped at the first shown group, so an empty final group still cached hid the newest group with a frame and a one-second join started one group early. Scan held and released live groups alike down to the first with a timestamp. Document the one-departure-per-gap bound on TrackState::departed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#9529 serves held groups newest first. The draining-copy backfill tests now peek the newest group before the eviction and backfill groups 1 and 2; the expired-in-place tests read ascending to hold the older groups; the JS reach tests expect newest-first order. Each still fails without its fix. Refresh the resume model's state counts after merging the Evict action onto the Group Order model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
quest land watch: the merge queue removed this pull request at 035bf9e because its 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.
…me.rs:436:5
|
436 | .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |left| left.checked_sub(size))
| ^^^^^^^^^^^^
|
help: replace the use of the deprecated method
|
436 - .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |left| left.checked_sub(size))
436 + .try_update(Ordering::Relaxed, Ordering::Relaxed, |left| left.checked_sub(size))
|
warning: use of deprecated method `std::sync::atomic::Atomic::<u64>::fetch_update`: renamed to `try_update` for consistency
--> rs/moq-net/src/model/group/content.rs:153:5
|
153 | .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |total| total.checked_sub(charge))
| ^^^^^^^^^^^^
|
help: replace the use of the deprecated method
|
153 - .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |total| total.checked_sub(charge))
153 + .try_update(Ordering::Relaxed, Ordering::Relaxed, |total| total.checked_sub(charge))
|
warning: use of deprecated method `std::sync::atomic::Atomic::<usize>::fetch_update`: renamed to `try_update` for consistency
--> rs/moq-net/src/session.rs:1250:5
|
1250 | .fetch_update(Ordering::AcqRel, Ordering::Acquire, |live| {
| ^^^^^^^^^^^^
|
help: replace the use of the deprecated method
|
1250 - .fetch_update(Ordering::AcqRel, Ordering::Acquire, |live| {
1250 + .try_update(Ordering::AcqRel, Ordering::Acquire, |live| {
|
warning: use of deprecated method `std::sync::atomic::Atomic::<u64>::fetch_update`: renamed to `try_update` for consistency
--> rs/moq-net/src/transport/boxed.rs:161:5
|
161 | .fetch_update(Ordering::AcqRel, Ordering::Acquire, |paused| {
| ^^^^^^^^^^^^
|
help: replace the use of the deprecated method
|
161 - .fetch_update(Ordering::AcqRel, Ordering::Acquire, |paused| {
161 + .try_update(Ordering::AcqRel, Ordering::Acquire, |paused| {
|
mbx[progress]: 15s elapsed; 0 hits, 0 misses, 0 bypassed, 0 not looked up; ~0s compiler work saved
warning: `moq-net` (lib) generated 9 warnings (run `cargo fix --lib -p moq-net` to apply 9 suggestions)
Checking qmux v0.7.0 (/var/cache/github-runner-work/moq/moq/rs/qmux)
mbx[progress]: 30s elapsed; 0 hits, 1 misses, 0 bypassed, 0 not looked up; ~0s compiler work saved
Checking moq-tokio v0.19.23 (/var/cache/github-runner-work/moq/moq/rs/moq-tokio)
mbx[progress]: 45s elapsed; 0 hits, 2 misses, 0 bypassed, 0 not looked up; ~0s compiler work saved
mbx[progress]: 1m elapsed; 0 hits, 2 misses, 0 bypassed, 0 not looked up; ~0s compiler work saved
Finished `dev` profile [unoptimized] target(s) in 1m 02s
mbx[cache]: object cache: 0 hits, 3 misses; 0 B downloaded, 0 B uploaded, 20.1 MiB stored locally
mbx[cache]: 1m 4s session; 0s estimated compiler time avoided (summed across compilations)
mbx[cache]: Cargo artifact reuse and CI cache archive transfers are not included above
mbx[savings]: 2.9 TiB logical of target/ was waiting for checkouts that are never coming back. it has stopped waiting.
##[endgroup]
##[group]test rs
sh/rs/select.sh test "$LIST"
rs: selecting hang libmoq moq-archive moq-audio moq-bench moq-boy moq-cli moq-e2ee moq-ffi moq-gst moq-hls moq-interop moq-json moq-loc moq-mux moq-net moq-net-tests moq-relay moq-rtmp moq-rtsp moq-srt moq-stats moq-tokio moq-transcode moq-uring moq-video moq-webrtc qmux
KIO_DENY_HOST_TIMERS=1 CARGO_BUILD_WARNINGS=deny RUSTC_WORKSPACE_WRAPPER='/nix/store/jqx7yhf9hnxfi9lgb1bfl608xyjq57jm-rust-minimal-1.98.1/bin/clippy-driver' bash sh/rs/nextest.sh cargo nextest run --locked --tests "$@"
Compiling moq-net v0.3.10 (/var/cache/github-runner-work/moq/moq/rs/moq-net)
error: recipe `test-changed` was terminated on line 118 by signal 15
##[endgroup]
error: recipe `test` was terminated on line 365 by signal 15
ci: wall and CPU seconds per module
182 306 check rs
7 0 test rs (cancelled)
189 507 check rs_cross (failed)
9 42 check biome
101 437 check js
23 101 test js
6 7 check dead_code
6 9 check audio_quality
44 55 check carla_bridge (cancelled)
189 1468 whole run
error: recipe `ci` failed on line 121 with exit code 101
##[group]check carla_bridge
cd bridge && cargo fmt --check
cd bridge && CARGO_BUILD_WARNINGS=deny RUSTC_WORKSPACE_WRAPPER='/nix/store/jqx7yhf9hnxfi9lgb1bfl608xyjq57jm-rust-minimal-1.98.1/bin/clippy-driver' bash ../../../sh/local.sh cargo test --locked
Compiling moq-net v0.3.10 (/var/cache/github-runner-work/moq/moq/rs/moq-net)
mbx[progress]: 15s elapsed; 0 hits, 0 misses, 0 bypassed, 0 not looked up; ~0s compiler work saved
Compiling moq-json v0.5.8 (/var/cache/github-runner-work/moq/moq/rs/moq-json)
Compiling moq-loc v0.2.19 (/var/cache/github-runner-work/moq/moq/rs/moq-loc)
Compiling hang v0.21.11 (/var/cache/github-runner-work/moq/moq/rs/hang)
Compiling moq-mux v0.10.11 (/var/cache/github-runner-work/moq/moq/rs/moq-mux)
Compiling moq-video v0.1.10 (/var/cache/github-runner-work/moq/moq/rs/moq-video)
Compiling moq-carla-bridge v0.1.0 (/var/cache/github-runner-work/moq/moq/demo/carla/bridge)
mbx[warning]: result was not stored: absolute path has no stable cache mapping: /var/cache/github-runner-work/moq/moq/clippy.toml
Finished `test` profile [unoptimized] target(s) in 29.13s
Running unittests src/lib.rs (target/debug/deps/carla_bridge-e08bd1115192e3be)
running 16 tests
test protocol::tests::events_match_the_shared_vectors ... ok
test protocol::tests::requests_match_the_shared_vectors ... ok
test protocol::tests::rejects_malformed_messages ... ok
test stream::tests::a_rendition_never_encodes_an_instant_twice ... ok
test stream::tests::a_lost_packet_drops_its_rendition_until_the_next_idr ... ok
test stream::tests::closing_the_session_parks_the_cameras ... ok
test stream::tests::losing_the_camera_falls_back_to_one_that_still_covers ... ok
test stream::tests::nothing_renders_without_demand ... ok
test source::tests::every_camera_of_a_stream_renders_on_one_device ... ok
test stream::tests::renders_the_smallest_camera_covering_the_largest_demand ... ok
test stream::tests::pictures_from_before_a_switch_are_not_encoded ... ok
test stream::tests::resuming_and_switching_force_idrs_once ... ok
test source::tests::a_picture_nobody_encodes_returns_its_slot ... ok
test server::tests::a_superseded_connection_changes_nothing ... ok
test tests::a_live_bridge_keeps_its_socket ... ok
test tests::a_stale_socket_is_replaced ... ok
test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/gpu.rs (target/debug/deps/gpu-fec4025a42a00da4)
running 1 test
test gpu_video_reaches_the_worker ... ignored, needs a Linux NVIDIA GPU; run by `just carla bridge-gpu`
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests carla_bridge
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
mbx[cache]: object cache: 0 hits, 6 misses, 3 not looked up, 2 bypassed; 0 B downloaded, 0 B uploaded, 251.1 MiB stored locally
mbx[cache]: 29.31s session; 0s estimated compiler time avoided (summed across compilations)
mbx[cache]: 3 compilations had no usable prior inputs or matching prediction for a lookup
mbx[cache]: bypass reasons: 1 rustdoc, 1 unsupported-crate-type
mbx[cache]: Cargo artifact reuse and CI cache archive transfers are not included above
mbx[savings]: 1.1 TiB of outputs materialized without a copy. the copy machine stays off.
cd bridge && RUSTDOCFLAGS="-D warnings" bash ../../../sh/local.sh cargo doc --locked --no-deps
Checking moq-net v0.3.10 (/var/cache/github-runner-work/moq/moq/rs/moq-net)
Checking moq-json v0.5.8 (/var/cache/github-runner-work/moq/moq/rs/moq-json)
Checking moq-loc v0.2.19 (/var/cache/github-runner-work/moq/moq/rs/moq-loc)
Checking hang v0.21.11 (/var/cache/github-runner-work/moq/moq/rs/hang)
Checking moq-mux v0.10.11 (/var/cache/github-runner-work/moq/moq/rs/moq-mux)
Checking moq-video v0.1.10 (/var/cache/github-runner-work/moq/moq/rs/moq-video)
error: recipe `bridge-check` was terminated on line 97 by signal 15
##[endgroup]
##[error]ci: check rs_cross failed
##[error]Process completed with exit code 101.
##[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: bc6157bd683ca1c9b34bb8f0a1b77695170f4237
CHECK_FAIL_FAST: 1
NEXTEST_TEST_THREADS: 24
MBX_CACHE_LINKS: 1
MBX_REMOTE_URL:
##[endgroup]
With the provided path, there will be 2 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 140523
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is d64baf64e85225d4424d40d41ea4f9f63afa118334b9bdbdc0e6de178006a625
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 15067447616
Artifact cargo-timings has been successfully uploaded! Final size is 140523 bytes. Artifact ID is 15067447616
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/45711371092/artifacts/15067447616
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@88acf2bb50552c7c508cbac13e5f8c576b95b1de;id=__b37a4fb4-9cf5-4eaf-8b3a-f417cc9e7b1c.mbx]
##[end-action id=__b37a4fb4-9cf5-4eaf-8b3a-f417cc9e7b1c.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/3aeb293d-96e8-4179-a796-63d817ab17e4' 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 19 objects and 1 action results (428.5 MiB logical); 49.9 GiB logical remain
dropped 6 session event streams
Cleaning up orphan processes
(written by quest land watch) |
|
claude, claude-opus-5-5, medium effort land fixer note:
(written by claude, claude-opus-5-5, medium effort) |
|
quest land watch: armed auto-merge on this pull request at f8298c4, so it joins the back of the merge queue once its required checks pass, with the land fixer's fix ( (written by quest land watch) |
…ld it Record::retire forgets what ranges moved past its limit left behind, so ranges holding a group again may hand it out a second time, as the maintainer decided in #9564 (S4). The with_range and update docs in Rust and JS promised never twice; they now say once while the ranges hold it. Both resume models allow a re-hand-out only after a range edit left the group outside the ranges, and keep the seed 444444444 shrunk case as a regression. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Completes quest/m1/subscribe-progress-fixes.md: the non-wire half of the 2026-11-24
moq-netsubscribe/fetch audit. Each item was first reproduced onmain(7d831cf4cd) by a deterministic mocked-time test that fails without its fix; items that did not reproduce are dropped below with the evidence.Summary
Fixed (Rust test / JS test):
end: None) answered with no start now places its time:report_startscounted only bounded ranges as reaching it, soprobes()never asked again and the reader waited forever. Both publishers answer an open range empty only once the track ended. (an_open_range_answered_empty_places_its_time/ updateda lite-07 range answered empty is reported only for a range reaching its time)asked.min(now)like the answered branch. (a_join_range_retuned_wider_before_its_answer_is_probed/a join range retuned wider before its answer is probed)Record::retireforgets the unserved stretches it retires (newDelivered::remove) instead of marking them delivered andSettled, so a range covering them again is served.Record::foldneeded no change: it only passes served or reported keys. (lite07_a_range_added_back_gets_the_gaps_left_behind,a_reader_hopping_back_gets_the_gaps_it_left; JS has no record retirement)ServeLoop::pollkeeps reading responses, serving fetches and fills, unparking, and cancelling while a SUBSCRIBE_UPDATE waits on credit; only changes that would buffer another update are deferred and applied once the flush completes. Cancel andfinish_subreset rather than FIN a stream with an unsent update. (an_update_waiting_on_credit_still_reads_and_cancels, Lite06 and Lite07; JS reads responses in a separate task)finish(), orfinish_atthat places a waiting time start now wakes its track readers (TrackState::watch_placesovergroup::Handle::poll_past). (a_frame_or_end_placing_a_time_start_wakes_its_reads/track: a frame or end placing a time start wakes its reads)TrackState::poll_head_stale, split out ofexpire_heads) and gives the head up past its budget. Whenever its walk finds no later group, on an open feed or an ended one, it now expires the heads it passed as stale, so a bounded read's last headless group can't hold its end. A head written off there is counted once. (an_ordered_read_gives_up_a_head_still_asked_past_its_budget,a_bounded_ordered_read_ends_past_its_last_head_gone_stale/fill: a %s read gives up a head still asked past its budget; JS's ordered walk withdraws a passed head through#stoppedReading)Open::Duplicateparks itsReadingwhile it waits on the other copy and resumes if it takes the group, so the tail settles. JSCountedgainspark()/resume(). (extendeda_duplicate_of_an_arriving_copy_waits_for_it_to_settle/a duplicate wait does not hold the end,a parked stream holds nothing, and an excuse while parked applies once it resumes)FinishedServe::probe) A time start atu64::MAXis refused withNotFoundrather than skipped. (a_finished_copy_refuses_a_time_start_at_the_last_key)backfill_gapswhen its cache evicts any (evicted_groupscounter). A walk an edit queues for its own ranges keeps the watches it does not renew, and a re-arm replaces such a walk with one over the whole route. (a_group_a_draining_copy_loses_is_backfilled,a_range_added_above_the_resume_point_keeps_the_drain_watched/a group a draining copy loses is backfilled; JS always walks the whole route; modeled byResumeReader.tla's newEvictaction andEvict.cfg, which failsCleanEndIsCompletewithReArm = FALSE)RangeFillsdrains only while someone reads the track, so the upstream SUBSCRIBE closes andIDLE_LINGERruns; JSRangeFills.changedalso wakes on demand. (a_drained_run_goes_once_nobody_reads/range fills: a drained run goes once nobody reads)Pending. (a_range_added_past_the_feed_start_keeps_it_declared/ same)fit_afterkeeps room for one worst-case range so the probe past a full budget never overflowsMAX_MESSAGE_SIZE, andwanted_probesalternates time and join probes so joins are not starved. (a_range_past_a_full_budget_fits_the_message,time_probes_leave_room_for_a_join/ JS twins)FeedFetches::polldrains until it sees the queue empty, which also registers the waiter. (a_feed_fetch_readied_during_a_drain_is_not_lost; no JS counterpart)Oldest..=aandOldest..=bkeep only the furthest end, incrementally and in the fold. (ranges_from_the_oldest_keep_only_the_furthest_end/ same)Local/Refusedtime start lands at an evicted group between cached ones rather than an older cached group: the track remembers the lowest evicted live group between each cached pair (bounded by the cache, counted inCACHE_OVERHEAD). (a_local_time_start_ignores_an_older_group_kept_past_an_evicted_one/ same)a_join_after_the_end_measures_an_evicted_edge/ same)Gapappears between cached groups. (a_local_skip_between_held_groups_outlives_its_expiry,paying_debt_keeps_a_local_skip_between_held_groups/a local skip between held groups outlives its expiry)successor()stops at an evicted successor, and counts one a closed track aged out in place (not failed) as still bounding the group before it;watch_abortre-picks only when the picked group failed. (an_evicted_successor_still_bounds_the_reach/ same,an_ended_track_judges_by_a_successor_it_expired_in_place)a finished copy answers a time only once placed, Rust mirrorlite07_a_finished_copy_answers_a_time_only_once_placed, which already passed)a_widening_asks_again_for_a_lost_stale_skip; JS has no debt eviction)Dropped, did not reproduce:
Cursor::poll_time_startlocalDuration::MAX: a local track places any time once it holds a group, and every way out (group, skip, drop, finish, abort) changes the track and wakes the read; four probes all woke.Recover::pollonStalled/Closed,poll_fetchDuration::MAX: a staged copy lives only while its query is in flight and is dropped (waking the read) right after the front's step; waits are bounded by the reader's budget, and an unbounded fetch on a track with no max age waits the same with or without a front (a_short_group_waits_for_a_staged_replacement,a_pending_recovery_expires_within_the_readers_windowalready cover it).Fronton transientUnroutable: deliberate since moq-dev/moq#8881 (wait for the route table, not a timer);an_upstream_flapping_faster_than_its_news_strands_no_readerpins it.poll_peek_group), and the only pre-read fill ask (ask_unproven) is never reached by an ordered resumed read. Thetake_withdrawnhalf belongs toquest/m3/widened-front-reader-asks-stale-again.md(moq-dev/moq#9437 closed unmerged).None of the in-flight moq-dev/moq#9529, moq-dev/moq#9530, or moq-dev/moq#9546 fixes any item; the branch merges cleanly with each head, except an expected textual conflict beside
prune_skippedwith #9529.Choices made, for review:
u64::MAXtime start fails withNotFound(always past the copy's end).reaches()ignores an absolute end's frame where Rust counts it; left alone because the JS subscriber only sends time ends, so the branch is unreachable.Decisions
Decided 2026-11-24 (maintainer, comment):
track::Subscribermoving its ranges past the record's limit and back may get groups it already had (rejected: (B) a real SUBSCRIBE_DROP per retired gap; (C) main's fabricatedSettled).Gap, as for any forgotten history (rejected: (B) keep that run too, one more run per track).Decided 2026-11-24 (maintainer, comment):
Decided 2026-11-25 (maintainer, in
/quest-run, on5b7d475e4d):a_sequence_keyed_join_measures_past_a_cached_empty_group, failing without it); JS has no such scan, since its cache records every evicted group through#departand itsstampedscan already skips frameless groups (rejected: (B) accept it withquest review --accept; (C) drop the PR).TrackState::departed(rejected: (B) keep every departure a disjoint window could need, which grows with eviction history).CopiesBounded's coarse bound inResumeReader.tla, since every config caps evictions (rejected: (B) model backfill lifetimes).Follow-ups
None.
quest/m1/finished-copy-empty-start.md, which this PR added, is done here and deleted.Public API
None.
Wire
None. Behavior: a lite subscriber resets (Cancel) instead of FINning a Subscribe Stream whose SUBSCRIBE_UPDATE is still unsent.
Caused by
reachestreated an open range as not reaching its timeRecord::retirerecorded retired gaps as delivered andSettled; D10e: pruned lost stale skips as finalexpire_headsadded to the arrival read onlyFinishedServe::probeskippedu64::MAXwithout refusingreadonly to recoveries; moq-dev/moq#8616 the JS draining loopReview
mechanical fix by claude, claude-opus-5-5, medium effort:
merged base; base #9607 added SubStream.stale_cap, so the PR's new test a_join_range_retuned_wider_before_its_answer_is_probed gets stale_cap: None like base's fixtures; ran nix develop --command just ci base (all modules passed)(head f8298c4)Rewritten by
quest reviewafter each round.Head: 035bf9e
Base: origin/main at bc6157b
Risk: medium,
The change rewrites subscriber, publisher, and resume/fill behavior in rs/moq-net and js/net. A mistake would make a relay or client serve or resume groups wrongly for consumers of the next release, but it keeps the public API and wire format (the Lite07 uses are in tests and existing version plumbing, with no new wire fields or version bumps), and a revert fully undoes it, so it is not high.Classified: medium by Claude Code, claude-haiku-5-5, low effort, session
1459224f-2b4e-4d80-8d11-8e4c9707e759Reviewer: Codex, gpt-6.2-sol, xhigh effort
Session:
01a213c4-523e-7192-ba24-34348b35b772, round 5Score: 10/10,
The merge resolution and Group Order test updates introduce no new findings, so the head is ready to land.Rounds: 9; first round 3 (medium 3); findings 6 (medium 6): fixed 4, refuted 2, open 0
Findings: none
Validation
Every new regression test above failed on
7d831cf4cdand passes here; the finished-copy JS test fails withoutc3ff0d1a37and passes with it.quest gate just checkon the merged headc3ff0d1a37(clippy, fmt, tsc, biome, coverage tables,rsandjstests over the changed packages): pass, 11530 nextest tests.bun test srcinjs/net: 3897 pass.After the review fixes (
f41a8ecddb,fef6a0fbb1,3d6ec8221d, Rust only):quest gate cargo test -p moq-net --all-featurespasses (4533 tests), clippy-D warningsis clean, and each new test fails without its fix.quest gate just test interop --all(Rust and JS over lite-05/06/07-wip and moq-transport): all pass on the merged head, exercising the built binaries against each other with the S5/S14/D8 serve changes and the finished-copy fix./verify-resume(TLA+ResumeReader.tla) on the merged head: default 23.1M,ThreeRoutes.cfg5.5M, and the newEvict.cfg16.6M distinct states, all pass.Evict.cfgwithReArm = FALSEfailsCleanEndIsComplete(checked by the previous session on4ee4fa2347). The failover model is unchanged (it evicts nothing); its four configs passed on4ee4fa2347.CodeRabbit round on
3d6ec8221d(67021ef669): five findings fixed (one refuted); each code fix has a test that fails without it, except the JS twin of the refetched-departure compaction, which changes no delivered output and no JS hook exposes, so the Rust test covers it. Rusta_join_ignores_an_evicted_older_group_running_past_the_edge,an_evicted_successor_past_an_unserved_one_still_bounds_the_reach,evicting_a_refetched_departure_compacts_its_gap; JSa join ignores an evicted older group running past the edge,an evicted successor past an unserved one still bounds the reach.quest gate just check origin/mainpasses on01da2955fe(11535 nextest tests),bun test srcinjs/net3899 pass, andResumeReader.tlaEvict.cfgpasses with the per-route eviction count (16.6M distinct states, unchanged atMaxEvicts = 1).Local review rounds on
01da2955fe..5b7d475e4d(fresh Codex session, since the saved one was refused):bc48726745re-polls demand after deferring a change behind an update waiting on credit (an_update_waiting_on_credit_still_reads_and_cancelsnow asserts the next change wakes a counting waiter, failing without it on Lite06 and Lite07), and measures a join on an ended track by the newest group its sweep expired in place (a_join_measures_an_edge_expired_in_place, extended in5b7d475e4dwith an empty final group that also expires). Each fails without its fix.quest gate just check origin/mainpasses on5b7d475e4d(11536 nextest tests). The round-1 finding on thefit.rsprobe reserve was refuted: at most 56 bytes of a 65,535-byte message.Maintainer decisions on
5b7d475e4d:a_sequence_keyed_join_measures_past_a_cached_empty_group(received sequence-keyed copy, groups 1 to 3 at 1 to 3 s, 3 expired in place, empty 4 still cached) starts a one-second join at group 1 without the fix ([1, 2, 4]) and at 2 with it.quest gate just check origin/mainpasses (11537 nextest tests),bun test srcinjs/net3899 pass.ResumeReader.tlais unchanged, so/verify-resumewas not rerun.Merged
origin/mainat9116810044(with moq-dev/moq#9529, which serves held groups newest first, and the model resync moq-dev/moq#9627) in844efeb45e.ResumeReader.tlakeeps main's Group OrderPeekand adds this PR'sEvict,gone, anddrainson top; both skills now name main's sync commit7cab21e65bplus this PR's re-armed backfill.prune_skippedkeeps main's refill check and this PR's lost-run check.035bf9e434adapts the eviction tests to newest-first order (the draining-copy tests now peek group 3 before the eviction and backfill 1 and 2; the expired-in-place tests read ascending; the JS reach tests expect newest first). With the fix disabled,a_group_a_draining_copy_loses_is_backfilled,a_range_added_above_the_resume_point_keeps_the_drain_watched,a_sequence_keyed_join_measures_past_a_cached_empty_group, and the JSa group a draining copy loses is backfilledstill fail./verify-resumeon the merged model: default 20.3M,ThreeRoutes.cfg5.0M,Evict.cfg14.7M distinct states, all pass;Evict.cfgwithReArm = FALSEfailsCleanEndIsComplete.quest gate just check origin/mainpasses (11573 nextest tests),bun test srcinjs/net3918 pass. One earlierbun testrun hit the known flakea widening recovers the stale groups for a bounded lite-07 reader(quest/m0/test-flakes-4/widened-bounded-reader-js.md), which passed six isolated reruns and the full rerun.Models
Size: L
Implementer: Claude Code, claude-opus-5-5, unknown effort
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, L)
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, S)
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, XS)
Implementer: Claude Code, claude-opus-5-5, unknown effort (merge, S)
(Written by Opus 5.5)