Skip to content

Commit 360b41d

Browse files
authored
Remove portable_simd take implementation and remove unused cargo flags (#7388)
First of all we never use nightly so portable simd never gets enabled, second of all it looks like avx512 doesn't bring any benefits beyond avx2 for simd gather per gcc mailing list and Intel GDS mailing list. AVX2 on modern intel machines is comparable to Zen 5 machines and on Zen 5 machines AVX512, AVX2 and scalar versions behave the same. Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent d8c156f commit 360b41d

12 files changed

Lines changed: 18 additions & 371 deletions

File tree

.github/AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Nightly is required for:
55
- `-Z` flags: sanitizers (`-Zsanitizer=address`), miri (`-Zmiri-*`), publish (`-Zpublish-timeout`)
66
- `cargo-fuzz` (requires nightly)
77
- `public-api` xtask (nightly rustdoc JSON)
8-
- `--cfg vortex_nightly` (enables `portable_simd` feature gate)
98

109
Everything else (build, clippy, tests, docs, benchmarks, packaging) should use stable.
1110

.github/scripts/close_fixed_fuzzer_issues.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ def build_fuzz_target(target: str) -> bool:
162162
"""Build the fuzz target once. Returns True on success."""
163163
print(f"\nBuilding fuzz target: {target}")
164164
env = os.environ.copy()
165-
env["RUSTFLAGS"] = "--cfg vortex_nightly"
166165
result = run(
167166
["cargo", "+nightly", "fuzz", "build", "--dev", "--sanitizer=none", target],
168167
env=env,
@@ -173,7 +172,6 @@ def build_fuzz_target(target: str) -> bool:
173172
def retest_crash(target: str, crash_path: str, timeout_secs: int = 120) -> str:
174173
"""Run the fuzz target with the crash file. Returns 'fixed', 'reproduces', or 'timeout'."""
175174
env = os.environ.copy()
176-
env["RUSTFLAGS"] = "--cfg vortex_nightly"
177175
try:
178176
result = run(
179177
[

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ jobs:
409409
VORTEX_SKIP_SLOW_TESTS: "1"
410410
# -Cunsafe-allow-abi-mismatch=sanitizer: libraries like compiler_builtins
411411
# unset -Zsanitizer flag and we should allow that.
412-
RUSTFLAGS: "-A warnings -Cunsafe-allow-abi-mismatch=sanitizer --cfg disable_loom --cfg vortex_nightly -C debuginfo=2 -C opt-level=0 -C strip=none"
412+
RUSTFLAGS: "-A warnings -Cunsafe-allow-abi-mismatch=sanitizer -C debuginfo=2 -C opt-level=0 -C strip=none"
413413
steps:
414414
- uses: runs-on/action@v2
415415
if: github.repository == 'vortex-data/vortex'
@@ -492,8 +492,7 @@ jobs:
492492
run: |
493493
# TODO(myrrc): remove --no-default-features
494494
RUSTFLAGS="-A warnings -Cunsafe-allow-abi-mismatch=sanitizer \
495-
--cfg disable_loom --cfg vortex_nightly -C debuginfo=2 \
496-
-C opt-level=0 -C strip=none -Zexternal-clangrt \
495+
-C debuginfo=2 -C opt-level=0 -C strip=none -Zexternal-clangrt \
497496
${{ matrix.sanitizer_flags }}" \
498497
cargo +$NIGHTLY_TOOLCHAIN build --locked --no-default-features \
499498
--target x86_64-unknown-linux-gnu -Zbuild-std \
@@ -850,7 +849,7 @@ jobs:
850849
timeout-minutes: 40
851850
env:
852851
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation -Zmiri-env-forward=RUST_BACKTRACE
853-
RUSTFLAGS: "-A warnings --cfg vortex_nightly"
852+
RUSTFLAGS: "-A warnings"
854853
RUST_BACKTRACE: full
855854
steps:
856855
- uses: runs-on/action@v2

.github/workflows/fuzz-coverage.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ jobs:
7575
7676
- name: Generate coverage data
7777
run: |
78-
RUSTFLAGS="--cfg vortex_nightly" \
79-
cargo +$NIGHTLY_TOOLCHAIN fuzz coverage --release --debug-assertions \
78+
cargo +$NIGHTLY_TOOLCHAIN fuzz coverage --release --debug-assertions \
8079
${{ matrix.fuzz_target }} \
8180
-- -rss_limit_mb=4096
8281

.github/workflows/fuzzer-fix-automation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
echo "Building fuzzer target: ${{ steps.extract.outputs.target }} (debug mode for faster build)"
164164
165165
# Build the fuzzer target in debug mode (faster than release)
166-
if RUSTFLAGS="--cfg vortex_nightly" cargo +$NIGHTLY_TOOLCHAIN fuzz build --dev --sanitizer=none "${{ steps.extract.outputs.target }}" 2>&1 | tee fuzzer_build.log; then
166+
if cargo +$NIGHTLY_TOOLCHAIN fuzz build --dev --sanitizer=none "${{ steps.extract.outputs.target }}" 2>&1 | tee fuzzer_build.log; then
167167
echo "✅ Fuzzer target built successfully"
168168
echo "build_success=true" >> $GITHUB_OUTPUT
169169
else
@@ -183,7 +183,7 @@ jobs:
183183
echo "Attempting to reproduce crash with fuzzer (debug mode)..."
184184
185185
# Run fuzzer with crash file (debug mode, no sanitizer, full backtrace)
186-
RUSTFLAGS="--cfg vortex_nightly" RUST_BACKTRACE=full timeout 30s cargo +$NIGHTLY_TOOLCHAIN fuzz run --dev --sanitizer=none "${{ steps.extract.outputs.target }}" "${{ steps.download.outputs.crash_file_path }}" -- -runs=1 -rss_limit_mb=0 2>&1 | tee crash_reproduction.log
186+
RUST_BACKTRACE=full timeout 30s cargo +$NIGHTLY_TOOLCHAIN fuzz run --dev --sanitizer=none "${{ steps.extract.outputs.target }}" "${{ steps.download.outputs.crash_file_path }}" -- -runs=1 -rss_limit_mb=0 2>&1 | tee crash_reproduction.log
187187
188188
FUZZ_EXIT_CODE=${PIPESTATUS[0]}
189189

.github/workflows/minimize_fuzz_corpus_workflow.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ jobs:
9191
CORPUS_DIR="fuzz/corpus/${{ inputs.fuzz_target }}"
9292
MINIMIZED_DIR="${CORPUS_DIR}_minimized"
9393
mkdir -p "$MINIMIZED_DIR"
94-
RUSTFLAGS="--cfg vortex_nightly" \
95-
cargo +$NIGHTLY_TOOLCHAIN fuzz cmin $FEATURES_FLAG \
94+
cargo +$NIGHTLY_TOOLCHAIN fuzz cmin $FEATURES_FLAG \
9695
${{ inputs.fuzz_target }} "$CORPUS_DIR" -- "$MINIMIZED_DIR"
9796
rm -rf "$CORPUS_DIR"
9897
mv "$MINIMIZED_DIR" "$CORPUS_DIR"

.github/workflows/run-fuzzer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
if [ "${{ inputs.jobs }}" -gt 1 ]; then
125125
FORK_FLAG="-fork=${{ inputs.jobs }}"
126126
fi
127-
${{ inputs.extra_env }} RUSTFLAGS="--cfg vortex_nightly" RUST_BACKTRACE=1 \
127+
${{ inputs.extra_env }} RUST_BACKTRACE=1 \
128128
cargo +$NIGHTLY_TOOLCHAIN fuzz run --release --debug-assertions \
129129
$FEATURES_FLAG \
130130
${{ inputs.fuzz_target }} -- \
@@ -163,7 +163,7 @@ jobs:
163163
if [ -n "${{ inputs.extra_features }}" ]; then
164164
FEATURES_FLAG="--features ${{ inputs.extra_features }}"
165165
fi
166-
RUSTFLAGS="--cfg vortex_nightly" RUST_BACKTRACE=1 \
166+
RUST_BACKTRACE=1 \
167167
cargo +$NIGHTLY_TOOLCHAIN fuzz run --release --debug-assertions \
168168
$FEATURES_FLAG \
169169
${{ inputs.fuzz_target }} \

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,6 @@ unused_lifetimes = "deny"
316316
unused_qualifications = "deny"
317317
unexpected_cfgs = { level = "deny", check-cfg = [
318318
"cfg(codspeed)",
319-
"cfg(disable_loom)",
320-
"cfg(vortex_nightly)",
321319
'cfg(target_os, values("unknown"))',
322320
] }
323321
warnings = "warn"

vortex-array/src/arrays/primitive/compute/take/mod.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
55
mod avx2;
66

7-
#[cfg(vortex_nightly)]
8-
mod portable;
9-
107
use std::sync::LazyLock;
118

129
use vortex_buffer::Buffer;
@@ -32,23 +29,19 @@ use crate::validity::Validity;
3229
// Kernel selection happens on the first call to `take` and uses a combination of compile-time
3330
// and runtime feature detection to infer the best kernel for the platform.
3431
static PRIMITIVE_TAKE_KERNEL: LazyLock<&'static dyn TakeImpl> = LazyLock::new(|| {
35-
cfg_if::cfg_if! {
36-
if #[cfg(vortex_nightly)] {
37-
// nightly codepath: use portable_simd kernel
38-
&portable::TakeKernelPortableSimd
39-
} else if #[cfg(target_arch = "x86_64")] {
40-
// stable x86_64 path: use the optimized AVX2 kernel when available, falling
41-
// back to scalar when not.
42-
if is_x86_feature_detected!("avx2") {
43-
&avx2::TakeKernelAVX2
44-
} else {
45-
&TakeKernelScalar
46-
}
32+
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
33+
{
34+
if is_x86_feature_detected!("avx2") {
35+
&avx2::TakeKernelAVX2
4736
} else {
48-
// stable all other platforms: scalar kernel
4937
&TakeKernelScalar
5038
}
5139
}
40+
41+
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
42+
{
43+
&TakeKernelScalar
44+
}
5245
});
5346

5447
trait TakeImpl: Send + Sync {

0 commit comments

Comments
 (0)