Skip to content

Implement HNSW graph structure, GPU search, and unit tests#2

Merged
sharma-open-source merged 4 commits into
mainfrom
improvments
Jul 3, 2026
Merged

Implement HNSW graph structure, GPU search, and unit tests#2
sharma-open-source merged 4 commits into
mainfrom
improvments

Conversation

@sharma-open-source

Copy link
Copy Markdown
Owner

No description provided.

Sharma 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`.
@sharma-open-source sharma-open-source merged commit 2c95a4c into main Jul 3, 2026
1 check passed
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.

1 participant