Skip to content

feat(net)!: settle lite-07 starts via GROUP_END and SUBSCRIBE_DROP(SKIP) without timers - #9686

Merged
kixelated merged 24 commits into
mainfrom
fix/lite07-subscription-holes
Nov 26, 2026
Merged

kixelated merged 24 commits into
mainfrom
fix/lite07-subscription-holes

Conversation

@kixelated

@kixelated kixelated commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #9626 and completes quest/m2/lite07-subscribe/previous-delta.md and quest/m3/ietf-finish-shared-tail.md.

Summary

lite-07 settles every group start without a stall timer, combining GROUP_END spans with SUBSCRIBE_DROP(SKIP) and fixing the remaining zero-timer gaps across Rust, JS, moq-quic, FFI bindings, moq-transcode, the draft spec, and TLA+:

  • Merge SUBSCRIBE_SKIP into SUBSCRIBE_DROP(SKIP) (0x3a): Removes Subscribe Stream message type 0x3 on lite-07 and represents empty/never-produced starts via SUBSCRIBE_DROP (0x2) with Error Code = SKIP (0x3a, StreamError::Skip in Rust, StreamCode.Skip in JS) across rs/moq-net, js/net, drafts/draft-lcurley-moq-lite.md, and rs/moq-net/verify/subscribe/SubscribeAccounting.tla.
  • Zero-timer lite-07 accounting (built on feat(net): lite-07 settles every start without a timer, naming plain-reset groups in a drop #9626 head 2ba6f8fade): Keeps GROUP_END ([Start, End)) as the sole proof of (Start + 1)..End without Previous Delta, names plain-reset groups in SUBSCRIBE_DROP via poll::Session::reliable_reset() / SendStream.reliableReset, re-sends cut GROUP_END inner spans as SUBSCRIBE_DROP(SKIP), and removes stall graces on proven lite-07 copies while keeping graces on pre-lite-07 and moq-transport.
  • Disjoint range settlement and history drops: Introduces TailState (Local | Pending | Settled) so proven copies end cleanly (or with their declared error) once all active ranges settle, without waiting on unasked gaps between disjoint ranges. Forwards dropped history runs overlapping explicitly requested Time/Absolute ranges on lite-07 TrackRun::resolve and triggers rescan_drops when a late range lowers TrackRun start (mirrored in js/net).
  • Bounded arrival and proof ledgers: Caps retained ledger runs at MAX_RUNS = 4096 in both Rust (rs/moq-net/src/ledger.rs) and JS (js/net/src/ledger.ts, js/net/src/tail.ts) so a long-lived subscription shifting its range stays bounded.
  • Prevent unread GROUP_END loss on stream eviction: Updates rs/moq-quic so a receive stream whose FIN arrived is never silently evicted unread without sending STOP_SENDING, and updates rs/moq-net (GroupRecv parking and GROUP_END drain, validating GROUP_END against group.check_end and drained frame timestamps) so unread GROUP_END trailers are drained or explicitly signalled back to the publisher without adding a wire Lost list.
  • Remove local TrackState::miss_grace timer and expose finish_at: Removes the 1 s local miss grace so local tracks ask fill handlers immediately and treat refusals as final at once, while holes with no fill handler stay owed until created, skipped, ended, or a handler attaches. Respects whole-group spans (finish_at) in holes()/outside_spans(), preserves them as skips on cache eviction, withdraws in-flight fills when arriving track drops settle their keys, forwards source.end() to finish_at in moq-transcode, and exposes finish_at across moq-ffi, libmoq (moq_publish_group_finish_at), Python, Swift, and Go wrappers.
  • Quest cleanup: Retires quest/m2/lite07-subscribe/previous-delta.md and quest/m3/ietf-finish-shared-tail.md, and unblocks downstream lite-07 quests.

Maintainer decisions

  • Span accounting: Keep GROUP_END ([Start, End)) as the sole proof of (Start + 1)..End without Previous Delta.
  • Wire skip encoding: Merge SUBSCRIBE_SKIP (0x3) into SUBSCRIBE_DROP (0x2) with Error Code = SKIP (0x3a).
  • Local TrackState::miss_grace: Explicitly approved by the maintainer to remove the 1 s local miss grace timer now so local and lite-07 tracks share the same zero-timer contract (no timer papering over undeclared gaps). Sparse local publishers declare empty spans via append_group, finish_at(end), or skip_groups(...), or serve missing keys via a fill handler (requests()).

Impact

  • Wire (breaking for unpublished moq-lite-07-wip only):
    • Removes Subscribe Stream message type 0x3 (SUBSCRIBE_SKIP); empty starts are sent via SUBSCRIBE_DROP (0x2) with Error Code = 0x3a (SKIP).
    • Plain resets without RESET_STREAM_AT name the lost group in SUBSCRIBE_DROP; cut GROUP_END inner spans are re-sent as SUBSCRIBE_DROP(SKIP).
    • Pre-lite-07 (moq-lite-01..06) and moq-transport wire formats and graces are unchanged.
  • Public API:
    • Breaking behavior change for local tracks: TrackState::miss_grace (1 s local timer) is removed. Local producers that create non-contiguous groups without append_group should declare empty ranges with finish_at(end) or skip_groups(...), or attach a fill handler (requests()).
    • Additive error code: StreamError::Skip (0x3a) in Rust (rs/moq-net) and StreamCode.Skip (0x3a) in JS (@moq/net).
    • Additive producer API: finish_at(end) on MoqGroupProducer (moq-ffi), moq_publish_group_finish_at (libmoq), and Python/Swift/Go wrappers.

Validation

  • just check (all modules, including 12,415 Rust workspace tests, JS build/tests across all packages, Python, Go, Swift, Kotlin, Dart, C, C++, Biome, Drafts, Quest, and cross-lint): passed.
  • just test interop --all (full cross-language interop matrix): passed.
  • just rs tla moq-net/verify/subscribe/SubscribeAccounting.tla -config rs/moq-net/verify/subscribe/CutGroupEnd.cfg: 28,943 distinct states, 0 errors.
  • just rs tla moq-net/verify/subscribe/SubscribeAccounting.tla -config rs/moq-net/verify/subscribe/PlainReset.cfg: 32,168,466 distinct states, 0 errors.
  • just rs tla moq-net/verify/subscribe/SubscribeAccounting.tla: 78,748,916 distinct states, 0 errors.

Models

Size: L
Implementer: Antigravity, gemini-4-neon, high

(Written by Gemini 4 Neon with high)

Review

Rewritten by quest review after each round.

  • Head: 44544bd

  • Base: origin/main at df029b4

  • Risk: high, The branch changes the core lite subscribe wire path (SUBSCRIBE_SKIP merged into SUBSCRIBE_DROP(SKIP), miss-grace removal, publisher and subscriber accounting in rs/moq-net and js/net), and its commit is marked as a breaking `feat(net)!`, with public API index changes in js/net and js/qmux. If wrong, peers and published Rust/JS consumers that speak lite-07 or call the changed API could break once the next cut ships it, and undoing that means a wire and API revert, not just a code revert. Caveat: my Bash access was denied, so I could not read the version.rs or API diffs and did not confirm whether lite-07 is an unpublished -wip version; the tier rests on the stat and commit messages, and it would still be high on the breaking-change marker alone.

  • Classified: high by Claude Code, claude-haiku-5-5, low effort, session f3ad2a4f-65da-40a4-8f2f-52d3d2c03733

  • Reviewer: Claude Code, claude-opus-5-5, high effort

  • Session: ba249c5b-a431-4632-8426-f7b955e9dae3, round 3

  • Score: 8/10, The only finding left was the local grace-timer removal, and it is now a recorded maintainer decision (Q8) with explicit span-settling APIs across the bindings, so nothing open holds the head.

  • Rounds: 3; first round 1 (high 1); findings 1 (high 1): fixed 0, refuted 1, open 0

  • Findings: none

  • The last round's findings, at 40787a9:

    • Refuted: high, rs/moq-net/src/model/track.rs:3619: Local-track gaps still wait forever, or are refused at once; quest/m2/lite07-subscribe/README.md:25 (Q8) records the maintainer's 2026-11-26 decision to remove the local miss_grace timer, rejects the 1 s fallback, and defines how undeclared local gaps settle (finish_at, skip_groups, a finite max_delay, or finish()); those APIs exist at rs/moq-ffi/src/producer.rs:922,1025,1156 and rs/libmoq/src/api.rs:3739,4251. I could not open the cited PR #9686 comment to confirm the decision there.

kixelated and others added 22 commits November 25, 2026 11:34
…, replacing SUBSCRIBE_SKIP

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reset after GROUP_END may cut it on the wire, so the publisher re-tells
the span's inner starts as skips that wait for the group above (its
Previous Delta) or a NOT_FOUND drop. The subscriber now validates a
GROUP_END before accounting for its span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pEnd

