Description
Code
I tried this code:
- cloudflare/sliceslice-rs@a7d4556 compiled in release mode.
I expected to see this happen: tests pass with success
Instead, this happened: some tests are failing:
failures:
tests::search_middle
tests::search_multiple
tests::search_prefix
tests::search_suffix
Version it worked on
It most recently worked on: Rust 1.55.0
Version with regression
rustc +1.56.0 --version --verbose
:
rustc 1.56.0 (09c42c458 2021-10-18)
binary: rustc
commit-hash: 09c42c45858d5f3aedfa670698275303a3d19afa
commit-date: 2021-10-18
host: x86_64-unknown-linux-gnu
release: 1.56.0
LLVM version: 13.0.0
and onwards (1.56.1, 1.57.0, beta and nightly)
How to reproduce
Just run the following command with the previously mentioned commit checked out:
$ cargo +1.56.0 test --release -- tests::search_middle
What does commit cloudflare/sliceslice-rs@a7d4556 do
It just moves method vector_search_in
from the Avx2Searcher
struct to the Searcher
trait. Loosing the #[target_feature(enable = "avx2")]
attribute at the same time.
I found two (unsatisfactory) way to make the tests pass:
- Re-add the attribute to the trait method: cloudflare/sliceslice-rs@a7d4556#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R265
#[inline]
// Uncommenting the following lines makes it work
// #[target_feature(enable = "avx2")]
unsafe fn vector_search_in<V: Vector>(
But that won't work ultimately because the trait is going to be implemented for other architectures.
- Printing
hash.first
to the standard output: cloudflare/sliceslice-rs@a7d4556#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R212
// Uncommenting the following lines makes it work
// println!("[vector_search_in_chunk] hash.first={:?}", hash.first);
println!("[vector_search_in_chunk] first={:?}", first);
Absolutely no idea why printing something would have any influence!
Everything works properly for rust versions <= 1.55.0
Bisection attempt
I have tried to use cargo-bisect-rustc
to bisect and it seems introduced between nightly-2021-08-10 and nightly-2021-08-12 (there are no nightly for 2021-08-11).
Further (manual) bisection points to #87254 but I am not sure my bisection is actually correct so any help is welcome 👍