Skip to content

fix(net): a scale-less track ages by arrival, and lite-05/06 stamp its group's start - #9266

Draft
kixelated wants to merge 4 commits into
mainfrom
quest/m2/time-addressing/scale-less-arrival
Draft

kixelated wants to merge 4 commits into
mainfrom
quest/m2/time-addressing/scale-less-arrival

Conversation

@kixelated

@kixelated kixelated commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Finishes quest/m2/time-addressing/scale-less-arrival.md, one of the lite-07 cut's blockers.

  • A scale-less track ages by arrival alone, in Rust, @moq/net, and the lite-07 draft. Its group starts are bare numbers, so they never count as milliseconds of a Max Age: keys 0, 10000, and 20000 arriving together no longer expire group 0 under a 5 ms budget.
    • Rust model/track.rs: presented and started_at give no time on a scale-less track, so it has no live edge, no reach, and a group finished whole waits for a successor (ended_at), instead of ageing from its arrival plus its bare span. poll_drifted stops after the wall-clock check there. age is gone.
    • JS track.ts: #drift finds no presentation edge on a scale-less track, and #presented/#reach/#endedAt follow Rust. A track whose info is not accepted yet keeps measuring by its frames' timestamps, as before.
    • Draft: "A scale-less Track has no timestamp age: its groups expire by arrival age alone", with the changelog bullet.
  • @moq/net stamps a scale-less frame or datagram on lite-05/06 with its group's start (or its sequence), as Rust's Stamp::wire already did, instead of Timestamp.now(). A frame now carries the same timestamp at every hop and on every fetch. wireTime mirrors Stamp::wire, and Stamp.timed and bareTime are gone.
  • One shared byte fixture, rs/moq-net/fixtures/stamps.json, pins a scale-less group's lite-05 and lite-06 Group Stream. Rust (serve_group_test::a_scale_less_group_stream_matches_the_shared_fixture) and JS (lite/publisher.test.ts) both serve it and compare byte for byte.
  • Docs and comments that said lite-05/06 carry an untimed track's send time now say they carry its group's start. Only a released @moq/net publisher still sends send times, which is why unchecked stays.

Choices made without asking, for review:

  • A scale-less group finished whole (finish_at) no longer ages from its own end. Its end is a bare number, so treating its span as time is the same bare-units-as-milliseconds rule this quest rejected. It now ages only once a successor arrives, as the draft already says for every group.
  • group-id.test.ts drops its lite-05 and lite-06 lanes (see Decisions).
  • resume.test.ts "a group fetched over a wire goes stale by the fetch's own budget" judged a scale-less track by its keys under a still clock. It now advances the clock a second past the successor's arrival.

Impact

  • Public API: none.
  • Wire: no byte change on lite-07. On lite-05/06, a scale-less frame or datagram from @moq/net now carries its group's start (or sequence) in milliseconds, not its send time, which matches what Rust already sent. On lite-07-wip, expiry semantics change for scale-less tracks (an unpublished version).
  • Behavior: a scale-less track's superseded groups expire only by the wall clock. A finished scale-less group with no successor no longer expires.

Decisions

Unattended choices, taken by the /quest-run orchestrator's recommendation while the maintainer was away. A review can still undo them; none is a maintainer decision.

  • A scale-less track keyed past 2^53 crossing a JS hop over lite-05/06: stamping the bare start means a frame or datagram timestamp carries the key as milliseconds, and a JS Timestamp holds a number, so a JS receiver cannot hold such a key (Rust's bound is 2^61). Rust publishers already sent these keys before this PR, so only the JS-to-JS case is new. ✅ (a) accept the limit, since lite-05/06 are legacy and lite-07 carries a scale-less key as a bigint (rejected: (b) keep send times in JS only for keys past 2^53, which reintroduces a timestamp that differs per hop; (c) make JS timestamps hold a bigint for timed tracks, which touches the whole time API). group-id.test.ts therefore drops its lite-05/06 lanes. Today the failure also closes the downstream session of a JS node that republishes the track; the follow-up below fixes that for any malformed group.

Validation

  • After merging main (b4496b1, which reworked model/track.rs and track.ts time starts): cargo test -p moq-net --all-features all pass (4146), and bun test in js/net 3441 pass.
  • just rs test -p moq-net --all-features: 4106 passed. The 4 integration timeouts seen in earlier full runs moved between unrelated tests from run to run while the host's load average was about 24 on 24 cores. They pass on rerun, and on main.
  • bun test in js/net: 3425 pass. js/hang and js/publish pass.
  • just test interop --all: all checks passed, including JS-to-Rust over lite-05/06.
  • New tests fail on main's code. With main's track.ts, "a scale-less track ages by arrival alone" fails. With main's publisher.ts, both fixture cases fail (...0001 61... instead of ...0a01 61...), and so do the new lite-05/06 lanes of untimed.test.ts ("an untimed group past 0 arrives stamped with its start").
  • I derived the fixture bytes independently by hand before running either encoder: type 00, GROUP 03 00 05 00 (lite-06; lite-05 has no frame start, so 02 00 05), then frames 0a 01 61 (zigzag(5), size 1, a) and 00 01 62. Both languages produced exactly these bytes.
  • just check: its only failures were the timeouts above and one js/publish worker test, which all passed on rerun.

Caused by

  • moq-dev/moq#8638: counted a scale-less track's bare starts as milliseconds of max age in Rust's age, presented, and ended_at (found by person: the pre-cut audit's /quest-plan).
  • moq-dev/moq#8908: wrote that rule into the draft's Expiration (found by person).
  • moq-dev/moq#9027: mirrored it in @moq/net's #drift/#presented (found by person).
  • moq-dev/moq#4968: stamped a scale-less lite-05/06 frame with the JS send time, which differs at each hop and on each fetch (found by person).

Follow-ups

  • A JS hop's data decode error never closes another session: a group stream decode error, such as a lite-05/06 timestamp past 2^53, keeps its malformed mark when a republishing node aborts its copy with it, and the node's publisher then closes the downstream session. No open decisions.

Models

Size: M
Implementer: Claude, claude-opus-5-5, high effort (arm B)
Implementer: Claude Code, claude-opus-5-5 (iterate, M, arm B)

(Written by Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 4 commits November 20, 2026 17:12
…up's start

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title A scale-less track ages by arrival, and lite-05/06 stamp its group's start fix(net): a scale-less track ages by arrival, and lite-05/06 stamp its group's start Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant