Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
85a1691
chore(quest): claim quest/m1/drop-set.md
kixelated Nov 3, 2026
757a072
docs(quest): record drop-set accounting and range-term blockers
kixelated Nov 3, 2026
66e324d
Merge remote-tracking branch 'origin/main' into quest/m1/drop-set
kixelated Nov 3, 2026
cf95e8f
docs(quest): align drop-set plan and tests with open decisions
kixelated Nov 3, 2026
dd755c5
Merge origin/main
kixelated Nov 3, 2026
edb3320
feat(net)!: split lite-07 holes into SUBSCRIBE_SKIP and SUBSCRIBE_DROP
kixelated Nov 3, 2026
a1c55f7
fix(net): settle a declared end over given-up groups and spare covere…
kixelated Nov 3, 2026
160a5ca
fix(net): supersede stale runs on a new upstream SUBSCRIBE and refuse…
kixelated Nov 3, 2026
ceb2b68
fix(net): keep received stale runs from settling bounded readers or o…
kixelated Nov 3, 2026
35971a4
fix(net): settle a received stale run up to where the upstream's rang…
kixelated Nov 3, 2026
fe27d73
fix(net): keep a superseded stale run unknown in JS and seed new read…
kixelated Nov 3, 2026
14488a3
Merge origin/main
kixelated Nov 3, 2026
163a89d
fix(net): owe a reversed stale drop again in the subscriber's tail
kixelated Nov 3, 2026
81cef05
fix(net): coalesce the JS subscriber's stale runs
kixelated Nov 3, 2026
6761813
feat(net)!: lite-07 DROP names its Update; any update reopens stale d…
kixelated Nov 4, 2026
f0bc48e
fix(net): build drop_groups only for tests and fuzz benches
kixelated Nov 4, 2026
efcb809
fix(net): drop expired streams again by run, not per sequence
kixelated Nov 4, 2026
47000a3
fix(net): re-offer a cached expired stream on a lite-07 update
kixelated Nov 4, 2026
5552dc2
fix(net): re-offer expired streams through a front's serving copy
kixelated Nov 4, 2026
85fe17f
test(net): compare the re-offered run as a set
kixelated Nov 4, 2026
228a8ce
feat(net)!: SKIP only from an explicit skip_groups or append_group
kixelated Nov 4, 2026
67c68ea
fix(net): re-judge pending redrops and front-backed stale reports on …
kixelated Nov 4, 2026
73b4f9f
fix(net): clippy and TypeDoc nits in the skip tests and docs
kixelated Nov 4, 2026
385f24e
chore(js): record skipGroups and Skipped in the @moq/net API report
kixelated Nov 4, 2026
a87fa40
fix(net): report again what is stale at the max age bound on reopen
kixelated Nov 4, 2026
9b2f3c6
docs(quest): record no create_group gap error for drop set
kixelated Nov 4, 2026
ebdc018
Merge remote-tracking branch 'origin/main' into t3/e664be97
kixelated Nov 4, 2026
660ba20
fix(net): keep forwarded OLD reports across route changes; SKIP repla…
kixelated Nov 4, 2026
464db62
style(net): fmt and a self-referencing test type
kixelated Nov 4, 2026
14fda04
fix(js): ask fills for stale runs a reader doesn't settle; skips reac…
kixelated Nov 4, 2026
d8d24d5
fix(js): settle the end when a drop or skip reaches it
kixelated Nov 4, 2026
244c609
Merge origin/main into quest/m1/drop-set
kixelated Nov 4, 2026
f6a2281
feat(net): a SKIP replaces every drop, final or stale (Rust)
kixelated Nov 4, 2026
463bfc8
feat(net): a SKIP replaces every drop in JS, the draft, and migration…
kixelated Nov 4, 2026
d4036a5
Merge remote-tracking branch 'origin/main' into iterate/drop-set-skip
kixelated Nov 4, 2026
1ccc779
fix(net): a lite-07 group or final drop replaces a stale drop sent
kixelated Nov 4, 2026
7837c35
style: format
kixelated Nov 4, 2026
143d1a3
fix(net): only a forwarded verdict replaces an earlier lite-07 drop
kixelated Nov 4, 2026
2b76047
Merge remote-tracking branch 'origin/main' into iterate/drop-set-skip
kixelated Nov 4, 2026
8458868
fix(net): retire a lite-07 stale report its group or final verdict re…
kixelated Nov 4, 2026
e4c0ee2
style(net): drop an unused mut in a test
kixelated Nov 4, 2026
0fee3fd
fix(js): close the groups an update re-offered when the subscription …
kixelated Nov 4, 2026
fe4066c
Merge remote-tracking branch 'origin/main' into iterate/drop-set-retire
kixelated Nov 4, 2026
b6ba432
Merge remote-tracking branch 'origin/main' into iterate/drop-set-retire
kixelated Nov 4, 2026
d265b8e
Merge remote-tracking branch 'origin/main' into quest/m1/drop-set
kixelated Nov 5, 2026
8c2f1d9
fix(net): address lite-07 drop-set review findings
kixelated Nov 5, 2026
e790fe9
fix(net): drop a needless mut in a subscriber test helper
kixelated Nov 5, 2026
d5e72cc
fix(net): keep a fill owed across a stale verdict in JS
kixelated Nov 5, 2026
237a354
Merge remote-tracking branch 'origin/main' into iterate/drop-set-lite07
kixelated Nov 5, 2026
f3820fb
Merge remote-tracking branch 'origin/main' into t3/76554407
kixelated Nov 5, 2026
831959f
feat(net): hold a duplicate group stream until the first copy settles
kixelated Nov 5, 2026
964edfd
fix(net): leave a superseded upstream stale report owed on an update
kixelated Nov 5, 2026
2a43d68
test(net): format the superseded stale report test
kixelated Nov 5, 2026
aad23d9
test(net): wait for the accepted copy before checking the source start
pullfrog[bot] Nov 5, 2026
b5a4e95
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 5, 2026
a8f9dd7
fix(net): a finished group wins over a late stale drop once evicted
kixelated Nov 5, 2026
947e057
quest: confirm the drop set's agent decisions 14 and 16 to 25
kixelated Nov 5, 2026
5408c04
fix(net): return the tail's finished runs by value
kixelated Nov 5, 2026
b005f5c
fix(net): record finished group streams only on lite-07
kixelated Nov 5, 2026
44d32a9
test: drive the finished-stream record through the group stream path
kixelated Nov 5, 2026
6dc75e9
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 5, 2026
bfb98c0
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 5, 2026
e089338
Merge base and resolve drop-set conflicts
Nov 5, 2026
fae447b
Merge origin/main into quest/m1/drop-set
kixelated Nov 6, 2026
c7640b9
fix(net): a queued drop poll keeps the last drift, and draft clarific…
kixelated Nov 6, 2026
42bf1b7
Merge origin/main into quest/m1/drop-set
kixelated Nov 6, 2026
6cc305b
docs(net): state where append_group's implicit skip starts
kixelated Nov 6, 2026
efb9123
style: format the merge and drift fix
kixelated Nov 6, 2026
7875aff
fix(net): main's headless IETF group drop records a Hole
kixelated Nov 6, 2026
0862958
style: format the IETF call-site fix
kixelated Nov 6, 2026
13a544e
Merge origin/main into quest/m1/drop-set
kixelated Nov 6, 2026
70c04a9
test(net): quarantine datagram-tracks' end-before-close case
pullfrog[bot] Nov 6, 2026
fc47e7e
Merge remote-tracking branch 'origin/main' into fix/pool-debt-flake
kixelated Nov 6, 2026
72bab58
docs: append_group's implicit skip starts past the previous append; n…
kixelated Nov 6, 2026
236ce6d
feat(ffi,c): expose skip_groups through the bindings
kixelated Nov 6, 2026
fe6c1e1
fix(net): an unaccounted gap that joins an older one waits a fresh grace
kixelated Nov 6, 2026
897a9c0
Merge remote-tracking branch 'origin/main' into fix/pool-debt-flake
kixelated Nov 6, 2026
0e3e7ab
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 6, 2026
915ed98
test(net): keep the resume copy helper local, as Rust does
pullfrog[bot] Nov 6, 2026
a8bf6e7
test(net): main's finished-route backfill test uses authored copies
kixelated Nov 6, 2026
29d2227
fix(net): ask a fill for an unsettled stale run above the newest group
kixelated Nov 6, 2026
e958788
fix(net): ask unsettled stale runs past the newest group only while a…
kixelated Nov 6, 2026
4e71bbe
Merge commit '915ed98b4e' into HEAD
kixelated Nov 6, 2026
cfbfb64
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 6, 2026
c791126
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 6, 2026
d7d84d7
feat(net): a stale verdict accepts every range the upstream judged
kixelated Nov 6, 2026
fff5f03
fix(net): satisfy clippy and biome on the multi-range verdict
kixelated Nov 6, 2026
f07a781
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 6, 2026
9321f3b
quest: record decision 28 for drop-set
kixelated Nov 6, 2026
54cac96
fix(net): set update on the lite-05/06 subscribe test helper
pullfrog[bot] Nov 6, 2026
ad93e53
Merge remote-tracking branch 'origin/main' into quest/m1/drop-set
kixelated Nov 6, 2026
3167350
fix(net): pass a NonZeroU64 to origin::Config::new in two lite subscr…
kixelated Nov 6, 2026
3047260
quest: datagram-end-close notes #8000 merged first
kixelated Nov 6, 2026
8aa91c2
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 6, 2026
4fee4d5
Merge remote-tracking branch 'origin/main' into quest/m1/drop-set
kixelated Nov 7, 2026
e15fa69
Merge remote-tracking branch 'origin/main' into quest/m1/drop-set
kixelated Nov 7, 2026
fa97eb7
fix(net): a re-offer dropped again before it opens counts as given up
kixelated Nov 7, 2026
037ce47
Merge remote-tracking branch 'origin/main' into fix/resolve-quest-con…
kixelated Nov 7, 2026
16d4bd1
Merge remote-tracking branch 'origin/main' into fix/resolve-quest-con…
kixelated Nov 7, 2026
dde07a5
quest land: merge tested base
Nov 7, 2026
15b4588
Merge remote-tracking branch 'origin/main' into quest/m1/drop-set
kixelated Nov 7, 2026
c1ed79c
fix(moq-net): async-only helpers stay quiet without the async feature
kixelated Nov 7, 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
28 changes: 28 additions & 0 deletions dart/moq_ffi/lib/src/moq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14381,6 +14381,7 @@ abstract class MoqTrackProducerInterface {
void finishAt({required int finalSequence});
MoqPosition? largest();
MoqTrackRequests requests();
void skipGroups({required int start, required int end});
void writeFrame({required MoqFrame frame});
}

