From 49ba1cd11b8c747264e84b84dd127ca2ef0a6968 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 15 Jul 2026 01:20:56 +0200 Subject: [PATCH] fix(host): cover Codec::PyroWave in the Windows NVENC/AMF match arms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nine non-exhaustive matches windows-host CI tripped on (run 9917) — all inside encoder objects a PyroWave session can never open (the open_video dispatch routes PyroWave to its own backend on Linux and bails on Windows), so the arms are dispatch-guarded unreachable!(). Verified: cargo check -p punktfunk-host --features nvenc,amf-qsv --release green on the windows-amd64 runner. Co-Authored-By: Claude Fable 5 --- crates/punktfunk-host/src/encode/windows/amf.rs | 3 +++ crates/punktfunk-host/src/encode/windows/nvenc.rs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/punktfunk-host/src/encode/windows/amf.rs b/crates/punktfunk-host/src/encode/windows/amf.rs index 6832e659..25ce27cc 100644 --- a/crates/punktfunk-host/src/encode/windows/amf.rs +++ b/crates/punktfunk-host/src/encode/windows/amf.rs @@ -913,6 +913,7 @@ fn codec_props(codec: Codec) -> CodecProps { intra_refresh: None, ltr: None, }, + Codec::PyroWave => unreachable!("PyroWave never opens the AMF backend"), } } @@ -1525,6 +1526,7 @@ impl AmfEncoder { )?; } } + Codec::PyroWave => unreachable!("PyroWave never opens the AMF backend"), } // Colour signalling, mirroring `open_win_encoder`: BT.709 limited (SDR) or BT.2020 PQ // (HDR) — VUI on AVC/HEVC, sequence-header colour config on AV1. Required when HDR — a @@ -2171,6 +2173,7 @@ impl Encoder for AmfEncoder { // The static KEY_FRAME_ALIGNED header-insertion mode already puts a sequence // header OBU on every key frame; there is no per-surface twin. Codec::Av1 => {} + Codec::PyroWave => unreachable!("PyroWave never opens the AMF backend"), } } // LTR-RFI per-frame properties (design: the AMD twin of NVENC intra-refresh recovery). diff --git a/crates/punktfunk-host/src/encode/windows/nvenc.rs b/crates/punktfunk-host/src/encode/windows/nvenc.rs index 0246231a..ad914f71 100644 --- a/crates/punktfunk-host/src/encode/windows/nvenc.rs +++ b/crates/punktfunk-host/src/encode/windows/nvenc.rs @@ -244,6 +244,7 @@ fn codec_guid(codec: Codec) -> nv::GUID { Codec::H264 => nv::NV_ENC_CODEC_H264_GUID, Codec::H265 => nv::NV_ENC_CODEC_HEVC_GUID, Codec::Av1 => nv::NV_ENC_CODEC_AV1_GUID, + Codec::PyroWave => unreachable!("PyroWave never opens the direct-NVENC backend"), } } @@ -757,6 +758,7 @@ impl NvencD3d11Encoder { } // H.264 has no tier; the preset default level is already autoselect. Codec::H264 => {} + Codec::PyroWave => unreachable!("PyroWave never opens the direct-NVENC backend"), } // Chroma + bit depth. Full-chroma 4:4:4 (HEVC Range Extensions) takes precedence and composes @@ -795,6 +797,7 @@ impl NvencD3d11Encoder { cfg.encodeCodecConfig.hevcConfig.set_pixelBitDepthMinus8(2); // 10 - 8 } + Codec::PyroWave => unreachable!("PyroWave never opens the direct-NVENC backend"), Codec::Av1 => { cfg.encodeCodecConfig.av1Config.set_pixelBitDepthMinus8(2); // The input rides at its real depth; NVENC upconverts (mirrors the HEVC path). @@ -864,6 +867,7 @@ impl NvencD3d11Encoder { av1.matrixCoefficients = mat; av1.colorRange = 0; // studio/limited swing } + Codec::PyroWave => unreachable!("PyroWave never opens the direct-NVENC backend"), } } @@ -885,6 +889,7 @@ impl NvencD3d11Encoder { Codec::Av1 => { cfg.encodeCodecConfig.av1Config.maxNumRefFramesInDPB = RFI_DPB; } + Codec::PyroWave => unreachable!("PyroWave never opens the direct-NVENC backend"), } } Ok(cfg) @@ -1456,6 +1461,9 @@ impl Encoder for NvencD3d11Encoder { } // AV1 mastering/CLL ride METADATA OBUs, not SEI — separate follow-up. Codec::Av1 => {} + Codec::PyroWave => { + unreachable!("PyroWave never opens the direct-NVENC backend") + } } } (api().encode_picture)(self.encoder, &mut pic)