Skip to content

Add SIMD primitive comparison kernels - #9587

Draft
connortsui20 wants to merge 3 commits into
developfrom
ct/primitive-comparison-simd
Draft

Add SIMD primitive comparison kernels#9587
connortsui20 wants to merge 3 commits into
developfrom
ct/primitive-comparison-simd

Conversation

@connortsui20

Copy link
Copy Markdown
Member

Summary

Moves the explicit AVX2 and AVX-512 primitive comparison kernels from #9547 into the handwritten comparison path. This leaves the RowFn work in #9547 and #9548 untouched while preserving the existing portable lane-kernel fallback on non-x86 targets and x86-64 CPUs without AVX2.

Changes

  • Adds full-word SIMD kernels for all primitive types, comparison operators, and array/constant orientations, with scalar tail handling.
  • Adds boundary and nullable coverage plus representative comparison benchmarks.
  • Confirms the intended x86-64 codegen by cross-compiling for macOS: AVX2 uses packed ymm masks and AVX-512 uses zmm/k masks with direct bitmap stores. This environment cannot provide x86 runtime timings.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20 connortsui20 added the changelog/performance A performance improvement label Aug 24, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 11.66%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
✅ 1978 untouched benchmarks
🆕 12 new benchmarks
⏩ 54 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime words_gather_scalar_avx2[65536] 9.4 µs 8.2 µs +13.48%
Simulation search_index_above_max_chunked 608.7 µs 549.4 µs +10.78%
Simulation search_index_in_range_chunked 610.1 µs 550.9 µs +10.74%
🆕 WallTime compare_f32_neon N/A 5.4 µs N/A
🆕 WallTime compare_int_constant_left_neon N/A 4 µs N/A
🆕 WallTime compare_u64_neon N/A 4.6 µs N/A
🆕 WallTime compare_u8_neon N/A 3.8 µs N/A
🆕 WallTime compare_f32_avx2 N/A 3.1 µs N/A
🆕 WallTime compare_int_constant_left_avx2 N/A 3.4 µs N/A
🆕 WallTime compare_u64_avx2 N/A 4 µs N/A
🆕 WallTime compare_u8_avx2 N/A 1.7 µs N/A
🆕 WallTime compare_f32_avx512 N/A 2.6 µs N/A
🆕 WallTime compare_int_constant_left_avx512 N/A 2.6 µs N/A
🆕 WallTime compare_u64_avx512 N/A 3 µs N/A
🆕 WallTime compare_u8_avx512 N/A 1.6 µs N/A

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ct/primitive-comparison-simd (3e39406) with develop (e4b3421)

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant