From e30551b1e275c2beb1961e4bf2f7a5026e9850a1 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Fri, 24 Jul 2026 23:12:49 +0200 Subject: [PATCH] fix(encode/nvenc-linux): unrot the direct-NVENC test module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All ten `NvencCudaEncoder::open` call sites in the `#[cfg(test)]` module passed 9 arguments to a 10-parameter function: `cursor_blend` was added to `open` and the tests were never updated. The module has been uncompilable ever since — `cargo clippy -p pf-encode --features nvenc --all-targets` fails with 10x E0061. Nothing in CI noticed because no job compiles this crate's feature-gated test targets: ci.yml lints/tests with default features (which do not include `nvenc`), and windows-host.yml lints `-p punktfunk-host`, which builds pf-encode as a dependency and so never builds its test targets. The CI commit below closes that gap; this has to land first or that leg starts red. `false` is what these tests exercised before `cursor_blend` existed: every frame they build sets `cursor: None`, and there is no cursor-blend test. Co-Authored-By: Claude Opus 5 (1M context) --- crates/pf-encode/src/enc/linux/nvenc_cuda.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/pf-encode/src/enc/linux/nvenc_cuda.rs b/crates/pf-encode/src/enc/linux/nvenc_cuda.rs index 25ee82f8..8c0da416 100644 --- a/crates/pf-encode/src/enc/linux/nvenc_cuda.rs +++ b/crates/pf-encode/src/enc/linux/nvenc_cuda.rs @@ -2165,6 +2165,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) .expect("open NVENC CUDA session"); @@ -2241,6 +2242,7 @@ mod tests { true, 8, ChromaFormat::Yuv444, + false, ) .expect("open NVENC CUDA 4:4:4 session"); @@ -2286,6 +2288,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) .expect("open NVENC CUDA session"); @@ -2343,6 +2346,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) else { eprintln!( "skipping rfi_declines_impossible_ranges: NVENC unavailable (no NVIDIA driver)" @@ -2369,6 +2373,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) .expect("open NVENC CUDA encoder") } @@ -2403,6 +2408,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) .expect("open"); for f in 0..4u32 { @@ -2540,6 +2546,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) .expect("open NVENC CUDA session"); let frame = nv12_frame(W, H, 0); @@ -2581,6 +2588,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) .expect("open NVENC CUDA session"); // Steady sync frames first (stream-ordered mode). @@ -2660,6 +2668,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) .expect("open NVENC CUDA session"); @@ -2765,6 +2774,7 @@ mod tests { true, 8, ChromaFormat::Yuv420, + false, ) .expect("open NVENC CUDA session");