Skip to content

Optimize clustering, batch search, and index allocation - #128

Merged
gouyt13 merged 1 commit into
mainfrom
codex/index-engineering-optimizations
Oct 3, 2026
Merged

gouyt13 merged 1 commit into
mainfrom
codex/index-engineering-optimizations

Conversation

@gouyt13

@gouyt13 gouyt13 commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Reduce clustering copies and assignment work with centroid-buffer swaps, workload-aware batching, and previous-winner pruning.
  • Add IVF/SymphonyQG batch search, reuse SymphonyQG worker scratch, and bound IVF encoding scratch.
  • Avoid redundant graph zero-initialization and apply size-aware huge-page allocation across all indexes.

Existing search APIs, saved-index formats, and dependencies remain compatible. Profiling and benchmark code/docs are excluded.

Testing

  • 292 C++ tests; 700 Python tests (2 platform skips); 284 ASan/UBSan tests with leak checking passed.
  • Bidirectional compatibility with main: 44 index variants, identical IDs/distances at 1, 2, and automatic threads.
  • Formatting, Ruff, full clang-tidy, strict docs, examples, and installed CMake consumer passed.
  • GIST1M construction: 46.9 → 34.0 s median over 3 runs (Xeon 6418H, GCC 14.3, native AVX-512, 96 threads, reproduced single-NUMA allocation stall); recall stayed within the baseline range.

PR CI passed on Linux x86-64/ARM64, Windows, and macOS ARM64, including Python wheels and AVX2/AVX-512 emulation.

@gouyt13
gouyt13 merged commit 0e84da7 into main Oct 3, 2026
52 of 54 checks passed
@gouyt13
gouyt13 deleted the codex/index-engineering-optimizations branch October 3, 2026 15:43
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