Skip to content

Test: introduce index_gt_test GTest suite - #725

Closed
yoonseok-kim wants to merge 2 commits into
unum-cloud:main-devfrom
yoonseok-kim:index_gt_test
Closed

yoonseok-kim wants to merge 2 commits into
unum-cloud:main-devfrom
yoonseok-kim:index_gt_test

Conversation

@yoonseok-kim

Copy link
Copy Markdown
Contributor

I thought it would be useful to have dedicated unit tests for index_gt, so I added them. I would appreciate your review. :)

Key Changes

  • Add index_gt_test.cpp, a GTest-based unit test suite for the low-level index_gt engine
  • Wire up the new target via USEARCH_BUILD_TEST_CPP_GT CMake option (GoogleTest v1.17.0 via FetchContent)
  • Document build and run instructions in cpp/README.md

Test Coverage

  • Parameterized add/search correctness across multiple configs (size, dims, connectivity, ef)
  • Search result distance ordering (non-decreasing)
  • member_iterator_gt and candidates_iterator_t postfix ++/-- STL semantics
  • Prefetch invocation during add and search, including cache-populated metric pattern
  • Predicate filtering (even keys, reject-all, exclude-self, combined with prefetch)
  • Copy/move semantics, edge cases (1D vectors, minimum connectivity), and stress test (2048 vectors)

@ashvardanian ashvardanian added the v3 Breaking changes planned for v3 label Apr 5, 2026
@ashvardanian

Copy link
Copy Markdown
Member

@yoonseok-kim, thanks for the test suite! 3.0 deletes the v2 index_gt core, and the C++ tests now live per scalar type and residency in test/dense/ on the project's own harness, so I'm closing this as superseded; if you'd like to stress the new indexes, that's the place to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 Breaking changes planned for v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants