Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3c66035
quest(m1): claim archive/subscribe-all
kixelated Oct 19, 2026
ba2db36
wip(moq-net): list a broadcast's tracks and an origin's broadcasts
kixelated Oct 19, 2026
6c1d522
wip(moq-net): SUBSCRIBE_ALL codec and publisher
kixelated Oct 19, 2026
504edca
wip(moq-net): SUBSCRIBE_ALL subscriber and integration tests
kixelated Oct 19, 2026
9371656
wip(moq-lite): specify SUBSCRIBE_ALL in lite-07
kixelated Oct 19, 2026
75c42cb
wip(moq-net): one lister per session, and a SUBSCRIBE_ALL benchmark
kixelated Oct 19, 2026
c960069
quest(m1): split SUBSCRIBE_ALL's JS half into its own quest
kixelated Oct 19, 2026
bdc5cce
wip(moq-net): document SUBSCRIBE_ALL and format
kixelated Oct 19, 2026
f05ee72
wip(moq-net): mark the listing hook pending and lint without async
kixelated Oct 19, 2026
9c570dc
Merge remote-tracking branch 'origin/main' into quest/m1/archive/subs…
kixelated Oct 19, 2026
ce49a22
wip(doc): count the Subscribe All row in the draft table test
kixelated Oct 19, 2026
1e8b71b
Merge remote-tracking branch 'origin/main' into iter-subscribe-all
kixelated Oct 19, 2026
f074d09
fix(net): one copy per listed track, and its floor goes upstream
kixelated Oct 19, 2026
059a9c7
Merge remote-tracking branch 'origin/main' into iter-subscribe-all
kixelated Oct 19, 2026
87a3547
fix(net): lints after merging main
kixelated Oct 19, 2026
87c893f
style(net): format
kixelated Oct 19, 2026
da26dca
Merge branch 'main' of github.com:moq-dev/moq into iter-subscribe-all
kixelated Oct 19, 2026
c3199e8
Merge branch 'main' of github.com:moq-dev/moq into iter-subscribe-all
kixelated Oct 19, 2026
128a251
Merge branch 'main' of github.com:moq-dev/moq into iter-subscribe-all
kixelated Oct 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/.vitepress/drafts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,20 @@ describe("tables render as tables", () => {

const rendered = html(page as DraftPage);

// The Bidirectional Streams table: one header, seven body rows, each
// The Bidirectional Streams table: one header, eight body rows, each
// separated by a kramdown rule in the source. Cells carry the source's
// alignment, so match around the style attribute.
const header = /<th[^>]*>Stream<\/th>/.exec(rendered);
expect(header).not.toBeNull();

for (const stream of ["Announce", "Subscribe", "Fetch", "Probe", "Goaway", "Track", "Auth"]) {
for (const stream of ["Announce", "Subscribe", "Fetch", "Probe", "Goaway", "Track", "Auth", "Subscribe All"]) {
expect(rendered).toMatch(new RegExp(`<td[^>]*>${stream}</td>`));
}

// One header row plus seven body rows, in a single table.
// One header row plus eight body rows, in a single table.
const start = rendered.lastIndexOf("<table", header?.index);
const rows = rendered.slice(start).split("</table>")[0];
expect(rows.match(/<tr>/g) ?? []).toHaveLength(8);
expect(rows.match(/<tr>/g) ?? []).toHaveLength(9);
});
});

Expand Down
7 changes: 7 additions & 0 deletions doc/concept/moq-lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ JSON snapshot). Groups can also be fetched by sequence number, which is how the
[HLS gateway](/bin/hls) and the relay's [HTTP fetch](/bin/relay/http) serve
history.

On moq-lite 07 (`moq-lite-07-wip`, opt-in) a subscriber can instead ask for
every track of every broadcast under a path prefix in one request, including
tracks and broadcasts that appear later, so it records everything without
reading a catalog. Only tracks a publisher creates are listed, never ones it
serves on request, and a relay answers every such request for a prefix with
one request upstream. Rust only for now.

Each subscription carries the knobs that decide behavior under congestion:

