Skip to content

support brute-force range search for binary sub/superstructure#1568

Open
862103595 wants to merge 1 commit into
zilliztech:mainfrom
862103595:fix/binary-substructure-range-search
Open

support brute-force range search for binary sub/superstructure#1568
862103595 wants to merge 1 commit into
zilliztech:mainfrom
862103595:fix/binary-substructure-range-search

Conversation

@862103595
Copy link
Copy Markdown

@862103595 862103595 commented Apr 9, 2026

issue: #1574

Summary

  • add brute-force binary range search support for SUBSTRUCTURE and SUPERSTRUCTURE
  • route binary sub/superstructure range search through the existing binary matcher
  • enable brute-force UT coverage for the new range search path

Context

This PR closes a capability gap in binary brute-force range search by extending support to SUBSTRUCTURE and SUPERSTRUCTURE.
It adds coverage for missing cases rather than fixing a regression.

Test

  • LD_LIBRARY_PATH=/home/zilliz/.conan/data/gflags/2.2.2/_/_/package/ef45d1cd7d44c3c89fa6456b370ced89171f282b/lib:/home/zilliz/.conan/data/glog/0.7.1/_/_/package/926e0eaeed666f528abdc8d0c87a9035fe0b0adf/lib:$LD_LIBRARY_PATH ./tests/ut/knowhere_tests "Test Brute Force"
  • pre-commit run --files src/common/comp/brute_force.cc thirdparty/faiss/faiss/cppcontrib/knowhere/utils/binary_distances.cpp tests/ut/test_bruteforce.cc

Enable brute-force binary range search for substructure and superstructure metrics, and cover the path in brute force tests.

Signed-off-by: xiejh <862103595@qq.com>
@sre-ci-robot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 862103595
To complete the pull request process, please assign zhengbuqian after the PR has been reviewed.
You can assign the PR to them by writing /assign @zhengbuqian in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot requested review from cqy123456 and foxspy April 9, 2026 03:21
@sre-ci-robot
Copy link
Copy Markdown
Collaborator

Welcome @862103595! It looks like this is your first PR to zilliztech/knowhere 🎉

@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 9, 2026

@862103595 🔍 Important: PR Classification Needed!

For efficient project management and a seamless review process, it's essential to classify your PR correctly. Here's how:

  1. If you're fixing a bug, label it as kind/bug.
  2. For small tweaks (less than 20 lines without altering any functionality), please use kind/improvement.
  3. Significant changes that don't modify existing functionalities should be tagged as kind/enhancement.
  4. Adjusting APIs or changing functionality? Go with kind/feature.

For any PR outside the kind/improvement category, ensure you link to the associated issue using the format: “issue: #”.

Thanks for your efforts and contribution to the community!.

@alexanderguzhva
Copy link
Copy Markdown
Collaborator

/kind improvement
issue: #1574

@862103595 862103595 changed the title fix: support binary substructure range search support brute-force range search for binary sub/superstructure Apr 10, 2026
@862103595
Copy link
Copy Markdown
Author

/kind enhancement
issue: #1574

for (size_t j = 0; j < nb; j++) {
if (!sel || sel->is_member(j)) {
if (mc.compute(b + j * code_size)) {
T dis = static_cast<T>(0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why compare dis=0 to the radius here instead of the actual computed distance?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants