usearch 2.21.0 → 2.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -354,16 +354,16 @@ By now, the core functionality is supported across all bindings.
354
354
  Broader functionality is ported per request.
355
355
  In some cases, like Batch operations, feature parity is meaningless, as the host language has full multi-threading capabilities and the USearch index structure is concurrent by design, so the users can implement batching/scheduling/load-balancing in the most optimal way for their applications.
356
356
 
357
- | | C++ 11 | Python 3 | C 99 | Java | JavaScript | Rust | Go | Swift |
358
- | :---------------------- | :----: | :------: | :---: | :---: | :--------: | :---: | :----: | :---: |
359
- | Add, search, remove | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
360
- | Save, load, view | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
361
- | User-defined metrics | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
362
- | Batch operations | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
363
- | Filter predicates | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
364
- | Joins | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
365
- | Variable-length vectors | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
366
- | 4B+ capacities | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
357
+ | | C++ 11 | Python 3 | C 99 | Java | JavaScript | Rust | Go | Swift |
358
+ | :---------------------- | :----: | :------: | :---: | :---: | :--------: | :---: | :---: | :---: |
359
+ | Add, search, remove | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
360
+ | Save, load, view | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
361
+ | User-defined metrics | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
362
+ | Batch operations | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
363
+ | Filter predicates | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ✅ |
364
+ | Joins | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
365
+ | Variable-length vectors | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
366
+ | 4B+ capacities | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
367
367
 
368
368
  ## Application Examples
369
369
 
@@ -534,13 +534,14 @@ index = Index(ndim=ndim, metric=CompiledMetric(
534
534
  - [x] TiDB & TiFlash: [C++](https://github.com/pingcap/tiflash), [announcement](https://www.pingcap.com/article/introduce-vector-search-indexes-in-tidb/).
535
535
  - [x] YugaByte: [C++](https://github.com/yugabyte/yugabyte-db/blob/366b9f5e3c4df3a1a17d553db41d6dc50146f488/src/yb/vector_index/usearch_wrapper.cc).
536
536
  - [x] Google: [UniSim](https://github.com/google/unisim), [RetSim](https://arxiv.org/abs/2311.17264) paper.
537
- - [x] Memgraph: [C++](https://github.com/memgraph/memgraph/blob/784dd8520f65050d033aea8b29446e84e487d091/src/storage/v2/indices/vector_index.cpp), [announcement](https://memgraph.com/blog/simplify-data-retrieval-memgraph-vector-search).
537
+ - [x] MemGraph: [C++](https://github.com/memgraph/memgraph/blob/784dd8520f65050d033aea8b29446e84e487d091/src/storage/v2/indices/vector_index.cpp), [announcement](https://memgraph.com/blog/simplify-data-retrieval-memgraph-vector-search).
538
538
  - [x] LanternDB: [C++](https://github.com/lanterndata/lantern), [Rust](https://github.com/lanterndata/lantern_extras), [docs](https://lantern.dev/blog/hnsw-index-creation).
539
539
  - [x] LangChain: [Python](https://github.com/langchain-ai/langchain/releases/tag/v0.0.257) and [JavaScript](https://github.com/hwchase17/langchainjs/releases/tag/0.0.125).
540
540
  - [x] Microsoft Semantic Kernel: [Python](https://github.com/microsoft/semantic-kernel/releases/tag/python-0.3.9.dev) and C#.
541
541
  - [x] GPTCache: [Python](https://github.com/zilliztech/GPTCache/releases/tag/0.1.29).
542
542
  - [x] Sentence-Transformers: Python [docs](https://www.sbert.net/docs/package_reference/quantization.html#sentence_transformers.quantization.semantic_search_usearch).
543
543
  - [x] Pathway: [Rust](https://github.com/pathwaycom/pathway).
544
+ - [x] Vald: [GoLang](https://github.com/vdaas/vald).
544
545
 
545
546
 
546
547
  ## Citations
@@ -551,7 +552,7 @@ doi = {10.5281/zenodo.7949416},
551
552
  author = {Vardanian, Ash},
552
553
  title = {{USearch by Unum Cloud}},
553
554
  url = {https://github.com/unum-cloud/usearch},
554
- version = {2.21.0},
555
+ version = {2.21.2},
555
556
  year = {2023},
556
557
  month = oct,
557
558
  }
@@ -9,7 +9,7 @@
9
9
 
10
10
  #define USEARCH_VERSION_MAJOR 2
11
11
  #define USEARCH_VERSION_MINOR 21
12
- #define USEARCH_VERSION_PATCH 0
12
+ #define USEARCH_VERSION_PATCH 2
13
13
 
14
14
  // Inferring C++ version
15
15
  // https://stackoverflow.com/a/61552074
@@ -3806,6 +3806,25 @@ class index_gt {
3806
3806
  return {nodes_mutexes_, slot};
3807
3807
  }
3808
3808
 
3809
+ struct optional_node_lock_t {
3810
+ nodes_mutexes_t& mutexes;
3811
+ std::size_t slot;
3812
+ inline ~optional_node_lock_t() noexcept {
3813
+ if (slot != std::numeric_limits<std::size_t>::max())
3814
+ mutexes.atomic_reset(slot);
3815
+ }
3816
+ };
3817
+
3818
+ inline optional_node_lock_t optional_node_lock_(std::size_t slot, bool condition) const noexcept {
3819
+ if (condition) {
3820
+ while (nodes_mutexes_.atomic_set(slot))
3821
+ ;
3822
+ return {nodes_mutexes_, slot};
3823
+ } else {
3824
+ return {nodes_mutexes_, std::numeric_limits<std::size_t>::max()};
3825
+ }
3826
+ }
3827
+
3809
3828
  struct node_conditional_lock_t {
3810
3829
  nodes_mutexes_t& mutexes;
3811
3830
  std::size_t slot;
@@ -4133,6 +4152,8 @@ class index_gt {
4133
4152
  node_try_conditional_lock_(candidate_slot, updated_slot != candidate_slot, failed_to_acquire);
4134
4153
  if (failed_to_acquire)
4135
4154
  continue;
4155
+ auto optional_node_lock =
4156
+ optional_node_lock_(candidate_slot, updated_slot == candidate_slot);
4136
4157
  neighbors_ref_t candidate_neighbors = neighbors_(candidate_ref, level);
4137
4158
 
4138
4159
  // Optional prefetching
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usearch",
3
- "version": "2.21.0",
3
+ "version": "2.21.2",
4
4
  "description": "Smaller & Faster Single-File Vector Search Engine from Unum",
5
5
  "author": "Ash Vardanian (https://ashvardanian.com/)",
6
6
  "license": "Apache 2.0",
Binary file
Binary file