Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
91f93a5
chore(quest): claim quest/m1/audit-interop.md
kixelated Oct 23, 2026
7095e5b
fix(net): read an omitted publisher priority as 128
kixelated Oct 23, 2026
1dface5
quest: finish the m1 interop audit and schedule the m2 run
kixelated Oct 23, 2026
f7c08f3
Merge remote-tracking branch 'origin/main' into quest/m1/audit-interop
kixelated Oct 23, 2026
5400898
quest: separate the Rust and JS lifecycle causes in the m2 audit
kixelated Oct 23, 2026
bde353f
fix(net): read an omitted subscriber priority as 128 too
kixelated Oct 23, 2026
63a933e
Merge remote-tracking branch 'origin/main' into quest/m1/audit-interop
kixelated Oct 23, 2026
308f67c
quest: record the settled priority and backport decisions in the m2 a…
kixelated Oct 23, 2026
2b0ed11
Merge remote-tracking branch 'origin/main' into quest/m1/audit-interop
kixelated Oct 23, 2026
9c25be8
fix(net): restate the priority in a draft-14 max-age update
kixelated Oct 23, 2026
d4fd42f
quest: count unsupported cells as done in the m2 interop audit summary
kixelated Oct 23, 2026
95e69ec
docs(net): the omitted track priority is 128 in js/net properties
kixelated Oct 23, 2026
d60dd82
Merge remote-tracking branch 'origin/main' into quest/m1/audit-interop
kixelated Oct 23, 2026
3f5b143
Merge remote-tracking branch 'origin/main' into merge-6538
kixelated Oct 23, 2026
23550e6
Merge remote-tracking branch 'origin/main' into merge-6538
kixelated Oct 24, 2026
34ee753
Merge remote-tracking branch 'origin/main' into merge-6538
kixelated Oct 24, 2026
297ab4e
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Oct 24, 2026
3a503e3
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Oct 24, 2026
90d3832
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Oct 24, 2026
2991ecf
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Oct 24, 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
2 changes: 1 addition & 1 deletion doc/concept/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ subset drops. What a peer actually observes against this implementation:
- **Refused, not fatal.** A legal request this stack does not serve is rejected on its own and the session stays up: the fetch forms above get `NOT_SUPPORTED`. Range Filters get `INVALID_FILTER` on draft 19 and later because the advertised filter limit is zero. On draft 21 and later, namespaces whose first tuple field is exactly `.` or `.session` get `DOES_NOT_EXIST` before application lookup; other dot prefixes still reach the application. Subscription updates accept priority, negotiated subscriber max age, and delivery timeouts; Rust also renews request tokens and judges `NEW_GROUP_REQUEST` as a join (see dynamic groups below). Other supported-but-unimplemented preferences end that subscription; a `TRACK_PROPERTY_FILTER` there closes the session with `PROTOCOL_VIOLATION`, since it belongs only to `SUBSCRIBE_TRACKS`. On draft 18 and later a namespace update may change its prefix; suffixes after the acknowledgement are relative to that new prefix.
- **Objects and datagrams.** Only subgroup 0 is accepted: a stream for any other subgroup, whether its header gives the ID or takes it from the first Object ID, is stopped and the session stays up. Rust relays preserve Object IDs, gaps, object properties, FIRST\_OBJECT, and END\_OF\_GROUP status objects between moq-transport peers for subgroup 0, including across a moq-lite-07 hop between two relays that negotiate the [ietf](/draft/moq-ietf) extension. Datagrams retain their IDs, properties, priority, and status. Plain Rust readers and moq-lite peers see consecutive frames and normal datagram payloads; JavaScript supports only normal datagrams at Object ID 0. A malformed datagram closes the session; a relayed one the downstream draft cannot carry is dropped. A relayed Timestamp leaves in the units the downstream response declares, and is dropped where it declares none (drafts 14 through 16), as for a plain frame; an immutable one that would change or vanish is refused. On a timed track the frame holds each object's time, so a mutable Timestamp that only repeats the immutable one is not restated; a status object has no frame, so it keeps its Timestamp among its properties. Only property 0x10 is read as a Timestamp. Property 0x06 stays opaque and keeps its value regardless of timestamp units; it is dropped across the draft-19 boundary, or refused when immutable, because draft 19 assigns it to SUBGROUP\_DELIVERY\_TIMEOUT. From draft 15, a status object carrying properties is refused, and one relayed from draft 14 leaves without them. Draft 14 allows them, but an END\_OF\_TRACK carrying properties ends the subscription as unsupported, since a track end has nowhere to keep them. A `FETCH` carries the END\_OF\_GROUP object on drafts 14 and 15; later drafts have no FETCH status, so their response ends at the last frame. A group cannot resume across route changes by frame ordinal once Object IDs skip ahead of the ordinals on either route; recovery refuses it instead of splicing different objects.
- **Dynamic groups.** A track advertises `DYNAMIC_GROUPS` when its publisher sets a refresh ratio, and a track received with `DYNAMIC_GROUPS` gets a ratio of 0. A `NEW_GROUP_REQUEST` (draft 15 and later) counts as one more subscriber joining, which a `SUBSCRIBE` already is: it asks for a new group only when the newest group's bytes after its first frame exceed the ratio times the first frame. Joins coalesce until the asked-for group arrives. A Rust relay sends `NEW_GROUP_REQUEST` upstream, on the `SUBSCRIBE` or in a `REQUEST_UPDATE`, once a join wants a group past the newest it holds; a relay holding nothing yet asks for none. On a track without a ratio, an update carrying one ends the subscription with `UPDATE_FAILED`. On drafts 15 and 16, whose `TRACK_STATUS` answer has no room for it, a relay copy first learned from `TRACK_STATUS` (a fetch-only reader) does not advertise it to later subscribers. A moq-lite-07 hop (`moq-lite-07-wip`, opt-in) carries the same demand natively: the ratio in `TRACK_INFO` and the asked-for group in `SUBSCRIBE_UPDATE`. Earlier moq-lite versions carry neither, so a track received over one never refreshes.
- **Priority.** Higher is served first. This stack's priorities run from -128 to 127 with 0 unset, and go out on the IETF wire, which ranks lower first, as `127 - priority`: an unset priority is IETF 127, and an absent IETF priority is 0. A relay's upstream subscription carries the highest priority its subscribers ask for and updates it as they come and go; its group order stays as the `SUBSCRIBE` asked, since no draft lets an update change it.
- **Priority.** Higher is served first. This stack's priorities run from -128 to 127 with 0 unset, and go out on the IETF wire, which ranks lower first, as `127 - priority`: an unset priority is IETF 127. An omitted subscriber or publisher priority reads as the drafts' default of IETF 128, one step below unset, so a relay forwards it unchanged. A relay's upstream subscription carries the highest priority its subscribers ask for and updates it as they come and go; its group order stays as the `SUBSCRIBE` asked, since no draft lets an update change it.
- **Size.** An object extension block larger than 64 KiB ends that subgroup stream. The session stays up. This cap is ours, not the draft's.

