Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
49c7a1e
chore(quest): claim Rust frame continuity signaling
kixelated Oct 10, 2026
f0dc21e
feat(mux): expose container and audio delivery continuity
kixelated Oct 10, 2026
279e568
chore: merge main into Rust delivery continuity
kixelated Oct 11, 2026
bf89731
fix(audio): preserve continuity across resampler tails
kixelated Oct 11, 2026
4352579
chore(quest): claim watch arrival diagnostics
kixelated Oct 11, 2026
482a736
feat(watch): expose bounded ingress diagnostics
kixelated Oct 11, 2026
7666ce5
Merge origin/main into quest/m1/watch-arrivals
kixelated Oct 12, 2026
3c4ca61
refactor(watch): replace retained arrival windows with caller-owned h…
kixelated Oct 12, 2026
76eb7a6
fix(watch): close arrival handles when iteration stops
kixelated Oct 12, 2026
a0c16a6
fix(hang): report a latency skip only when content was discarded
kixelated Oct 12, 2026
26a5c65
perf(watch): read arrival backlogs in amortized constant time
kixelated Oct 12, 2026
4a227bf
fix(hang): ignore a queued endpoint marker when detecting a latency skip
kixelated Oct 12, 2026
c375772
chore: merge main into Rust delivery continuity
kixelated Oct 12, 2026
4cb9ad2
chore: merge main into Rust delivery continuity
kixelated Oct 12, 2026
9f07a7a
refactor(mux): name the read wrapper container::Delivery; split video…
kixelated Oct 12, 2026
5a0e640
fix(mux): mark the delivery after an evicted current group non-contin…
kixelated Oct 12, 2026
35163c7
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Oct 13, 2026
48ec8c6
feat(mux): read gaps and declared ends as items in delivery order
kixelated Oct 13, 2026
5e9c469
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Oct 13, 2026
c5817e3
fix(interop): read the frame item in the JS native subscriber
kixelated Oct 13, 2026
be9337e
fix(hang): read no gap when a retired group lost nothing
kixelated Oct 13, 2026
69c098b
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Oct 13, 2026
785567e
feat(watch): arrivals yield frames and gaps from the container read
kixelated Oct 13, 2026
b5cef36
test(watch): narrow arrival entries to frames
kixelated Oct 13, 2026
552b23b
fix(mux): read a joined marker's end, and keep gaps for unfinished re…
kixelated Oct 13, 2026
2fef188
Merge commit '552b23bcb89a009327cae0f476c9cb54d81c388c' into HEAD
kixelated Oct 13, 2026
1a8e545
Merge remote-tracking branch 'origin/main' into agent-watch-arrivals-…
kixelated Oct 13, 2026
0cb0cbc
fix(hang): read nothing after close, even the frame a gap was deferre…
kixelated Oct 13, 2026
1b38d59
feat(mux): a gap carries its span, and a join is not a gap
kixelated Oct 13, 2026
ba99ad9
Merge remote-tracking branch 'origin/main' into agent-watch-arrivals-…
kixelated Oct 13, 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
4 changes: 4 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ jobs:
if: ${{ !cancelled() }}
run: nix develop --command just js catalog-bench

- name: JS arrival window benchmark
if: ${{ !cancelled() }}
run: nix develop --command just js arrivals-bench

# Times Effect create and close beside a bare `new Error()`. No threshold: it only
# has to keep running, and its numbers track the creation stack's cost.
- name: JS signals effect benchmark
Expand Down
24 changes: 24 additions & 0 deletions doc/lib/js/watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,30 @@ Pass a signal from [`@moq/signals`](/lib/js/signals) for any control you want
to change later, such as `muted` or `delay`. `Player` is the pipeline inside
`<moq-watch>`; its parts are exported for custom composition.

To chart when each frame arrived against when it plays, open an `arrivals()`
handle on a decoder. It yields every frame received while it is open, stamped
when the frame came off the transport, and a gap wherever media after an earlier
frame will never arrive (a latency skip, a hole):

```ts
const arrivals = player.audio.arrivals();
for await (const entry of arrivals) {
if (entry.kind === "gap") {
// Break the plotted line; nothing arrived from `timestamp` for `duration`.
continue;
}
const { timestamp, arrival, late } = entry;
// `late`: arrived after its playback deadline.
}
```

A gap's span is an upper bound: without per-frame durations it starts at the
last frame's timestamp, and it covers any pause the publisher declared.

Unread frames queue on the handle, so keep reading and keep your own window.
Leaving the loop or calling `arrivals.close()` stops observing and releases
them; nothing is retained without an open handle. Video reports the rendition on screen.

## Buffered playback

By default the player minimizes latency: it skips ahead whenever media piles
Expand Down
6 changes: 4 additions & 2 deletions doc/lib/rs/moq-mux.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ export. The [CLI page](/bin/cli#import) covers these and the MPEG-TS specifics:
one program per broadcast, damaged packets, and feed checks.

A container read yields frames plus two markers in delivery order: a gap where
media will never arrive (the join, a skip, a hole) and an end where the
publisher declared its media stops (a pause, a source switch, the finish).
media after what was read will never arrive (a skip, a hole), carrying where it
starts and how long it lasts as an upper bound, and an end where the publisher
declared its media stops (a pause, a source switch, the finish). Joining
mid-track is not a gap.

Data tracks are catalog entries too. The [hang page](/concept/hang#data-tracks)
describes the modes. A capture time converts onto the broadcast clock; a
Expand Down
1 change: 0 additions & 1 deletion js/hang/src/container/consumer.skips.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ for (const count of [1, 16, 256]) {
expect(warn).toHaveBeenLastCalledWith(`skipping slow groups: track=tone 0 -> ${count * 2} count=${count}`);
expect(consumer.buffered.peek()[0]?.start).toBe(Time.Milli(count));
// The retained group is still delivered, and another catch-up reports separately.
expect(await consumer.next()).toEqual({ kind: "gap" });
expect(await consumer.next()).toMatchObject({ kind: "frame", group: count * 2 });
newest.writeFrame({ payload: Varint.encode(count * 1000), timestamp: Time.Timestamp.now() });
write(count * 2 + 2, (count + 1) * 1000);
Expand Down
27 changes: 11 additions & 16 deletions js/hang/src/container/consumer.startup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ function setup(maxDelay = 100) {
return { track, consumer, results, warn };
}

// Each item as "gap", "<group>@<µs>" for a frame, or "end <group>@<µs>".
// Each item as "gap <µs>+<µs>", "<group>@<µs>" for a frame, or "end <group>@<µs>".
function items(results: Read[]): string[] {
return results.map((read) => {
if (read.kind === "gap") return "gap";
if (read.kind === "gap") return `gap ${read.timestamp}+${read.duration}`;
if (read.kind === "end") return `end ${read.group}@${read.end}`;
return `${read.group}@${read.frame.timestamp}`;
});
Expand Down Expand Up @@ -79,8 +79,8 @@ for (const emptySuccessor of [false, true]) {
for (let i = 0; i < 5; i++) write(live, 1_000_000 + i * 33_333);
await flush();

// Nothing was read before the live group, so the stale one leaves no gap.
expect(items(results)).toEqual([
"gap",
...[1_000_000, 1_033_333, 1_066_666, 1_099_999, 1_133_332].map(
(timestamp) => `${sequence}@${timestamp}`,
),
Expand All @@ -98,14 +98,15 @@ test("Consumer preserves a declared marker before its first media across a hole"
write(marker, 0, true);
marker.close();
await flush();
expect(items(results)).toEqual(["gap", "end 16@0"]);
expect(items(results)).toEqual(["end 16@0"]);

const live = new Group.Producer(18);
track.writeGroup(live);
write(live, 50_000);
await flush();
// Group 17 never arrived, so the media after the marker is past a gap.
expect(items(results)).toEqual(["gap", "end 16@0", "gap", "18@50000"]);
// Group 17 never arrived, so the media after the marker is past a gap. It spans the declared
// pause too: the reader can't tell where group 17 would have started.
expect(items(results)).toEqual(["end 16@0", "gap 0+50000", "18@50000"]);
expect(frames(results)[0].frame.keyframe).toBe(true);
expect(warn).not.toHaveBeenCalled();
});
Expand All @@ -117,15 +118,15 @@ test.each([false, true])("Consumer still waits for a gap after media (playhead r
write(first, 0);
first.close();
await flush();
expect(items(results)).toEqual(["gap", "16@0"]);
expect(items(results)).toEqual(["16@0"]);

if (reset) {
const marker = new Group.Producer(17);
track.writeGroup(marker);
write(marker, 0, true);
marker.close();
await flush();
expect(items(results)).toEqual(["gap", "16@0", "end 17@0"]);
expect(items(results)).toEqual(["16@0", "end 17@0"]);
}
const sequence = reset ? 20 : 19;
const later = new Group.Producer(sequence);
Expand All @@ -141,13 +142,7 @@ test.each([false, true])("Consumer still waits for a gap after media (playhead r
write(bridge, 0);
bridge.close();
await flush();
// The bridge closes the hole, so nothing reads as a gap past the first.
expect(items(results)).toEqual([
"gap",
"16@0",
...(reset ? ["end 17@0"] : []),
`${sequence - 1}@0`,
`${sequence}@50000`,
]);
// The bridge closes the hole, so nothing reads as a gap.
expect(items(results)).toEqual(["16@0", ...(reset ? ["end 17@0"] : []), `${sequence - 1}@0`, `${sequence}@50000`]);
expect(warn).not.toHaveBeenCalled();
});
Loading
Loading