From e8c75e7bc1738b7cbf5bb2e818fc91b77aa5d1b5 Mon Sep 17 00:00:00 2001 From: enthropy7 Date: Fri, 7 Aug 2026 18:23:00 +0300 Subject: [PATCH] imgproc: route the crop_resize ISA checks through yscv-cpu `check-runtime-dispatch.sh` has been failing on main since the SSE4.1 and AVX-512 crop_resize paths landed: six raw `std::is_x86_feature_detected!` calls in the bit-exactness tests. The guard exists so feature detection has one home, and the surrounding production dispatch in this same file already goes through `yscv_cpu::host_cpu().features`. GitHub CI does not run this script, which is why it went unnoticed. --- crates/yscv-imgproc/src/ops/crop_resize.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/yscv-imgproc/src/ops/crop_resize.rs b/crates/yscv-imgproc/src/ops/crop_resize.rs index a2608e15..e1da9968 100644 --- a/crates/yscv-imgproc/src/ops/crop_resize.rs +++ b/crates/yscv-imgproc/src/ops/crop_resize.rs @@ -1235,7 +1235,7 @@ mod tests { ); #[cfg(target_arch = "x86_64")] unsafe { - if (ch == 1 || ch == 3) && std::is_x86_feature_detected!("avx512f") { + if (ch == 1 || ch == 3) && yscv_cpu::host_cpu().features.avx512f { bitexact( &want, &crop_resize_border_avx512( @@ -1244,7 +1244,7 @@ mod tests { &lbl, ); } - if (ch == 1 || ch == 3) && std::is_x86_feature_detected!("avx2") { + if (ch == 1 || ch == 3) && yscv_cpu::host_cpu().features.avx2 { bitexact( &want, &crop_resize_border_avx2( @@ -1253,7 +1253,7 @@ mod tests { &lbl, ); } - if std::is_x86_feature_detected!("sse4.1") { + if yscv_cpu::host_cpu().features.sse41 { bitexact( &want, &crop_resize_border_sse( @@ -1311,21 +1311,21 @@ mod tests { // and each individual SIMD path the host supports #[cfg(target_arch = "x86_64")] unsafe { - if (ch == 1 || ch == 3) && std::is_x86_feature_detected!("avx512f") { + if (ch == 1 || ch == 3) && yscv_cpu::host_cpu().features.avx512f { bitexact( &want, &crop_resize_avx512(&src, h, w, ch, cx, cy, ww, wh, tw, th), &lbl, ); } - if (ch == 1 || ch == 3) && std::is_x86_feature_detected!("avx2") { + if (ch == 1 || ch == 3) && yscv_cpu::host_cpu().features.avx2 { bitexact( &want, &crop_resize_avx2(&src, h, w, ch, cx, cy, ww, wh, tw, th), &lbl, ); } - if std::is_x86_feature_detected!("sse4.1") { + if yscv_cpu::host_cpu().features.sse41 { bitexact( &want, &crop_resize_sse(&src, h, w, ch, cx, cy, ww, wh, tw, th),