Several project drafts extend the IETF wire without breaking it, since `SETUP`
Expand Down
9 changes: 9 additions & 0 deletions js/net/src/ietf/ietf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2045,6 +2045,15 @@ test("Subscribe v20: decodes every legal parameter", async () => {
expect(msg.propertiesWanted).toBe(false);
});

// From draft-15 an omitted SUBSCRIBER_PRIORITY means 128, not the unset 127, so a relay
// forwards it unchanged.
test("Subscribe: an omitted SUBSCRIBER_PRIORITY is 128", async () => {
for (const version of [Version.DRAFT_15, Version.DRAFT_16, Version.DRAFT_18, Version.DRAFT_20, Version.DRAFT_22]) {
const msg = await decodeVersioned(framed([...TRACK_HEAD, 0x00]), Subscribe.Subscribe.decode, version);
expect(msg.subscriberPriority).toBe(128);
}
});

// INCLUDE_PROPERTIES is a uint8: one raw byte with no Length.
test("Subscribe v20: INCLUDE_PROPERTIES is a uint8", async () => {
const msg = new Subscribe.Subscribe({
Expand Down
4 changes: 2 additions & 2 deletions js/net/src/ietf/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProtocolViolation, StreamCode, Stream as StreamError } from "../error.t
import { asIetf, type Cursor, type Reader, Writer } from "../stream.ts";
import { type Timescale, Timestamp } from "../time.ts";
import { U64 } from "../util/u64.ts";
import { ABSENT_WIRE } from "./priority.ts";
import { DEFAULT_WIRE } from "./priority.ts";
import { type IetfVersion, Version } from "./version.ts";

// Implementation limit for object extension blocks, independent of the IETF draft.
Expand Down Expand Up @@ -235,7 +235,7 @@ export class Group {
const trackAlias = await r.u62();
const groupId = await r.u53();
const subGroupId = flags.hasSubgroup ? await r.u53() : 0;
const publisherPriority = hasPriority ? await r.u8() : ABSENT_WIRE;
const publisherPriority = hasPriority ? await r.u8() : DEFAULT_WIRE;

return new Group({ trackAlias, groupId, subGroupId, publisherPriority, flags });
}
Expand Down
7 changes: 4 additions & 3 deletions js/net/src/ietf/priority.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from "bun:test";
import * as Lite from "../lite/priority.ts";
import { infoDefaults } from "../track.ts";
import { ABSENT_WIRE, fromWire, toWire } from "./priority.ts";
import { DEFAULT_WIRE, fromWire, toWire } from "./priority.ts";

test("IETF priority is lower first", () => {
expect(fromWire(0)).toBe(127);
Expand All @@ -27,7 +27,8 @@ test("IETF mirrors moq-lite", () => {
}
});

test("an unset track priority goes out as the absent byte", () => {
// An omitted priority is the drafts' 128, one step below the unset 127, so it forwards unchanged.
test("an unset track priority goes out as 127 and an omitted one reads as -1", () => {
expect(toWire(infoDefaults().priority)).toBe(127);
expect(fromWire(ABSENT_WIRE)).toBe(0);
expect(fromWire(DEFAULT_WIRE)).toBe(-1);
});
10 changes: 7 additions & 3 deletions js/net/src/ietf/priority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
* `ietf::priority`.
*
* moq-transport ranks lower first, so the wire carries `127 - priority`: the unset priority 0
* goes out as 127, and an absent priority decodes as 0.
* goes out as 127, and an omitted priority decodes as -1, one step below it.
*
* @module
*/

/** The wire byte for the unset priority 0, which an absent priority stands for. */
export const ABSENT_WIRE = 127;
/**
* The IETF priority an omitted SUBSCRIBER_PRIORITY or DEFAULT_PUBLISHER_PRIORITY stands for, as
* the drafts define both, and the byte for a message that must carry a priority it was not given.
* It reads as -1, so a relay forwards an omitted priority as 128, not as the unset 127.
*/
export const DEFAULT_WIRE = 128;
Comment thread
kixelated marked this conversation as resolved.
Resolved

/** Convert an IETF priority byte into the model's higher-first priority. */
export function fromWire(priority: number): number {
Expand Down
2 changes: 1 addition & 1 deletion js/net/src/ietf/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface Properties {
/// `undefined` declares no timeline, so the track and its objects are untimed.
timescale?: Timescale;

/// Publisher priority for a group header without its priority flag. The wire default is 127, the unset priority 0.
/// Publisher priority for a group header without its priority flag. Omitted, it is the wire default 128, priority -1.
priority?: number;

/// The publisher's preference for prioritizing groups within a subscription,
Expand Down
4 changes: 2 additions & 2 deletions js/net/src/ietf/publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import * as Message from "./message.ts";
import * as Namespace from "./namespace.ts";
import { FetchFrame, Frame, Group as GroupMessage } from "./object.ts";
import { Parameters } from "./parameters.ts";
import { fromWire, toWire } from "./priority.ts";
import { DEFAULT_WIRE, fromWire, toWire } from "./priority.ts";
import * as Properties from "./properties.ts";
import { Publish, PublishDone, PublishDoneStatus } from "./publish.ts";
import {
Expand Down Expand Up @@ -2581,7 +2581,7 @@ export class Publisher {
requestId: id,
trackNamespace: namespace,
trackName: name,
subscriberPriority: defaults.subscriberPriority ?? 127,
subscriberPriority: defaults.subscriberPriority ?? DEFAULT_WIRE,
groupOrder: defaults.groupOrder === GroupOrder.Ascending ? "ascending" : "descending",
filter: defaults.subscriptionFilter,
propertiesWanted: defaults.includeProperties ?? true,
Expand Down
6 changes: 3 additions & 3 deletions js/net/src/ietf/subscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as Filter from "./filter.ts";
import * as Message from "./message.ts";
import * as Namespace from "./namespace.ts";
import { type MessageLocation, MSG_PARAM_FORWARD, MSG_PARAM_SUBSCRIBER_PRIORITY, Parameters } from "./parameters.ts";
import { ABSENT_WIRE } from "./priority.ts";
import { DEFAULT_WIRE } from "./priority.ts";
import * as Properties from "./properties.ts";
import { type IetfVersion, Version } from "./version.ts";

Expand Down Expand Up @@ -221,7 +221,7 @@ export class Subscribe {
}
// v15+: fields are in parameters
const params = await Parameters.decode(r, version, "subscribe");
const subscriberPriority = params.subscriberPriority ?? ABSENT_WIRE;
const subscriberPriority = params.subscriberPriority ?? DEFAULT_WIRE;
const groupOrder = decodeGroupOrder(params.groupOrder ?? GroupOrder.Descending);

// FILL_PARAMETERS and INCLUDE_PROPERTIES are draft-20 additions, and the Range
Expand Down Expand Up @@ -460,7 +460,7 @@ export class SubscribeUpdate {
await w.u62(0n); // start_group
await w.u62(0n); // start_object
await w.u62(0n); // end_group
await w.u8(this.parameters.subscriberPriority ?? ABSENT_WIRE);
await w.u8(this.parameters.subscriberPriority ?? DEFAULT_WIRE);
await w.bool(this.parameters.forward ?? true);
await this.parameters.encode(w, version, [MSG_PARAM_SUBSCRIBER_PRIORITY, MSG_PARAM_FORWARD]);
} else {
Expand Down
13 changes: 13 additions & 0 deletions js/net/src/ietf/subscribe_tracks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,19 @@ test("PUBLISH carries listing defaults and honors INCLUDE_PROPERTIES", async ()
expect(publish.parameters?.subscriptionFilter).toEqual({ kind: "relative", groups: 2n });
});

// An omitted SUBSCRIBER_PRIORITY is the drafts' 128, so the PUBLISH restates 128, not the unset 127.
test("PUBLISH restates an omitted listing priority as 128", async () => {
const version = Version.DRAFT_22;
const fx = fixture(version);
const listing = await fx.list("room", false, new Parameters());
await ok(listing, version);
const broadcast = fx.origin.createBroadcast(Path.from("room/live"));
broadcast.announce();
broadcast.createTrack("later");
const { publish } = await fx.offered();
expect(publish.parameters?.subscriberPriority).toBe(128);
});

test("an update ends only its listing and frees its prefix", async () => {
const version = Version.DRAFT_22;
const fx = fixture(version);
Expand Down
10 changes: 5 additions & 5 deletions js/net/src/ietf/subscriber.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1226,9 +1226,9 @@ test("a compact END_OF_TRACK at object 5 with properties is subgroup 5, refused
}
});

test("older peer without priority property inherits the unset priority", async () => {
test("older peer without priority property inherits the default publisher priority", async () => {
const { subscriber, track } = await subscribeTrack();
expect((await track.info()).priority).toBe(0);
expect((await track.info()).priority).toBe(127 - 128);
const group = new GroupMessage({
trackAlias: ALIAS,
groupId: 3,
Expand All @@ -1237,7 +1237,7 @@ test("older peer without priority property inherits the unset priority", async (
flags: { ...groupFlags(true), hasPriority: false },
});
await subscriber.handleGroup(group, new Reader(undefined, encodeObjects([0]), VERSION));
expect(group.publisherPriority).toBe(127);
expect(group.publisherPriority).toBe(128);
track.close();
});

Expand Down Expand Up @@ -1351,7 +1351,7 @@ test.each(["acceptance", "timeout"])("returning demand preserves pending setup u
if (outcome === "acceptance") {
await peer.writer.u53(SubscribeOk.id);
await new SubscribeOk({ requestId: request.requestId, trackAlias: ALIAS }).encode(peer.writer, VERSION);
expect(await info).toMatchObject({ priority: 0 });
expect(await info).toMatchObject({ priority: 127 - 128 });
expect(returned.closed.peek()).toBeUndefined();
} else {
jest.advanceTimersByTime(4_000);
Expand Down Expand Up @@ -1418,7 +1418,7 @@ test("setup abandonment closes before a queued viewer can attach", async () => {
const request = await Subscribe.decode(next.reader, VERSION);
await next.writer.u53(SubscribeOk.id);
await new SubscribeOk({ requestId: request.requestId, trackAlias: ALIAS }).encode(next.writer, VERSION);
expect(await info).toMatchObject({ priority: 0 });
expect(await info).toMatchObject({ priority: 127 - 128 });
});

test("abandonment cancels once and a late acceptance cannot capture a reused alias", async () => {
Expand Down
6 changes: 4 additions & 2 deletions js/net/src/ietf/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
ObjectIdGap,
} from "./object.ts";
import { Parameters } from "./parameters.ts";
import { ABSENT_WIRE, fromWire, toWire } from "./priority.ts";
import { DEFAULT_WIRE, fromWire, toWire } from "./priority.ts";
import { type Publish, PublishDone, PublishDoneStatus, publishDoneClean } from "./publish.ts";
import {
type AdvertParams,
Expand Down Expand Up @@ -1243,7 +1243,9 @@ export class Subscriber {
// No TIMESCALE (always so on drafts 14-16, which can't carry it) means no timeline,
// and the track must not claim one when served onward.
timescale: ok.properties.timescale,
priority: fromWire(ok.properties.priority ?? ABSENT_WIRE),
// Drafts 14 and 15 carry only per-subgroup priorities, which the model does not keep,
// so they get the later drafts' default too.
priority: fromWire(ok.properties.priority ?? DEFAULT_WIRE),
maxAge: maxCacheDuration === undefined ? undefined : Milli(Number(maxCacheDuration)),
// A moq-transport peer may stamp arrival times, and nothing on the wire says it didn't.
ietf: version,
Expand Down
1 change: 0 additions & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ audit's receive-memory, priority, and lease bugs rank ahead of that reshape.
- [Peers advertise their implementation and version](/quest/m1/peer-version.md) - moq-net and `@moq/net` send a `name/version` SETUP parameter both ways, and the auth request and session span carry the client's
- [Binding peer version](/quest/m1/binding-peer-version.md) - every binding names itself ahead of the Rust core in that parameter
- [Calibrate the paired nightly benchmarks](/quest/m1/bench-ci.md) - A/A and deliberately slowed Nightly runs set the paired comparison's threshold, so its regression alerts can be trusted
- [Interop audit](/quest/m1/audit-interop.md) - our interop runner entries match what we ship, and every red interop cell with a moq.dev side is fixed, reported, or noted as down
- [Refuse unknown MOQ_* environment variables](/quest/m1/env-unknown.md) - every binary exits at startup naming a `MOQ_*` variable it does not read
- [HLS recorder in the CLI](/quest/m1/hls-record-cli.md) - `export hls --output <dir>` records playlists and segments to a directory
- [Group storage benchmark](/quest/m1/group-storage-bench.md) - numbers pick the append-only log, a ring buffer, or sorted runs for `GroupState` before either lands
Expand Down
Loading
Loading