From 786f6ad28ffa059c109dacf9e9d1a3911a79ebad Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Thu, 23 Jul 2026 00:22:02 +0200 Subject: [PATCH] fix(pf-driver-proto): catch the layout tests up with the cursor-channel proto bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cursor-channel sweep grew AddReply by the cursor_excluded u32 tail (24 bytes, legacy prefix 20) and bumped PROTOCOL_VERSION to 6, but left two lib tests behind: the AddReply byte-layout roundtrip still built the legacy initializer (a compile error that turned the rust CI leg red on main), and the version-coherence assertion still pinned v5 (hidden behind that compile error). Cover the new tail bytes + the legacy-size constant, and widen the compat-window note to v4–v6 (floor stays 3). Co-Authored-By: Claude Fable 5 --- crates/pf-driver-proto/src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/pf-driver-proto/src/lib.rs b/crates/pf-driver-proto/src/lib.rs index 7c03915c..e84152ed 100644 --- a/crates/pf-driver-proto/src/lib.rs +++ b/crates/pf-driver-proto/src/lib.rs @@ -1278,14 +1278,19 @@ mod tests { target_id: 262, resolved_monitor_id: 7, wudf_pid: 4242, + cursor_excluded: 1, }; let rbytes = bytemuck::bytes_of(&reply); - assert_eq!(rbytes.len(), 20); + assert_eq!(rbytes.len(), 24); assert_eq!(*bytemuck::from_bytes::(rbytes), reply); // resolved_monitor_id occupies the old `_reserved` slot at offset 12 — byte-compatible. assert_eq!(rbytes[12..16], 7u32.to_le_bytes()); // The v2 duplication-target pid trails at offset 16. assert_eq!(rbytes[16..20], 4242u32.to_le_bytes()); + // The cursor-excluded tail rides after the legacy boundary; an un-upgraded driver writes + // only the prefix, so a zero-filled tail reads as "unknown/clean" (see the field docs). + assert_eq!(rbytes[20..24], 1u32.to_le_bytes()); + assert_eq!(control::ADD_REPLY_LEGACY_SIZE, 20); } #[test] @@ -1330,8 +1335,8 @@ mod tests { req ); assert_eq!(bytes[8..12], 2560u32.to_le_bytes()); - // The compat window: v4/v5 are additive over v3, so the host floor stays at 3. - assert_eq!(PROTOCOL_VERSION, 5); + // The compat window: v4–v6 are additive over v3, so the host floor stays at 3. + assert_eq!(PROTOCOL_VERSION, 6); assert_eq!(MIN_DRIVER_PROTOCOL_VERSION, 3); }