SubscribeAccounting.tla drops SUBSCRIBE_SKIP: a skipped start waits for the
header of the group above it (Previous Delta) or a drop naming it, or is
dropped as not found once none will. A reset after GROUP_END re-tells the
starts it accounted. QuietIsSettled now asks for every start, so
CutGroupEnd.cfg passes and is no longer an open finding; NoContradictoryDrop
is split out of NamedOnce.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A skip the cursor gave up before SUBSCRIBE_START was forwarded whole at
resolve, re-telling as Skip what a served group's Previous Delta had
already proved, which then went out again as a NOT_FOUND drop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lta, replacing SUBSCRIBE_SKIP

Mirrors the Rust side: GROUP carries Previous Delta, SUBSCRIBE_SKIP (type 3)
is gone, and the publisher defers a skip to the header of the group above
it, names it in that group's drop, or drops it as not found once nothing
will. A reset after GROUP_END names the span's starts again. The record no
longer lets a skip go out over a drop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…IBE_SKIP

The draft proves a declared skip with the Previous Delta of the GROUP just
above it, names it in that group's drop or with NOT_FOUND where no GROUP
can prove it, names again the starts a reset after GROUP_END may cut, and
drops the subscriber's grace period. Comments that still named
SUBSCRIBE_SKIP follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…resh group first

The raw GROUP streams in receive_credit gain the Previous Delta field. The
two-relay refresh test raced the late join's answer against the fresh group:
the fresh GROUP's header now proves the cached group superseded the moment it
lands, so a zero max age skips the cached one unless it was read first. Read
it before driving the refresh, which still shows refresh never holds it.

Also clippy: rfind over filter().last(), and a single-range match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isions

The verify-subscribe sync commit moves to the last Rust change it covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: main edited the skip-over-drop tests this branch deleted with that
machinery, and its stale-hole cap meets this branch's hasPrevious. A new
publisher test no longer filters for SUBSCRIBE_SKIP, which lite-07 lacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
finish_shared is reached only from moq-transport, outside the lite-07 epic,
and the quest its recommendation named finished on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lite-07 track is proven: its publisher names every start, so the tail,
the producer's miss grace, and resume copy retention wait for the wire to
account for a gap instead of a timer. The excused-stream bound stays until
browser WebTransport exposes RESET_STREAM_AT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a drop

A plain RESET_STREAM lets the peer's transport discard a Group Stream's
GROUP header unread, even once acknowledged, so a held header accounts
for nothing there. poll::Session::reliable_reset says whether a reset
keeps its prefix (moq-quic and qmux-02 with RESET_STREAM_AT negotiated,
the memory transport); the lite-07 publisher holds the header only then
and otherwise names the reset group in SUBSCRIBE_DROP with the reset's
error. JS mirrors it through @moq/qmux's new SendStream.reliableReset.

The draft drops the hold-until-ACK fallback and the subscriber's MUST to
read every header on arrival. SubscribeAccounting.tla gains ReliableReset
and PlainReset.cfg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…verify-subscribe syncs to 74e935b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; previous-delta waits on the marker question

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…P name every empty start

The maintainer removed Previous Delta: the previous group's GROUP_END End
already proves the starts up to it empty, and a control message covers the
rest. lite-07 keeps main's SUBSCRIBE_SKIP (its own message, not a drop code,
since a drop's code ends readers and a skip is final cacheable emptiness) for
a discontinuity, a first group, a group closed without an end, and a
GROUP_END a reset may have cut, which the publisher re-tells as a skip in
Rust and JS.

Still in force from this PR: zero lite-07 timers, a reset without
RESET_STREAM_AT named in a drop, and every drop final on the wire, so no
skip goes out over a drop but a cut GROUP_END's re-tell, which changes
nothing for a dropped start.

SubscribeAccounting.tla models SKIP as a message again, with ReliableReset
and the cut re-tell; CutGroupEnd.cfg now passes QuietIsSettled with every
start accounted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…262a76

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests drop the Previous Delta plan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cal miss grace, and fix zero-timer lite-07 accounting

- Merge lite-07 SUBSCRIBE_SKIP (0x3) into SUBSCRIBE_DROP (0x2) with Error Code = SKIP (0x3a) across Rust, JS, spec, and SubscribeAccounting.tla.
- Settle disjoint ranges at track end and forward disjoint history drops on lite-07 publisher resolve/report_started.
- Bound arrival/proof ledgers to MAX_RUNS = 4096 in Rust and JS.
- Prevent moq-quic from evicting unread FIN streams without sending STOP_SENDING, and drain GROUP_END in moq-net before discarding GroupRecv streams.
- Remove local TrackState::miss_grace timer, respect whole-group spans (finish_at) in holes and cache eviction, and expose finish_at across moq-transcode, moq-ffi, libmoq, Python, Swift, and Go bindings.
- Retire quest/m2/lite07-subscribe/previous-delta.md and unblock dependent lite-07 quests.
- Validate GROUP_END against highest frame timestamp and group.check_end(end) in FrameIngest::try_drain_end and GroupRecv::poll_serve.
- Add StreamError::Skip to ietf::error::tests EVERY_ERROR and unregistered_conditions_are_internal.
- Retire quest/m3/ietf-finish-shared-tail.md (resolved by Producer::finish_shared tail settlement).
- Update .claude/skills/verify-subscribe/SKILL.md coverage table and sync commit.
- Clarify sparse create_group / moq_publish_track_group_at docs on settling empty gaps with finish_at or skip_groups.
@kixelated
kixelated marked this pull request as ready for review November 26, 2026 09:46
@kixelated
kixelated added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 9943f1e Nov 26, 2026
4 of 5 checks passed
@kixelated
kixelated deleted the fix/lite07-subscription-holes branch November 26, 2026 10:01
kixelated added a commit that referenced this pull request Nov 26, 2026
Resolves the resume.rs conflict with #9686's drain eviction
watch: its re-arm keeps Resumed::Route, which here carries nothing. The
flight test at group 5 now takes the join's ask for the groups below it
first, which main asks since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated added a commit that referenced this pull request Nov 26, 2026
…cast-growth

main (#9686) reports nothing twice: a skip no longer goes out over a drop.
Drop `Report::blocks`, and with it the reason Fold::Final kept a drop
inside a whole span for its skip: a drop now folds anywhere inside a span
the track holds whole, where no other group can land late. The test that
a skip replaces a received drop is gone with that behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated added a commit that referenced this pull request Nov 26, 2026
Ports #9686 (SUBSCRIBE_SKIP folded into SUBSCRIBE_DROP(SKIP), no grace period, reset accounting) into the condensed moq-lite draft, and words the lite-07 timestamp decision as unsigned deltas whose timestamps never decrease.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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