From 9387174a07467836d2ce4c3f38fd9dbc87c7bd43 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 30 Oct 2026 10:52:44 +0000 Subject: [PATCH] fix(test): preserve valid wire compatibility measurements (#7061) * chore(quest): claim quest/m0/interop-green/wire-compat-remeasure.md Quest-Claim: 6e5004b8f34cdb87 * docs(quest): record wire-compat measurement blockers * fix(test): preserve valid wire compatibility measurements * fix(test): preserve demux timestamps in compatibility decodes * fix(test): exempt a released CLI publisher from the tone phase check The released CLI's fMP4 import restamps media on an arrival-anchored clock, so its tone never starts at timestamp zero; the phase error varies per run. * test(interop): re-pin lite-07-wip to the 2026-10-30 releases `just test wire-compat --remeasure` against moq-cli 0.14.10, moq-relay 0.17.10, and @moq/net 0.4.7: the 16 cross-version lite-07-wip media, publication, and FETCH cells still fail, and every stable lite-01 through lite-06 cell passes, Opus phase included. Finishes the wire-compat remeasure quest. Co-authored-by: Claude Opus 5.5 Co-authored-by: GPT-6 --- quest/m0/interop-green/README.md | 1 - .../m0/interop-green/wire-compat-remeasure.md | 17 ----------------- test/interop/compat.sh | 19 +++++++++++++------ test/interop/compat/client.ts | 8 +++++++- test/interop/compat/planned-breaks.json | 8 ++++---- test/interop/interop.sh | 11 +++++++---- 6 files changed, 31 insertions(+), 33 deletions(-) delete mode 100644 quest/m0/interop-green/wire-compat-remeasure.md diff --git a/quest/m0/interop-green/README.md b/quest/m0/interop-green/README.md index 918ba8fba61..08d8aaf328e 100644 --- a/quest/m0/interop-green/README.md +++ b/quest/m0/interop-green/README.md @@ -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 diff --git a/quest/m0/interop-green/wire-compat-remeasure.md b/quest/m0/interop-green/wire-compat-remeasure.md deleted file mode 100644 index c5b5b809985..00000000000 --- a/quest/m0/interop-green/wire-compat-remeasure.md +++ /dev/null @@ -1,17 +0,0 @@ -# [XS] Remeasure the planned wire break - -## Goal - -`just test wire-compat` runs again: the lite-07-wip planned break in -`test/interop/compat/planned-breaks.json` is measured against the released -`@moq/net` 0.4.6 instead of 0.4.5. - -## Plan - -npm published `@moq/net` 0.4.6 on 2026-10-23, so `stale()` in -`test/interop/compat/resolve.ts` refuses every scheduled run since. Run -`just test wire-compat --remeasure`, confirm the lite-07-wip cells still -fail against the released builds and the stable lite-01 through lite-06 -cells still pass, and update the entry's releases and reason with the date. - -Public API: none. Wire: none. diff --git a/test/interop/compat.sh b/test/interop/compat.sh index 9ed72206a53..48d80b4e839 100755 --- a/test/interop/compat.sh +++ b/test/interop/compat.sh @@ -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. @@ -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, @@ -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 @@ -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" diff --git a/test/interop/compat/client.ts b/test/interop/compat/client.ts index ae0f598ff93..3acdcb784e9 100644 --- a/test/interop/compat/client.ts +++ b/test/interop/compat/client.ts @@ -18,6 +18,12 @@ import { connect } from "./transport"; type FrameMicros = Parameters[1]; type TimestampMicros = Parameters[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(section: { renditions: Record } | undefined): [string, T] | undefined { return Object.entries(section?.renditions ?? {})[0]; @@ -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. diff --git a/test/interop/compat/planned-breaks.json b/test/interop/compat/planned-breaks.json index f0cd5750d55..afc48fc303f 100644 --- a/test/interop/compat/planned-breaks.json +++ b/test/interop/compat/planned-breaks.json @@ -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" } } } diff --git a/test/interop/interop.sh b/test/interop/interop.sh index b8d5e1a2320..32d1102b659 100755 --- a/test/interop/interop.sh +++ b/test/interop/interop.sh @@ -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" @@ -370,14 +370,15 @@ publisher_codecs() { } # phase_checked : 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 case=C [field=value...]` (see @@ -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"