Skip to content

Replace FHT assembly with AVX intrinsics - #112

Merged
gouyt13 merged 1 commit into
mainfrom
fht-avx-intrinsics
Sep 23, 2026
Merged

gouyt13 merged 1 commit into
mainfrom
fht-avx-intrinsics

Conversation

@gouyt13

@gouyt13 gouyt13 commented Sep 23, 2026

Copy link
Copy Markdown
Member

Summary

Replace the GNU inline assembly and Windows MASM FHT kernels with shared AVX intrinsics used by the AVX2 and AVX-512 rotation backends. Preserve butterfly ordering, four rotation passes, normalization, and saved rotation state while removing the assembler build dependency.

  • Support input dimensions from 64 through 65,536, including padded dimensions, and update HNSW load validation accordingly.
  • Add scalar-reference/backend parity, norm/inner-product, and large-dimension persistence coverage.
  • Remove the obsolete assembly header, MASM snapshot, and generator; update documentation and lint exclusions.

Saved-index formats and production dependencies are unchanged. The previously installed internal rabitqlib/utils/fht_avx.hpp header is removed; downstream code directly including it must migrate.

Testing

  • All 173 C++ tests passed with RABITQ_ENABLE_NATIVE_OPTIMIZATION=OFF, including explicit AVX2 and AVX-512 rotation checks.
  • Installed CMake package consumer built and passed after assembly removal.
  • C++ formatting, Python formatting/lint, ShellCheck on changed scripts, focused clang-tidy for both rotation backends, and git diff --check passed.
  • Windows/MSVC, the full pre-merge clang-tidy run, and strict MkDocs validation were not run locally.

Local FHT microbenchmarks were kept outside the repository. This PR makes no end-to-end query performance claim.

@gouyt13
gouyt13 merged commit 1a99b1c into main Sep 23, 2026
23 checks passed
@gouyt13
gouyt13 deleted the fht-avx-intrinsics branch September 23, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant