Skip to content

lite-07 Group Streams carry each time once, and GROUP_END the group's end - #9263

Draft
kixelated wants to merge 3 commits into
mainfrom
quest/m2/time-addressing/group-times
Draft

kixelated wants to merge 3 commits into
mainfrom
quest/m2/time-addressing/group-times

Conversation

@kixelated

@kixelated kixelated commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Completes Group times. On lite-07-wip a Group Stream carries each time once:

  • GROUP keeps Group Start and loses Previous Start.
  • The first FRAME's Timestamp Delta counts from the Group Start (on a Fetch Stream, from the FETCH's), so frame 0's is 0.
  • A scale-less FRAME carries no Timestamp Delta; its time is its group's start.
  • GROUP_END carries the End as a non-negative delta from the highest frame timestamp on the stream, or from the Group Start when the stream carried no frame. Rust keeps a stream's base in lite::Clock, shared by Group and Fetch Streams on both sides.

A whole group's span, [start, End), holds no other start:

  • Its GROUP_END accounts for the starts inside it: the publisher records them told, the subscriber's tail accounts them, and a copy records them skipped, as the publisher's own append_group did.
  • A drop of a group held whole names its span, since the reset can lose the GROUP_END.
  • SUBSCRIBE_SKIP names the rest, [End, next start), and contiguous groups send none. The publisher's elision of skips a GROUP's Previous Start passed over (TrackRun::elided, owes_group, send_elided) is gone.
  • group::Producer::finish_at refuses an End below the group's highest frame, and accepts one equal to it or to the start.

Producers that ended a group below a frame of their own now close it without an End: moq-mux close_group and hang's legacy #close. Their overlap belongs to groups never overlap, which now lists both guards to delete.

The draft (Frame, Group, GROUP, FRAME, GROUP_END, SUBSCRIBE_SKIP/DROP, the changelog), doc/concept/moq-lite.md, and the subscribe model (SubscribeAccounting.tla) change with it.

Public API and wire impact

  • Wire: lite-07-wip only, which is unpublished. lite-05/06 and moq-transport are unchanged.
  • Rust: group::Producer::finish_at returns TimestampMismatch for an End below the group's highest frame, where it previously accepted any End above the start. JS Group.Producer.finishAt matches.
  • Internal only otherwise: track::Subscriber::previous_start and holds became span_end; JS hooks previousStart became wholeEnd/wholeAround.

Migration note for MIGRATE.md: a producer calling finish_at(end) must pass an end at or above every frame timestamp it wrote to the group, or call finish().

