Repository navigation
Conversation
Quest-Claim: 96fecce8f08dcbff
An OLD drop now carries the Max Age the publisher judged its groups stale under (ms + 1, 0 = Publisher Max Age), taken from the cursor's verdict or the group's expiry. Subscribers record that exact budget, so SubStream::stale_budget (and its JS staleBudget counterpart) and the narrowest-asked guess are gone: a transient LATEST viewer no longer settles wider readers on the same upstream subscription. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lite-07 SUBSCRIBE and SUBSCRIBE_UPDATE drop their top-level Subscriber Priority and Group Order; each Range carries its own, and a Retune carries a new priority, order, and (for a live join) Max Age. Until the publisher schedules per group, it serves the subscription at the highest range priority, descending if any range there is. Also polls each held group once in TrackState::watch_places, at the largest time it holds, instead of once per asked time, which spun past kio's Ready poll limit on a relay with thousands of asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # js/net/src/lite/subscribe.ts # js/net/src/lite/subscriber.test.ts
Replace the subscription-wide Start::Unresolved/Resolved, withheld and placed_floor with one Answer enum: lite-05/06 keep their single held start, and lite-07 tracks a RangeState per Range ID beside one Delivery lifecycle (Unresolved, Withheld, Answered) that carries the drops held for the first SUBSCRIBE_START. - S8: lite-07 serves groups while delivery is unresolved instead of holding the first one and the cursor behind it. - S3: the lite-07 cursor floor stays put; the window places each range, so an unplaced time start no longer cuts off the group holding it. - S9/S11: a finished track answers every waiting range, with the cache's largest when the edge is unknown, which flushes the withheld drops. - S10: an empty track ending at 0 marks every range answered by its END. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r, and Max Age SubscribeDedup.tla fans N relay readers, each with its own Priority, Group Order, and Max Age, into one lite-07 upstream subscription, with joins, leaves, judged and shed OLD drops, the relay's recorded Max Age, and its own recovery request racing on the wire. It checks SentOnce, NoPoison, QuietIsSettled, EffectivePolicy, JudgedWidest, and the fold rule over every range mix (ASSUME). Each rule was broken once to see TLC catch it. The subscribe directory now holds two specs, so the accounting model's configs take its name as a prefix, as sh/tla.sh picks a spec by it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A group goes out at the highest priority among the live ranges covering it whose max age has not expired it, at that priority's order, and falls to the next once it ages past them. In-flight streams follow through the steer, a grouped stream moving to the send group of its new priority. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Track Mirror the Rust TrackRun refactor: replace the subscription-wide startSent, startKey, skipped, first and withheld closures with one StartAnswer union (legacy; waiting/started for lite-05/06; unresolved/withheld/answered for lite-07), beside the per-range `unstarted` map. - S8: lite-07 serves groups while delivery is unresolved instead of holding the first one, and resolves from the lowest served once the source answers or a range is placed. - S10: a lite-07 track ending before its first group answers every range with its SUBSCRIBE_END at 0, and a copy whose source already answered no longer parks forever waiting on its upstream. - S9/S11: a finished track answers a live range with the newest held position when the edge is still unknown. - Lite-03/04 ignore drops rather than holding them forever. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A group goes out at the highest priority among the live ranges covering it whose max age has not aged it out, at that priority's order, and falls to the next once it ages past them. In-flight streams follow: Priority ranks each stream by its own policy, re-ranking as the group ages or an update retunes a range. Mirrors the Rust ranking in d7ca47c. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e783 # Conflicts: # js/net/src/priority.ts
…6a2cce6e783 # Conflicts: # .claude/skills/verify-subscribe/SKILL.md # drafts/draft-lcurley-moq-lite.md # js/net/src/broadcast.ts # js/net/src/lite/subscribe.test.ts # js/net/src/lite/subscribe.ts # js/net/src/lite/subscriber.test.ts # js/net/src/lite/subscriber.ts # js/net/src/track.ts # rs/moq-gst/src/sink/pad.rs # rs/moq-mux/src/container/mkv/import_test.rs # rs/moq-net/src/lite/publisher.rs # rs/moq-net/src/lite/subscribe.rs # rs/moq-net/src/lite/subscriber.rs # rs/moq-transcode/src/rung.rs
…quest Follow-up to the two accepted review findings on mid-group route switches, waiting on per-range-policy (#9719), which rewrites the relay copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iven up - A range edit re-reads the Range IDs covering each group in flight (Rust `Steer::inflight`, JS ranking reads coverage each time), so an added range or a span re-added under a new ID moves a group already streaming. - A group stream re-polls the steer until pending, so a second update wakes it. - `shed` and `give_way` name the drop under the narrowest live range when the group is given up, not when a drop held for the first START goes out. - Stale verdicts judged under the publisher's max age name the reader's budget, as the cursor does, so a history reader settles instead of asking again. - Fills and recoveries carry their priority and ascending order on the wire range, which lite-07 reads policy from. - Native smoke client subscribes the catalog with defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…own verdict - `TrackRun::poll_step` drives the open group streams before the group waiting for credit, so a retune moves them before the waiting one ranks against them and an oldest-first range's newer group never preempts an older one. - A stale verdict the local cache ceiling decided names the ceiling rather than the reader's budget, since upstream may still hold the group; one the publisher's max age decided still names the budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ferred not given up Behind a group waiting for stream credit it cannot make room for, the cursor now hands out the group ranked highest by the policy it would go out at now (`Pick::Ranked`), and only if it outranks the waiting one; nothing ranked lower is consumed, so blocked history never holds an urgent group back. A waiting group an oldest-first range still wants is deferred when it gives way, taking the place back once it empties or outranks the waiting one, instead of being dropped as OLD. The shed path is gone. SendCredit.tla models mixed policies (history only, live aging into history), groups arriving over time, the ranked read, and deferral, with HistoryKept, NoHeadOfLine, and DeferredWaits; the old admission breaks both new rules on SendCreditMixed.cfg. The finished per-range-policy quest is deleted, and a follow-up quest covers re-ranking in-flight groups on placement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n fix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6a2cce6e783 # Conflicts: # .claude/skills/verify-credit/SKILL.md # doc/concept/moq-lite.md # js/net/src/lite/publisher.ts # js/net/src/lite/subscriber.test.ts # js/net/src/lite/subscriber.ts # rs/moq-net/src/lite/publisher.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Design change: credit admission under mixed range policies is now fixed in this PR, as the reviewers recommended and the maintainer picked.
New review sessions follow with (Written by Claude Opus 5.5) |
Credit admission no longer gives a group up: a group that gives way to an outranking one is deferred as a plain group handle, kept while the cache holds it and a range wants it, and named stale or dropped only when a budget expires it or the cache lets it go. A waiting group with no stream of its own serving, as when another subscription holds the session's credit, still gives way to a group that outranks it. Also from review: the CARLA control subscription puts its order on a range, verify-resume's coverage names `narrowest`, and every sync commit moves to the PR's base. recover-group-provenance drops its requirement on this quest, which this PR finishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ones From review: - A deferred group whose copy lost frames asks the same recovery-aware `poll_given_up` a serving group does, so a held re-offer or another route still brings it rather than a final drop. - A finished group the cache evicted before it went out is let go and named, so what waits for credit stays bounded by the cache. `group::Consumer::poll_lost` parks on the group, so a finished group costs no ready poll. - Deferred groups rank by a retune not yet read when the slot refills. - A drop a pruned deferred group names goes out before the run parks. Each has a test that fails without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A deferred group no longer asks a route for frames its copy lost while it waits: one a route may still bring back (a hold, another copy, a fetching track, or a resumed read) stays deferred and recovers once it takes the opening slot, so a credit stall asks upstream for one group at a time. One no route can bring back is named and let go, as before. `group::Consumer::poll_lost` now parks on the copy's close alone, so a frame written to a deferred group wakes no subscription, and a closed copy is judged once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Design change: deferred groups now recover lazily. Codex's two unsettled round-3 findings are fixed as it recommended. The maintainer is away, so this follows the standing instruction to take the recommendation.
New review sessions follow with (Written by Claude Opus 5.5) |
Replace the deferred-group list with the cursor itself: a group waiting for stream credit that gives way to one outranking it is given back unread (`track::Subscriber::give_back`, through every route copy), its record untold, so the cursor hands it out again while it is cached and wanted. The cache and the budgets bound what waits, as for any group never handed out, recovery is asked only for the group that takes the slot, and a reopened group takes the current frame bounds. Once a group gave way, the slot refills by rank (`Admit::Best`) until nothing is left unread, so a cached group and one that gave way compete by rank. Also from review: - A lite-07 start resolved when the track ends before any range placed it is never above a group already served (`resolve_held`), as JS and `TrackRun::start` do. - A group judged stale while it waits for recovery records the budget that judged it. `SendCredit.tla` returns a group that gives way to "cached", drops `Refill` and `DeferredWaits`, and swaps the `NeverDefers` witness for `NeverGivesWay`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from From review: - A fetched group a read hands back unread is offered again among the fill's answers (`Misses::refill`), not among the arrivals, whose scan passes over fetch-only slots. - A waiting group whose served mark the record folded into its settled prefix keeps its place rather than giving way, since the mark can't be taken back (`Record::folded`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd returns only where read - A group waiting for stream credit is held out of the record's fold (`Subscriber::hold`, `Standing::held`), so giving way can always take back its served mark. `stuck` drops the folded guard, which forced `Admit::None` and let a higher-ranked group stall behind it. - A ranked read that refuses its best group parks on that group's stale deadline, so it ages out through the cache driver rather than waiting on another event. - `Cursor::give_back` owes a key again only while the cursor's floor, cap, and ranges still read it, so a fill answer a narrowing retired is not handed out by the order fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every SendCredit and subscribe config passes on the hold, wake, and range-check fixes. 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>
…base The merged main commit changes no function their tables cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rank Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Design change: Codex's four open round-3 findings on the give-back path are fixed as its reviewer recommended, picked while the maintainer was away (rejected: (c) as a follow-up quest, or all four as follow-ups).
Each has a test that fails without it: (Written by Claude Opus 5.5) |
Finishes quest/m2/lite07-subscribe/per-range-policy.md, deleting it.
Moves subscription priority and group order onto each
track::Range(wire and public API, in every language), schedules each lite-07 group by the ranges still wanting it, names the judged Max Age on OLD drops, answers each lite-07 range from its own state inTrackRun, and adds a TLA+ model of N-to-1 heterogeneous dedup. Fixes audit findings S3, S8 to S11, D3, and D4.Subscriber Priority/Group Order. Each Range carries its own, and each Retune carriesPriority,Group Order, andMax Age(0for a range that is not a live join). Older wires keep the one subscription-wide pair, derived from the ranges (Policy::top: highest priority, descending if any range at it asks).priorityandordermove fromtrack::Subscriptionontotrack::Rangein Rust, JS,moq-ffi,libmoq, and the py, swift, kt, go, and dart wrappers (cpp is generated frommoq-ffi). In-tree callers are updated.Steer::serving,poll_policy, per-prioritySendGroups; JSPriorityranks each stream by its ownRanking).demand/ranges.rscounts ranges per policy and drops one only when ranges at covering policies (higher priority, or equal with the same order or descending) cover its span, so a high-priority or finite-Max-Age live join never folds into a lower-priorityRange::ALL. With one policy asked it stays O(log n) per change.an_edit_retuning_every_live_range_fits_one_message).SUBSCRIBE_DROP(OLD)carriesMax Age(ms + 1,0= publisher max age). The relay records exactly that;SubStream::stale_budgetand its JS counterpart are deleted.TrackRun(S3, S8 to S11):Start::Unresolved/Resolved,withheld,placed_floor, andtaken_backare gone. Lite-07 keeps aRangeState::Waiting | Startedper Range ID beside oneDeliveryenum (Unresolved,Withheld,Answered) that holds the drops a subscriber reads only after the first SUBSCRIBE_START. Groups are served while delivery is unresolved, a finished track answers every waiting range, and an empty track ending at 0 answers them with its END. JSrunTrackmirrors it.rs/moq-net/verify/subscribe/SubscribeDedup.tlachecksSentOnce,NoPoison,QuietIsSettled,EffectivePolicy,JudgedWidest, and the fold rule. The accounting model's configs take its name as a prefix.Pick::Ranked,Subscriber::poll_recv_group_above), and only if it outranks the waiting one. It ranks each range's first unread group it still wants and takes the best, so nothing ranked lower is consumed or holds a higher group back. A waiting group counts as stuck behind every stream its subscription serves, none included, so it gives way even while another subscription holds the session's credit. A group that gives way goes back to the cursor unread, its record untold (TrackRun::give_way,track::Subscriber::give_back, through every route copy, to the arrivals or the fill it came from). The cursor hands it out again while it is cached and wanted, so the cache and the budgets bound what waits, as for any group never handed out. Once one gave way, the slot refills by rank (Admit::Best) until nothing is left unread. Credit never gives a group up, and the shed and give-up paths are gone. The waiting group is held out of the record's fold until it opens or gives way (Subscriber::hold,Standing::held), so giving way can always take its served mark back. A ranked read that refuses its best group parks on that group's stale deadline, so a group that gave way ages out through the cache driver rather than waiting for another event.SendCredit.tlamodels mixed policies (SendCreditMixed.cfg, new ruleNoHeadOfLine, witnessNeverGivesWay). JS needs no change: every JS group stream holds its own place in line, with no single waiting slot.TrackState::watch_placespolls each held group once, at its largest asked time, instead of once per time.Steer::inflight, JS ranking), so an added range, or a span re-added under a new Range ID, moves a group already streaming. A group stream re-polls the steer until pending, so every update wakes it.poll_stepdrives the open streams before the group waiting for credit, so a retune never makes a newer group preempt an older one its oldest-first range sends first.resolve_held), as JS andTrackRun::startdo.narrowest, and every sync commit is the PR's base.0for history); one a relay's local cache ceiling decided names the ceiling (TrackState::stale_name).@moq/nettakes.Cursor::give_back).Impact
moq-lite-07-wiponly, which is unpublished. Older versions and moq-transport are byte-identical. Per-rangePriorityandGroup Orderreplace the top-level fields; Retune gainsPriorityandGroup Order;SUBSCRIBE_DROP(OLD)gainsMax Age. The draft is updated (Prioritization, SUBSCRIBE, SUBSCRIBE_UPDATE, SUBSCRIBE_DROP, changelog), and the shared corpus fixture moves to the new layout.MIGRATE.md:track::Subscriptionno longer haspriority,order,with_priority, orwith_order. Set them on eachtrack::Rangeinstead:Subscription::default().with_ranges([Range::from(start).with_priority(p).with_order(o)]), or thepriority/orderfields in aRange { .. }literal (add..Default::default()where you set neither). To change a subscription's priority,updateit with its ranges at the new priority; lite-07 retunes them in place.Track.Subscription.priorityand.ordermove to eachTrack.Range:subscribe({ ranges: [{ start, priority, order }] }).MoqSubscription.priority/.ordermove toMoqRange.priority/.order. Regenerate bindings and rebuild the matching native library together.moq_subscription.priority/.ordermove tomoq_range.priority/.order.Validation
quest gate just checkandquest gate just ci: pass on 04f1ceb, after merging main twice (the second for fix(net): a read that finds the end settles a waiting live join first #9810's read-loopWalkedresult, which the ranked pick now returns through).quest gate just test interop --all: all checks passed on d3437fc. The later commits change no wire layout, and the admission fix is publisher scheduling only.lite07_a_backlog_group_history_wants_waits_rather_than_being_shed,lite07_history_below_a_waiting_group_holds_back_no_group_that_outranks_it) fail on 3a49dad (group 1 dropped OLD; group 40 held behind refused history) and pass on the head.lite07_a_waiting_group_gives_way_with_no_stream_of_its_own_servingfails with the old stuck rule (group 10 kept the place) and passes.lite07_a_slot_goes_to_the_best_unread_group_once_one_gave_wayfails with a refill in subscription order (slots 9, 1, 5) and passes (9, 5, 1). The give-back path is covered bylite07_a_group_that_gave_way_then_evicted_takes_no_credit,lite07_a_group_that_gave_way_goes_out_from_its_reoffer, andlite07_a_group_that_gave_way_aging_out_is_named. Codex's round-3 fixes each have a test that fails without them:a_held_group_stays_above_the_fold(the waiting key folds and stays told after it gives way),lite07_a_refused_group_aging_out_wakes_the_run(no OLD drop after the cache driver crosses the deadline), anda_group_given_back_outside_the_ranges_is_not_offered_again(the retired key is handed out). Dropping the folded guard instuckhas no test of its own: with the hold the folded case cannot arise, andgive_waydebug-asserts it on every give-way in the suite.moq-nettests: all pass. CARLA sim tests: 190 passed./verify-credit, rerun on the round-3 fixes: every send config passes (SendCredit.cfg88k states 3 s,SendCreditPriority.cfg102k 4.5 min,SendCreditStreams.cfg331k 16 s,SendCreditLive.cfg45k 2 s,SendCreditMixed.cfg5.1k 8 s, withGuarded), and the receive configs passed earlier on this branch. With the old admission (unaged admit, aged shed, give-way drop, next-in-arrival refusal),SendCreditMixed.cfgbreaksNoHeadOfLine. TheNeverGivesWaywitness fails as expected.widened_max_age::a_tightened_start_leaves_history_fillable_by_an_intermediate_readerpasses with relay=false and relay=true./verify-subscribe, rerun on the round-3 fixes:SubscribeAccounting.tla(78.7M states, 9 min),CutGroupEnd.cfg,PlainReset.cfg(32.2M), and every dedup config (Three83.0M) pass. The models treat a give-up as a free choice, which deferral only makes rarer, and a deferred group that expires is named as one that never opened./verify-resume:ResumeReader,StaleRecover,Evict, andThreeRoutespass. The credit and subscribe sync commits move to the PR's base,e91efb9653; verify-resume keeps main's.Models
Size: L
Implementer: Claude Code, claude-opus-5-5, unknown
Implementer: Claude Code, claude-opus-5-5, unknown (arm A)
Decisions
0(the publisher's max). With0, a downstream lite-07 relay settled every reader, including readers whose wider budgets still wanted the group. That hung a lite-06 to lite-07 relay test, and sending no Max Age at all failed it outright. A shed or give-way judges it when the group is given up, so a drop held for the first SUBSCRIBE_START keeps it.TrackRunkeeps one subscription-wideDeliveryenum beside the per-range states. The wire requires it: drops go out only after the first SUBSCRIBE_START, so drops given up before any range is answered are held per subscription. It replaces the old flags with one enum whose variants carry their data.Follow-ups
TrackRun::holeand the resume reader recompute the narrowest live budget andPolicy::ofper drop or pick (reviewer note). Track them incrementally if a relay's fitted demand makes this hot.write_off_stale) still names the unclamped budget when a relay's local cache ceiling decided. Name it asTrackState::stale_namedoes.Review
Rewritten by
quest reviewafter each round.Head: 04f1ceb, named in full once no reviewer reports a finding
Base: origin/main at e91efb9
Risk: high,
The branch changes the unpublished moq-lite-07-wip wire format (the SUBSCRIBE Meta field moves in the lite.json fixture, and the new hasJudgedDrop/has_judged_drop gating is added to version.ts and version.rs), and the JS public API in js/net/api/index.api.md moves order and priority from Track.Subscription to Track.Range, which breaks published consumers and deployed peers when the next cut publishes lite-07; it is hard to undo once released because peers on the new wire format and consumers of the API must migrate.Classified: high by Claude Code, claude-haiku-5-5, low effort, session
64c1e8db-ca21-41c3-b79e-65328cd4fc3fRisk file: bb7b1c0de60b
Reviewer: Codex, gpt-6.2-sol, xhigh effort
Session:
01a2223f-9e21-7c11-a217-8796ff1fe6b6, round 1Score: 6/10,
The patch needs rework because Rust can give scarce stream credit to lower-priority groups and JavaScript placement probes can override the requested priority and order.Rounds: 10; first round 8 (high 2, medium 6); findings 25 (high 3, medium 22): fixed 20, refuted 1, open 4
Findings, open until the next round settles them:
rs/moq-net/src/lite/publisher.rs:7072:Rank the first group before spending stream creditrs/moq-net/src/lite/publisher.rs:6937:Recheck cached contenders when a waiting group loses rankrs/moq-net/src/model/track.rs:11784:Continue a newest-first scan past an individually stale groupjs/net/src/lite/subscriber.ts:3379:Carry the demand policy on JavaScript placement probesNotes, the author's to take or leave:
rs/moq-net/verify/credit/SendCredit.tla:132:Model effective group priority across subscriptionsReviewer: Claude Code, claude-opus-5-5, high effort, second
Session:
a22d06e2-141f-4834-aad8-0ddd61ca380c, round 1Score: 8/10,
Nothing in the reviewed areas blocks merging: the wire format, range edits, group ranking, demand fold, answer state machine and bindings all checked clean. The two notes are a stale example in the draft and its doc comments, and a JS/Rust difference in when a held drop's Max Age is captured. Coverage was partial: JS give-way parity, the verify-* models, and some relay-copy files were not reviewed.Rounds: 10; first round 4 (high 2, medium 2); findings 7 (high 3, medium 4): fixed 7, refuted 0, open 0
Findings: none
Notes, the author's to take or leave:
drafts/draft-lcurley-moq-lite.md:897:Draft's OLD-drop example names a removed pathjs/net/src/lite/publisher.ts:2087:JS builds a held OLD drop's Max Age when it holds the drop, not when it sends it