From d55df02bcf9cbf6570a0a149e96518a2e90a7eee Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sat, 21 Nov 2026 08:54:34 -0800 Subject: [PATCH] conformance: viewport_cuts tests read texels by as_chunks and state the cover corners by sign What: the recorded texels split by as_chunks (clippy chunks_exact_to_as_chunks); the cover rectangle corners are held by their signs rather than a constant assertion (assertions_on_constants). Why: clippy -D warnings, all three configurations, on 84d9b840d9 (job m3-max-63978). --- .../src/cases/viewport_cuts.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/metal2vulkan-conformance/src/cases/viewport_cuts.rs b/crates/metal2vulkan-conformance/src/cases/viewport_cuts.rs index a6668fd42..ea3f0b8b9 100644 --- a/crates/metal2vulkan-conformance/src/cases/viewport_cuts.rs +++ b/crates/metal2vulkan-conformance/src/cases/viewport_cuts.rs @@ -652,13 +652,15 @@ mod tests { panic!("drawn/texels holds no bytes"); }; assert_eq!(bytes.len(), plane(size) as usize); + let (texels, _) = bytes.as_chunks::<{ TEXEL as usize }>(); Some( - bytes - .chunks_exact(TEXEL as usize) + texels + .iter() .map(|texel| { + let (words, _) = texel.as_chunks::<4>(); let mut channels = [0f32; 4]; - for (channel, word) in channels.iter_mut().zip(texel.chunks_exact(4)) { - *channel = f32::from_le_bytes([word[0], word[1], word[2], word[3]]); + for (channel, word) in channels.iter_mut().zip(words) { + *channel = f32::from_le_bytes(*word); } channels }) @@ -799,7 +801,8 @@ mod tests { let reach = f64::from(corner.abs()); assert!(reach > 1.0 && reach < KEPT_BAND, "{corner}"); } - assert!(COVER[0] < COVER[2] && COVER[1] < COVER[3]); + // The first corner below and left of the square, the second above and right of it. + assert_eq!(COVER.map(f32::signum), [-1.0, -1.0, 1.0, 1.0]); // The triangle's legs lie along x = -2 and y = -2 and its third edge along x + y = 4, so // the clip square lies inside it: a unit from each leg, and its corner (1, 1), where // x + y = 2, is the square's nearest point to the third edge.