Skip to content

Conversation

@Iamdavidonuh
Copy link
Collaborator

Part of #184. Introduces the HNSW implementation with little to no improvements(Correctness over optimization)

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Test Results

0 tests   - 196   0 ✅  - 196   0s ⏱️ - 9m 39s
0 suites  -  31   0 💤 ±  0 
0 files    -   3   0 ❌ ±  0 

Results for commit ea0841e. ± Comparison against base commit 5cf2c31.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Benchmark Results

group                                                        main                                   pr
-----                                                        ----                                   --
store_batch_insertion_without_predicates/size_100            1.00    735.2±5.02µs        ? ?/sec    1.01    744.2±8.71µs        ? ?/sec
store_batch_insertion_without_predicates/size_1000           1.00      6.2±0.03ms        ? ?/sec    1.00      6.2±0.04ms        ? ?/sec
store_batch_insertion_without_predicates/size_10000          1.00     84.3±0.38ms        ? ?/sec    1.01     85.0±0.44ms        ? ?/sec
store_batch_insertion_without_predicates/size_100000         1.00    868.8±4.42ms        ? ?/sec    1.01    876.7±9.35ms        ? ?/sec
store_retrieval_no_condition/size_100                        1.00      2.2±0.01ms        ? ?/sec    1.00      2.2±0.01ms        ? ?/sec
store_retrieval_no_condition/size_1000                       1.00     14.6±0.05ms        ? ?/sec    1.00     14.6±0.13ms        ? ?/sec
store_retrieval_no_condition/size_10000                      1.00    142.5±0.20ms        ? ?/sec    1.00    142.7±0.46ms        ? ?/sec
store_retrieval_no_condition/size_100000                     1.00   1427.5±3.04ms        ? ?/sec    1.00   1434.0±9.58ms        ? ?/sec
store_retrieval_non_linear_kdtree/size_100                   1.00      2.2±0.00ms        ? ?/sec    1.01      2.2±0.01ms        ? ?/sec
store_retrieval_non_linear_kdtree/size_1000                  1.00     15.4±0.02ms        ? ?/sec    1.00     15.4±0.03ms        ? ?/sec
store_retrieval_non_linear_kdtree/size_10000                 1.01    153.2±0.28ms        ? ?/sec    1.00    152.2±0.31ms        ? ?/sec
store_retrieval_non_linear_kdtree/size_100000                1.00   1537.8±2.39ms        ? ?/sec    1.01   1548.7±8.97ms        ? ?/sec
store_sequential_insertion_without_predicates/size_100       1.00  1536.3±38.05µs        ? ?/sec    1.00  1537.4±17.00µs        ? ?/sec
store_sequential_insertion_without_predicates/size_1000      1.01     15.0±0.16ms        ? ?/sec    1.00     14.9±0.00ms        ? ?/sec
store_sequential_insertion_without_predicates/size_10000     1.00    149.9±1.19ms        ? ?/sec    1.00    150.2±1.53ms        ? ?/sec
store_sequential_insertion_without_predicates/size_100000    1.01  1503.0±13.34ms        ? ?/sec    1.00   1484.9±0.48ms        ? ?/sec

#[derive(Debug, Clone)]
pub struct LayerIndex(pub u16);

impl PartialEq for LayerIndex {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can derive PartialEq and Eq since it's a simple new type

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe PartialOrd too

}

/// NodeId wraps String(hash of node embeddings) to uniquely identify a node across all layers.
#[derive(Debug, Clone)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implicit trait derives as well

@Iamdavidonuh Iamdavidonuh force-pushed the david/impl-hnsw branch 2 times, most recently from abf6b5f to 1ef1e7e Compare January 11, 2026 11:14
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.

3 participants