Validation

  • just check passes, after merging main (with fix(moq-net): a waiting time start reads its owed group first, and a fill past the live edge reaches subscriptions #9172).
  • just rs test --workspace --all-features: 13050 passed.
  • bun test in js/net (3431) and js/hang (786) pass.
  • just test interop --all: all checks passed, including drop moq-lite-07-wip both ways and the lite-07 tail and compress cases.
  • /verify-subscribe: SubscribeAccounting.tla checks ServedOnce, NamedOnce, and QuietIsSettled with group 1 ending at 2, 3, or 4, so its span holds none, one, or both starts above it: 75.7M distinct states, nine minutes, no violation. Only its comments changed after that run.
  • New tests:
    • Codec: GROUP round trip and size bound without Previous Start; the fixtures in rs/moq-net/fixtures/lite.json.
    • A first delta counts from the group's start (Rust receive_group; JS, also for a stream resumed at Frame Start above 0).
    • A B-frame group's GROUP_END counts from its highest frame (group_end_counts_from_the_highest_frame), and an End past 64 bits is refused.
    • A scale-less frame takes its group's start.
    • Contiguous whole groups send no SKIP, and a pause sends [End, next) (lite07_skips_only_past_a_whole_groups_end), even when each group finishes as the next is appended.
    • A whole group's drop names its span; its span is not dropped again at the track's end (verified failing without GroupOutcomes::whole).
    • JS: a lite-07 GROUP_END accounts for its span in the tail and the copy.

Two regressions found and fixed along the way:

  • Skipping an append from the previous group's End rather than just past its start broke lite-06 readers of a local track (moq-hls over lite-06), which have no GROUP_END to name the span. The append's skip stays as on main.
  • Reading a whole group's span as a hole without a recorded skip hid a gap in moq-mux's a_lost_discontinuity_marker_still_breaks_the_clock, whose marker group starts inside the previous group's span. That is the overlap noted in groups-never-overlap.

Waiting

  • Maintainer: confirm the GROUP_END base is the highest frame timestamp on the stream, not the group's. A stream resumed at Frame Start above 0 doesn't carry the lower frames, so a group-wide base would stop the stream from decoding alone. Recommended: keep it per stream, as the draft now says.
  • Maintainer: the Time Anchor rule for spans, and a cache proving a time from a held whole group, are in span-time anchors, now Required by the lite-07 cut. Recommended: keep it a follow-up and keep it Required, since it changes the draft's Time Anchor text and overlaps no-relative-anchors and fix(moq-net): a waiting time start reads its owed group first, and a fill past the live edge reaches subscriptions #9172.
  • Maintainer: moq-mux and hang's legacy producer close without an End where theirs would fall below a frame of their own, until groups never overlap lands. Recommended: keep the guards, which that quest deletes.
  • Maintainer: a SUBSCRIBE_SKIP may still name starts inside a whole group's span when it races ahead of the GROUP_END (or follows a drop that named the group before it was whole). Both say no group starts there, and the model checks it. Recommended: allow it rather than hold skips back, which is the elision this quest removed.
  • Maintainer: the subscribe model check now takes nine minutes, up from two, for the span cases. Recommended: accept; it runs nightly.

Follow-ups

  • A time anchor lands by group spans (new): the Time Anchor rule and the cache proof from a whole group.
  • Groups never overlap (updated): the producer guards above, the discontinuity marker that starts inside the span cut(end) just closed, and the overlapping keyframe's estimated End.

Models

Size: L
Implementer: Claude, claude-opus-5-5, high effort

(Written by Claude Opus 5.5 with high)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 168e500, named in full once no reviewer reports a finding

  • Base: origin/main at cb9cb51

  • Risk: high, The change alters lite-07 GROUP headers and timestamp/end encoding, which can break interoperability for Rust and JS consumers and deployed peers; reverting code cannot restore compatibility with peers already using the changed wire format.

  • Classified: high by Codex, gpt-6.1-sol, low effort, session 01a1fc78-e908-7012-b343-32c3a7c8d81d

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

  • Session: 01a1fc79-10e6-74d3-83a4-866bb80bf064, round 1

  • Score: 6/10, The head needs rework because span traversal can panic and valid JS streamed-frame groups are rejected.

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

  • Findings, open until the next round settles them:

    • High, rs/moq-net/src/model/track.rs:1805: Stop span traversal when it passes the requested end
    • Medium, js/net/src/group.ts:741: Rescale streamed timestamps before validating the group end

kixelated and others added 2 commits November 20, 2026 20:44
… the group's end

On lite-07-wip, GROUP loses Previous Start, the first FRAME's Timestamp Delta
counts from the Group Start (the FETCH's on a Fetch Stream), a scale-less FRAME
carries no Timestamp Delta, and GROUP_END carries the End as a non-negative
delta from the highest frame timestamp on the stream, or from the Group Start.

A whole group's span, [start, End), holds no other start. Its GROUP_END
accounts for the starts inside it, which a copy records skipped, and a drop of
a group held whole names its span. The publisher's elision of skips a GROUP's
Previous Start passed over goes. `finish_at` refuses an End below the group's
highest frame, so moq-mux and hang's legacy producer close without an End when
theirs would fall below a frame of their own.

The time-anchor rule for spans moves to a follow-up quest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing/group-times

# Conflicts:
#	quest/m2/README.md

This branch has not been deployed

No deployments
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