Repository navigation
fix(net): a resumed read asks upstream for a kept-out key no held copy knows - #9435
Conversation
Quest-Claim: 3a144000aede123c
…y knows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the rest, in Rust and JS Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…out-reask # Conflicts: # js/net/src/resume.ts
…out-reask # Conflicts: # rs/moq-net/src/model/resume.rs
…and ask upstream 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>
…indow moves Every ask starts at the first kept-out key no copy declared skipped, so only the copy asked furthest from there needs keeping; an ask from lower down covers the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the local floor Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. WalkthroughThe Rust and JavaScript readers now track skip information for keys excluded by local bounds and request uncovered keys from the serving route. They retain an asked-for copy across route replacements. Tests cover partial skip declarations, returned groups, repeated window changes, and nested-front route switches. The change also adds two planning documents and removes one prior planning document. Merge Risk:
|
There was a problem hiding this comment.
ℹ️ No blocking issues — one liveness edge worth a look inline.
Approach: sound. Asking the serving route again instead of keeping a growing skip history follows the cache rule, and keeping a single retained ask copy holds the bound under repeated window moves.
Reviewed changes
All 6 files at 0c61367, Rust and JS side by side.
Reader::accounts/#accountsasks upstream: it collects kept-out keys that neither the record nor a held copy declares skipped, then asks for their hull through the existingbackfilldedup.Reader::asking/#askingreplaces the let-go merge: on every let-go, it rewritesskippedto the skipped prefix of each kept-out run and returns where the ask starts.let_go/#letGokeeps one asked copy: this is the serving channel's copy reaching furthest past that key, sobackfill's "a floor lowered again asks once" check holds the ask open without re-subscribing.Copy::asked_for/copyAskedFor: a new predicate that both languages mirror.- Tests: the quest case, an inner-front ask, an asked-once/stays-owed case, and a window-moved-down bound, in both languages. The superseded inner-front test was removed.
claude-opus-5-5 | 𝕏
#9389 deletes resume-model-placement.md, so the note lives in quest/m1/js-kept-out-start-placement.md instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pullfrog's finding on #9435: an interior skip split across the pool's expiry window leaves a bounded read pending. One plain cursor fails the same way, so it is the track's to fix, not the resumed reader's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Only quest planning notes changed since the prior pullfrog review; no runtime code.
- Added
forgotten-skip-reask.md: tracks the earlier expiry-window liveness edge as a follow-up quest. - Added
js-kept-out-start-placement.md: moves the JS start-placement note into its own quest.
claude-sonnet-5-5 | 𝕏
Ports main's mid-group ends (#9402), answered joins past the end (#9311), the ietf Oldest start (#9405), and the kept-out reask (#9435) onto per-range Live max ages. Main's tests that leaned on a subscription-wide delay take a Live range now; two that relied on a history range expiring let the replaced route fail instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Finishes quest/m1/resume-kept-out-reask.md.
Problem
A bounded resumed read owes a key that its local floor or cap keeps out under the serving copy's resume point until a copy declares it skipped. moq-dev/moq#9326 kept only the skipped start and end of each gap from copies it let go, so an interior skip known only to a let-go copy was lost. For example: copy A alone declared
[2,3)skipped in gap[1,5)with the floor at 3, A was let go, and a later copy declared[1,2)and[3,5). Group 2 stayed owed, no copy knew it, nothing asked for it, and the read stayed pending.Approach
The reader asks the serving route again instead of keeping skip history, per the cache rule. Rust (
rs/moq-net/src/model/resume.rs) and JS (js/net/src/resume.ts) both get this:Reader::accountscollects the kept-out keys that are neither recorded nor declared skipped by a held copy, and asks the serving route for their hull through the existing backfill path (Reader::ask). It polls a nested front's copy ready so its inner reader exists to answer.Reader::asking(JS#asking) runs on every let-go. It returns the key where the ask starts, and replacesReader::skippedwith only the skipped run at the start of each kept-out run. That is at most two runs a gap, however many routes come and go, and it is written before the cache that answered can forget it (JS drop records expire after the pool's idle window).let_gokeeps one replaced copy: of the serving channel's copies asked for that key (Copy::asked_for), the one reaching furthest. A waiting reader therefore asks once instead of on every poll. Moving the window again and again still keeps one copy, because an ask from lower down covers the ones before it.#keepSkips,#lacking).Impact
Decisions
backfill, rather than one subscription per run.Copy::retainsand the budget.a_skip_behind_an_inner_switch_ends_the_readis now language-agnostic, because JS ended without asking while its inner front still held the old copy. Both languages now end after the route's skip. Deleteda_skip_behind_an_inner_front_the_local_floor_keeps_out_ends_the_read, which is superseded bya_kept_out_key_is_asked_through_an_inner_front. Added the quest's case, the inner-front ask, and an asked-once/stays-owed case in both languages.Reader::owed(what only a fill may still deliver), so this PR's function is namedasking, built on fix(net): a bounded read across a route switch waits for its backfill; the range table stalls the old route #9407'slacking. fix(net): a bounded read across a route switch waits for its backfill; the range table stalls the old route #9407'sowednow sees the smaller record. A fill may therefore wait for its own answer on an admitted key that a let-go copy skipped at a gap's edge. That is bounded by the reader's budget, and the sweeps are unchanged.[3,5)first and[1,3)only after the pool's expiry window, the read stays pending. One plain JS cursor does the same: with a 10-hour budget, it ends when both skips arrive together and stays pending when they arrive 60 s apart. The maintainer's rule is that a resumed reader ends a read when one cursor does, and it does. The track-level cause is theforgotten-skip-reaskfollow-up.Validation
just rs test -p moq-net --features asyncfiltered to resume and integration tests, 926 passed. JS:bun teston resume, track, and range-table, 592 passed. Both runs were after the last merge.a_kept_out_group_is_asked_once_and_stays_owedfails in both languages. The Rust case tracks the asked copy's lease, and the JS case countssubscribecalls.a_window_moved_down_under_the_local_floor_keeps_one_ask(Rust) and "a window moved down under the cursor keeps one ask" (JS) move a bounded window down 10 times over kept-out keys, then pass the budget. On the previous head, Rust kept 10 asked copies and JS kept 11 open route subscriptions. With the fix, Rust keeps 1 and JS keeps 2 (the serving copy and the ask). Rust resume and integration tests: 927 passed. JS: 593 passed.MOQ_RESUME_CASES=4096:resume-model-placementandresume-model-route-closequests.just test relay-fill, 2 passed (range table through relays, and Rust peers through the JS relay).just check: passes.verify-resumemodel, which covers unbounded subscriptions, where this path never runs.Caused by
No single PR: the case is as old as owing kept-out keys across route changes. moq-dev/moq#9326 bounded the record and deferred this case explicitly.
Follow-ups
window.floor() ?? 0n. It then asks the serving route for[0,10)where Rust asks for[9,10), so it owes groups below the window that one cursor does not. This note first went intoresume-model-placement.md, which moq-dev/moq#9389 deletes, so it moved to its own quest at the maintainer's request. No open decisions.Models
Size: L
Implementer: Claude Code, claude-opus-5-5, unknown effort
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, L)
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 329c12c
Base: origin/main at 52125fe
Risk: medium,
This is a bug fix to the internal resume-reader logic in rs/moq-net and js/net that keeps the public API and wire format. What could break is a bounded read that now asks upstream for kept-out keys it used to owe silently, so consumers may see extra subscriptions or different end timing. A revert of this diff fully undoes it, so it is medium rather than high, and the quest plans and tests are low on their own.Classified: medium by Claude Code, claude-haiku-5-5, low effort, session
3f65b3cf-cf22-44d6-aab2-ab44092b0ee2Reviewer: Codex, gpt-6.1-sol, xhigh effort
Session:
01a2055a-3d36-7180-b240-e7ae738c32db, round 4Score: 10/10,
The incremental diff only reorganizes and adds quest plans, with no runtime changes or new findings.Rounds: 4; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0
Findings: none