Expand Down Expand Up @@ -14518,6 +14519,17 @@ class MoqTrackProducer implements MoqTrackProducerInterface {
);
}

void skipGroups({required int start, required int end}) {
return rustCall((status) {
uniffi_moq_ffi_fn_method_moqtrackproducer_skip_groups(
uniffiClonePointer(),
FfiConverterUInt64.lower(start),
FfiConverterUInt64.lower(end),
status,
);
}, moqExceptionErrorHandler);
}

void writeFrame({required MoqFrame frame}) {
return rustCall((status) {
uniffi_moq_ffi_fn_method_moqtrackproducer_write_frame(
Expand Down Expand Up @@ -21940,6 +21952,16 @@ external Pointer<Void> uniffi_moq_ffi_fn_method_moqtrackproducer_requests(
Pointer<RustCallStatus> uniffiStatus,
);

@Native<Void Function(Pointer<Void>, Uint64, Uint64, Pointer<RustCallStatus>)>(
assetId: _uniffiAssetId,
)
external void uniffi_moq_ffi_fn_method_moqtrackproducer_skip_groups(
Pointer<Void> ptr,
int start,
int end,
Pointer<RustCallStatus> uniffiStatus,
);

@Native<Void Function(Pointer<Void>, RustBuffer, Pointer<RustCallStatus>)>(
assetId: _uniffiAssetId,
)
Expand Down Expand Up @@ -23748,6 +23770,9 @@ external int uniffi_moq_ffi_checksum_method_moqtrackproducer_largest();
@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqtrackproducer_requests();

@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqtrackproducer_skip_groups();

@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqtrackproducer_write_frame();

Expand Down Expand Up @@ -24635,6 +24660,9 @@ void _checkApiChecksums() {
if (uniffi_moq_ffi_checksum_method_moqtrackproducer_requests() != 60252) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqtrackproducer_skip_groups() != 25592) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqtrackproducer_write_frame() != 46891) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
Expand Down
97 changes: 83 additions & 14 deletions drafts/draft-lcurley-moq-lite.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions go/wrapper/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ func (t *TrackProducer) CreateGroup(sequence uint64) (*GroupProducer, error) {
return &GroupProducer{inner: inner}, nil
}

// SkipGroups declares that groups start up to the exclusive end will never be
// produced, so readers move past them. Creating a group there then fails.
func (t *TrackProducer) SkipGroups(start, end uint64) error {
return t.inner.SkipGroups(start, end)
}

// WriteFrame writes frame as a single-frame group.
func (t *TrackProducer) WriteFrame(frame Frame) error {
return t.inner.WriteFrame(frame)
Expand Down
5 changes: 5 additions & 0 deletions js/net/api/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ export namespace Error {
});
readonly code: SessionCode;
}
export class Skipped extends Error {
constructor(sequence: bigint);
readonly sequence: bigint;
}
export class Stream extends Error {
constructor(code: StreamCode, options?: Error.StreamOptions);
readonly code: StreamCode;
Expand Down Expand Up @@ -751,6 +755,7 @@ export namespace Track {
readonly name: string;
get priority(): number;
requests(): Track.Requests;
skipGroups(start: bigint, end: bigint): void;
subscribe(options?: Track.Subscription): Track.Subscriber;
get subscription(): Signals.Getter<Track.Subscription | undefined>;
writeFrame(frame: Group.Frame): void;
Expand Down
19 changes: 19 additions & 0 deletions js/net/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,25 @@ function localStreamCode(err: unknown): StreamCode {
return StreamCode.Internal;
}

/**
* A group was created at a sequence its track declared skipped.
*
* A skip says the sequence will never be produced, so it is final. See the track producer's
* `skipGroups`. Mirrors the Rust `Error::Skipped`.
*
* @public
*/
export class Skipped extends Error {
/** The sequence that was refused. */
readonly sequence: bigint;

constructor(sequence: bigint) {
super(`sequence ${sequence} was skipped`);
this.name = "Skipped";
this.sequence = sequence;
}
}

/**
* The {@link StreamCode | StreamCode.ControlTimeout} error for a control request the peer never answered.
*
Expand Down
1 change: 1 addition & 0 deletions js/net/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export {
ProtocolViolation,
RefusedRedirect,
Session,
Skipped,
Stream,
type StreamOptions,
TimestampMismatch,
Expand Down
128 changes: 126 additions & 2 deletions js/net/src/fill.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Producer as BroadcastProducer } from "./broadcast.ts";
import { accept as acceptSession, connect as connectSession } from "./connection/index.ts";
import { NotFound, StreamCode, StreamError, toStreamCode } from "./error.ts";
import type { Consumer as GroupConsumer } from "./group.ts";
import { hooks } from "./internal.ts";
import { hooks, staleHole } from "./internal.ts";
import * as Lite from "./lite/index.ts";
import { createMockTransportPair } from "./mock.ts";
import { Producer as OriginProducer } from "./origin.ts";
Expand Down Expand Up @@ -336,6 +336,30 @@ test("fill: a fill names the most urgent priority and loosest budget among its r
broadcast.close();
});

// A stale verdict settles only the readers it covers, so a fetch it does not settle keeps its fill.
// Rust records a stale run without answering any fill.
test("fill: a stale verdict leaves an outstanding fill owed", async () => {
const broadcast = new BroadcastProducer();
const track = broadcast.createTrack("video", { maxAge: null });
const requests = track.requests();
track.createGroup(3n).finish();
const fetching = wireOf(broadcast).fetchGroup("video", 2n);
const fill = await requests.requestedFill();
if (!fill) throw new Error("no fill");
expect(fill.wanted()).toBe(2n);

hooks.dropTrackGroups(track, 2n, 3n, staleHole(500));
expect(fill.wanted()).toBe(2n);
const group = fill.accept(2n);
group.writeFrame({ payload: enc.encode("filled") });
group.finish();
expect(await frames(await fetching)).toEqual(["filled"]);

fill.close();
requests.close();
broadcast.close();
});

test("fill: a group arriving live answers the fill", async () => {
const broadcast = new BroadcastProducer();
const track = broadcast.createTrack("video", { maxAge: null });
Expand Down Expand Up @@ -720,7 +744,7 @@ test("fill: a group the track gives up elsewhere answers the fill", async () =>

// An upstream SUBSCRIBE_DROP, say: the handler is no longer asked for it.
const cut = new StreamError(StreamCode.Cancel, { message: "cut upstream" });
hooks.dropTrackGroups(track, 2n, 3n, cut);
hooks.dropTrackGroups(track, 2n, 3n, { error: cut });
expect(fill.wanted()).toBeUndefined();
await expect(fetching).rejects.toBe(cut);

Expand All @@ -729,6 +753,106 @@ test("fill: a group the track gives up elsewhere answers the fill", async () =>
broadcast.close();
});

// A received stale run that does not settle a reader is unknown to it, so its fill is still asked:
// here the upstream judged it under an open range, while the reader is capped. Mirrors the Rust
// `Misses::unclaimed`.
test("fill: a stale run that does not settle the reader is still asked for", async () => {
const { broadcast, track } = resumed(2n);
const requests = track.requests();
hooks.dropTrackGroups(track, 0n, 2n, staleHole(60_000));
const reader = track.subscribe({
ranges: [{ start: { absolute: 0n }, end: { absolute: 2n } }],
delay: { max: Milli(500) },
});
void drain(reader);
const fill = await Promise.race([requests.requestedFill(), yieldNow().then(() => undefined)]);
expect(fill && [fill.start, fill.end]).toEqual([0n, 2n]);

fill?.close();
reader.close();
requests.close();
broadcast.close();
});

// The upstream judged 0..2 and 4..6 under 500ms, and gave up both of them as stale.
function judgedTwice() {
const broadcast = new BroadcastProducer();
const track = broadcast.createTrack("video", { maxAge: null });
hooks.receiveTrack(track);
const requests = track.requests();
hooks.supersedeStale(track, [
{ start: 0n, end: 2n },
{ start: 4n, end: 6n },
]);
hooks.dropTrackGroups(track, 0n, 2n, staleHole(500));
hooks.dropTrackGroups(track, 4n, 6n, staleHole(500));
const reader = (ranges: [bigint, bigint][]) =>
track.subscribe({
ranges: ranges.map(([start, end]) => ({ start: { absolute: start }, end: { absolute: end } })),
delay: { max: Milli(500) },
});
return { broadcast, requests, reader };
}

// A stale verdict settles a reader that reads every range the upstream judged it against, however
// many there are, with nothing received and no fill asked. Mirrors Rust.
test("fill: a stale verdict settles a reader of every range it judged", async () => {
const { broadcast, requests, reader: subscribe } = judgedTwice();
const reader = subscribe([
[0n, 2n],
[4n, 6n],
]);
expect(hooks.tryDrop(reader)).toMatchObject({ start: 0n, end: 2n, stale: 500 });
expect(hooks.tryDrop(reader)).toMatchObject({ start: 4n, end: 6n, stale: 500 });
expect(hooks.tryRecvGroup(reader, false)).toEqual({ kind: "done" });
const fill = await Promise.race([requests.requestedFill(), yieldNow().then(() => undefined)]);
expect(fill).toBeUndefined();

reader.close();
requests.close();
broadcast.close();
});

// A reader whose ranges only partly overlap the ones a stale verdict was judged against is settled
// where it reads every judged group above the run, and asks a fill for the rest, even with nothing
// received: no update brings it, since its ranges add nothing to the upstream's terms. Mirrors Rust.
test("fill: a stale verdict settles a partly overlapping reader only where it reads above", async () => {
const { broadcast, requests, reader: subscribe } = judgedTwice();
// Reads every judged group above each run, and more past them: settled.
const wider = subscribe([
[1n, 2n],
[4n, 8n],
]);
expect(hooks.tryDrop(wider)).toMatchObject({ start: 1n, end: 2n, stale: 500 });
expect(hooks.tryDrop(wider)).toMatchObject({ start: 4n, end: 6n, stale: 500 });
expect(hooks.tryDrop(wider)).toBeUndefined();
expect(await Promise.race([requests.requestedFill(), yieldNow().then(() => undefined)])).toBeUndefined();
// Stops at 4, which the upstream judged against 5: its own newest, which no verdict convicts.
// Both runs are unknown to it, and asked for.
const narrower = subscribe([
[0n, 2n],
[4n, 5n],
]);
expect(hooks.tryRecvGroup(narrower, false)).toEqual({ kind: "idle" });
expect(hooks.tryDrop(narrower)).toBeUndefined();
const asked: bigint[][] = [];
for (;;) {
const fill = await Promise.race([requests.requestedFill(), yieldNow().then(() => undefined)]);
if (!fill) break;
asked.push([fill.start, fill.end]);
}
asked.sort((a, b) => Number(a[0] - b[0]));
expect(asked).toEqual([
[0n, 2n],
[4n, 5n],
]);

wider.close();
narrower.close();
requests.close();
broadcast.close();
});

test("fill: a cache-miss fetch of a dynamic track serves the one track the broadcast already has", async () => {
const broadcast = new BroadcastProducer();
// Pulled first, so the broadcast serves tracks on demand.
Expand Down
9 changes: 3 additions & 6 deletions js/net/src/ietf/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1907,12 +1907,9 @@ export class Subscriber {
};
// A group that will never arrive whole is dropped, so readers stop owing it.
const dropHeadless = () =>
hooks.dropTrackGroups(
track,
group.groupId,
group.groupId + 1n,
new StreamError(StreamCode.NotFound, { message: "the group's head was lost" }),
);
hooks.dropTrackGroups(track, group.groupId, group.groupId + 1n, {
error: new StreamError(StreamCode.NotFound, { message: "the group's head was lost" }),
});
// After an END_OF_GROUP or END_OF_TRACK status only the stream's end may follow: an
// object past the group's final one makes the track malformed.
const last = async () => {
Expand Down
Loading
Loading