feat(search): add fast_query for dense read-only collections - #761
Open
luoxiaojian wants to merge 23 commits into
Open
luoxiaojian wants to merge 23 commits into
luoxiaojian wants to merge 23 commits into
Conversation
luoxiaojian
requested review from
Cuiyus,
chinaux,
iaojnh,
richyreachy and
zhourrr
as code owners
September 16, 2026 07:13
richyreachy
reviewed
Sep 17, 2026
JalinWang
reviewed
Sep 17, 2026
luoxiaojian
force-pushed
the
codex/fast-query-upstream
branch
3 times, most recently
from
September 19, 2026 16:20
9ddd8ef to
6af0d53
Compare
Return owned internal-ID arrays and optional scores through C++ search_fast and Collection.fast_query with a thin NumPy binding. Reuse query parameters and graph/Flat fast paths, retaining filtered and multi-segment fallbacks. Preserve the existing scale_factor defaults and Uniform raw-Flat fallback. Cover native reference types, default and explicit refine budgets, all dense index families, parameter reuse, result ownership, and untrained/mixed Uniform segments. Validation: 634 related Python tests passed; 70 C++ tests passed with one existing skip. Ruff, changed-line clang-format, and diff checks passed. Adapted from alignment commit 9ddbd5aa082615226d91addb41cd60496143d15a onto upstream/main 43f72b1.
Reuse query parameter mapping across ordinary and fast queries, remove redundant cached references and result copies, and handle empty collections consistently. Add coverage for reusable parameters, empty collections, and Uniform quantizer fallback before and after optimize and subsequent inserts. Validation: 151 related tests passed; the complete 780-point SIFT/GIST comparison stayed within the established QPS and recall tolerances.
Use Turbo distance evaluation and score normalization in fast Flat searches. Preserve base query parameters when graph indexes fall back to Flat, and keep strict validation for concrete graph query paths. Stabilize the queue recovery test by leaving background eviction headroom. Validation: seven related C++ test executables passed; Python regressions passed 277 tests with seven platform skips; queue recovery passed 500 repetitions; clang-format and git diff checks passed.
Resolve eligible single-block index routes when opening read-only collections. Share synchronous engine dispatch with call-local query and refiner parameters to avoid repeated routing and parameter allocations, while retaining lifecycle locking and the existing composite fallback. Extend index and metric dispatch tests to alternate refinement settings and defaults. Validated with clang-format 18.1.8, Ruff 0.14.4, 34 native tests, 70 Python tests, and mixed concurrent query/fast_query checks.
luoxiaojian
force-pushed
the
codex/fast-query-upstream
branch
from
September 20, 2026 06:18
f52f7f5 to
cb11e4b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Return owned internal-ID arrays and optional scores through C++ search_fast and Collection.fast_query with a thin NumPy binding. Reuse query parameters and graph/Flat fast paths, retaining filtered and multi-segment fallbacks.
Preserve the existing scale_factor defaults and Uniform raw-Flat fallback. Cover native reference types, default and explicit refine budgets, all dense index families, parameter reuse, result ownership, and untrained/mixed Uniform segments.
Validation: 634 related Python tests passed; 70 C++ tests passed with one existing skip. Ruff, changed-line clang-format, and diff checks passed.
Adapted from alignment commit 9ddbd5aa082615226d91addb41cd60496143d15a onto upstream/main 43f72b1.