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
6 changes: 5 additions & 1 deletion doc/concept/moq-lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ authorization and hidden names work exactly as without one.

- **One instance, one epoch.** A publisher mints an epoch per run. Replicas of
the same content announce that same epoch. A prefix claim, and any route
without an epoch, names no instance.
without an epoch, names no instance, so a relay cannot tell that a claim's
worker closed a path and serves it again. Such a worker keeps the path's group
sequence going, even when its own input starts over at 0. Otherwise a viewer
returning within a relay's cache window gets the old output's latest group,
then nothing until the new sequence passes it.
- **Newest wins.** Among routes at the same prefix, the newest epoch ranks
first, ahead of cost, and a route without an epoch ranks last. Newest means
the latest UUIDv7 timestamp, so hosts with skewed clocks can lose a restart
Expand Down
1 change: 0 additions & 1 deletion quest/m0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ remain and no release waits on them.
- [Capped stream END_OF_GROUP](/quest/m0/ietf-end-of-track-location.md) - a stream capped by the subscription's end Location never claims END_OF_GROUP; moving End of Track's Location is deferred
- [End of Group status](/quest/m0/ietf-end-of-group-status.md) - an End of Group status on a stream whose header already marks the group's end is accepted, so imquic's last object per group arrives
- [TRACK stream demand](/quest/m0/track-stream-demand.md) - a lite-05+ subscribe shows the publisher one `used` edge, not a flap between TRACK and SUBSCRIBE
- [Idle fronts](/quest/m0/idle-fronts.md) - a front nobody has read for the linger ends with its per-path state, so a standing claim stops accumulating fronts and sources
- [web-transport releases the qmux fixes](/quest/m0/qmux-credit-upstream.md) - waiting on moq-dev/web-transport#412 and #413 to merge and ship, which qmux credit bumps to
- [qmux credit](/quest/m0/qmux-credit.md) - qmux returns connection credit for dropped and stopped streams and delivers its close frame, on both lines
- [Broadcast epochs](/quest/m0/broadcast-epoch/README.md) - every first-party publisher that can restart mints a fresh route epoch, the newest wins a path, and only routes with the same epoch resume a subscription
Expand Down
101 changes: 0 additions & 101 deletions quest/m0/idle-fronts.md

This file was deleted.

1 change: 0 additions & 1 deletion quest/m0/track-stream-demand.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,4 @@ fields.

## Related

