From 0430d907bbf52e1e2b7ad501153e6b7ee6647cf3 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Fri, 7 Aug 2026 09:01:05 +0200 Subject: [PATCH] =?UTF-8?q?fix(pf-encode):=20gate=20forced=5Fsplit=5Fwidth?= =?UTF-8?q?=20to=20Linux=20=E2=80=94=20WP4=20broke=20the=20Windows=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The verification gap flagged in 01294e3a was real. `.133` came back up and the WP4 commit failed Windows clippy: `forced_split_width` is used only by the libav NVENC path (`enc/linux/mod.rs`), but it was added to `codec.rs`, which compiles everywhere -- so it is dead code on Windows and `-D warnings` rejects it. Third time this crate has hit the same item-level dead_code trap (see `subframe_env_forced`, and the arbiter items in `nvenc_core`), and the third time it was caught by actually running the Windows check rather than by reasoning about it. The comment on the gate says so, since the pattern is clearly not self-evident from the code. Verified .21: clippy -D warnings clean both WITH and WITHOUT the nvenc feature, 65 unit tests. Verified .133: Windows clippy --features nvenc --all-targets -D warnings clean, zero errors, zero dead_code. fmt clean. --- crates/pf-encode/src/enc/codec.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/pf-encode/src/enc/codec.rs b/crates/pf-encode/src/enc/codec.rs index 7a59e053..f74c8937 100644 --- a/crates/pf-encode/src/enc/codec.rs +++ b/crates/pf-encode/src/enc/codec.rs @@ -654,6 +654,11 @@ pub(crate) fn max_forced_split_mode(engines: u32) -> u32 { /// For callers that can only express "split this many ways" and have no vocabulary for our other /// modes — the libav path, whose `split_encode_mode` AVOption is libavcodec's own enum, not the /// NVENC one (our `DISABLE` is `15`, which would be meaningless there). +// Linux-only: its sole caller is the libav NVENC path (`enc/linux/mod.rs`). `codec.rs` compiles +// everywhere, so without this it is dead code on Windows — the same item-level `dead_code` +// trap this crate has now hit three times (see `subframe_env_forced`, and the arbiter items in +// `nvenc_core`). Caught by the `.133` check, never by reasoning about it. +#[cfg(target_os = "linux")] pub(crate) fn forced_split_width(mode: u32) -> Option { match mode { m if m == SPLIT_TWO_FORCED => Some(2),