Repository navigation
Fix HNSW entry-point races and construction failure handling - #131
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix four correctness failures in HNSW construction and insertion: a parallel entry-point race, invalid cleanup after an initial build failure, corruption after rejecting a second build, and undefined behavior for
M = 0orM = 1.M < 2during construction and loading. Add C++ allocation-failure/retry tests and C++/Python regressions for invalid degrees and rejected rebuilds.Public signatures, serialized layouts, and dependencies are unchanged. Previously accepted index files with
M = 1are now rejected. Scheduling and numerical formulas are unchanged; Python cluster-ID conversion is outside this change.Testing
RABITQ_ENABLE_NATIVE_OPTIMIZATION=OFF.add(), each with 800 points, eight workers, and forced delays after unlocking the entry-point mutex. HNSW header paths were instrumented; the linked compiled core was not TSan-instrumented. Deadlock detection was disabled for these race-focused checks.git diff --checkpassed.Validation ran on Linux x86-64 with GCC 14.3.0. LeakSanitizer was disabled because of the tracing sandbox. ARM64 was not executed. This is a correctness fix; no benchmark or performance improvement is claimed.