Skip to content

feat(search): add fast_query for dense read-only collections - #761

Open
luoxiaojian wants to merge 8 commits into
alibaba:mainfrom
luoxiaojian:codex/fast-query-upstream
Open

luoxiaojian wants to merge 8 commits into
alibaba:mainfrom
luoxiaojian:codex/fast-query-upstream

Conversation

@luoxiaojian

Copy link
Copy Markdown
Collaborator

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.

Comment thread tests/ailego/buffer/vector_page_table_test.cc Outdated
Comment thread src/db/index/segment/segment.cc Outdated
Comment thread src/db/collection.cc Outdated
@luoxiaojian
luoxiaojian force-pushed the codex/fast-query-upstream branch from 7161726 to 7e0bad7 Compare September 17, 2026 12:47
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.
@luoxiaojian
luoxiaojian force-pushed the codex/fast-query-upstream branch from 7e0bad7 to 9ddd8ef Compare September 18, 2026 03:29
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.

3 participants