Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
898f3ec
chore(quest): claim quest/m2/multicast/router.md
kixelated Nov 16, 2026
8eca12a
feat(moq-net): the multicast route rule as route::relay::Router
kixelated Nov 16, 2026
ca6cbc9
test(moq-net): run the bake-off on route::relay::Router and compare i…
kixelated Nov 16, 2026
edb24a0
test(moq-net): search every delivery order on route::relay::Router
kixelated Nov 16, 2026
1289fb0
test(moq-net): the bake-off's fixtures, the debounce, and per-event w…
kixelated Nov 16, 2026
f7333e2
test(moq-net): measure session floor growth on route::relay::Router
kixelated Nov 16, 2026
af0b3d0
fix(moq-net): at equal rank, a route with no marked link beats a mark…
kixelated Nov 16, 2026
c2957b5
chore(quest): finish quest/m2/multicast/router.md
kixelated Nov 16, 2026
be7dc80
fix(moq-net): route::relay::Router answers requests under a claim, ta…
kixelated Nov 16, 2026
3f1b9d5
fix(moq-net): route::relay::Router serves only the newest run of the …
kixelated Nov 16, 2026
3239cb8
fix(moq-net): route::relay::Router tells an endpoint or scoped neighb…
kixelated Nov 16, 2026
bd0a8f3
fix(moq-net): route::relay::Router tells a late asker what a waiting …
kixelated Nov 16, 2026
2a98e29
fix(moq-net): route::relay::Router shows a waiting claim to a new ask…
kixelated Nov 16, 2026
b47d327
fix(moq-net): route::relay::Router never takes a claim first told una…
kixelated Nov 16, 2026
5099172
test(moq-net): a request naming a relay stays closed once a newer run…
kixelated Nov 16, 2026
7a84a68
fix(moq-net): route::relay::Router judges a claim first told unavaila…
kixelated Nov 16, 2026
ecca03b
test(moq-net): bound the gateway fixture's wait for the relay to read…
kixelated Nov 16, 2026
fa92358
Merge origin/main into quest/m2/multicast/router
kixelated Nov 17, 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
3 changes: 2 additions & 1 deletion quest/m2/cluster-routes/route-fanout.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ multicast](/quest/m2/multicast/README.md)): this waits on the
[bake-off](https://github.com/moq-dev/moq/pull/8880). Its first and third findings are
in `path::Router`'s indexes and its doubts and dead hops, which the new router
replaces; the second, per-broadcast rewrites in `route/node.rs`, the
[router](/quest/m2/multicast/router.md) takes as a requirement. If the new
router (`route::relay::Router`, from
[moq-dev/moq#8901](https://github.com/moq-dev/moq/pull/8901)) takes as a requirement. If the new
rule goes ahead, [the switch](/quest/m2/multicast/switch.md) deletes this
quest with the fixtures that pin it; if it does not, this starts as written.

Expand Down
7 changes: 6 additions & 1 deletion quest/m2/multicast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ Settled:
on evidence ([requests](https://github.com/moq-dev/moq/pull/8881),
[route health](/quest/m3/route-health/README.md)). What a hold protected,
a claim flickering while routes settle, becomes a reader's local debounce
from unavailable to offline, never on the wire. This reverses items 19 and
from unavailable to offline, never on the wire (narrowed 2026-11-16 by the
coordinator and confirmed by the maintainer's merge pick of
[moq-dev/moq#8901](https://github.com/moq-dev/moq/pull/8901): the route
exchange between routing nodes keeps no timer, and an endpoint or scoped
neighbour is told what the reader shows, so it hears a lost claim
unavailable until the debounce runs out). This reverses items 19 and
27's doubt (rejected: keeping holds and doubt with the doubt tied to the
idle timeout; a doubt lifted by an epoch the surviving node floods).
5. ✅ **Three ways to find a warm copy are measured before one is picked**
Expand Down
137 changes: 0 additions & 137 deletions quest/m2/multicast/router.md

This file was deleted.

65 changes: 60 additions & 5 deletions quest/m2/multicast/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Goal

Every lite-07 session in Rust drives the
[new router](/quest/m2/multicast/router.md) on one announce stream per side,
new router (`route::relay::Router`, from
[moq-dev/moq#8901](https://github.com/moq-dev/moq/pull/8901)) on one announce stream per side,
the draft specifies it, and the old rule is gone: ROUTE_HOLD, the doubt,
DEAD's moved list, the Route Key Parameter with its proof and symbolic model,
qualified Node IDs, routes per prefix with their Route Suffix and Route
Expand Down Expand Up @@ -98,6 +99,40 @@ for the wire:
- A claim's end carries one bit, ended or lost, and a claim carries the lowest
link priority to its publisher and a draining bit beside its cost and chain.
- A claims message with no change still carries its floor.
- Among routes of equal rank a node takes one with no upstream-marked link on
its path before staying on its next hop, or a neighbour behind its own
upstream link is reachable by arrival order (decided by the coordinator on
2026-11-16 and confirmed by the maintainer's merge pick of
[moq-dev/moq#8901](https://github.com/moq-dev/moq/pull/8901)).
- A claim carries an unavailable bit beside its draining bit. An endpoint or
scoped neighbour is told what the node's own reader shows: the closest claim
while a route reaches one, and while none does, the claim of the best
precedence marked unavailable, withdrawn only when the reader's debounce
runs out. A scoped neighbour's adopter announces the claim again with the
bit, so its domain keeps the claim and fails requests closed, a request
reaching that adopter included, instead of withdrawing and starting it
again. The debounce runs from when a reader first showed the claim
unavailable, so the domain past a grant lets the claim go about when the
near one does, not a debounce later. The route exchange between routing
nodes keeps no timer (decided by the coordinator on 2026-11-16 and confirmed by the maintainer's merge pick of
[moq-dev/moq#8901](https://github.com/moq-dev/moq/pull/8901)).
- The unavailable bit counts only as a change to a run the receiver already
holds from that sender, a run being the claim's distance and epoch. A sender
still tells a new asker what its reader shows, the bit included, but a
receiver never takes a run it is first told unavailable, which nothing can
serve: that run is not there until it is told available, and then is taken
as usual. A sender that moves to such a run no longer gives the one it gave,
which the receiver drops as lost. A gateway whose session opens while a
claim is unavailable therefore announces nothing and starts no route, a
claim that comes back unavailable across a second grant starts none either,
and an unreachable newer run never fences an older one another neighbour
still serves (decided by the coordinator on 2026-11-16 and confirmed by the maintainer's merge pick of
[moq-dev/moq#8901](https://github.com/moq-dev/moq/pull/8901);
per run rather than per claim by the implementer, on review).
- A message names each claim once, and a receiver refuses one that names a
claim twice, so no order within a message decides what it says (decided by
the implementer on 2026-11-16 and confirmed by the maintainer's merge pick of
[moq-dev/moq#8901](https://github.com/moq-dev/moq/pull/8901)).
- A node offers a route to itself only once it announces a claim, so a relay
that has never announced a claim and only forwards or only serves viewers
has no route on the wire.
Expand All @@ -107,6 +142,30 @@ for the wire:
joined by two grants; the chain cost none. Keep that shape in the acceptance
fixtures.

Found 2026-11-16 by [the proof](https://github.com/moq-dev/moq/pull/8904)
against the prototype, and moved here when
[moq-dev/moq#8901](https://github.com/moq-dev/moq/pull/8901) finished the
router quest that listed them:

- Order equal routes by the neighbour's Node ID, or give the proof's binding
the key the router orders them by: the proof orders them by the neighbour,
the prototype by its simulation's node index, and `route::relay::Router` by
its neighbour key.
- Record the chain as the claim instance's path: the announcing relay first,
then each grant's exporter and adopter, so a node refuses a claim naming it
in the role it would take. The prototype and the router record only the
adopters, so they refuse fewer echoes than the proof assumes.
- Move the binding to the router before this PR changes it: point
`route/tests/algebra.rs` and `route/tests/sticky.rs` at the router's own
functions for a node's own route, sending a route on, taking one in,
ordering candidates, and listing them, regenerate `Vectors.agda`, and run
`just test route-proof`. The claim instance first needs the router's
precedence as its leading keys: a claim exactly at its path before a
broader one shown there, then the newest epoch, decided over every claim
of the Instance at that path whether or not a route reaches it, and only
then the route joined with the claim's drain, priority, and cost. Neither
the mechanized instance nor its Rust vectors cover precedence yet.

Delete with the old rule:

- `rs/moq-net/src/route/proof.rs`, `js/net/src/lite/route_key.ts`,
Expand Down Expand Up @@ -211,7 +270,3 @@ Public API: breaking. `origin::RouteKey`, `Config::route_key`, and
`Consumer::local()` leave the public API. Config and CLI: `cluster.route_key`
is removed (never released). Wire: lite-07-wip only; the moq-cluster
extension on moq-transport is no longer sent or read.

## Required

- [The router](/quest/m2/multicast/router.md) - the rule these sessions drive
2 changes: 1 addition & 1 deletion quest/m4/resume-trace-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ can keep passing on code that has moved on. Milestone m4.
[reconnect](/quest/m4/reconnect-trace-validation.md) and
[subscribe](/quest/m4/subscribe-trace-validation.md) reuse: route's trace
validation, which was to build them, gave way to the
exhaustive route search, which [the router](/quest/m2/multicast/router.md) now carries (decided
exhaustive route search, which `route::tests::multicast_search` now runs on the new router (decided
2026-11-14, maintainer, on [moq-dev/moq#8764](https://github.com/moq-dev/moq/pull/8764)). The
sweep records each step as the model action it corresponds to (the
`verify-resume` skill's Coverage table is the mapping) with the variables
Expand Down
39 changes: 37 additions & 2 deletions rs/moq-net/src/route/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub(crate) mod node;
pub(crate) mod path;
mod proof;
mod reader;
#[cfg_attr(not(test), allow(dead_code, reason = "driven only by tests until the switch"))]
pub(crate) mod relay;
mod view;

#[cfg(test)]
Expand All @@ -45,6 +47,17 @@ pub(crate) trait Item: Clone + Eq + fmt::Debug {
/// much broader it is, so the claim keeps that distance: a claim exactly at a prefix
/// outranks every broader one there. `lowered(0)` is the claim itself.
fn lowered(&self, by: u64) -> Self;

/// How many segments the claim's own prefix lacks of the path it is shown at, as
/// [`Self::lowered`] counts them: 0 for a claim exactly there, which outranks every
/// broader one whatever their epochs or routes.
fn above(&self) -> u64;

/// Which run of its Instance the publisher is on: among claims of one Instance at one
/// path and distance, a higher epoch supersedes a lower one whatever either's route
/// costs, or whether a route reaches it, as `model::origin` ranks them. 0 for
/// attributes that carry none.
fn epoch(&self) -> u64;
}

/// Opaque attributes that cover nothing broader than their own path.
Expand All @@ -55,6 +68,14 @@ macro_rules! opaque {
fn lowered(&self, _: u64) -> Self {
self.clone()
}

fn above(&self) -> u64 {
0
}

fn epoch(&self) -> u64 {
0
}
}
)*};
}
Expand Down Expand Up @@ -216,9 +237,11 @@ pub(crate) enum Kind {
Unavailable,
}

/// A change the reader sees: `id` is the publisher a path router keys claims by, or
/// the Instance under [`relay::Router`].
#[derive(Clone, Debug, PartialEq, Eq)]
pub(crate) struct Event<A> {
pub id: Id,
pub(crate) struct Event<A, K = Id> {
pub id: K,
pub claim: Path,
pub kind: Kind,
pub item: A,
Expand All @@ -241,4 +264,16 @@ pub(crate) enum Error {
Nested,
#[error("no such interest prefix")]
UnknownPrefix,
#[error("a neighbor connected twice")]
Duplicate,
#[error("a routing neighbor asked for part of the tree")]
Partial,
#[error("a claim outside what was asked, or anything before the answer began")]
Unasked,
#[error("claims or news about no route the neighbor offered")]
Unrouted,
#[error("a route or chain the rule never builds")]
Malformed,
#[error("a message the neighbor's role never sends")]
Role,
}
8 changes: 8 additions & 0 deletions rs/moq-net/src/route/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ impl super::Item for Claim {
..self.clone()
}
}

fn above(&self) -> u64 {
self.above
}

fn epoch(&self) -> u64 {
self.epoch
}
}

/// A shown claim as the origin serves it through one live route.
Expand Down
Loading