Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ disabled rung strands WHEP, HLS, and moq-mux export viewers.
- [Publish channel count](/quest/m1/publish-audio-channel-count.md) - forcing a channel count on an Audio.Capture stops costing the subscriber gaps of silence
- [JS request deadline](/quest/m1/js-request-deadline.md) - each JS request, PUBLISH_NAMESPACE included, has one fatal 10 s timer from create to answer and fails fast without stream credit, so nothing queues or retries
- [JS cancellation bench](/quest/m1/js-forget-bench.md) - the requests bench sweeps cancellation over competing dynamic routes, so a per-cancel cost that grows with routes shows as a slope
- [Container reads drop backfill](/quest/m1/read-backfill.md) - the JS container consumer drops groups below its read cursor like Rust
- [ExportSource reads Read items](/quest/m1/export-source-read.md) - exporters learn of gaps and ends from the read stream, and the private counters go
- [Rust request credit](/quest/m1/rs-request-credit.md) - a moq-net request fails at once without stream credit instead of waiting
- [qmux no-wait opens](/quest/m1/qmux-no-wait.md) - @moq/qmux rejects an over-limit create when waitUntilAvailable is false, like Chrome
- [E2EE](/quest/m1/e2ee/README.md) - TypeScript and Rust peers interoperate over encrypted broadcasts no relay can decrypt
Expand Down
30 changes: 30 additions & 0 deletions quest/m1/export-source-read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# [XS] ExportSource reads gaps and ends as Read items

## Goal

`moq_mux::container::ExportSource` (`rs/moq-mux/src/container/source.rs`)
consumes the container read's `Read::{Frame, Gap, End}` items instead of
polling the consumer's crate-private `discontinuity()` and `markers()`
counters, and those counters are deleted.
Comment on lines +5 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve fMP4 group-end events when consuming Read

Switching ExportSource from Consumer::poll_event to the Read stream removes the private Event::GroupEnd signal because Read intentionally contains only frames, gaps, and declared ends. fmp4::Export::poll_next_chunk currently relies on that signal to set group_finished and emit a completed fragment while the track remains live, so implementing this goal literally can stall live fMP4 output until the track closes. The quest should explicitly preserve group boundaries through an internal event API or provide an equivalent fragmentation trigger and regression test.

Useful? React with 👍 / 👎.

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.

Agreed. c322fc6 adds a plan step: keep a crate-private group-boundary signal next to the Read items so live fMP4 still cuts a fragment at each group end, with a regression test.

(Written by Claude Opus 5.5)


## Plan

#5288 made gaps and declared ends items in the read stream but left
`ExportSource` on the old counters, so the exporters (fMP4, TS, MKV, FLV, and
the raw H.264/H.265 exports) still learn of a gap after the fact.

- Map `Gap` to the exporter's discontinuity handling and `End` to its
declared-end handling, in delivery order.
- Keep the events `Read` filters reaching the exporters. fMP4 cuts a fragment
on `Event::GroupEnd` while the track stays live, and sizes a durationless
final sample from a trailing `Event::FrameEnd { opens: false }`; losing
either stalls fMP4 or writes the wrong duration. Keep a crate-private path
for both alongside the Read items. Tests: a live fMP4 export still emits a
fragment at each group end, and
`zero_fragment_duration_waits_for_the_exact_video_endpoint` passes.
- Delete `Consumer::discontinuity()` and `Consumer::markers()` once nothing
reads them, along with `ExportSource::markers()` if it only forwards.
- Existing exporter tests must pass unchanged; add one where a gap and an end
arrive back to back to pin the order.

Public API: none (crate-private). Wire: none.
37 changes: 37 additions & 0 deletions quest/m1/read-backfill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# [S] Rust and JS container reads drop groups below the cursor

## Goal

The Rust and JS container consumers agree on groups that arrive below the read
cursor: neither delivers them. The read stays `Frame | Gap | End` in delivery
order past the cursor, and what lies below is already covered by the `Gap`
that moved the cursor.

## Plan

Found while landing #5288: JS (`js/hang/src/container/consumer.ts`) still
delivers a group that arrives below the cursor as a late backfill; Rust
(`rs/moq-mux/src/container/consumer.rs`) never does.

- ✅ Decided 2026-10-13: both drop, matching Rust. Not chosen: both deliver,
flagged so readers can skip; leave it open.
- Match Rust's startup first. Groups are served newest-first, so the head of a
retained window can arrive after the live edge; JS sets its cursor from the
first arrival, so dropping alone would lose valid startup media
(`consumer.outoforder.test.ts` covers that order). Rust keeps it by waiting
for an explicit start floor under the max-delay budget
(`startup_keeps_late_arriving_head_group_within_max_delay`); give JS the same
startup so the window head is never below the cursor.
- Open: a subscription with only a max delay and no start (as in
`consumer.outoforder.test.ts`) has no floor to wait for, so the window head
can still land below the cursor, in Rust too. Options include requiring a
start floor for retained windows or settling the floor before the first
delivery. Ask the maintainer before dropping groups in that case; do not
ship a drop that loses startup media.
- Then change the JS consumer to discard groups below the cursor, and add a
test mirroring Rust's: a reordered group older than the cursor is never
yielded and no extra `Gap` appears.
- Check JS readers that relied on backfill (watch's audio/video decoders,
`Sync`, the arrivals handle from #5311 if it has landed) and adjust them.

Public API: no type change; JS read behavior changes. Wire: none.
1 change: 1 addition & 0 deletions quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,4 @@ and bench readiness. Refusal reasons folded the same day into
- [Binding track resolver](/quest/m2/binding-track-helper.md) - binding apps subscribe to a rendition without inlining `track` or the key
- [Exporters follow a rendition to a new track](/quest/m2/export-rendition-rebind.md) - the fMP4, TS, MKV and FLV exporters rebuild a rendition whose resolved `track` or `broadcast` changes under the same ID
- [IETF driver double poll](/quest/m2/ietf-driver-double-poll.md) - a fired deadline costs a moq-transport session's driver one poll, as #5393 makes moq-lite's
- [Play resume](/quest/m2/play-resume.md) - `moq-cli play` plays out pictures buffered before a declared end when new media arrives quickly
31 changes: 31 additions & 0 deletions quest/m2/play-resume.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# [M] moq-cli play plays out pictures before a quick resume

## Goal

When new media arrives before the pictures buffered ahead of a declared end
have played (a source switch, say), `moq-cli play` plays the old timeline out
first instead of dropping it.

## Plan

#5288 fixed `rs/moq-cli/src/play/video.rs` so `Read::End` no longer discards
the buffered pictures, with the restart waiting for the first frame of a later
group. A resume that arrives before those pictures play still drops them, as
it did before #5288.

Playing them out needs a sequential timeline in `play`: queue the new group's
frames behind the remaining pre-end pictures, then rebase the clock at the
boundary. Queueing encoded frames is not enough when the decoder reorders: the
declared end has to reach the decode loop so it flushes the pictures it still
holds before decoding the resumed group, which today happens only when the
track ends.

Open: whether audio follows the same queue or snaps to the new timeline. Audio
owns the presentation anchor, so this sets the latency and sync policy; ask
the maintainer before implementing.

Test with a declared end followed immediately by a new group, using a decoder
that holds pictures (depth above zero): every pre-end picture is shown before
the first new one.

Public API: none. Wire: none.
Loading