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
1 change: 0 additions & 1 deletion quest/m0/interop-green/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ Public API: none. Wire: none.
## Required

- [Browser tests expect current behavior](/quest/m0/interop-green/stale-browser-tests.md) - the renderer and element version tests match the shipped validation and version list
- [Remeasure the planned wire break](/quest/m0/interop-green/wire-compat-remeasure.md) - the lite-07-wip planned break is measured against `@moq/net` 0.4.6
17 changes: 0 additions & 17 deletions quest/m0/interop-green/wire-compat-remeasure.md

This file was deleted.

19 changes: 13 additions & 6 deletions test/interop/compat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ fetch() {
bash "$DIR/interop.sh" --publishers rust --subscribers rust
}

# The released CLI's fMP4 import restamps media on its arrival clock, so its tone
# does not start at timestamp zero and its decodes cannot be held to the tone's
# phase (see phase_checked in interop.sh). Its readers' phase is still checked.
live_publisher() {
[[ "$1" == "$RELEASED" ]] && echo 1 || echo 0
}

# Same-source cells keep exercising the compat reader while version-pairing
# exceptions skip cross-source media. A control always uses its own binary,
# relay, and package set, and can never be covered by a planned break.
Expand All @@ -206,7 +213,7 @@ while read -r source version <&3; do
;;
esac
cell media-control "$version" "$source" "$source" env RELAY_BIN="$relay" CLI_BIN="$pub" INTEROP_SUB_MOQ="$pub" INTEROP_VERSION="$version" \
INTEROP_COMPAT_CLIENT="$js" INTEROP_DECODE=1 bash "$DIR/interop.sh" --subscribers rust,js-native-node
INTEROP_COMPAT_CLIENT="$js" INTEROP_DECODE=1 INTEROP_PUB_LIVE="$(live_publisher "$pub")" bash "$DIR/interop.sh" --subscribers rust,js-native-node
done 3<"$HARNESS_RUN/controls"

