Skip to content

feat(net)!: the lite-07 wire addresses groups by start - #8908

Merged
kixelated merged 38 commits into
mainfrom
quest/m2/time-addressing/lite07
Nov 17, 2026
Merged

kixelated merged 38 commits into
mainfrom
quest/m2/time-addressing/lite07

Conversation

@kixelated

@kixelated kixelated commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m2/time-addressing/lite07.md (deleted here, with its links). The lite-07-wip wire carries no group sequence numbers. Each group is named by its start, a GROUP also names the start of the group before it, GROUP_END says where a whole group ends, and every subscription bound, drop, and skip is a span of starts. The PR also carries the pre-cut audit's smaller lite-07 fixes. lite-01..06 and moq-transport are unchanged.

Summary

  • Draft (drafts/draft-lcurley-moq-lite.md): every "sequence" now reads as a start. New and changed:
    • The concept sections now describe three group ends (finished, closed, aborted). They also cover scale-less tracks, where Timescale is 0 and every frame carries its group's start.
    • Added a GROUP_END section, and GROUP gains Previous Start.
    • SUBSCRIBE_DROP and SUBSCRIBE_SKIP carry a [Group Start, Group End) span.
    • Every drop is final, OLD included: Update is gone, along with reopen and re-offer.
    • Expiry closes an open Group Stream instead of resetting it with OLD.
    • SUBSCRIBE_OK gains Largest Ended.
    • Subscriber Max Age is encoded as ms plus one, with 0 meaning no limit.
    • One inclusive Time anchor (0x1); type 0x3 is gone.
    • TRACKS_ADD, TRACKS_REMOVE, and TRACKS_FINISH carry a Kind.
    • The Padding stream and datagram are removed, and so is binding 5 (Qmux over RTCDataChannel, with its RFC 8831 reference and the DTLS clause).
    • The changelog is rewritten to match, and the lines about earlier versions' encodings are dropped.
  • E2EE draft: the nonce's group input is the group's start. The bytes are unchanged.
  • doc/concept/moq-lite.md:
    • Describes the three group ends and the previous-start link.
    • Says a dropped group's report is final.
    • Says a lite-07 listing names datagram tracks.
    • Says a lite-07 scale-less track stamps each frame with its group's start.
  • rs/moq-net and js/net, mirrored, so the two interoperate on lite-07:
    • Drops and skips: spans on the wire. The update numbers go, with the publisher's redrop/reoffered, the tail's update and finished bookkeeping, and the track's re-offers and judged ranges.
    • GROUP: carries Previous Start. A subscriber applies the passed-over starts as a skip. The publisher holds back the SUBSCRIBE_SKIP for a run directly below a group whose stream it opens, and sends that run before any drop of the group.
    • GROUP_END: ends a finished group on Group and Fetch Streams. On receipt the subscriber calls finish_at(end); a bare FIN calls finish(), the names main's moq-dev/moq#8961 gave them.
    • Expiry: an expired lite-07 stream that is already open is closed, and a stream whose end was written is never reset.
    • Scale-less frames: a lite-07 frame on a scale-less track carries its group's start as its timestamp, and a mismatch is TIMESTAMP_MISMATCH. Datagrams always carry a timestamp.
    • Listings: a listing lists datagram tracks and says which kind each track is.
    • Max Age, anchors, Largest Ended: max age is plus one, anchors are 0/1/2, and SUBSCRIBE_OK's Largest Ended is recorded and forwarded by a relay. JS reads a Time anchor as a full 64-bit value.
    • Padding: the Padding stream and datagram are gone.
  • TLA+: the verify/subscribe model drops the update numbers and reopen; StreamWins.cfg, StreamWins, and NoViolation go, and it gains NamedOnce. It now models the expiry close, Previous Start, and held-back skips. The skill records the new runs.
  • Quests: this quest is deleted and its links removed. YIELDED deferred now owns GROUP's Frame Start and the model's YIELDED half. lite07-finalize, refresh-interval, group-drops, and unused-api/js are updated to the landed wire.

Impact

