Implement HNSW graph structure, GPU search, and unit tests#2
Merged
Conversation
added 4 commits
July 2, 2026 18:47
- Added `hnsw.worker.ts` to handle graph construction and search in a Web Worker, ensuring main thread remains unblocked during operations. - Introduced `hnswGpu.ts` for GPU-based graph search execution, leveraging WebGPU for efficient query processing. - Created `hnswGraph.ts` to define the core HNSW graph structure, including methods for graph construction, serialization, and k-NN search. - Implemented efficient memory management and data handling for both CPU and GPU paths, optimizing performance for large datasets.
… and other components - Implement tests for snapshot format serialization and deserialization in `format.test.ts`. - Add tests for the `hashingEmbedder` functionality in `hashing.test.ts`. - Create comprehensive tests for the `HNSWGraph` class, including search and serialization in `hnswGraph.test.ts`. - Introduce tests for K-means clustering algorithms and related utilities in `kmeans.test.ts`. - Add tests for the pseudo-random number generator (PRNG) functions in `prng.test.ts`. - Implement tests for the `Rotator` class and its functionalities in `rotator.test.ts`. - Create tests for the `Store` class, ensuring proper handling of vectors and entries in `store.test.ts`. - Add tests for the `topK` function to validate its behavior with various score inputs in `topk.test.ts`. - Configure Vitest workspace for unit and browser testing environments in `vitest.workspace.ts`.
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.
No description provided.