Skip to content

Support simd_reduce_max (reached by core::arch::aarch64::vmaxvq_u8 / <[u8]>::is_ascii) #4954

Closed

Description

@feliperodri

Summary

simd_reduce_max is not implemented, so any code reaching it is reported as an unsupported construct. In the standard library that includes core::arch::aarch64::vmaxvq_u8, which <[u8]>::is_ascii now uses on aarch64 with NEON (is_ascii_neon).

Reproducer

#![feature(core_intrinsics, repr_simd)]
#![allow(internal_features, non_camel_case_types)]

#[repr(simd)]
#[derive(Clone, Copy)]
pub struct u8x16([u8; 16]);

#[kani::proof]
fn check_reduce_max() {
    let lanes: [u8; 16] = kani::any();
    let max = unsafe { core::intrinsics::simd::simd_reduce_max(u8x16(lanes)) };
    assert!(lanes.iter().all(|&l| l <= max));
}
$ kani main.rs
Failed Checks: simd_reduce_max is not currently supported by Kani. Please post your example at https://github.com/model-checking/kani/issues/new/choose
VERIFICATION:- FAILED

Reproduced on main (1640445d). Only simd_reduce_all is listed in kani-compiler/src/intrinsics.rs.

Impact on verify-rust-std

slice::ascii::verify::check_is_ascii fails on the macOS (aarch64) runners in model-checking/verify-rust-std#687:

Failed Checks: simd_reduce_max is not currently supported by Kani.
  File: stdarch/crates/core_arch/src/aarch64/neon/generated.rs, line 12378, in vmaxvq_u8

The harness is already compiled out on x86_64 + SSE2 for a different Kani limitation, so it currently runs only on aarch64. Until this is supported we'll compile it out on aarch64 + NEON too, which means it runs on neither CI platform. Supporting simd_reduce_max (and probably simd_reduce_min, same shape: a fold over the lanes) would let us switch it back on.

Activity

  1. added a commit that references this issue on Oct 22, 2026
    8b51f50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions