Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5acab32
quest(rs2ts): claim the Generated @moq/net questline
kixelated Sep 29, 2026
340836f
quest(rs2ts): claim the Sans-IO moq-net questline
kixelated Sep 29, 2026
b73496e
quest: claim quest/m1/rs2ts/varint-codec
kixelated Sep 29, 2026
7440317
chore(quest): claim quest/m1/rs2ts/sans-io/model
kixelated Sep 29, 2026
3fc2057
quest(rs2ts): fold the duplicate Required section
kixelated Sep 29, 2026
a508c2d
bench(net): measure the wire codec on its own
kixelated Sep 29, 2026
e6c7f8f
refactor(net): one clock for the model's time
kixelated Sep 29, 2026
f67c08c
bench(net): time the cache's per-poll gc and due expiry pass over N t…
kixelated Sep 29, 2026
ee9e41d
refactor(net)!: encode through a concrete VarInt codec
kixelated Sep 29, 2026
1946ef0
Merge remote-tracking branch 'origin/quest/m1/rs2ts/README' into ques…
kixelated Sep 29, 2026
389631b
style(net): format the track bench
kixelated Sep 29, 2026
526b82d
perf(net): fixed-size varint reads and reserved size prefixes
kixelated Sep 29, 2026
239c866
chore(quest): claim quest/m1/rs2ts/mock-clock
kixelated Sep 29, 2026
ddb2a85
test(net): run moq-net's tests on a simulated clock instead of tokio
kixelated Sep 29, 2026
535248d
style(net): drop a stray blank line
kixelated Sep 29, 2026
0132559
quest(rs2ts): keep rs2ts generic, add IETF parameters quest
kixelated Sep 29, 2026
0bf0dd6
Merge remote-tracking branch 'origin/quest/m1/rs2ts/README' into ques…
kixelated Sep 29, 2026
0684eb3
refactor(net)!: drop the VarInt newtype for plain u64
kixelated Sep 29, 2026
e550d13
docs: moq-net tests run on moq-net-sim, and sans-IO sessions make the…
kixelated Sep 29, 2026
d1a681b
perf(net): inline the varint path natively, QUIC read as an if-chain
kixelated Sep 29, 2026
3b70086
test(net): drop leftover double negations in IETF codec tests
kixelated Sep 29, 2026
4e09797
Merge pull request #4458 from moq-dev/quest/m1/rs2ts/sans-io/model
kixelated Sep 29, 2026
0aaab8f
docs(js): point zigzag comments at moq_net::varint
kixelated Sep 29, 2026
95c0f42
Merge pull request #4463 from moq-dev/quest/m1/rs2ts/varint-codec
kixelated Sep 29, 2026
293e6ef
Merge remote-tracking branch 'origin/quest/m1/rs2ts/README' into ques…
kixelated Sep 30, 2026
65accbf
fix(net): sim re-raises a dropped handle's panic and schedules the ro…
kixelated Sep 30, 2026
b237f7f
docs(rs): point moq-net tests at #[moq_net_sim::test]
kixelated Sep 30, 2026
ab7b3bb
Merge remote-tracking branch 'origin/dev' into quest/m1/rs2ts/README
kixelated Sep 30, 2026
ac6debe
Merge branch 'quest/m1/rs2ts/README' into quest/m1/rs2ts/sans-io/README
kixelated Sep 30, 2026
12d0bb1
Merge remote-tracking branch 'origin/quest/m1/rs2ts/README' into ques…
kixelated Sep 30, 2026
2f030c8
Merge pull request #4466 from moq-dev/quest/m1/rs2ts/mock-clock
kixelated Oct 1, 2026
f943324
Merge origin/main into quest/m1/rs2ts/README
kixelated Oct 5, 2026
dccc433
Merge quest/m1/rs2ts/sans-io/README into quest/m1/rs2ts/README
kixelated Oct 5, 2026
20a47d2
Merge origin/main into quest/m1/rs2ts/README
kixelated Oct 5, 2026
706f276
Merge origin/main into quest/m1/rs2ts/README
kixelated Oct 5, 2026
3c72b2f
fix(net): address the rs2ts review findings
kixelated Oct 5, 2026
2b5eb63
Merge origin/main into quest/m1/rs2ts/README
kixelated Oct 6, 2026
3878714
docs(upgrade): moq-net's VarInt is the varint module
kixelated Oct 6, 2026
8e32b87
Merge remote-tracking branch 'origin/main' into rs2ts-merge-a594
kixelated Oct 6, 2026
975cf31
Merge origin/main into quest/m1/rs2ts/README
kixelated Oct 6, 2026
abb6ed7
Merge origin/main into quest/m1/rs2ts/README
kixelated Oct 6, 2026
7df02c5
Merge origin/main into quest/m1/rs2ts/README
kixelated Oct 6, 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
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ members = [
"rs/moq-native",
"rs/moq-net",
"rs/moq-net/fuzz",
"rs/moq-net/sim",
"rs/moq-net/sim/macros",
"rs/moq-nvenc",
"rs/moq-pattern",
"rs/moq-quic",
Expand Down
5 changes: 3 additions & 2 deletions doc/concept/moq-lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ Rust and TypeScript speak moq-lite 01 through 06 and moq-transport drafts
still in progress: it negotiates as `moq-lite-07-wip`, and only when both
sides explicitly enable it. moq-lite 07 also switches every varint from QUIC's
two-bit length prefix to moq-transport's leading-ones form, so values up to 127
take one byte instead of up to 63, and the range widens from 62 to 64 bits. Rust
still refuses lite-07 values above 2^62-1 until its `VarInt` widens.
take one byte instead of up to 63, and the range widens from 62 to 64 bits.
A relay cannot forward a value past 2^62 - 1 to an older peer, so it fails
that subscription or group and keeps the session.

## Subscription completion

Expand Down
5 changes: 5 additions & 0 deletions doc/setup/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ These land with the next breaking release, not the 2026-09-23 train.
broadcast that ends with media queued behind an undescribed track is an error
rather than an empty `Ok(None)`. Restart the export to pick up a new
rendition.
- **moq-net has no `VarInt`.** Varints are plain `u64`s:
`VarInt::decode_quic(buf)?.into_inner()` is `moq_net::varint::decode_quic(buf)?`,
and `VarInt::try_from(v)?.encode_quic(buf)` is
`moq_net::varint::encode_quic(v, buf)`, which fails past
`varint::MAX_QUIC` (2^62 - 1).
- **Opus mapping family lives only on `mapping`.**
`moq_mux::codec::opus::Config::mapping_family` is gone. Family 0 is
`mapping: None`; any other family is the mapping's own (`mapping.family()`).
Expand Down
2 changes: 1 addition & 1 deletion js/net/src/lite/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Group {
}
}

