Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int or tableint ? #604

Open
DN20011219 opened this issue Dec 5, 2024 · 0 comments
Open

int or tableint ? #604

DN20011219 opened this issue Dec 5, 2024 · 0 comments

Comments

@DN20011219
Copy link

Hey there!

In both the searchBaseLayer() and searchBaseLayerST() functions in hnswalg.h, there is a part where neighbors of a vector are loaded, but it seems like there is a slight difference in their behaviors.

In the function searchBaseLayer() (line 274), the type of the vector's ID is defined as tableint (unsigned int):

image

However, in the function searchBaseLayerST() (line 378), it's defined as int:

image

After that, candidate_id is used to access visited_array. Since the vector ID is stored in memory as tableint (unsigned int), is there any possibility that a larger unsigned int could be converted to a negative number, causing issues like accessing visited_array[-1]?

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

No branches or pull requests

1 participant