From d86db487698a70d75db25f7b736dd94f670172d9 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 16:06:11 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m1/vaapi-radeonsi.md Quest-Claim: 46c0186d975484c5 From f90f93a43d3cb2a5714f81bc99d4960112bca2f6 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 16:29:17 -0800 Subject: [PATCH 2/2] fix(moq-video): take moq-vaapi 0.2.1 so VA-API encode is correct on radeonsi moq-vaapi 0.2.1 sends the packed slice header radeonsi needs to write the SPS, PPS, and slice NAL header, lifts the QP ceiling that held bitrate above target, and names both VPP color spaces on Mesa. With it, all 20 moq-video VA-API tests, ignored ones included, pass on an AMD RX 9070 (Mesa 26.2.6). Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 4 +-- Cargo.toml | 2 +- quest/m1/README.md | 1 - quest/m1/vaapi-radeonsi.md | 39 ------------------------ quest/m3/h265-min-width.md | 3 +- rs/moq-video/src/encode/backend/vaapi.rs | 7 +++-- 6 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 quest/m1/vaapi-radeonsi.md diff --git a/Cargo.lock b/Cargo.lock index 9201bbed1e2..f6a7558a88f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5233,9 +5233,9 @@ dependencies = [ [[package]] name = "moq-vaapi" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b175d0632ae90ceaa88ff0c2a6ad949ae227f39d35ea1dd5019beff278d967f" +checksum = "67e1eee8b86560f73818e82838ac5ec60b04f1251deb94df35640de190db67f5" dependencies = [ "anyhow", "bitflags 2.13.2", diff --git a/Cargo.toml b/Cargo.toml index 1ee715bc17f..b5e87d0285c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -174,7 +174,7 @@ moq-uring = { version = "0.0.12", path = "rs/moq-uring", default-features = fals moq-v4l = { version = "0.1.0", path = "rs/moq-v4l" } # Standalone crate (moq-dev/vaapi); vendored from cros-libva + cros-codecs. # dlopen's libva at runtime (no libva-dev at build, no NEEDED libva in the binary). -moq-vaapi = "0.2.0" +moq-vaapi = "0.2.1" # `default-features = false` is here for `capture` (V4L2, libclang), which the # cross-compiled Python, Swift, Kotlin, and Go builds have no use for: adding # `features = ["capture"]` to a consumer that ships in those bindings pulls the diff --git a/quest/m1/README.md b/quest/m1/README.md index 897602cde36..f29543e988c 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -54,7 +54,6 @@ moves what remains of them once their claims merge. - [Push-to-talk's press-to-audible latency fits a budget on the defaults](/quest/m1/push-to-talk-latency.md) - press to audible on the browser defaults, excluding device output, stays under a kixtop-measured budget that `just test push-to-talk` enforces - [TS fidelity and recovery](/quest/m1/ts-reliability/README.md) - both modes have explicit profiles, automated validation, loss tests, and a dedicated guide - [MoQ on rind](/quest/m1/rind/README.md) - every MoQ crate takes its crypto from rind, a pure-Rust graviola fork, so no build compiles C crypto -- [VA-API encode is correct on radeonsi](/quest/m1/vaapi-radeonsi.md) - AMD's VA-API H.264 encode decodes, once moq takes moq-vaapi 0.2.1 - [Tests run on a mocked clock](/quest/m1/mock-clock-tests/README.md) - about 300 tests stop proving nothing happened by waiting, sleeping to settle, or asserting on elapsed time - [moq-mux reads only the base layer's H.265 SPS](/quest/m1/h265-base-layer-sps.md) - a layered MV-HEVC or SHVC stream imports as its base layer instead of misreading an enhancement-layer SPS, which still reaches the track - [A cancelled dispatch lane stops its phase promptly](/quest/m1/dispatch-cancel-race.md) - a TERM landing just before a lane forks its phase's command still stops that command, instead of waiting out the phase diff --git a/quest/m1/vaapi-radeonsi.md b/quest/m1/vaapi-radeonsi.md deleted file mode 100644 index 7fac16a0bb0..00000000000 --- a/quest/m1/vaapi-radeonsi.md +++ /dev/null @@ -1,39 +0,0 @@ -# [S] VA-API encode is correct on radeonsi - -## Goal - -On an AMD RX 9070 (radeonsi), moq-video's VA-API H.264 encoder produces a -stream that ffmpeg decodes, its VPP NV12 conversion matches the space it -labels, and its rate control stays near the target bitrate. The VA-API -tests in `rs/moq-video/src/encode/backend/vaapi.rs`, ignored ones included, -pass on that card with `MOQ_VAAPI_DEVICE` naming its node. - -## Plan - -The causes were in moq-vaapi and are fixed in -[moq-dev/vaapi#13](https://github.com/moq-dev/vaapi/pull/13). With it patched -in, all 19 of moq-video's VA-API tests pass on the RX 9070 (`renderD129`, -Mesa 26.2.5); on moq-vaapi 0.2.0, 7 fail. That PR's body has the evidence. - -- H.264 bytes: radeonsi writes the packed SPS and PPS, and the slice's NAL - header, only from a packed slice header, which moq-vaapi did not send. -- Bitrate: moq-vaapi's QP ceiling of 36 set a smallest picture on both iHD - and radeonsi; it is now 51. -- Chroma: not an offset. Mesa's VPP reads the BT.601 standard as SMPTE 170M - primaries and gamut-maps; moq-vaapi now names each side explicitly on Mesa. - -Decided 2026-11-07 (maintainer, /quest-unblock): an agent merged #13 and -published it as moq-vaapi 0.2.1 (a patch: `cargo semver-checks` against 0.2.0 -needs no bump), tagged `v0.2.1`. - -What remains here: bump `moq-vaapi` in the root `Cargo.toml` to 0.2.1, refresh `Cargo.lock` with it, and say in the module docs of -`rs/moq-video/src/encode/backend/vaapi.rs` that the tests pass on radeonsi. -Then delete this quest. - -Public API: none. Wire: none. - -## Related - -- [Vulkan Video encode on AMD](/quest/m3/vulkan-encode.md) - AMD's long-term encode path -- [VA-API renderer tests](/quest/m4/vaapi-render-tests.md) - runs the VA-API tests on each render node -- [moq-vaapi vendor sync](/quest/m3/vendor-sync/vaapi.md) - the crate's upstream record diff --git a/quest/m3/h265-min-width.md b/quest/m3/h265-min-width.md index 20f547e334f..1f7ba752894 100644 --- a/quest/m3/h265-min-width.md +++ b/quest/m3/h265-min-width.md @@ -25,7 +25,7 @@ is 320 wide for a 4:3 source), and a failed rung probe must fail only that rung: today `Pipeline::new` propagates it and aborts the whole transcode. Decided 2026-11-06 (maintainer, /quest-unblock): ✅ an S quest in m3. Not -chosen: folding it into [the radeonsi quest](/quest/m1/vaapi-radeonsi.md), +chosen: folding it into the radeonsi quest, or dropping it. Decided 2026-11-07 (maintainer, /quest-complete): ✅ narrowed to the @@ -43,5 +43,4 @@ none. ## Related -- [VA-API encode is correct on radeonsi](/quest/m1/vaapi-radeonsi.md) - the same AMD hardware run - [Vulkan Video encode on AMD](/quest/m3/vulkan-encode.md) - may report a different minimum diff --git a/rs/moq-video/src/encode/backend/vaapi.rs b/rs/moq-video/src/encode/backend/vaapi.rs index c3397cecaa9..5fca4a3270c 100644 --- a/rs/moq-video/src/encode/backend/vaapi.rs +++ b/rs/moq-video/src/encode/backend/vaapi.rs @@ -35,8 +35,9 @@ //! frames, VA-API decodes handed over as DMA-BUFs, and packed RGB buffers at //! and above the encoder's size, decode each stream with openh264, and compare //! pixels. The H.265 case decodes with the VA-API decoder, since there is no -//! software one, and was validated on Intel Arrow Lake (iHD 26.1.2). They skip -//! on a machine without a VA-API device. +//! software one, and was validated on Intel Arrow Lake (iHD 26.1.2). All of +//! them, ignored ones included, also pass on an AMD RX 9070 with radeonsi (Mesa +//! 26.2.6). They skip on a machine without a VA-API device. use std::collections::HashSet; use std::path::Path; @@ -644,7 +645,7 @@ mod hardware_tests { /// The tests above check pixels with an independent software decoder; this /// proof deliberately compiles without a software codec. #[test] - #[ignore = "requires an Intel VA-API decode/VPP/encode device"] + #[ignore = "requires a VA-API decode/VPP/encode device"] fn vaapi_1080p_ladder_stays_on_the_gpu() { const FRAMES: usize = 12; let size = Size::new(1920, 1080);