Wire (breaking, lite-07-wip only, which changes freely): GROUP, FRAME (a Payload Length of 0 is now GROUP_END, and scale-less frames carry a timestamp), datagrams (an always-present Timestamp, no type 0x1), SUBSCRIBE, SUBSCRIBE_UPDATE, SUBSCRIBE_OK, SUBSCRIBE_DROP, SUBSCRIBE_SKIP, TRACKS_ADD, TRACKS_REMOVE, and TRACKS_FINISH all change, and stream type 0x2 is gone. A lite-07-wip build from before this PR cannot talk to one after it. Published lite versions are untouched.

Public API (breaking):

  • Rust moq_net::broadcast::TracksEvent:
    • Added { name, info: Listed }, where Listed is Track(track::Info) or Datagrams(datagram::Info).
    • Removed { kind, name } and Finished { kind, name }, where kind is a broadcast::Kind.
    • Lister::add(name, impl Into<Listed>); Lister::remove and Lister::finish take (kind, name).
    • Migrate: match Added { info: Listed::Track(info), .. } where you matched info, and add Kind::Track to remove and finish calls.
  • JS @moq/net listing:
    • An added event is { kind: "added", name } & Listed, where Listed is { info: Track.Info } | { info: Datagram.Info, datagrams: true }. Removed and finished events set datagrams: true for a datagram track.
    • Lister.add(name, { info }), remove(name, datagrams?), finish(name, datagrams?).
    • Migrate: narrow on event.datagrams before treating event.info as a Track.Info, and wrap Lister.add's info in { info }.
  • JS Group.Producer.finishAt(end) ends a group whole at end, mirroring Rust's group::Producer::finish_at, and Group.Consumer.end reports it. These are additive. It stays public though nothing outside @moq/net calls it yet (moq-dev/moq#8929 prunes such exports), since without it a JS publisher could never end a group with GROUP_END the way a Rust one can.
  • Behavior: a group reported dropped stays dropped for that reader, even after its max delay is raised; a relay whose own reader allows more asks upstream again.

Decisions

Choices for review

Choices made without the maintainer, any of which a review can undo:

  1. Kept GROUP Frame Start. The quest says to keep it while YIELDED continuations still set it. YIELDED deferred now removes it.
  2. GROUP_END is the quest's recommended shape: a Payload Length of 0, then an absolute End.
    • A receiver refuses only an End at or below the group's start, as group::Producer::finish does.
    • A Fetch Stream that reaches a finished group's end also ends with GROUP_END, so a relay fill finishes the group instead of closing it.
    • No GROUP_END goes out on streams carrying ietf object records.
  3. An expired open stream is closed (FIN without GROUP_END) instead of reset with OLD, as the quest decided. The stream accounts for the group, so no drop names it.
    • The cost: a closed stream still delivers what is already queued and holds its stream slot until delivered. YIELDED remains the tool for stream credit.
    • Two other expiries still reset: an expired FETCH, and a JS group evicted from cache.
  4. One Time anchor (0x1, inclusive) and Relative (0x2). Type 0x3 is a PROTOCOL_VIOLATION rather than reserved.
  5. Previous Start is plus one, with 0 for unknown. The publisher derives it in three steps:
    • from the run of skipped starts directly below the group;
    • otherwise, from a known group at start - 1;
    • otherwise it is 0.
    • A drop of a group whose stream opened re-sends the passed-over run as SUBSCRIBE_SKIP first, even if it already went out. That is idempotent, so a start can be named twice.
  6. SUBSCRIBE_DROP and SUBSCRIBE_SKIP spans are [Start, End) with an exclusive end. An empty or inverted span is a PROTOCOL_VIOLATION, where a count of 0 used to be legal.
  7. Largest Ended is a byte after Largest Frame, present when Largest Group is not 0. It is 1 for a finished or closed group. An aborted group reads 0, since it can still be fetched; the quest said "finished or closed".
    • There is no public accessor: nothing reads it yet, so it stays crate-internal and a relay just forwards it.
  8. Without update numbers, a relay records a received OLD drop under the narrowest max delay its subscription ever asked for (stale_budget). Too narrow costs a wider reader one recovery request; too wide would settle a reader on a group it could still get.
  9. Max delay "no limit" (0 on lite-07) gives up on a missing group after the model's one-second grace. The old 2^53 ms value effectively waited forever. socket::track_messages_are_read_in_key now waits half a second instead of exactly one.
  10. TRACKS_REMOVE and TRACKS_FINISH carry Kind too, not just TRACKS_ADD. Datagram tracks have their own namespace, so a name alone is ambiguous.
    • The JS listing uses datagrams: true rather than a kind field, because kind already tags JS listing events. Rust uses broadcast::Kind.
    • Sessions' internal datagram tracks for lite-05/06 and moq-transport bridging are created unlisted.
  11. JS still keys groups by sequence until @moq/net by start, so a JS publisher reads the one lite-07 Time anchor as a group key, a start as a floor at that key. This keeps fills, resumes, and Rust relays naming JS groups by the starts they received working.
    • The cost is a regression from main: a JS time anchor sent to a JS publisher whose keys are not its timestamps no longer resolves by frame timestamp (main's type 3 did), and on sparse keys a start between two groups skips the one it falls in. Nothing outside js/net builds a time anchor.
    • The alternative is a key-based containing start in the JS model now. That fixes sparse keys but still not timestamp seeks, which need JS rekeyed by start. js.md's Plan records the case.
  12. The draft's SUBSCRIBE_DROP keeps the relay rule that an OLD verdict settles only readers no wider than the subscription's budget and reading everything above it; a reader it does not settle asks again.

Validation

  • cargo nextest run -p moq-net --all-features: 4000 tests pass on the last slice, and 3989 at the A+B+C merge.
  • clippy with --all-targets --all-features -D warnings is clean on moq-net, moq-archive, moq-crypto, moq-stats, and moq-relay.
  • js/net: bun test passes (3320 tests on the final head) and bun run check is clean.
  • just check passes on the final head. One earlier run under heavy load failed test rs and a rerun passed; that failing log was lost and is not investigated.
  • just test interop --all (Rust, Node, Bun, Python over lite-07-wip) passes after the drop/update slice and again on the final code, before only doc and quest edits.
  • lite_tracks_interop, Rust and JS both ways, lists a datagram track.
  • New integration test tests/integration/group_end.rs sends GROUP_END and a bare FIN over a real session.
  • TLA+ verify/subscribe: the main config finds 15.9M distinct states in 3m37s and passes, and Continuation.cfg finds 493K in 4s and passes. Three deliberately broken variants (a missing skip join, no skip before a held-back group's drop, no skip before a served group's drop) each fail QuietIsSettled, and an earlier one that served an already-told group fails NamedOnce.
    • The model surfaced one real bug, fixed in 157042024b: a held-back skip run was lost when its group was skipped too.
  • After merging main three times (resolving against moq-dev/moq#8961's finish_at/finish, moq-dev/moq#8835's Announce Stream, moq-dev/moq#8958's Min Age join, moq-dev/moq#8910's ordered gaps, moq-dev/moq#8952's per-track ietf records, and moq-dev/moq#8929/moq-dev/moq#8931's pruned API), on the final head:
    • just check passes (11825 Rust tests); js/net bun test passes 3389 tests.
    • just test interop --all passes: 209 PASS, one known Chromium route-key SKIP.
    • TLA+ verify/subscribe passes both configs: 15.9M distinct states, and 493K for Continuation.cfg.
    • A GROUP_END is now held back only on a stream that actually carries ietf object records (object_records), since main made those per track.
  • The Codex review found two bugs on the merged branch, both fixed with a test that failed before the fix:
    • A skip held back for a group's GROUP was lost if the cache's expiry or debt forgot the skip before the group got stream credit, so neither GROUP nor SUBSCRIBE_SKIP named the run. serve now takes the held run itself (Rust and JS; the model's Serve mirrors it). Test: lite07_a_held_skip_outlives_the_cache_forgetting_it.
    • A JS lite-07 stream whose group expired mid-frame sent a FIN over a frame that then failed, truncating it. It now resets with the frame's failure, as Rust's GroupServe does. Test: lite draft-07: an expired stream resets when its frame in flight fails.
  • verify/resume and verify/failover were not rerun. Both assume nothing expires and every group is written whole, and neither distinguishes a finished group from a closed one.
  • just drafts check passes, and quest check passes.

Follow-ups

None.

Models

Size: L
Implementer: Claude Code, claude-opus-5-5, high effort
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, L)

Review

Rewritten by quest review after each round.

  • Head: 8d83f77

  • Base: origin/main at ca8b08c

  • Risk: high, The branch changes lite-07 wire behavior relied on by remote subscribers and relays, so regressions can break interoperability and reverting cannot repair already-transmitted streams.

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, xhigh effort

  • Session: 01a1e8ed-8b83-7de3-9641-3aa6c205f8eb, round 5

  • Score: 10/10, The incremental review found no new issues in the merge resolutions or their interactions with branch-added code.

  • Raised the risk to high: The branch changes lite-07 wire behavior relied on by remote subscribers and relays, so regressions can break interoperability and reverting cannot repair already-transmitted streams.

  • Rounds: 8; first round 2 (medium 2); findings 4 (medium 4): fixed 3, refuted 1, open 0

  • Findings: none

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 27 commits November 16, 2026 03:14
The lite draft names every group by its start: GROUP carries the start
and the previous group's start, GROUP_END ends a whole group, drops and
skips name spans of starts, and OLD drops are final. Folds in the pre-cut
audit's fixes: Subscriber Max Age plus one, one Time anchor, no Padding,
a listing kind, Largest Ended, and no RTCDataChannel binding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Padding Stream (0x2) and Padding Datagram (0x1) leave lite-07. A
datagram keeps its type, 0x0 the only one; any other is discarded. An
unknown uni stream type is now stopped with UNEXPECTED_STREAM on every
version rather than just dropped, so the peer learns of it at once, as JS
already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chor, and whether the largest ended

Subscriber Max Age on lite-07 SUBSCRIBE and SUBSCRIBE_UPDATE is
milliseconds plus one, 0 for no limit, so the model's unlimited budget
crosses the wire as itself. The codec carries Option<Duration>: Lite01/02,
which have no field, decode as no limit, which retires the publisher's
serving_max_delay, and lite03-06 still send 2^53 - 1 for none.

Lite-07 range anchors are 0 None, 1 Time, 2 Relative; type 3 is gone and
is malformed. Time is inclusive at both ends. An in-memory absolute
position goes out as its group's time, an exclusive end as the inclusive
time before it, so the subscriber's ranges and fills need no change.

SUBSCRIBE_OK on lite-07 adds Largest Ended after Largest Frame: the
publisher sends whether its cache's largest group ended (finished or
closed, or reported ended by its source), and a subscriber records it so
a relay forwards it. It stays crate-private: nothing in this repo reads it
yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… final (JS)

SUBSCRIBE_DROP and SUBSCRIBE_SKIP on lite-07 carry a non-empty
[Group Start, Group End) span with an exclusive end. A decoded End not past
Start is a protocol violation, and an empty span has no encoding. The
version predicate is renamed hasGroupSpan. Earlier versions keep their
inclusive Group End.

The Update field leaves SUBSCRIBE, SUBSCRIBE_UPDATE, and SUBSCRIBE_DROP,
and a SUBSCRIBE_UPDATE reopens nothing:

- Publisher: no update numbers, no update-time re-offer or re-drop. A group
  the subscription told the wire about, served or dropped (stale or not),
  is never served or dropped again on it; only a skip goes out over a drop.
  The wire record's stale variant collapses into a plain final drop.
- Subscriber: an OLD drop is final, accounted in the tail and recorded in
  the copy as a stale hole under the subscription's current budget, so a
  wider reader recovers the group through a request of its own. The
  per-update stale bookkeeping, the tail's reopen paths (restore,
  unaccount, finished streams) and Ledger.unaccount are gone. A drop that
  named a group being read ends it on a later YIELDED reset.
