Repository navigation
Add CPU feature detection tests with emulated CPU support - #10451
Conversation
Add a `rust-test-cpu-features` matrix job that runs the vortex-buffer, vortex-mask and vortex-array tests (debug `ci` profile) under Intel SDE (`-hsw` for AVX2, `-icx` for AVX-512) and QEMU user mode (`neoverse-n1` for NEON, `max` for SVE2), so every runtime-dispatched kernel tier is exercised regardless of the runner's CPU. A new vortex-buffer `cpu_features` test checks `VORTEX_EXPECT_CPU_FEATURES` against runtime detection, so a matrix entry fails instead of silently testing a different tier. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrpkFgXTULvqViTeJ7bbfM
NEON is mandatory on aarch64, so the regular linux-arm64 test job already covers it. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrpkFgXTULvqViTeJ7bbfM
Replace Intel SDE and QEMU with EC2 instance families pinned via runs-on that natively have each feature tier: c6a (AVX2, no AVX-512), c6i (AVX-512 F/BW/VBMI2/VPOPCNTDQ) and c8g (SVE2 + BITPERM). Tests now run with nextest like the other test jobs. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrpkFgXTULvqViTeJ7bbfM
Merging this PR will degrade performance by 26.59%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | filter_neon[80] |
3 µs | 5.4 µs | -43.55% |
| ❌ | WallTime | threshold_neon[64] |
4.4 µs | 6.1 µs | -28.95% |
| ❌ | WallTime | threshold_neon[8] |
2.9 µs | 4 µs | -28.02% |
| ❌ | WallTime | filter_neon[64] |
2.8 µs | 3.3 µs | -15.42% |
| ❌ | WallTime | threshold_neon[80] |
4.7 µs | 5.4 µs | -12.68% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ji/determined-mccarthy-2qi5lf (a748ec4) with develop (1a9ed68)
The guard test now treats VORTEX_EXPECT_CPU_FEATURES as the complete set of known features the runner must have: every listed feature must be detected and every other known feature must not be, so e.g. any AVX-512 feature on the avx2 entry fails the job. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrpkFgXTULvqViTeJ7bbfM
The guard test prints each known feature's detection and the expected set, and runs as its own --no-capture step so the job log shows which features each instance has. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrpkFgXTULvqViTeJ7bbfM
…cros Use spot instances (price-capacity-optimized) for all three entries, and move the cpu_features guard test into vortex-array-macros. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrpkFgXTULvqViTeJ7bbfM
Drop the ci-profile comment in the workflow and the module explanation in the cpu_features guard test. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrpkFgXTULvqViTeJ7bbfM
Summary
This PR adds a comprehensive CPU feature detection test suite that validates runtime-dispatched SIMD kernel tiers across different CPU architectures. It enables testing on emulated CPUs (via Intel SDE for x86_64 and QEMU for aarch64) to ensure every kernel tier is exercised regardless of the runner's native CPU capabilities.
Changes
New Test:
vortex-buffer/tests/cpu_features.rsAdded a new test module that:
VORTEX_EXPECT_CPU_FEATURESenvironment variable!prefixCI Workflow:
rust-test-cpu-featuresJobAdded a new CI job that:
VORTEX_EXPECT_CPU_FEATURESto validate each tier's feature setvortex-buffer,vortex-mask, andvortex-arraycrates where SIMD kernels are implementedcargo test(not nextest) to minimize emulator startup overhead