# Existing media drivers: current publisher -> released clients and the reverse,
Expand Down Expand Up @@ -245,7 +252,7 @@ while read -r version <&3; do
# One cell per reader, so a planned break in one reader's release keeps the other running.
for reader in rust js-native-node; do
cell "media-$reader" "$version" "$relay_source" "$source" env RELAY_BIN="$relay" CLI_BIN="$pub" INTEROP_SUB_MOQ="$sub" INTEROP_VERSION="$version" \
INTEROP_COMPAT_CLIENT="$other_js" INTEROP_DECODE=1 bash "$DIR/interop.sh" --subscribers "$reader"
INTEROP_COMPAT_CLIENT="$other_js" INTEROP_DECODE=1 INTEROP_PUB_LIVE="$(live_publisher "$pub")" bash "$DIR/interop.sh" --subscribers "$reader"
done
[[ "$released_fetch" == true && "$current_fetch" == true ]] || continue
# Drive JS publication from actual subscriber demand: the publisher's own JS
Expand All @@ -261,13 +268,13 @@ while read -r version <&3; do
done
done 3<"$HARNESS_RUN/shared"
echo "session cells: $ran ran, $skipped skipped"
if ((${#failed[@]})); then
printf 'FAIL %s\n' "${failed[@]}" >&2
exit 1
fi
if [[ -n "$remeasure" ]]; then
bun "$DIR/compat/resolve.ts" remeasure "$DIR/compat/planned-breaks.json" "$HARNESS_RUN/current-help" "$HARNESS_RUN/released-help" "$HARNESS_RUN/versions.json" "$HARNESS_RUN/measured"
bun x biome format --write "$DIR/compat/planned-breaks.json"
echo "rewrote compat/planned-breaks.json: review the diff and refresh each reason"
fi
if ((${#failed[@]})); then
printf 'FAIL %s\n' "${failed[@]}" >&2
exit 1
fi
echo "wire compatibility: token, session, catalog, and container lanes passed"
8 changes: 7 additions & 1 deletion test/interop/compat/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import { connect } from "./transport";
type FrameMicros = Parameters<typeof Container.Legacy.encodeFrame>[1];
type TimestampMicros = Parameters<typeof Moq.Time.Timestamp.fromMicros>[0];

// Group completion was renamed after @moq/net 0.4.7. Select the installed API
// once before connecting, so the same client can publish with either package.
const groupMethods = Moq.Group.Producer.prototype as { finish?: () => void; close?: () => void };
const finishGroup = groupMethods.finish ?? groupMethods.close;
if (!finishGroup) throw new Error("group producer has no clean completion method");

/** A catalog section's first rendition, with its name. */
function first<T>(section: { renditions: Record<string, T> } | undefined): [string, T] | undefined {
return Object.entries(section?.renditions ?? {})[0];
Expand Down Expand Up @@ -319,7 +325,7 @@ if (command === "sign") {
payload: new TextEncoder().encode("compat-fetch"),
timestamp: Moq.Time.Timestamp.fromMicros(1 as TimestampMicros),
});
group.finish();
finishGroup.call(group);
await connection.closed;
} else if (command === "subscribe") {
// The flags of the interop subscriber this stands in for.
Expand Down
8 changes: 4 additions & 4 deletions test/interop/compat/planned-breaks.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"moq-lite-07-wip": {
"reason": "Re-accepted by the maintainer (2026-10-13): this draft is unpublished and its wire is still changing. Remeasured 2026-10-23 against these releases, with the media lanes checking the audio tone: all 16 cross-version lite-07-wip media, publication, and FETCH cells fail, while its FETCH capability check and the stable lite-01 through lite-06 cells pass. Current and released lite-07-wip framing differs (long buffer, invalid value, protocol violation). Reassess when any affected release changes.",
"reason": "Re-accepted by the maintainer (2026-10-13): this draft is unpublished and its wire is still changing. Remeasured 2026-10-30 against these releases, with the media lanes checking the audio tone: all 16 cross-version lite-07-wip media, publication, and FETCH cells fail, while its FETCH capability check and the stable lite-01 through lite-06 cells pass, including the Opus phase check now that moq-cli 0.14.10 keeps the Opus edit list. Current and released lite-07-wip framing differs (long buffer, invalid value, protocol violation). Reassess when any affected release changes.",
"releases": {
"moq-cli": "0.14.8",
"moq-relay": "0.17.8",
"@moq/net": "0.4.5"
"moq-cli": "0.14.10",
"moq-relay": "0.17.10",
"@moq/net": "0.4.7"
}
}
}
11 changes: 7 additions & 4 deletions test/interop/interop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ source "$INTEROP_DIR/../lib/harness.sh"

# Captured before the parse below consumes it, so the rerun command carries every
# flag and every environment override this run was actually given.
RERUN="$(harness_env INTEROP_TIMEOUT INTEROP_FPS INTEROP_SIZE INTEROP_PORT INTEROP_PROFILE RELAY_BIN CLI_BIN INTEROP_SUB_MOQ INTEROP_VERSION INTEROP_COMPAT_CLIENT INTEROP_DECODE INTEROP_FETCH_DATA INTEROP_FETCH_TRACK)just test interop$(harness_argv "$@")"
RERUN="$(harness_env INTEROP_TIMEOUT INTEROP_FPS INTEROP_SIZE INTEROP_PORT INTEROP_PROFILE RELAY_BIN CLI_BIN INTEROP_SUB_MOQ INTEROP_VERSION INTEROP_COMPAT_CLIENT INTEROP_DECODE INTEROP_PUB_LIVE INTEROP_FETCH_DATA INTEROP_FETCH_TRACK)just test interop$(harness_argv "$@")"

PUBLISHERS="rust"
SUBSCRIBERS="rust"
Expand Down Expand Up @@ -370,14 +370,15 @@ publisher_codecs() {
}
# phase_checked <round> <subscriber> <codec>: whether tone.py also holds the tone's phase to the
# decode's timestamps, which fails a misapplied pre-skip. Every publisher's tone starts at
# timestamp zero except the browser's, which stamps its file from its own page clock. The native-JS
# timestamp zero except the browser's, which stamps its file from its own page clock, and a CLI_BIN
# whose fMP4 import restamps on arrival (INTEROP_PUB_LIVE=1: a released CLI's live import). The native-JS
# subscriber hands WebCodecs raw Opus without the OpusHead, as the player does, which keeps the
# pre-skip for the player to trim, and its libav fallback stamps milliseconds. GStreamer's AAC is
# skipped for its decoder: `faad`, which decodebin picks, drops the first frame's output and stamps
# the rest a frame early, so it reads the priming 1024 samples early whatever the timestamps say.
# shellcheck disable=SC2329 # reached from run_cell, which 'harness_spawn' invokes
phase_checked() {
[[ "$1" != js* && "$2" != js-native-* && ("$2" != gst || "$3" == opus) ]]
[[ "$1" != js* && ("$1" != rust || "${INTEROP_PUB_LIVE:-0}" != 1) && "$2" != js-native-* && ("$2" != gst || "$3" == opus) ]]
}

# Record a case for the CI report: `record <outcome> case=C [field=value...]` (see
Expand Down Expand Up @@ -1285,13 +1286,15 @@ PYCODE
# frame's timestamp and length for tone.py. The outputs are the verdict: a CLI may
# exit on EPIPE with a plain error once ffmpeg has what it needs. The WAV cannot say
# which codec it came from, so this takes a publisher of one audio rendition.
# Keep demuxed PTS: Opus priming can start before zero, and FFmpeg's default
# start-time shift would move the kept samples after their actual media time.
if [[ "$codecs" == *,* ]]; then
echo "error: the ffmpeg decode reads one audio rendition, not $codecs" >&2
return 1
fi
(timeout -k 3 "$TIMEOUT" "${INTEROP_SUB_MOQ:-$MOQ}" --connect "$URL" \
${INTEROP_VERSION:+--connect-version "$INTEROP_VERSION"} --broadcast "$broadcast" export fmp4 || [[ "$?" == 141 ]]) |
ffmpeg -hide_banner -loglevel error -i - \
ffmpeg -hide_banner -loglevel error -copyts -i - \
-map 0:v:0 -frames:v 1 -f rawvideo -pix_fmt gray "$HARNESS_RUN/$broadcast.raw" \
-map 0:a:0 -af "atrim=duration=${AUDIO_MS}ms" -c:a pcm_f32le \
-stats_enc_pre "$audio_out.stats" -stats_enc_pre_fmt '{tb} {pts} {samp}' -f wav "$audio_out.wav"
Expand Down
Loading