feat(pyramid): integrate reasoning mechanism for Pyramid index#2333
feat(pyramid): integrate reasoning mechanism for Pyramid index#2333LHT129 wants to merge 1 commit into
Conversation
Merge Protections🟢 All 3 merge protections satisfied — ready to merge. Show 3 satisfied protections🟢 Require kind label
🟢 Require version label
🟢 Require linked issue for feature/bug PRs
|
There was a problem hiding this comment.
Code Review
This pull request implements the SearchWithRequest method in the Pyramid class, enabling search requests with reasoning capabilities when expected labels are provided. The feedback highlights two main issues: first, a potential null pointer dereference if the query dataset or its vectors are null, which should be validated with assertions; second, a design flaw where making the QueryContext parameter optional in search_impl leads to silent statistics loss for other search methods (like KnnSearch and RangeSearch). It is recommended to make QueryContext a required parameter across all callers.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Integrates the reasoning mechanism into Pyramid searches by adding a SearchWithRequest override and wiring ReasoningContext through the search path when expected_labels are provided.
Changes:
- Added
Pyramid::SearchWithRequestimplementation to support reasoning reports for missed expected labels - Extended
search_implto accept an optional externalQueryContext* - Added reasoning context setup/diagnosis/report generation when
expected_labelsis non-empty
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/algorithm/pyramid/pyramid.h | Adds SearchWithRequest API and extends search_impl with optional QueryContext* |
| src/algorithm/pyramid/pyramid.cpp | Implements SearchWithRequest, integrates ReasoningContext, and plumbs external QueryContext through search_impl |
89d84e3 to
6c9ea19
Compare
6c9ea19 to
b6de6f6
Compare
b6de6f6 to
9db2748
Compare
9db2748 to
ccfe08c
Compare
Implement SearchWithRequest for Pyramid to support reasoning context creation, expected_targets tracking, and diagnostic report generation. Changes: - Add Pyramid::SearchWithRequest override in pyramid.h/pyramid.cpp - Update search_impl to accept required QueryContext* parameter - Integrate ReasoningContext for expected labels tracking - Include partition selection and intra-partition search tracking When expected_labels is provided in SearchRequest, Pyramid now generates a reasoning report that diagnoses why expected results were missed (not_reachable, filter_rejected, quantization_error, ef_too_small, reorder_evicted). Zero overhead when expected_labels is empty. Signed-off-by: LHT129 <tianlan.lht@antgroup.com> Co-authored-by: opencode <opencode@anthropic.com>
ccfe08c to
e917e79
Compare
|
/label S-waiting-on-review |
Summary
Implement
SearchWithRequestfor the Pyramid index to integrate the reasoning mechanism.Changes
Pyramid::SearchWithRequestoverride (pyramid.h/pyramid.cpp)search_implto accept optionalQueryContext*parameterReasoningContextfor expected labels trackingBehavior
When
expected_labelsis provided inSearchRequest, Pyramid generates a reasoning report diagnosing missed expected results:not_reachable,filter_rejected,quantization_error,ef_too_small,reorder_evictedZero overhead when
expected_labelsis empty.Testing
Closes #2332