Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#55329 - [ripgrep] compiled without SIMD support

Attached to Project: Community Packages
Opened by Dror Levin (spatz) - Tuesday, 29 August 2017, 10:35 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Wednesday, 22 August 2018, 15:53 GMT
Task Type General Gripe
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

The upstream package is built with:
RUSTFLAGS="-C target-feature=+ssse3" cargo build --target $TARGET --release --features simd-accel

source: https://github.com/BurntSushi/ripgrep/blob/master/ci/before_deploy.sh

Bug the Arch package is built only with cargo build --release, which means that SIMD optimizations are disabled.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Wednesday, 22 August 2018, 15:53 GMT
Reason for closing:  Fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 31 August 2017, 04:20 GMT
We're using stable rust to compile this and that doesn't have SIMD yet. I'll note that in the package.
Comment by Mateusz (mati865) - Thursday, 28 June 2018, 14:09 GMT
Rust 1.27 supports SIMD, I think it should build with stable now.
Comment by Sven-Hendrik Haase (Svenstaro) - Tuesday, 03 July 2018, 20:51 GMT
True, but ripgrep uses feature gates which are only supported by nightly.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 06 August 2018, 01:45 GMT
According to upstream, 0.9 now automatically uses SIMD when detected so this can be resolved.
Comment by Dror Levin (spatz) - Saturday, 18 August 2018, 05:01 GMT
  • Field changed: Percent Complete (100% → 0%)
The binaries on github now check SIMD support at runtime but the binaries compiled by the Arch package does not:

$ rg --version
ripgrep 0.9.0
-SIMD -AVX
Comment by Mateusz (mati865) - Saturday, 18 August 2018, 11:45 GMT
It works a bit different than you'd expect.
Regex crate extensively used by ripgrep has runtime feature detection and it seems to work. There are also bytecount and encoding_rs crates which don't support runtime detection.
Building ripgrep with hardcoded SIMD/AVX would cause to generate SIGILL on the systems without those specific instructions and that's why GitHub release also shows -SIMD -AVX.

You can see instructions the binary contains:
Arch Linux:
$ rg --version
ripgrep 0.9.0
-SIMD -AVX
$ elfx86exts /usr/bin/rg
MODE64 (call)
CMOV (cmovb)
SSE1 (movups)
SSE2 (movdqu)
AVX (vxorps)
AVX2 (vpcmpeqd)
SSSE3 (pshufb)

GitHub:
$ Pulpit/rg --version
ripgrep 0.9.0 (rev 6799dcfc0e)
-SIMD -AVX
$ elfx86exts Pulpit/rg
MODE64 (push)
CMOV (cmovb)
SSE1 (movups)
SSE2 (movdqu)
AVX (vxorps)
AVX2 (vpcmpeqd)
SSSE3 (pshufb)
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 18 August 2018, 14:05 GMT
So we're good then?

Loading...