Skip to content
Closed
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
3 changes: 3 additions & 0 deletions quest/m1/qos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ preflight, consumes them downstream.

## Quests

- [Lag across a splice](/quest/m1/qos/lag-splice.md) - a route switch
neither loses pending lag weight nor keeps weighing a segment replaced
before its first frame
- [Starvation at frame granularity](/quest/m1/qos/starvation-frames.md) - the
acknowledged frontier moves at every frame boundary through `poll_acked`,
with a delivery-delay histogram for jitter
Expand Down
39 changes: 39 additions & 0 deletions quest/m1/qos/lag-splice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# [S] Lag across a splice

## Goal

A spliced subscription's `lag` histogram stays exact across a route switch:
every byte the viewer could read is weighed once, and nothing a retired
segment produces afterwards is weighed at all, however early in its life the
segment was replaced.

## Plan

[#4298](https://github.com/moq-dev/moq/pull/4298) added the per-broadcast
viewer lag sampler (`FrontierInner::sample` in `rs/moq-net/src/stats.rs`) and
had a spliced subscription watch each segment's track
(`rs/moq-net/src/model/resume.rs`). Two Codex findings on its last round
merged unanswered, and the maintainer ruled in the 09-28 merged-PR audit that
both block the line:

- **Pending weight is lost when the replacement has no frame yet**
([r4113824520](https://github.com/moq-dev/moq/pull/4298#discussion_r4113824520)).
`sample` takes `state.unsampled` before it knows a source supplies `newest`
and `first`. When a capped segment folded bytes into `unsampled` and the
replacement has not produced, the `?` returns and those bytes are gone.
Keep the weight until a sample can record it, or keep the retired source's
edge alongside its weight.
- **A segment replaced before its first frame is never unwatched**
([r4113824522](https://github.com/moq-dev/moq/pull/4298#discussion_r4113824522)).
`unwatch` runs only when an existing segment's `end` changes. A segment
the producer replaces outright is marked `pruned` and dropped through
`retired()` without it, so if its route keeps publishing, those
unreachable bytes keep weighing this viewer's lag. Unwatch on every path
that retires or replaces a segment, not just on a cap.

Extend the existing splice lag test (`lag_weighs_every_segment`) or add
siblings so each case fails without its fix.

## Related

- [QoS](/quest/m1/qos/README.md) - the line this blocks
Loading