Skip to content

Conversation

@SylviaZiyuZhang
Copy link

@SylviaZiyuZhang SylviaZiyuZhang commented Oct 9, 2025

  • Does this PR have a descriptive title that could go in our release notes? Yes and no, it is a mini bug fix.
  • Does this PR add any new dependencies? No.
  • Does this PR modify any existing APIs? No.
    • Is the change to the API backwards compatible? N/A
  • Should this result in any changes to our documentation, either updating existing docs or adding new ones? No.

Reference Issues/PRs

Fixes #649

What does this implement/fix? Briefly explain your changes.

If an index is built with the create_instance function in the index factory, assert(_graph_store->get_total_points() == _max_points + _num_frozen_pts); at the end of search_for_point_and_prune fails during the link() stage. For example. Minimal reproduction:

#include "abstract_index.h"
#include "index.h"
#include "index_config.h"
#include "index_factory.h"
#include "ann_exception.h"
#include "utils.h"

diskann::IndexWriteParameters index_build_params =
    diskann::IndexWriteParametersBuilder(L, R)
        .with_filter_list_size(Lf)
        .with_alpha(alpha)
        .with_saturate_graph(false)
        .with_num_threads(num_threads)
        .build();

diskann::IndexConfig config = diskann::IndexConfigBuilder()
    .with_metric(diskann::Metric::COSINE)
    .with_dimension(embedding_dim)
    .with_max_points(500)
    .is_dynamic_index(true)
    .with_index_write_params(index_build_params)
    .is_enable_tags(true)
    .is_use_opq(true)
    .is_pq_dist_build(false)
    .with_data_type("float")
    .build();
diskann::IndexFactory index_factory(config);
diskann_index = index_factory.create_instance();

_graph_store->get_total_points() would be 502 instead of 501 (with 1 frozen point by default).

Any other comments?

@SylviaZiyuZhang SylviaZiyuZhang marked this pull request as ready for review October 9, 2025 05:09
@SylviaZiyuZhang
Copy link
Author

@SylviaZiyuZhang please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement
I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.

@microsoft-github-policy-service agree

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.

[Question] Why add num_frozen_pts twice in create_instance()?

1 participant