You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Autoharness ICE: SIMD codegen unwraps vector length for a generic helper instantiated with a scalar #4919
kani autoharness crashes on a generic function whose body calls SIMD intrinsics but whose T has no SIMD bound. Autoharness picks T = i32, and the SIMD comparison codegen then unwraps the vector length of a scalar:
thread 'rustc' panicked at kani-compiler/src/codegen_cprover_gotoc/codegen/intrinsic.rs:1548:29:
called `Option::unwrap()` on a `None` value
[Kani] current codegen item: codegen_function: lib::imin::<i32>
Reproducer
#![feature(core_intrinsics)]#![allow(internal_features)]pubunsafefnimin<T:Copy>(a:T,b:T) -> T{let mask:T = core::intrinsics::simd::simd_lt(a, b);
core::intrinsics::simd::simd_select(mask, a, b)}
$ kani autoharness -Z autoharness lib.rs --only-codegenthread 'rustc' panicked at kani-compiler/src/codegen_cprover_gotoc/codegen/intrinsic.rs:1548:29:called `Option::unwrap()` on a `None` value
Line 1548 is unchanged on main.
Cause
if arg1.typ().len().unwrap() != ret_typ.len().unwrap(){
len() is None for a non-vector type. rustc itself rejects simd_lt::<i32> at monomorphization, so this instantiation can never be real code — Kani should report it, not crash.
Turn the unwrap()s in the SIMD codegen paths into a graceful unsupported-construct / codegen error.
The first avoids the dead instantiation; the second stops any other unbounded generic SIMD helper from aborting a whole run.
Why this matters for the standard library
core::core_arch::simd::simd_imin<T: Copy> (stdarch, nightly-2026-08-21) has exactly this shape. With #4819, #4848, #4869 and #4801 applied, autoharness over the whole standard library gets far enough to reach it, and core then fails codegen. This is what still blocks the unfiltered autoharness path — the Kani Metrics, Kani List and autoharness-analyzer jobs in model-checking/verify-rust-std#687, which pass no --include-pattern. I searched for existing issues and PRs on this and found none.
#4922 takes the second option: a SIMD intrinsic whose operand is not a SIMD type is reported as unsupported instead of panicking. I missed this issue and opened #4921 for the same crash, now closed as a duplicate.
With #4922 and #4856 added to the four fixes above, the autoharness listing CI runs (kani autoharness --list --std) completes on model-checking/verify-rust-std#687's library: 26,909 functions with harnesses, 14,326 without. On nightly-2026-08-21, #4856 needs layout.value_repr / ValueRepr written as layout.abi / ValueAbi.
Activity
srivatsansamraj commentedon Sep 30, 2026
#4922 takes the second option: a SIMD intrinsic whose operand is not a SIMD type is reported as unsupported instead of panicking. I missed this issue and opened #4921 for the same crash, now closed as a duplicate.
With #4922 and #4856 added to the four fixes above, the autoharness listing CI runs (
kani autoharness --list --std) completes on model-checking/verify-rust-std#687's library: 26,909 functions with harnesses, 14,326 without. On nightly-2026-08-21, #4856 needslayout.value_repr/ValueReprwritten aslayout.abi/ValueAbi.Report SIMD intrinsics on non-SIMD operands as unsupported (model-che…
Report a SIMD intrinsic monomorphized with a scalar instead of crashi…