- [Idle fronts](/quest/m0/idle-fronts.md) - found in the same transcode-pool report
- [#4225](https://github.com/moq-dev/moq/pull/4225) - holds a lite subscription's demand in the same publisher code; expect a conflict
1 change: 0 additions & 1 deletion quest/m1/claim-epochs.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,5 @@ it. Wire: lite-07 TRACK_INFO gains `Epoch`.

## Related

- [Idle fronts](/quest/m0/idle-fronts.md) - ends an unread front and its per-path state after the linger on every version
- [Upstream position regression](/quest/m1/largest-regression.md) - catches the same restart from the answer's largest position on lite-07 and moq-transport; lite-05 and 06 stay uncovered
- [Finalize moq-lite-07](/quest/m1/lite07-finalize.md) - waits on this wire change
1 change: 0 additions & 1 deletion quest/m1/front-deadline-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ Public API: none. Wire: none.

## Related

- [Idle fronts](/quest/m0/idle-fronts.md) - lands first and changes what a front holds; rebase onto it
- [Route wakes](/quest/m1/route-wakes.md) - narrows which fronts a route change wakes, in the same origin driver; one owner of `origin.rs` at a time
- [Front parking](/quest/m1/origin-front-parks.md) - also changes what a front holds, and wants a churn benchmark over requesters
12 changes: 9 additions & 3 deletions quest/m1/largest-regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ group's sequence, and they keep waiting on the floor.

## Plan

Found while scoping [Idle fronts](/quest/m0/idle-fronts.md) (2026-10-07):
Found while scoping idle fronts (2026-10-07):
under a prefix claim the relay never sees the worker close a broadcast, so a
restart at the same path reaches a lingering copy unannounced. A publisher
that restarts its group sequence under the same name is buggy, and this makes
Expand All @@ -30,7 +30,7 @@ Only a restart behind an unchanged route reaches a copy unannounced.

Decided 2026-10-08: shrunk to the two answer-carrying wires and moved to m1.
The heuristic is unproven and risks a false failover, so it builds on the
front and route shapes Restart and Idle fronts leave rather than ahead of
front and route shapes Restart and idle fronts leave rather than ahead of
them.

Where it lands: since #4914, a rejoining copy goes idle (`set_idle`) and the
Expand All @@ -46,6 +46,13 @@ was last served from without an epoch, where no cross-route resume happens,
or names a different epoch than the copy holds. Check for any other
legitimate case before relying on that split.

Whatever ends a front, it leaves the origin's front table before its broadcast
closes or anything fails, and `request()` treats a front whose broadcast closed
as gone. So a reader re-requesting after seeing the front's end mints a fresh
front. The copy's error must reach readers through that end, not an `Abort`
ahead of it, or a re-request can still join the old front. A request that
joined before the front decided to end is in flight, like a subscription.

Verification: mocked time, a publisher restarting a path at group 0 within
the linger. The returning reader gets an error and then the new instance from
group 0, never the old group. A same-epoch standby behind the cached copy
Expand All @@ -56,7 +63,6 @@ Public API: none. Wire: none.
## Required

- [Restart](/quest/m0/broadcast-epoch/restart.md) - route changes reach a copy as a `Restart`, leaving only same-route restarts for this to catch
- [Idle fronts](/quest/m0/idle-fronts.md) - reclaims the unread fronts whose lingering copies this judges

## Related

Expand Down
6 changes: 3 additions & 3 deletions quest/m1/origin-front-parks.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ as a real slope; the same benchmark then shows the replacement is cheaper. A
measured no-win deletes this quest. The `origin/viewer_*` benches do not
cover the retry loop.

The filtered front a peer session leaves behind, folded in here on
2026-10-05, moved to [Idle fronts](/quest/m0/idle-fronts.md) on 2026-10-07:
it ends once unread like any other front.
A parked front must not retire: a front nobody holds and nobody reads ends,
but only once it serves from a source with no route request pending
(`Front::idle` in `rs/moq-net/src/model/front.rs`).

Public API: no signature change expected. `routed_broadcast` and
`request_broadcast` keep their contracts; only where the waiting happens
Expand Down
3 changes: 1 addition & 2 deletions quest/m1/route-wakes.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ Decisions:
(maintainer, 2026-10-08); new requests take a fresh front on the winner
instead of waking it. An idle front (every track
forgotten, no consumer holding its broadcast, not waiting for coverage)
ends instead of moving
([Idle fronts](/quest/m0/idle-fronts.md)). A join or re-price must rehash
ends instead of moving. A join or re-price must rehash
every epoch front below the prefix, since rendezvous moves exactly the paths
the changed route now wins; only those fronts re-select. A leave wakes only
the fronts the leaver served or was requesting through.
Expand Down
33 changes: 32 additions & 1 deletion rs/moq-net/benches/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! already serves.
//!
//! A route swap on one front is swept over its tracks and the copies each track
//! still holds from earlier routes.
//! still holds from earlier routes, and a front retiring over the fronts around it.
//!
//! Run with `cargo bench -p moq-net --bench origin`.

Expand Down Expand Up @@ -430,6 +430,36 @@ fn bench_request(c: &mut Criterion) {
group.finish();
}

/// A front minted, resolved, and retired once its holder leaves, among `fronts`
/// others held open. A retiring front leaves the table it shares with them, so a
/// cost that grows with the table rather than with the one path shows up as a slope.
fn bench_retire(c: &mut Criterion) {
let mut group = c.benchmark_group("origin/retire");
for fronts in [100, 1_000, 10_000] {
group.bench_function(BenchmarkId::from_parameter(format!("{fronts}f")), |b| {
let mut fleet = fanout(fronts + 1, 0);
let waiter = kio::Waiter::noop();
let held: Vec<_> = (0..fronts)
.map(|i| fleet.consumer.request_broadcast(format!("room/{i}"), None))
.collect();
fleet.driver.poll(moq_net::time::Instant::now(), &waiter).unwrap();
let _held: Vec<_> = held
.into_iter()
.map(|pending| pending.now_or_never().expect("resolved once driven").expect("local"))
.collect();
let path = format!("room/{fronts}");
b.iter(|| {
let pending = fleet.consumer.request_broadcast(&path, None);
fleet.driver.poll(moq_net::time::Instant::now(), &waiter).unwrap();
drop(pending.now_or_never().expect("resolved once driven").expect("local"));
// Nothing holds it and a local source keeps no track, so it retires here.
fleet.driver.poll(moq_net::time::Instant::now(), &waiter).unwrap();
});
});
}
group.finish();
}

/// `(members, paths)` shapes for an equal-cost pool: how many advertisers claim
/// one prefix, against how many paths beneath it are already being served.
const POOL: [usize; 3] = [4, 32, 256];
Expand Down Expand Up @@ -849,6 +879,7 @@ criterion_group!(
bench_serve_idle,
bench_subscribe,
bench_request,
bench_retire,
bench_pool_churn,
bench_handoff,
bench_relay,
Expand Down
Loading
Loading