/** Decode an unsigned zigzag varint back to a signed delta (mirrors Rust `VarInt::to_zigzag`). */
/** Decode an unsigned zigzag varint back to a signed delta (mirrors Rust `varint::unzigzag`). */
function unzigzag(v: bigint): bigint {
return (v >> 1n) ^ -(v & 1n);
}
Expand Down
2 changes: 1 addition & 1 deletion js/net/src/lite/publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const PROBE_MAX_AGE = 10_000; // ms
const PROBE_MAX_DELTA = 0.25;
const PROBE_RTT_DELTA = 0.25;

/** Map a signed delta to an unsigned zigzag varint value (mirrors Rust `VarInt::from_zigzag`). */
/** Map a signed delta to an unsigned zigzag varint value (mirrors Rust `varint::zigzag`). */
function zigzag(delta: bigint): bigint {
return delta >= 0n ? delta << 1n : (-delta << 1n) - 1n;
}
Expand Down
6 changes: 2 additions & 4 deletions quest/m1/lite07-finalize.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ The cut:
- The draft's lite-07 changelog matches the wire and `just drafts check`
passes.

Decided 2026-10-05: Rust's 64-bit `VarInt` is not required first. The draft
already specifies 64 bits; Rust refusing values above 2^62-1 is an
implementation limit that [VarInt codec](/quest/m1/rs2ts/varint-codec.md)
fixes whenever it lands.
Rust's lite-07 varints already carry the full 64 bits the draft specifies,
so no codec work waits on the cut.

Open, for the maintainer:

Expand Down
6 changes: 3 additions & 3 deletions quest/m1/quest-flat-lines.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ Remaining:
- Land each line's umbrella PR with `/quest-complete`, then delete its branch:
#4403 wildcard, #4034 archive, #4039 auth, #4079 cpp, #4519 ffi-shape,
#4080 obs-moq-video, #4133 qos (held until
[Lag across a splice](/quest/m1/qos/lag-splice.md) is fixed), #4437 rs2ts,
#4180 transport-upgrade, #4640 tstd. #4162
(audio-jitter-target) and #4653 (test-flakes-2) landed, and #4438 folded into rs2ts.
[Lag across a splice](/quest/m1/qos/lag-splice.md) is fixed),
#4180 transport-upgrade, #4640 tstd. #4162 (audio-jitter-target), #4437 rs2ts
(with #4438 folded in), and #4653 (test-flakes-2) landed.
- Fold #4255 (archive/track-timeline) into the archive branch before #4034
lands; as of the 2026-10-05 audit it has not happened and #4034 is a draft.
- Before a line lands and its branch is deleted, merge or retarget every child
Expand Down
20 changes: 10 additions & 10 deletions quest/m1/rs2ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ Decided in planning (2026-09-27), with the spike data in
and bytes out, no runtime. The async helper methods move behind an `async`
cargo feature; rs2ts reads the crate without it and JS reimplements the
helpers with Promises. No second crate.
- Varints are not bounded to 2^53 on the wire: 62 bits in QUIC form, 64 in
leading-ones form. JS holds any `u64` as a `U64` with checked conversion to
and from `number`; varints are only its wire encoding.
- Values are plain `u64` in Rust, and varint is a wire encoding in the codec,
not a type. The spec is not bounded to 2^53: the leading-ones form
(moq-lite 07, moq-transport draft-17+) carries all 64 bits, and the QUIC
form (moq-lite 01-06, drafts 14-16) refuses anything past 2^62 - 1 rather
than truncating. Rust
`u64` maps to a TypeScript `U64` (two `u32` halves), generically, with
checked conversion to and from `number`.
- The generated TypeScript is committed and a CI lane regenerates it and
fails on drift, so JS contributors and npm publishing never need the
nightly toolchain Charon pins. It lives inside js/net and `@moq/net` stays
Expand All @@ -41,7 +45,8 @@ Decided in planning (2026-09-27), with the spike data in
is no worse to use; watch, publish, hang, and the demos update in the same
change.
- Parity: `just test interop --all`, plus moq-net's own tests translated with
the code once they run on a mock clock instead of tokio.
the code. They run on simulated time with no runtime (`moq-net-sim`), so the
async-free ones translate as they stand.
- The Rust refactors break moq-net's published API, and the translator and
generated code build on them.
- Hand-written js/net fixes keep landing until the generated path replaces
Expand All @@ -50,9 +55,7 @@ Decided in planning (2026-09-27), with the spike data in
Decided in the 2026-09-30 audit: the lite half stays in m1 with an explicit
go/no-go after the no-downgrade report below; a no-go stops the line before
anything else is generated. The IETF half (the sans-IO IETF session,
generated IETF, and the IETF parameters quest on this line's branch) moved to
m2 and waits on that go.

generated IETF, and IETF parameters) moved to m2 and waits on that go.

This README's own work is the no-downgrade report once generated lite ships:
bundle size, per-frame CPU, and first-frame latency against the hand-written
Expand All @@ -61,11 +64,8 @@ js/net it replaces, measured with the [browser benchmarks](/quest/m1/browser-ben
## Required

- [Browser benchmarks](/quest/m1/browser-benchmarks.md) - the harness the no-downgrade report uses

- [VarInt codec](/quest/m1/rs2ts/varint-codec.md) - moq-net encodes through a `VarInt` newtype and a concrete slice-based codec, not generic traits on primitives
- [rs2ts](/quest/m1/rs2ts/translator.md) - a Charon-based translator emits readable TypeScript for moq-net's lite codec, committed and checked for drift in CI
- [Sans-IO moq-net](/quest/m1/rs2ts/sans-io/README.md) - moq-net builds and runs without a runtime; async helpers sit behind an `async` feature
- [Mock-clock tests](/quest/m1/rs2ts/mock-clock.md) - moq-net's tests run on the sans-IO clock instead of tokio, so they translate with the code
- [Generated lite](/quest/m1/rs2ts/lite.md) - @moq/net's lite session and model layer are generated from moq-net
- [Remove moq-wasm](/quest/m1/rs2ts/remove-wasm.md) - the WASM experiment is deleted once generated lite ships

Expand Down
2 changes: 0 additions & 2 deletions quest/m1/rs2ts/lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,4 @@ Public API: breaks `@moq/net`. Wire: none.

- [rs2ts](/quest/m1/rs2ts/translator.md) - the translator
- [Sans-IO lite session](/quest/m1/rs2ts/sans-io/lite.md) - the session shape it translates
- [Sans-IO model](/quest/m1/rs2ts/sans-io/model.md) - the model shape it translates
- [The async feature](/quest/m1/rs2ts/sans-io/async-feature.md) - rs2ts reads moq-net without it
- [Mock-clock tests](/quest/m1/rs2ts/mock-clock.md) - the tests that prove parity
26 changes: 0 additions & 26 deletions quest/m1/rs2ts/mock-clock.md

This file was deleted.

1 change: 0 additions & 1 deletion quest/m1/rs2ts/sans-io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ half; this line is lite and the model only.
## Required

- [Sans-IO lite session](/quest/m1/rs2ts/sans-io/lite.md) - the lite session is driven by bytes, stream events, and `tick(now)`
- [Sans-IO model](/quest/m1/rs2ts/sans-io/model.md) - origin, broadcast, track, and group handles run without a runtime, with time supplied by the caller
- [The async feature](/quest/m1/rs2ts/sans-io/async-feature.md) - the async helpers sit behind an `async` feature and a CI lane builds and tests moq-net without it

## Related
Expand Down
1 change: 0 additions & 1 deletion quest/m1/rs2ts/sans-io/async-feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ Wire: none.
## Required

- [Sans-IO lite session](/quest/m1/rs2ts/sans-io/lite.md) - the session builds without a runtime
- [Sans-IO model](/quest/m1/rs2ts/sans-io/model.md) - the model builds without a runtime
2 changes: 2 additions & 0 deletions quest/m1/rs2ts/sans-io/lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ Guidance:
- Stream handles, write backpressure, and close codes become explicit events
or return values the driver acts on.
- Keep maps as Vec slabs where the key space is small.
- Turn the session's async test bodies into synchronous `poll_*` tests with
explicit instants as it is rewritten, so they translate with the code.

Public API: breaks moq-net's session API. Wire: none.
18 changes: 0 additions & 18 deletions quest/m1/rs2ts/sans-io/model.md

This file was deleted.

26 changes: 14 additions & 12 deletions quest/m1/rs2ts/translator.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ Mapping decided in planning:
`[Symbol.dispose]`; `Arc`/`Rc` of a type with drop glue become an explicit
refcount. JS is single-threaded, so `Mutex` and atomics become plain
access.
- Rust `u64` (and `VarInt` while it lasts) maps to js/net's `U64`
(`js/net/src/util/u64.ts`), read and written as a varint by
`Cursor.varint()` and `Writer.varint()`.
Integers up to 32 bits and `usize` map to `number` with checked arithmetic
that throws on overflow; never wrap silently. A `u64` or `i64` never maps
to a lossy `number`: the model accepts `u64::MAX` (e.g.
`model/subscription.rs`), so each one either becomes `U64` or an
`Option` in the source, or maps to a full-width 64-bit TypeScript type.
- Rust `u64` maps to js/net's `U64` (`js/net/src/util/u64.ts`, two `u32`
halves), generically, read and written as a varint by `Cursor.varint()` and
`Writer.varint()`. Integers up to 32 bits and `usize` map to `number` with
checked arithmetic that throws on overflow; never wrap silently. A `u64` or
`i64` never maps to a lossy `number`: the model accepts `u64::MAX` (e.g.
`model/subscription.rs`). Varint is a wire encoding in the codec, not a
type, so nothing maps by that name.

Guidance:

- Keep rs2ts a generic translator for a Rust subset, not a moq-net tool. It
maps by Rust type and construct (e.g. `u64` to one 64-bit TypeScript type),
never by moq-net names; anything project-specific lives in moq-net's source
or a small config, so another crate could use rs2ts unchanged.
- `varint::zigzag` and `unzigzag` (lite per-frame timestamps) still use
64-bit bit math, which the subset forbids. Rewrite them on two `u32` halves,
or give the 64-bit TypeScript type the operations they need.
- Pin Charon and its nightly in the nix shell for the regeneration lane only.
- Borrow rust-js's MIT oxc printer for formatting and source maps.
- Readability pass: inline single-use temporaries and keep source branch
Expand All @@ -54,7 +60,3 @@ Guidance:

Public API: none (internal tool). Lands with the codec it
translates. Wire: none.

## Required

- [VarInt codec](/quest/m1/rs2ts/varint-codec.md) - the codec shape the translator targets
36 changes: 0 additions & 36 deletions quest/m1/rs2ts/varint-codec.md

This file was deleted.

1 change: 1 addition & 0 deletions quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ waiting on an upstream release waits in [m4](/quest/m4/README.md).
- [macOS GPU input](/quest/m2/obs-macos.md) - feed the encoder from the OBS compositor without CPU readback
- [Windows GPU input](/quest/m2/obs-windows.md) - import or blit OBS D3D11 textures with explicit synchronization
- [Sans-IO IETF session](/quest/m2/rs2ts-sans-io-ietf.md) - the session shape it translates
- [IETF parameters](/quest/m2/rs2ts-ietf-params.md) - the IETF codec drops its `Param` trait on primitives, so it translates like lite
- [Generated IETF](/quest/m2/rs2ts-ietf.md) - @moq/net's moq-transport session is generated too
- [Per-stream deadlines](/quest/m2/quic-deadline.md) - hopeless retransmits
become resets, and a tail loss probe fires early while there is still time
Expand Down
22 changes: 22 additions & 0 deletions quest/m2/rs2ts-ietf-params.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# [S] IETF parameters without primitive traits

## Goal

moq-net's IETF message parameters encode and decode through concrete
per-kind methods, with no `Param` impls on `u8`, `bool`, `u64`, or
`Option<T>`, so the IETF codec has the same concrete shape as the lite codec
the translator targets.

## Plan

The VarInt codec removed Encode/Decode on primitives, but
`ietf/parameters.rs` still implements its own `Param` trait on them, which rs2ts can only translate with dictionary passing. Replace the
impls with methods on the concrete `Decoder`/`Encoder` (or on the parameter
kinds), keeping the draft-14..16 varint cast and the draft-17+ forms byte for
byte. Benchmark IETF message encode and decode before and after with
`--bench codec`.

Public API: none (`ietf` parameters are crate-private). Wire: none.

Decided in the 2026-09-30 audit: deferred to m2 with generated IETF, its only
consumer, until generated lite passes its go/no-go.
1 change: 1 addition & 0 deletions quest/m2/rs2ts-ietf.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ its no-downgrade go/no-go in the [rs2ts line](/quest/m1/rs2ts/README.md).

- [Generated lite](/quest/m1/rs2ts/lite.md) - the pipeline this reuses
- [Sans-IO IETF session](/quest/m2/rs2ts-sans-io-ietf.md) - the session shape it translates
- [IETF parameters](/quest/m2/rs2ts-ietf-params.md) - the concrete parameter codec it translates
2 changes: 2 additions & 0 deletions quest/m2/rs2ts-sans-io-ietf.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ twice (for `Session` and `ControlStreamAdapter<Session>`); collapse that while
here.
If the [async feature](/quest/m1/rs2ts/sans-io/async-feature.md) landed
first with the IETF session behind it, move the session out.
Turn the session's async test bodies into synchronous `poll_*` tests with
explicit instants as it is rewritten, like lite.

Public API: breaks moq-net's IETF session API. Wire: none.

Expand Down
2 changes: 1 addition & 1 deletion rs/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Prefer poll. New logic is a `poll_*` with an `async` helper, not the other way a

# Testing

- Tests are inline `#[cfg(test)] mod tests`. Time-dependent async tests call `tokio::time::pause()` first, unless they cross real networking that can't be mocked (sockets, smoke tests); those run on the wall clock and assert lower bounds.
- Tests are inline `#[cfg(test)] mod tests`. Time-dependent async tests call `tokio::time::pause()` first (moq-net uses `#[moq_net_sim::test]` instead), unless they cross real networking that can't be mocked (sockets, smoke tests); those run on the wall clock and assert lower bounds.
- Run tests through `just` (nextest), not `cargo test`: nextest kills a wedged test as TIMEOUT, cargo hangs forever. A test flagged SLOW is a bug to fix, not a threshold to raise.
- `just check` compiles default features only, like CI. `just rs features` (nightly) covers `--all-features` / `--no-default-features`. Keep a feature gate around the dependency, not the logic, so the logic's tests stay in the merge gate.
- Local checks compile only the host platform; PR CI runs `just rs windows` / `macos` on those hosts, and `just rs wasm` covers `moq-wasm`.
2 changes: 1 addition & 1 deletion rs/hang/src/catalog/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use serde_with::{base64::Base64, serde_as};
/// rendition must be ignored by consumers.
#[derive(Debug, Clone, PartialEq, Default)]
pub enum Container {
/// A QUIC VarInt timestamp prefix followed by the raw codec payload.
/// A QUIC varint timestamp prefix followed by the raw codec payload.
/// Timestamps are in microseconds.
#[default]
Legacy,
Expand Down
Loading
Loading