- Model: the copy's judged ranges are gone; supersedeStale runs only when a
  new upstream subscription opens. reofferStale and reofferGroups are
  replaced by continueGroup, which serves only the YIELDED continuation.

Tests that asserted reopening are deleted or flipped to the final behavior.

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

Lite-07 TRACKS_ADD now leads with a Kind (0x0 a track of groups with its
TRACK_INFO, 0x1 a datagram track with its DATAGRAMS_INFO), and TRACKS_REMOVE
and TRACKS_FINISH name the kind before the name. Any other kind is a
PROTOCOL_VIOLATION. A name is listed at most once per kind, and the duplicate
add / unknown removal rules apply per (kind, name).

The model lists a datagram track a broadcast creates until it ends (finished
or not), and a handler's answer lists either kind, so a relay's copy forwards
its upstream's datagram tracks too. A datagram track served on request, or a
session's datagram track riding a stream subscription (lite-05/06,
moq-transport), is never listed: sessions create those unlisted.

Rust: broadcast::TracksEvent::Added carries info: Listed (Track(track::Info) or
Datagrams(datagram::Info)); Removed and Finished carry kind: Kind.
Lister::add takes impl Into<Listed>; remove and finish take (kind, name).
moq-crypto's e2ee Lister mirrors that. lite::TracksEvent mirrors the model
with lite::Listed.

JS: TracksEvent's added variant is { kind, name } & Listed, where Listed is
{ info: track.Info, datagrams?: false } or { info: datagram.Info, datagrams:
true }; removed and finished set datagrams for a datagram track. Lister.add
takes a Listed; remove and finish take (name, datagrams).

moq-archive and moq-stats (Rust and JS) ignore datagram tracks: neither has
anything to do with one. The IETF listing lists only tracks of groups, as
before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… anchor, and whether the largest ended

The JS side of the lite-07 SUBSCRIBE changes:

- Subscriber Max Age is milliseconds plus one on lite-07, 0 for no limit. Subscribe and
  SubscribeUpdate carry `maxDelay: number | null`; lite-01/02 decode as null, and lite-03 to
  06 send no limit as the largest safe value, as before.
- Anchors are 0 none, 1 time (inclusive at both ends, full 64-bit), and 2 relative; any other
  type is a protocol violation. An absolute anchor goes out as a time, an end as the time
  before it. The JS model still keys groups by sequence, so a decoded time names that key.
- SUBSCRIBE_OK's largest carries whether its group ended. The publisher answers from its
  track, and the subscriber records it so a relay forwards it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Track Datagram on a scale-less datagram track carries its producer's bare timestamp, which
is its sequence, instead of omitting it. Lite-05/06 already stamp every datagram, so every
version with datagrams now carries one: the body codec drops its untimed form and the
lookup it needed to tell them apart. A subscriber reads a scale-less one as an unscaled
timestamp, which the track checks against the sequence.

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

SUBSCRIBE_DROP on lite-07 is now Group Start, Group End, Error Code, and
SUBSCRIBE_SKIP Group Start, Group End: a span [Start, End) with no count, where
an End at or below the Start is a PROTOCOL_VIOLATION. The Update field leaves
SUBSCRIBE, SUBSCRIBE_UPDATE, and SUBSCRIBE_DROP.

A stale (OLD) drop is final on its subscription. A SUBSCRIBE_UPDATE reopens
nothing: the publisher never serves or names again a group it already served or
dropped, and the subscriber never owes one again. A relay records a stale drop
under the narrowest budget its subscription asked, since the wire no longer says
which update a drop crossed; a reader wider than that asks for the group on a
request of its own.

Deleted with the reopen paths: the publisher's update number, redrop and
reoffered sets and stale replacement; the record's stale reports that an update
reopened; the track's judged ranges, re-offers, and tail billing; the tail's
finished and folded bookkeeping and its update count. The TLA+ model drops
updates, the StreamWins rule and config, and NoViolation, and gains NamedOnce.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…imited reader's grace

Lite-07 now carries no max age as 0, so a socket's unlimited reader reaches the publisher as
no limit rather than as the largest safe budget. The model waits a hole out for its grace
under no limit, then gives it up, so the test's late message lands inside that grace.
Formatting from `just fix` rides along.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirrors Rust: with no update number on SUBSCRIBE_DROP, a lite-07 stale drop
that arrives after a widening SUBSCRIBE_UPDATE may have been judged under the
budget before it, so the subscriber records it under the narrowest max delay
the subscription asked. A recovery's subscription records its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The model has no updates to reopen a drop, so the skill drops the update
numbers, re-offers, StreamWins and its open finding, adds NamedOnce, and syncs
the coverage table to the code. With the state space smaller, the default
config now covers two groups and Continuation.cfg two frames and three
YIELDED resets; both pass (about 70.8M and 840K distinct states).

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

# Conflicts:
#	js/net/src/lite/subscriber.ts
#	rs/moq-net/src/lite/publisher.rs
#	rs/moq-net/src/lite/subscribe.rs
#	rs/moq-net/src/lite/subscriber.rs
…GROUP_END

GROUP gains Previous Start (the previous group's start plus one, 0 unknown). The
publisher derives it from the skip run directly below the group, or a group just
below it, and stops sending SUBSCRIBE_SKIP for a run its GROUP passes over; the run
goes out as SUBSCRIBE_SKIP ahead of a drop of that group, or once an update means the
group is no longer owed. The subscriber records the passed-over starts as skipped
and refuses a previous start at or above the group's own.

A Group or Fetch Stream ends a finished group with GROUP_END (Payload Length 0, then
End) before its FIN; a bare FIN closes the group. The receiver finishes the group at
End, refusing anything after GROUP_END or an End the group refuses as a malformed
track, and closes it on a bare FIN. recv::Group splits into finish(end) and close().

A group that expires after its stream opened is closed rather than reset with OLD,
and needs no drop; one whose stream never opened is still dropped. A stream whose end
was written is never reset for expiry.

A scale-less lite-07 FRAME carries its timestamp, its group's start; any other value
is a TIMESTAMP_MISMATCH. Fills answer a group the copy records skipped, as a
SUBSCRIBE_SKIP would.

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

The JS counterpart of the Rust change.

- GROUP encodes and decodes Previous Start plus one on lite-07, 0 when
  unknown. The subscriber applies the starts it passes over as a skip, and
  refuses a previous start at or past the group's own as a malformed track.
- A Group Stream reads a Payload Length of 0 as GROUP_END, then the group's
  exclusive End, then the FIN; anything after it, or an End at or before the
  group's start, is malformed. A bare FIN closes the group.
- `Group.Producer.finish(end?)` finishes a group whole at `end`, or closes
  it without one, and `Group.Consumer.end` reads it back. A finished group's
  stream and a FETCH that reaches its end write GROUP_END.
- A scale-less lite-07 track stamps each frame with its group's start, and
  the subscriber refuses any other value with TIMESTAMP_MISMATCH.
- A lite-07 stream whose group expires after it opened is closed at the next
  frame boundary rather than reset, and no drop names the group.
- The publisher holds a skip back for the GROUP of the cached group just
  above it, and sends it ahead of that group's drop, or joined to its skip,
  if the group is given up instead. A drop of a group whose stream opened
  goes out after a skip of what its GROUP passed over.

Tests cover each, and the parked-expiry and copy-fill tests now tell an
eviction from a stale group, which lite-07 closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A skip held back for the GROUP of the group above it stayed held forever
once that group was skipped too: no GROUP would pass over it, and only a
drop sent it. A skip of that group now joins the held run, and a drop of
it sends the run first, as before.

Also catches up the tests that hand-build lite-07 bytes: the moq-tokio
receive credit GROUP headers carry a Previous Start, and the lite varint
interop GROUP names one, so both languages encode it alike.

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

SubscribeAccounting now describes lite-07 as the code runs it:

- A serving Group Stream whose group expires closes with a FIN and no
  drop (`StreamClose`). Only a stream that never opened is still given up
  with OLD, and nothing resets a stream once its FIN went out.
- Each GROUP passes over the skipped run directly below it. The publisher
  holds a skip back for the GROUP of a group it still owes (`held`), and
  sends it ahead of that group's drop or joined to its skip. A drop of a
  group whose stream opened repeats what its GROUP passed over first
  (`nahead`), which NamedOnce allows once.

Groups start at 1 in SubscribeAccounting.cfg, so a skip of 1 can be held
for 2. Both configs pass: 15.9M distinct states in four minutes, and 493K
in five seconds for Continuation.cfg. Mutations dropping the join, the
skip ahead of a held group's drop, or the skip ahead of a served group's
drop each break QuietIsSettled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deletes the quest and its links, and moves GROUP's Frame Start and the
model's YIELDED half to the YIELDED deferral, which still owns them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The lite-07 wire addresses groups by start feat(net)!: the lite-07 wire addresses groups by start Nov 16, 2026
The JS model resolving a lite-07 Time start to its containing group is
recorded in the quest that rekeys the JS model by start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 16, 2026 17:47
@pullfrog

pullfrog Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

This is the inline finding from the Pullfrog review, which the tooling dropped because it saw no textual diff for rs/moq-net/src/lite/publisher.rs.

ℹ️ A held-back skip run is lost when Previous Start changes before the GROUP goes out

When a skip run was held back for a group, serve() discards it with self.elided.remove(&key) (rs/moq-net/src/lite/publisher.rs:6071). Only after that does it recompute previous = self.track.previous_start(key). Nothing checks that the fresh Previous Start still passes over the held-back run; elides() checked that, but only when the run was held back. JS has the same pattern at js/net/src/lite/publisher.ts:1977-1978.

The run is lost if the Hole::Skip run below the group is no longer in the track's drops by the time the GROUP is written. That can happen in two ways:

  • forget_drops clears it, through expiry or billing reclaim while the group waits for stream credit.
  • A route switch moves serving to a copy that never learned the skip (Resume::previous_start asks only the serving copy).

The GROUP then goes out with Previous Start = 0, and the run is never sent as a SUBSCRIBE_SKIP. That breaks the draft's rule that every start is accounted for, and the subscriber's tail waits out the grace for those starts.

Technical details
# Held-back skip run lost when Previous Start changes before the GROUP is written

## Affected sites
- rs/moq-net/src/lite/publisher.rs:6071-6075 — `elided.remove(&key)`, then `previous_start(key)`, with no check of one against the other
- js/net/src/lite/publisher.ts:1977-1978 — the same pattern
- rs/moq-net/src/model/track.rs:1321 `previous_start` and the JS `hooks.previousStart` read `drops`, which `forget_drops` can clear

## Required outcome
- A run held back for a group must always reach the subscriber: either the GROUP's `Previous Start` passes over it (previous < elided start), or it goes out as SUBSCRIBE_SKIP ahead of the GROUP.

## Suggested approach
- Read the elided start before computing `previous`. Because the run was already declared skipped, `elided_start - 1` is a sound fallback: use the lower of the fresh value and `elided_start - 1`, or `elided_start - 1` alone when the fresh value is `None` or does not reach the run.
- A `verify/subscribe` variant in which drops can be forgotten between elision and serve would model this.

I worked this out by reading the code and did not reproduce it. The part I'm least sure of is whether forget_drops can clear the run while the group is still waiting.

Pullfrog  | View workflow run | via Pullfrog | Using claude-opus-5-5 | 𝕏

@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision (2026-11-16, /quest-run)

(Written by Opus 5.5)

kixelated and others added 10 commits November 17, 2026 01:12
Takes main's group::Producer::finish_at(end)/finish() names (#8961), with JS
mirroring them as finishAt(end)/finish(), keeps main's Announce Stream (0x3)
while dropping Padding (0x2), and drops main's edits to the re-offer and
judged-range tests this branch removes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's changes since touch no function the model covers, and both configs pass there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… close never cuts a frame

A GROUP whose skip run was held back passes over that run even once the cache's
expiry or debt forgot the skip, in Rust and JS and the subscribe model. A JS
lite-07 stream that expires mid-frame resets with the frame's failure instead of
closing over a truncated frame, as Rust's GroupServe already does.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps main's per-track ietf records (#8952), with GROUP_END held back only on a
stream that carries them, and main's ordered-reader gap test (#8910), and drops
main's edits to the superseded-budget test this branch removes.

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

Main's changes since touch only ietf records and the ordered reader, which the model
leaves out; both configs pass on the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Takes main's narrower Version::has_datagrams and its pruned @moq/net report
(#8929, #8931), keeping Group.Producer.finishAt.

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

Copy link
Copy Markdown
Collaborator Author

Applying the maintainer decision on head 8d83f77: main is merged in (no rebase), resolving against #8961, #8910, #8952, and #8929. just check, just test interop --all (209 PASS, one known Chromium skip), and both verify-subscribe configs pass on this head. The pick is recorded under ## Decisions in the PR body. The merge is not queued.

(Written by Claude Opus 5.5)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. The held-skip gap from the last review is closed.

Reviewed changes

This run covers the commits since 03d0b70: two fixes and the JS finishAt split, plus three merges of main. Most of the range-diff comes from those merges.

  • Held skip survives the cache forgetting it: TrackRun::serve (and JS serve) now takes the held run's start before computing Previous Start, as min(elided − 1, previous_start(key)). A pool expiry or debt that clears the cached skip no longer sends a GROUP with Previous Start 0 and no SUBSCRIBE_SKIP. A run is held only when previous_start(above) < run.start, so checked_sub(1) never drops a real run. lite07_a_held_skip_outlives_the_cache_forgetting_it covers this, and the TLA+ Serve now passes over held[g].
  • JS expiry close waits for the frame in flight: an expired lite-07 stream now closes only after the frame being written completes. If that frame fails, the stream resets with the frame's error rather than sending a FIN over a truncated frame, which matches Rust GroupServe.
  • JS Group.Producer.finishAt(end): finish() no longer takes an end. The subscriber's GROUP_END paths call finishAt, and every caller in js/ has moved to the new shape. The API report is regenerated.
  • Merges of main: the PR now uses finish_at/finish from #8961 and suppresses GROUP_END per track with object_records from #8952. The fixtures and tests are updated for both.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed 8d83f77555e58514ec2d0cf340d45691d85dad4e. The held skip now survives cache eviction in Rust and JS. JS expiry waits for the current frame write instead of ending it mid-frame. Rust suppression of GROUP_END now keys off per-track object-record mode, not just the session flag. Those changes look sound by inspection.

Correction to my earlier boundary finding: the draft already limits frame timestamps to below 2^61 and requires scale-less frames to use their group start. A nonempty scale-less group at 2^63 is therefore not conforming wire input. The remaining concern is API enforcement: an unscaled start outside the draft range can still be accepted before encoding later fails. Prefer rejecting it early; this is not evidence that a conforming timestamp cannot be encoded.

Static review only; I didn’t run Rust↔JS interop.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Re the automated review's remaining note on rejecting an unscaled start past the draft range early: left as is in this PR. A scale-less key is wire-agnostic in the model (Timestamp::unscaled takes any u64), since moq-transport group IDs up to 2^62 - 1 and older lite wires carry such keys, so the model can't refuse it at create_group/append_group without breaking those. On lite-07 the receiver already refuses a frame timestamp past 2^61 - 1 as malformed (a_received_timestamp_past_2_61_is_refused). I tried moving that refusal to the publisher's encode (Stamp::wire) and backed it out: it would also stop a third-party moq-transport ID past 2^61 from crossing a Rust lite-07 hop to a JS reader. Today that works, because JS doesn't bound the timestamp. Deciding that belongs with freezing lite-07's timestamp bound in lite07-finalize, alongside the matching JS receive check. It shouldn't land as a side effect here.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit fb443a5 Nov 17, 2026
8 checks passed
@kixelated
kixelated deleted the quest/m2/time-addressing/lite07 branch November 17, 2026 12:42
kixelated added a commit that referenced this pull request Nov 17, 2026
#8908 made every drop final and dropped SUBSCRIBE_UPDATE re-offers, so this
drops the re-offer hold rules along with YIELDED. With no continuation left on
a subscription, lite-07 GROUP loses Frame Start: every Group Stream starts at
frame 0. The subscribe accounting model is re-derived for one Group Stream per
group.

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