From de96b3ee8a9f543d70df436ce72bc8b5b9ed5cfc Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 30 Oct 2026 03:48:02 -0700 Subject: [PATCH 1/3] chore(quest): claim quest/m2/nested-options.md Quest-Claim: 1f2370f98d14fc63 From ba411fe98e7f6b439f056075216f233adee7542a Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 30 Oct 2026 03:48:41 -0700 Subject: [PATCH 2/3] refactor(net): flatten nested Options for the TS translation resolve_fetch_group and Live::base return their value after an early ? instead of mapping through Option>, and Request keeps its pending start in a named RequestedStart enum. Co-Authored-By: Claude Opus 5.5 --- rs/moq-net/src/ietf/subscriber.rs | 3 ++- rs/moq-net/src/lite/compress.rs | 3 ++- rs/moq-net/src/model/track.rs | 19 +++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/rs/moq-net/src/ietf/subscriber.rs b/rs/moq-net/src/ietf/subscriber.rs index f70b2ec62b2..594ca9bc4c1 100644 --- a/rs/moq-net/src/ietf/subscriber.rs +++ b/rs/moq-net/src/ietf/subscriber.rs @@ -5906,7 +5906,8 @@ fn resolve_fetch_group(prior: Option, wire: Option) -> Result Result { diff --git a/rs/moq-net/src/model/track.rs b/rs/moq-net/src/model/track.rs index da4102ad639..0de64268921 100644 --- a/rs/moq-net/src/model/track.rs +++ b/rs/moq-net/src/model/track.rs @@ -7983,9 +7983,8 @@ pub struct Request { // unless this request was reserved on a tagged broadcast. stats: stats::Scope, - // The floor the accepted track's start is pending at, until the source resolves it - // (see [`Self::request_start`]). - requested_start: Option>, + // Where the accepted track's start is pending; see [`Self::request_start`]. + requested_start: RequestedStart, // Whether the accepted track starts idle; see [`Self::idle`]. idle: bool, @@ -7997,6 +7996,14 @@ pub struct Request { list: Option, } +/// Whether a [`Request`] asked for its accepted track's start to be pending. +enum RequestedStart { + /// The track starts as [`Request::accept`] leaves it. + Unset, + /// Pending at this floor, `None` for the live edge, until the source resolves it. + Pending(Option), +} + impl Request { pub(super) fn new(broadcast: Arc, name: impl Into>) -> Self { let name = name.into(); @@ -8011,7 +8018,7 @@ impl Request { alive, _dynamic: dynamic, stats: stats::Scope::default(), - requested_start: None, + requested_start: RequestedStart::Unset, idle: false, routes: None, list: None, @@ -8042,7 +8049,7 @@ impl Request { /// see the track. #[cfg_attr(not(feature = "async"), allow(dead_code, reason = "async-only"))] pub(crate) fn request_start(mut self, floor: impl Into>) -> Self { - self.requested_start = Some(floor.into()); + self.requested_start = RequestedStart::Pending(floor.into()); self } @@ -8141,7 +8148,7 @@ impl Request { Ok(mut state) => { state.accept(info.clone()); state.staged = true; - if let Some(floor) = self.requested_start { + if let RequestedStart::Pending(floor) = self.requested_start { state.set_start(floor, true); } if self.idle { From 69e8b80a178973f1837c436c7b04f8616d1e80e2 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 30 Oct 2026 04:11:51 -0700 Subject: [PATCH 3/3] quest: finish m2/nested-options Co-Authored-By: Claude Opus 5.5 --- quest/m2/README.md | 1 - quest/m2/nested-options.md | 17 ----------------- 2 files changed, 18 deletions(-) delete mode 100644 quest/m2/nested-options.md diff --git a/quest/m2/README.md b/quest/m2/README.md index 4f4f2452b0a..e650b3129e0 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -99,7 +99,6 @@ lite-07; bitrate enforcement is not part of this release. - [Rust-backed @moq/net](/quest/m2/rs2ts/README.md) - measure browser baselines, complete WASM bindings, and adopt Rust behind @moq/net before the later JS-only stage - [Front parking](/quest/m2/origin-front-parks.md) - an unroutable request waits on a front instead of re-asking on every route-table move - [Route wakes](/quest/m2/route-wakes.md) - a route change wakes only the fronts it can move, so pool churn stops scaling with served paths -- [Flatten nested Options](/quest/m2/nested-options.md) - three moq-net functions stop building `Option>`, so the TS translation reaches them - [Fewer allocations in announce fan-out](/quest/m2/announce-fanout-allocs.md) - a deep path costs no more allocations per subscriber than a shallow one - [Keyed prefix polling](/quest/m2/keyed-prefix-polling.md) - `SubscriberDriver` polls only the prefixes a wake concerns, if a bench shows the slope - [Route health](/quest/m2/route-health/README.md) - epoch-only active/passive track recovery over metadata-only subscriptions diff --git a/quest/m2/nested-options.md b/quest/m2/nested-options.md deleted file mode 100644 index ea49139b951..00000000000 --- a/quest/m2/nested-options.md +++ /dev/null @@ -1,17 +0,0 @@ -# [XS] Flatten nested Options for the TS translation - -## Goal - -`resolve_fetch_group`, `request_start`, and `Live::base` in moq-net stop building an -`Option>`, so moq-dev/rust2's TypeScript translator can translate them. -Behavior is unchanged, and the code stays at least as clear. - -## Plan - -Decided with the maintainer on 2026-10-26, from moq-dev/rust2's -[census fixes](https://github.com/moq-dev/rust2/pull/78): rewrite these three -functions in moq rather than give the translator a second `Option` -representation. Use a named enum or an early return where it reads better, and keep -a change only if it does. - -Public API: none.