Skip to content

Reduce sanitizer runtime for graph search tests - #121

Closed
gouyt13 wants to merge 2 commits into
mainfrom
optimize-sanitizer-tests
Closed

gouyt13 wants to merge 2 commits into
mainfrom
optimize-sanitizer-tests

Conversation

@gouyt13

@gouyt13 gouyt13 commented Sep 29, 2026

Copy link
Copy Markdown
Member

Summary

Graph construction in two search tests repeatedly reconstructs vectors, adding substantial ASan/UBSan runtime. Enable the existing construction cache in those fixtures and reduce the 1025/4097-dimensional scratch-search cases from 257 to 65 points, retaining a non-complete graph with degree 32 and search window 1.

The 64/65-dimensional cases retain 257 points to cover IDs beyond 255. All dimensions, L2/IP metrics, raw/4-bit/8-bit modes, query counts, hints, ties, and assertions remain covered. Cached-versus-uncached construction parity and maximum-dimension tests are unchanged. No production code, sanitizer flags, APIs, formats, or dependencies change.

Testing

Local ASan/UBSan timings (one measurement per version, build excluded):

Test Before After
ScratchSearchMatchesRegularSearch 406.26 s 59.98 s
SingleResultMatchesTopKWithTiesAndHints 25.88 s 16.14 s
Combined 432.14 s 76.12 s

These two tests take 82.4% less time. Measurements used an Intel Xeon Gold 6418H, GCC 14.3.0, Linux x86-64 with AVX2/AVX-512 available and runtime dispatch, Debug builds with native optimization off, ASan leak detection and UBSan halt-on-error enabled, serial CTest pinned to CPUs 0–3, and OMP_NUM_THREADS=2.

  • Unmodified sanitizer baseline: 244/244 tests passed (1092.47 s wall time).
  • Modified sanitizer tests: 2/2 passed (76.22 s wall time); the full sanitizer suite was not rerun after these test-only edits.
  • Release tests: both modified tests and cached-versus-fresh construction parity passed (3/3).
  • Formatting, focused clang-tidy for the changed translation unit, and git diff --check passed. Full repository clang-tidy was not rerun.

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