Skip to content

HNSW Impl#283

Draft
Iamdavidonuh wants to merge 14 commits intomainfrom
david/impl-hnsw
Draft

HNSW Impl#283
Iamdavidonuh wants to merge 14 commits intomainfrom
david/impl-hnsw

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

206 tests   206 ✅  8m 37s ⏱️
 31 suites    0 💤
  3 files      0 ❌

Results for commit ec8bf85.

♻️ 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.01    797.0±6.80µs        ? ?/sec    1.00   790.6±15.28µs        ? ?/sec
store_batch_insertion_without_predicates/size_1000           1.02      6.2±0.04ms        ? ?/sec    1.00      6.1±0.01ms        ? ?/sec
store_batch_insertion_without_predicates/size_10000          1.02     86.3±0.27ms        ? ?/sec    1.00     85.0±0.28ms        ? ?/sec
store_batch_insertion_without_predicates/size_100000         1.02    872.8±4.96ms        ? ?/sec    1.00    857.5±6.96ms        ? ?/sec
store_retrieval_no_condition/size_100                        1.00      2.2±0.00ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
store_retrieval_no_condition/size_1000                       1.00     14.5±0.06ms        ? ?/sec    1.00     14.5±0.04ms        ? ?/sec
store_retrieval_no_condition/size_10000                      1.03    147.7±1.86ms        ? ?/sec    1.00    143.4±0.93ms        ? ?/sec
store_retrieval_no_condition/size_100000                     1.03  1479.1±13.74ms        ? ?/sec    1.00  1442.6±14.02ms        ? ?/sec
store_retrieval_non_linear_kdtree/size_100                   1.00      2.2±0.03ms        ? ?/sec    1.00      2.2±0.04ms        ? ?/sec
store_retrieval_non_linear_kdtree/size_1000                  1.03     16.2±0.27ms        ? ?/sec    1.00     15.7±0.31ms        ? ?/sec
store_retrieval_non_linear_kdtree/size_10000                 1.03    161.0±2.90ms        ? ?/sec    1.00    157.0±2.20ms        ? ?/sec
store_retrieval_non_linear_kdtree/size_100000                1.05  1634.4±30.39ms        ? ?/sec    1.00   1561.0±9.41ms        ? ?/sec
store_sequential_insertion_without_predicates/size_100       1.03   1534.9±7.42µs        ? ?/sec    1.00   1493.5±0.25µs        ? ?/sec
store_sequential_insertion_without_predicates/size_1000      1.04     15.3±0.02ms        ? ?/sec    1.00     14.7±0.28ms        ? ?/sec
store_sequential_insertion_without_predicates/size_10000     1.02    152.5±0.74ms        ? ?/sec    1.00    149.8±1.51ms        ? ?/sec
store_sequential_insertion_without_predicates/size_100000    1.03   1528.7±1.75ms        ? ?/sec    1.00  1490.4±28.24ms        ? ?/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.

2 participants