microsoft / DiskANN

Graph-structured Indices for Scalable, Fast, Fresh and Filtered Approximate Nearest Neighbor Search
Other
1.02k stars 208 forks source link

Create in memory data store/graph store with at least max_points as 1 #523

Closed ltan1ms closed 5 months ago

ltan1ms commented 5 months ago

Reference Issues/PRs

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

This fix the issue where when max_points passed is 0, it should use 1 to align with the logic in the other class constructor it calls into: https://github.com/microsoft/DiskANN/blob/main/src/index.cpp#L67-L69

Otherwise, the code will assume the underlying in memory block has 1 more than actual capacity and causes memory heap corruption as seen in my debugging: ac8915f4-0d7d-47a8-8314-9c81bc093da8

Any other comments?

harsha-simhadri commented 5 months ago

" it should use 1" -- for which variable?

ltan1ms commented 5 months ago

" it should use 1" -- for which variable?

oops, there was a typo in my PR description. it's the "max_points"