Skip to content

Conversation

@LHT129
Copy link
Collaborator

@LHT129 LHT129 commented Jan 5, 2026

No description provided.

@LHT129 LHT129 self-assigned this Jan 5, 2026
@LHT129 LHT129 added the kind/feature New feature or request label Jan 5, 2026
@LHT129 LHT129 requested a review from inabao as a code owner January 5, 2026 07:47
@gemini-code-assist
Copy link

Summary of Changes

Hello @LHT129, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the search functionality by introducing a new enable_reorder parameter. This parameter provides fine-grained control over whether the reordering step, which typically improves search accuracy, is performed during query execution. By consolidating reorder-related parameters into a common base class and updating algorithm implementations, the change ensures consistent behavior and allows users to optimize for either recall or performance based on their specific needs. New tests confirm the expected behavior when reordering is enabled or disabled.

Highlights

  • New Search Parameter: Introduced enable_reorder as a search parameter, allowing explicit control over the reordering step in search algorithms.
  • Parameter Consolidation: Centralized topk_factor and enable_reorder (formerly use_reorder) into the base IndexSearchParameter class, removing them from algorithm-specific parameter classes like HGraphSearchParameters and IVFSearchParameters.
  • Conditional Reordering Logic: Updated HGraph and IVF search implementations to apply reordering only if both the internal use_reorder_ flag and the new params.enable_reorder are true.
  • New Test Cases: Added comprehensive test cases for both HGraph and IVF to validate the functionality of disabling reordering and confirm its expected impact on search recall.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new search parameter enable_reorder to control the reordering step in HGraph and IVF search algorithms, which is a valuable addition for tuning search performance versus accuracy. The implementation is clean, involving refactoring common search parameters into a base class, which improves code structure. The changes are also well-supported by new tests that validate the functionality of the new parameter. My main feedback is to consistently use the && operator instead of the and keyword for logical operations to align with common C++ conventions and enhance code readability.

this->pool_->ReturnOne(vt);

if (use_reorder_) {
if (use_reorder_ and params.enable_reorder) {

Choose a reason for hiding this comment

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

medium

For consistency with common C++ style and to improve readability, it's recommended to use the && operator for logical AND instead of the and keyword.

    if (use_reorder_ && params.enable_reorder) {

param.search_mode = KNN_SEARCH;
param.topk = request.topk_;
if (use_reorder_) {
if (use_reorder_ and param.enable_reorder) {

Choose a reason for hiding this comment

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

medium

For consistency with common C++ style and to improve readability, it's recommended to use the && operator for logical AND instead of the and keyword.

Suggested change
if (use_reorder_ and param.enable_reorder) {
if (use_reorder_ && param.enable_reorder) {

Statistics stats;
auto search_result = this->search<KNN_SEARCH>(query, param, stats);
if (use_reorder_) {
if (use_reorder_ and param.enable_reorder) {

Choose a reason for hiding this comment

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

medium

For consistency with common C++ style and to improve readability, it's recommended to use the && operator for logical AND instead of the and keyword.

Suggested change
if (use_reorder_ and param.enable_reorder) {
if (use_reorder_ && param.enable_reorder) {

@LHT129 LHT129 force-pushed the reorder branch 4 times, most recently from 90a22cb to 78d8e89 Compare January 5, 2026 11:42
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff           @@
##             main    #1497   +/-   ##
=======================================
  Coverage   91.24%   91.25%           
=======================================
  Files         327      327           
  Lines       18977    18980    +3     
=======================================
+ Hits        17316    17320    +4     
+ Misses       1661     1660    -1     
Flag Coverage Δ
cpp 91.25% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
common 85.66% <ø> (ø)
datacell 93.56% <ø> (+0.45%) ⬆️
index 90.99% <100.00%> (-0.01%) ⬇️
simd 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 894de68...02b8e2e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LHT129 LHT129 force-pushed the reorder branch 4 times, most recently from 3153008 to 0d51934 Compare January 15, 2026 02:52
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.

1 participant