From c07b79a80eb500887b75aca22e11b98700acf27e Mon Sep 17 00:00:00 2001 From: mightsleep Date: Fri, 16 Oct 2026 15:03:02 +0200 Subject: [PATCH] chore: fix intermittent failure in fused_decode_is_wrapping_add Signed-off-by: mightsleep --- encodings/fastlanes/src/for_/tests.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/encodings/fastlanes/src/for_/tests.rs b/encodings/fastlanes/src/for_/tests.rs index bd1a7bbe2f8..18b6f3512ea 100644 --- a/encodings/fastlanes/src/for_/tests.rs +++ b/encodings/fastlanes/src/for_/tests.rs @@ -418,11 +418,16 @@ where // Each block draws its own width, from zero to the native width, so values wider than // their block's width become patches. let num_blocks = len.div_ceil(FL_CHUNK_SIZE); - let bit_widths: Vec = tc.draw( - gs::vecs(gs::integers().max_value(T::PTYPE.bit_width() as u8)) + let native = T::PTYPE.bit_width() as u8; + let mut bit_widths: Vec = tc.draw( + gs::vecs(gs::integers().max_value(native)) .min_size(num_blocks) .max_size(num_blocks), ); + // `encode_blocked` rejects all blocks at the native width; keep one block packed. + if bit_widths.iter().all(|&w| w == native) { + bit_widths[0] = native - 1; + } BitPackedData::encode_blocked(&encoded_array.into_array(), &bit_widths, &mut ctx)? } else { BitPacked::encode(&encoded_array.into_array(), bit_width, &mut ctx)?