| Knob | Effect |
Expand Down
175 changes: 174 additions & 1 deletion drafts/draft-lcurley-moq-lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ There's a 1-byte STREAM_TYPE at the beginning of each stream.
| ------- | ------------- | ----------- |
| 0x7 | Auth | Either |
| ------- | ------------- | ----------- |
| 0x8 | Subscribe All | Subscriber |
| ------- | ------------- | ----------- |

### Announce
A subscriber can open an Announce Stream to discover routes matching a prefix.
Expand Down Expand Up @@ -519,6 +521,29 @@ A publisher closing its session gracefully MUST wait for the subscriber's FIN or
A subscriber MAY cancel by closing its side (FIN); the publisher then closes its side (FIN) without owing SUBSCRIBE_END.
Unbounded subscriptions stay open until SUBSCRIBE_END, and either endpoint MAY reset the stream at any time.

### Subscribe All {#subscribe-all-stream}
A subscriber opens a Subscribe All Stream (0x8) to subscribe to every Track of every Broadcast under a prefix, including Tracks and Broadcasts that appear later.
A subscriber that wants every Track, such as an archive, needs no catalog and opens no stream per Track.

The subscriber sends a SUBSCRIBE_ALL message followed by any number of SUBSCRIBE_ALL_UPDATE messages, each of which applies to every Track of the request.
The publisher sends a BROADCAST_START for each Broadcast it holds under the prefix, as it learns of it, and a BROADCAST_START for a new publisher instance at the same path even while the old one is listed.
A Broadcast whose path has a `.`-prefixed segment below the prefix is not listed (see [Hidden Paths](#hidden)).
The publisher then sends a TRACK_START for each Track the Broadcast's producer creates, and serves it as if the subscriber had sent a SUBSCRIBE for it with the request's preferences and no bounds: TRACK_OK and TRACK_END stand in for the Track's SUBSCRIBE_OK and SUBSCRIBE_END, its groups arrive on Track Group Streams (0x2), and a TRACK_RESET stands in for the reset of its Subscribe Stream.
A Track served only on request, which a producer never creates, is never listed.
A publisher MUST NOT deliver a Track of a SUBSCRIBE_ALL as a datagram.
Once a Broadcast ends, the publisher sends a BROADCAST_END and lists no more of its Tracks; each listed Track still ends with its own TRACK_END or TRACK_RESET.

A Track Group Stream can arrive before the TRACK_START naming its Track, since the two travel on different streams.
The subscriber MUST NOT reject such a stream while the request is open; it waits for the TRACK_START.

The request needs subscribe permission on the prefix, and the publisher MUST NOT list a Broadcast the session does not allow.
It counts as one subscription against the publisher's bound (see [Resource Exhaustion](#resource-exhaustion)).
A relay MAY answer every SUBSCRIBE_ALL for a prefix with one request upstream.
Such a relay sends the highest `Subscriber Priority` and `Subscriber Max Age` its downstream readers ask for, with SUBSCRIBE_ALL_UPDATE as they change.
A subscriber that wants a listed Track's groups below its TRACK_OK `Group` sends a SUBSCRIBE for them that ends before that `Group`; a relay without them does the same upstream.
The subscriber cancels by closing its side (FIN), and the publisher then closes its own without owing anything further.
The publisher closes its side once it will list no more Broadcasts and every listed Track has ended.

### Fetch
A subscriber opens a Fetch Stream (0x3) to request a single Group from a Track.

Expand Down Expand Up @@ -699,6 +724,8 @@ Unidirectional streams are used for data transmission.
| ------ | -------- | ----------- |
| 0x1 | Setup | Either |
| ------ | -------- | ----------- |
| 0x2 | Track Group | Publisher |
| ------ | -------- | ----------- |

### Setup {#setup-stream}
Each endpoint MUST open a Setup Stream (0x1) at the start of the session to advertise the optional capabilities and extensions it supports.
Expand All @@ -710,7 +737,8 @@ An endpoint with no optional capabilities sends a SETUP with an empty parameter
See the [Session](#session) section for how an endpoint avoids waiting on the peer's SETUP before exchanging other streams.

### Group
A publisher creates Group Streams in response to a Subscribe Stream.
A publisher creates Group Streams in response to a Subscribe Stream, and Track Group Streams (0x2) for a Track of a [Subscribe All Stream](#subscribe-all-stream).
A Track Group Stream starts with a TRACK_GROUP message instead of a GROUP message and is otherwise the same.

A Group Stream MUST start with a GROUP message and MAY be followed by any number of FRAME messages.
A Group MAY contain zero FRAME messages, potentially indicating a gap in the track.
Expand Down Expand Up @@ -1342,6 +1370,129 @@ The publisher MUST NOT send SUBSCRIBE_END until every Group Stream it will open
The subscriber has received every Group Stream once it has read the header of `Stream Count` of them, which MAY happen after SUBSCRIBE_END or the FIN since streams are not ordered.
A Group Stream reset before its header arrived is never seen, so a subscriber SHOULD bound how long it waits for the rest, for example by `Subscriber Max Age`.

## SUBSCRIBE_ALL {#subscribe-all}
SUBSCRIBE_ALL is the first message on a Subscribe All Stream.

~~~
SUBSCRIBE_ALL Message {
Message Length (i)
Subscribe ID (i)
Broadcast Path Prefix (s)
Subscriber Priority (8)
Group Order (8)
Subscriber Max Age (i)
}
~~~

**Subscribe ID**:
Drawn from the same space as the SUBSCRIBE `Subscribe ID`, and named by every TRACK_GROUP of the request.

**Broadcast Path Prefix**:
The prefix whose Broadcasts are listed.

See [SUBSCRIBE](#subscribe) for the other fields, which apply to every listed Track.

## SUBSCRIBE_ALL_UPDATE
SUBSCRIBE_ALL_UPDATE changes the preferences of every Track of a SUBSCRIBE_ALL.

~~~
SUBSCRIBE_ALL_UPDATE Message {
Message Length (i)
Subscriber Priority (8)
Group Order (8)
Subscriber Max Age (i)
}
~~~

## BROADCAST_START {#broadcast-start}
BROADCAST_START lists a Broadcast on a Subscribe All Stream.
Each one implicitly assigns the next Broadcast ID, starting at 0.

~~~
BROADCAST_START Message {
Type (i) = 0x0
Message Length (i)
Broadcast Path Suffix (s)
Epoch (b)
}
~~~

**Broadcast Path Suffix**:
The Broadcast's path, relative to the requested prefix.

**Epoch**:
The publisher instance, encoded as in [ANNOUNCE_START](#announce-start).

## BROADCAST_END
BROADCAST_END says a listed Broadcast has ended: no further Track of it is listed.

~~~
BROADCAST_END Message {
Type (i) = 0x1
Message Length (i)
Broadcast ID (i)
}
~~~

## TRACK_START {#track-start}
TRACK_START lists a Track of a listed Broadcast, with its [TRACK_INFO](#track-info) fields.
Each one implicitly assigns the next Track ID, starting at 0.
A Broadcast ID that is unknown or has ended is a PROTOCOL_VIOLATION.

~~~
TRACK_START Message {
Type (i) = 0x2
Message Length (i)
Broadcast ID (i)
Track Name (s)
Publisher Priority (8)
Publisher Max Age (i)
Timescale (i)
}
~~~

## TRACK_OK
TRACK_OK is a listed Track's [SUBSCRIBE_OK](#subscribe-ok).

~~~
TRACK_OK Message {
Type (i) = 0x3
Message Length (i)
Track ID (i)
Group (i)
Largest Group (i)
[Largest Frame (i)]
}
~~~

## TRACK_END
TRACK_END is a listed Track's [SUBSCRIBE_END](#subscribe-end), counting its Track Group Streams.

~~~
TRACK_END Message {
Type (i) = 0x4
Message Length (i)
Track ID (i)
Group (i)
Stream Count (i)
}
~~~

## TRACK_RESET
TRACK_RESET ends a listed Track with an error, as a reset of its Subscribe Stream would.

~~~
TRACK_RESET Message {
Type (i) = 0x5
Message Length (i)
Track ID (i)
Error Code (i)
}
~~~

**Error Code**:
A stream error code (see [Stream Error Codes](#stream-error-codes)).

## FETCH
FETCH is sent by a subscriber to request a single group from a track.

Expand Down Expand Up @@ -1555,6 +1706,27 @@ A non-zero value means the leading frames are not on this stream, either because
The subscriber MUST NOT assume it will receive the missing frames on another stream; they are a gap unless a separate subscription or FETCH covers them.


## TRACK_GROUP
The TRACK_GROUP message starts a Track Group Stream: a GROUP of a Track listed by a SUBSCRIBE_ALL.

~~~
TRACK_GROUP Message {
Message Length (i)
Subscribe ID (i)
Track ID (i)
Group Sequence (i)
Frame Start (i)
}
~~~

**Subscribe ID**:
The SUBSCRIBE_ALL's Subscribe ID.

**Track ID**:
The Track, as assigned by its TRACK_START.

See [GROUP](#group) for the other fields.

## FRAME
The FRAME message is a payload within a group.

Expand Down Expand Up @@ -1634,6 +1806,7 @@ The `Message Length` describes the payload size on the wire.
- Any Setup Stream or bidirectional stream message that fails to decode closes the session with PROTOCOL_VIOLATION; previously only an unexpected Message Length did, as a SHOULD. A stream ending mid-message outside the Setup and Auth Streams, a malformed GROUP or FRAME, and a stream type the negotiated version predates still affect only that stream.
- A Report-level publisher reads and ignores PROBE targets instead of resetting the Probe Stream.
- Added NOT_SUPPORTED (0x30) to session errors; unsupported Auth Stream tokens and grants use AUTH_ERROR before or after a grant.
- Added the Subscribe All Stream (0x8) and the Track Group Stream (0x2): SUBSCRIBE_ALL subscribes to every Track of every Broadcast under a prefix, listed with BROADCAST_START, BROADCAST_END, and TRACK_START, and served with TRACK_OK, TRACK_END, and TRACK_RESET. Earlier versions have neither.
- Added the Auth Stream (0x7) with AUTH, AUTH_OK, and AUTH_ERROR: either endpoint presents a token on its own stream and learns the [path patterns](#path-pattern) it may publish and subscribe to. The union of a session's open grants is its scope. A shrink withdraws what it no longer covers, and an announcement outside the scope closes the session with UNAUTHORIZED. A peer without the stream resets it.

## moq-lite-06
Expand Down
1 change: 1 addition & 0 deletions quest/m1/archive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ from a host. Each child fixes the stale docs it touches.
## Required

- [SUBSCRIBE_ALL](/quest/m1/archive/subscribe-all.md) - one prefix-scoped moq-lite-07 request delivers every track of every broadcast under a path, including later ones, and relays fan it out from one upstream request
- [SUBSCRIBE_ALL in js/net](/quest/m1/archive/subscribe-all-js.md) - `@moq/net` lists and serves every track of every broadcast under a prefix over lite-07, mirroring the Rust names
- [Archive producer](/quest/m1/archive/producer.md) - `archive::Producer` stores every matching broadcast as duration-cut per-track objects keyed by group and pts, recording gaps instead of stalling, with an optional DVR mode
- [Archive consumer](/quest/m1/archive/consumer.md) - `archive::Consumer` serves a stored prefix as a broadcast from its key listing, and `moq export/import archive` use the new pair
- [Catalog HLS field](/quest/m1/archive/catalog-hls.md) - the root `archive` section is gone; an opt-in per-rendition `hls` field marks each aligned HLS segment's first group and pts and declares its nominal duration
Expand Down
35 changes: 35 additions & 0 deletions quest/m1/archive/subscribe-all-js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# [L] SUBSCRIBE_ALL in js/net

## Goal

`@moq/net` speaks moq-lite-07's SUBSCRIBE_ALL in both directions. A JS
consumer lists every broadcast under a prefix and every track each one's
producer creates, with the Rust names mirrored (`broadcasts(prefix)` on the
origin consumer, `tracks()` on the broadcast consumer). A JS publisher answers
a peer's SUBSCRIBE_ALL from its own broadcasts. Older versions refuse the
stream, as in Rust.

## Plan

See [SUBSCRIBE_ALL](/quest/m1/archive/subscribe-all.md) for the decisions and
the wire, which the Rust half fixed in `drafts/draft-lcurley-moq-lite.md`.

- Codec: SUBSCRIBE_ALL, SUBSCRIBE_ALL_UPDATE, the six typed responses, and the
TRACK_GROUP header (uni 0x2), refused before lite-07.
- Subscriber: one request per prefix per session, shared by every listing of
it; a TRACK_GROUP stream ahead of its TRACK_START waits for it.
- Publisher: list each broadcast as it appears and each track as its producer
creates it, never one served only on request; no datagrams.
- Mirror whatever the Rust half settles for the open decisions it left
(start floor, sharing listed tracks with ordinary requests).

Tests: Rust and JS list each other's broadcasts over lite-07, directly and
through moq-relay, including a track added later and a broadcast ending; a
lite-06 session lists nothing.

Public API: `broadcasts(prefix)` and `tracks()` in `@moq/net`. Wire: none
beyond the Rust half.

## Required

- [SUBSCRIBE_ALL](/quest/m1/archive/subscribe-all.md) - fixes the lite-07 wire and the Rust model this mirrors
8 changes: 4 additions & 4 deletions quest/m1/archive/subscribe-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ request and broadcasts that appear later, and delivers their groups; a
broadcast's tracks end when it ends. It never creates a track the publisher
serves only on request (an any-name `broadcast::Dynamic` handler such as a
transcoder). A relay answers many downstream SUBSCRIBE_ALLs from one upstream
request. Rust and JS both speak it.
request. Rust speaks it here, and
[SUBSCRIBE_ALL in js/net](/quest/m1/archive/subscribe-all-js.md) mirrors it.

## Plan

Expand Down Expand Up @@ -60,15 +61,14 @@ Guidance:
delivered.
- Fan-out: benchmark downstream requests against broadcast and track count per
the AGENTS.md fan-out rule.
- Split the JS half into its own quest if the PR grows too large to review.
- The JS half is [SUBSCRIBE_ALL in js/net](/quest/m1/archive/subscribe-all-js.md).

Test on mock time, directly and through a relay: tracks present at the
request, a track added later (its first group arrives), a broadcast appearing
and ending under the prefix, a new epoch at the same path, a dynamic-only track
never created, and two downstream requests sharing one upstream request.

Public API: the new prefix hook in Rust and `@moq/net`, mirrored names. Wire:
a new lite-07-wip request.
Public API: the new prefix hook in Rust. Wire: a new lite-07-wip request.

## Related

Expand Down
1 change: 1 addition & 0 deletions quest/m1/lite07-finalize.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ is published; older versions are unchanged.
- [Compressed tracks in Rust](/quest/m1/compress/core.md) - TRACK_INFO carries the compress flag and the frame header each compressed frame's inflated size
- [Compressed tracks in js/net](/quest/m1/compress/js.md) - JS reads and writes compressed lite-07 tracks instead of refusing them
- [SUBSCRIBE_ALL](/quest/m1/archive/subscribe-all.md) - lite-07 carries the prefix-scoped request for every track of every broadcast under a path
- [SUBSCRIBE_ALL in js/net](/quest/m1/archive/subscribe-all-js.md) - JS speaks SUBSCRIBE_ALL in both directions instead of refusing it

## Related

Expand Down
5 changes: 5 additions & 0 deletions rs/moq-net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,8 @@ required-features = ["async"]
name = "memory"
harness = false
required-features = ["async"]

[[bench]]
name = "subscribe-all"
harness = false
required-features = ["async"]
Loading
Loading