From f6e69d8371b46fb3fa4f1f2de9f4bc79b6e95ea9 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 28 Sep 2026 10:37:40 -0700 Subject: [PATCH 1/6] quest(moxygen): block the line on the #4276 group fetch fill findings Co-Authored-By: Claude Opus 5.5 --- quest/m1/moxygen/README.md | 15 +++++++++++ quest/m1/moxygen/fetch-fill.md | 49 ++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 quest/m1/moxygen/fetch-fill.md diff --git a/quest/m1/moxygen/README.md b/quest/m1/moxygen/README.md index 15dbcbc14f9..08854d7d048 100644 --- a/quest/m1/moxygen/README.md +++ b/quest/m1/moxygen/README.md @@ -26,11 +26,26 @@ Out of scope, so they are not reopened as bugs: - A peer that answers SUBSCRIBE_NAMESPACE with unimplemented. The session already continues. +Decided in the review of +[#4276](https://github.com/moq-dev/moq/pull/4276), also not reopened: + +- A FETCH starting mid-group is answered from that object. Each fetch + object carries its own IDs, so it is what was asked, not a partial group + ([r4113671550](https://github.com/moq-dev/moq/pull/4276#discussion_r4113671550)). +- FETCH_OK names the requested end when the range runs past a finished + group's last object. Missing objects there are a hole, like a missing + group ([r4114050992](https://github.com/moq-dev/moq/pull/4276#discussion_r4114050992)). +- An End of Track on a group FETCH_OK that contradicts the cache is + ignored. It only fills a boundary the live subscription has not declared, + and that subscription stays authoritative + ([r4114051032](https://github.com/moq-dev/moq/pull/4276#discussion_r4114051032)). + Docs stay inline in the change that makes them stale. No new guide. ## Quests - [Sparse FETCH ranges](/quest/m1/moxygen/fetch-span.md) - a FETCH costs the groups it returns, not the span of its range +- [Group fetch fill](/quest/m1/moxygen/fetch-fill.md) - a cache fill from an IETF upstream is complete or refused, validated against FETCH_OK, and asks from the frame the reader wants ## Related diff --git a/quest/m1/moxygen/fetch-fill.md b/quest/m1/moxygen/fetch-fill.md new file mode 100644 index 00000000000..3fc8c1cd121 --- /dev/null +++ b/quest/m1/moxygen/fetch-fill.md @@ -0,0 +1,49 @@ +# [M] Group fetch fill + +## Goal + +A relay filling a cache miss from an IETF upstream caches exactly what the +upstream promised, or nothing. A short or malformed fetch stream fails the +group loudly instead of landing in the cache as a complete one, and the +upstream FETCH asks for the frames the downstream reader actually wants. + +## Plan + +[#4276](https://github.com/moq-dev/moq/pull/4276) added the fill: each cache +miss becomes a standalone FETCH of one group (`run_group_fetch` in +`rs/moq-net/src/ietf/subscriber.rs`), and `recv_group_fetch_objects` writes +the fetch stream into the accepted group. Three of Codex's review findings +merged unanswered, and the maintainer ruled that each blocks the line: + +- **Truncation is cached as complete** + ([r4113942736](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942736)). + FETCH_OK names an `end_location`, but it never reaches the decoder. If the + peer cleanly ends the stream early, the group is finished and cached short, + and later readers see a normal end. Check the last object received (or an + end marker) against what FETCH_OK promised before finishing the producer, + and abort the group otherwise. +- **A first object with no IDs is accepted** + ([r4113942737](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942737)). + The `(false, None | Some(1))` arm treats omitted Group and Object IDs as + "same group, next object", which only means something when a prior object + exists. On the first object `prior_group` is `None` and `next` is 0, so an + anonymous object is cached under the requested group. The first object must + carry explicit IDs resolving to the requested group and start object; refuse + it as a protocol violation otherwise. +- **The upstream FETCH ignores the requested frame offset** + ([r4113942733](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942733)). + `group::Request::frame_start()` carries the downstream reader's start, and + `accept` already inserts the group at that offset, but the upstream FETCH + always asks from object 0 and the decoder numbers from 0. An upstream that + evicted the prefix but holds the suffix refuses a request it could have + answered. Ask from `frame_start` and number the fill from it, so the + request, the decoder, and the producer agree on where the group starts. + +Each fix gets a regression test in the existing subscriber test module that +fails without it. Keep the whole-group-only scope of the line: this is about +filling faithfully, not about new FETCH shapes. + +## Related + +- [Moxygen compatibility](/quest/m1/moxygen/README.md) - the line this blocks +- [Fetch without SUBSCRIBE](/quest/m1/ietf-fetch-only.md) - also changes how a relay reaches upstream for fetches From a9491beeef4dd6b77cc58247cf542e67ace30602 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 29 Sep 2026 11:23:19 -0700 Subject: [PATCH 2/6] quest(moxygen): whole-group truncation needs a concrete end signal Co-Authored-By: Claude Opus 5.5 --- quest/m1/moxygen/fetch-fill.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/quest/m1/moxygen/fetch-fill.md b/quest/m1/moxygen/fetch-fill.md index 3fc8c1cd121..e1b8a44f4be 100644 --- a/quest/m1/moxygen/fetch-fill.md +++ b/quest/m1/moxygen/fetch-fill.md @@ -19,9 +19,15 @@ merged unanswered, and the maintainer ruled that each blocks the line: ([r4113942736](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942736)). FETCH_OK names an `end_location`, but it never reaches the decoder. If the peer cleanly ends the stream early, the group is finished and cached short, - and later readers see a normal end. Check the last object received (or an - end marker) against what FETCH_OK promised before finishing the producer, - and abort the group otherwise. + and later readers see a normal end. Check the last object received against + what FETCH_OK promised before finishing the producer, and abort the group + otherwise. That only works when `end_location` names a concrete last + object: for a whole-group request our own `run_fetch_stream` answers with + the requested boundary (`(group + 1, 0)`), so a stream holding only object + 0 looks like a valid one-object group. For that case, find the wire signal + that marks a complete group (an End of Group status object, or a concrete + `end_location` from the publisher, fixing ours to send one) and require it; + if the drafts we speak offer none, ask the maintainer rather than guess. - **A first object with no IDs is accepted** ([r4113942737](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942737)). The `(false, None | Some(1))` arm treats omitted Group and Object IDs as From 1297cb3b6030b08fd548e0e67338958575041904 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 29 Sep 2026 11:24:05 -0700 Subject: [PATCH 3/6] quest(moxygen): keep the accepted requested-end decline Co-Authored-By: Claude Opus 5.5 --- quest/m1/moxygen/fetch-fill.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quest/m1/moxygen/fetch-fill.md b/quest/m1/moxygen/fetch-fill.md index e1b8a44f4be..63fa5ea59ce 100644 --- a/quest/m1/moxygen/fetch-fill.md +++ b/quest/m1/moxygen/fetch-fill.md @@ -24,10 +24,10 @@ merged unanswered, and the maintainer ruled that each blocks the line: otherwise. That only works when `end_location` names a concrete last object: for a whole-group request our own `run_fetch_stream` answers with the requested boundary (`(group + 1, 0)`), so a stream holding only object - 0 looks like a valid one-object group. For that case, find the wire signal - that marks a complete group (an End of Group status object, or a concrete - `end_location` from the publisher, fixing ours to send one) and require it; - if the drafts we speak offer none, ask the maintainer rather than guess. + 0 looks like a valid one-object group. The line's accepted declines keep + that requested end, so for this case find a wire signal that marks a + complete group (such as an End of Group status object) and require it; if + the drafts we speak offer none, ask the maintainer rather than guess. - **A first object with no IDs is accepted** ([r4113942737](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942737)). The `(false, None | Some(1))` arm treats omitted Group and Object IDs as From 3649817e6d74e7f8669f3fd3f76475c3dc7316c8 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 29 Sep 2026 11:56:06 -0700 Subject: [PATCH 4/6] quest(moxygen): exclusive end locations and every inherited first-object field Co-Authored-By: Claude Opus 5.5 --- quest/m1/moxygen/fetch-fill.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/quest/m1/moxygen/fetch-fill.md b/quest/m1/moxygen/fetch-fill.md index 63fa5ea59ce..c4da75c47b8 100644 --- a/quest/m1/moxygen/fetch-fill.md +++ b/quest/m1/moxygen/fetch-fill.md @@ -19,10 +19,10 @@ merged unanswered, and the maintainer ruled that each blocks the line: ([r4113942736](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942736)). FETCH_OK names an `end_location`, but it never reaches the decoder. If the peer cleanly ends the stream early, the group is finished and cached short, - and later readers see a normal end. Check the last object received against - what FETCH_OK promised before finishing the producer, and abort the group - otherwise. That only works when `end_location` names a concrete last - object: for a whole-group request our own `run_fetch_stream` answers with + and later readers see a normal end. Check the exclusive received boundary + (last object ID + 1) against FETCH_OK's `end_location`, which is exclusive, + before finishing the producer, and abort the group otherwise. That only + works when `end_location` names a concrete object: for a whole-group request our own `run_fetch_stream` answers with the requested boundary (`(group + 1, 0)`), so a stream holding only object 0 looks like a valid one-object group. The line's accepted declines keep that requested end, so for this case find a wire signal that marks a @@ -35,7 +35,9 @@ merged unanswered, and the maintainer ruled that each blocks the line: exists. On the first object `prior_group` is `None` and `next` is 0, so an anonymous object is cached under the requested group. The first object must carry explicit IDs resolving to the requested group and start object; refuse - it as a protocol violation otherwise. + it as a protocol violation otherwise. The same holds for every field that + inherits from a predecessor (draft-15+ `FetchSubgroup::Prior`, an omitted + publisher priority): on the first object each must be explicit. - **The upstream FETCH ignores the requested frame offset** ([r4113942733](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942733)). `group::Request::frame_start()` carries the downstream reader's start, and From eb1bccc2f7d4a82d6955dc35a06f76d7e33756ca Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 29 Sep 2026 12:07:06 -0700 Subject: [PATCH 5/6] quest(moxygen): the fill starts its producer at frame_start Co-Authored-By: Claude Opus 5.5 --- quest/m1/moxygen/fetch-fill.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/quest/m1/moxygen/fetch-fill.md b/quest/m1/moxygen/fetch-fill.md index c4da75c47b8..95b73655cf1 100644 --- a/quest/m1/moxygen/fetch-fill.md +++ b/quest/m1/moxygen/fetch-fill.md @@ -40,11 +40,12 @@ merged unanswered, and the maintainer ruled that each blocks the line: publisher priority): on the first object each must be explicit. - **The upstream FETCH ignores the requested frame offset** ([r4113942733](https://github.com/moq-dev/moq/pull/4276#discussion_r4113942733)). - `group::Request::frame_start()` carries the downstream reader's start, and - `accept` already inserts the group at that offset, but the upstream FETCH - always asks from object 0 and the decoder numbers from 0. An upstream that - evicted the prefix but holds the suffix refuses a request it could have - answered. Ask from `frame_start` and number the fill from it, so the + `group::Request::frame_start()` carries the downstream reader's start, but + the upstream FETCH always asks from object 0, the decoder numbers from 0, + and the handler never calls `start_at` on the producer `accept` returns, + though `frame_start`'s docs require it. An upstream that evicted the + prefix but holds the suffix refuses a request it could have answered. Ask + from `frame_start`, `start_at` it, and number the fill from it, so the request, the decoder, and the producer agree on where the group starts. Each fix gets a regression test in the existing subscriber test module that From 1cee2e1644e47453e49e5468dc901d725e378154 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 29 Sep 2026 12:18:33 -0700 Subject: [PATCH 6/6] quest(moxygen): align the fetch-fill summary Co-Authored-By: Claude Opus 5.5 --- quest/m1/moxygen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quest/m1/moxygen/README.md b/quest/m1/moxygen/README.md index d0b76bb4880..bd040aad9a6 100644 --- a/quest/m1/moxygen/README.md +++ b/quest/m1/moxygen/README.md @@ -45,7 +45,7 @@ Docs stay inline in the change that makes them stale. No new guide. ## Required - [Sparse FETCH ranges](/quest/m1/moxygen/fetch-span.md) - a FETCH costs the groups it returns, not the span of its range -- [Group fetch fill](/quest/m1/moxygen/fetch-fill.md) - a cache fill from an IETF upstream is complete or refused, validated against FETCH_OK, and asks from the frame the reader wants +- [Group fetch fill](/quest/m1/moxygen/fetch-fill.md) - a cache fill from an IETF upstream is complete or refused, validated against a concrete end signal, and asks from the frame the reader wants ## Related