usearch 2.7.2 → 2.7.6

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.
Files changed (56) hide show
  1. package/.github/workflows/Dockerfile.libs +4 -6
  2. package/.github/workflows/prerelease.yml +4 -1
  3. package/.github/workflows/release.yml +8 -28
  4. package/.github/workflows/update_version.sh +1 -0
  5. package/CITATION.cff +2 -2
  6. package/CMakeLists.txt +1 -1
  7. package/Cargo.toml +1 -1
  8. package/README.md +4 -4
  9. package/binding.gyp +1 -1
  10. package/build.gradle +20 -5
  11. package/conanfile.py +1 -1
  12. package/csharp/nuget/nuget-package.props +1 -1
  13. package/docs/compilation.md +0 -2
  14. package/golang/README.md +0 -1
  15. package/include/usearch/index.hpp +1 -1
  16. package/include/usearch/index_plugins.hpp +119 -243
  17. package/javascript/lib.cpp +4 -3
  18. package/package.json +1 -1
  19. package/simsimd/.github/workflows/prerelease.yml +33 -58
  20. package/simsimd/.github/workflows/release.yml +22 -9
  21. package/simsimd/.github/workflows/update_version.sh +3 -1
  22. package/simsimd/.releaserc +9 -1
  23. package/simsimd/.vscode/launch.json +3 -0
  24. package/simsimd/.vscode/settings.json +15 -2
  25. package/simsimd/.vscode/tasks.json +2 -2
  26. package/simsimd/CMakeLists.txt +36 -55
  27. package/simsimd/README.md +163 -109
  28. package/simsimd/binding.gyp +18 -0
  29. package/simsimd/cpp/bench.cxx +187 -0
  30. package/simsimd/go.mod +3 -0
  31. package/simsimd/golang/bench_test.go +40 -0
  32. package/simsimd/golang/simsimd.go +47 -0
  33. package/simsimd/golang/unit_test.go +40 -0
  34. package/simsimd/include/simsimd/binary.h +186 -0
  35. package/simsimd/include/simsimd/probability.h +645 -0
  36. package/simsimd/include/simsimd/simsimd.h +335 -575
  37. package/simsimd/include/simsimd/spatial.h +924 -0
  38. package/simsimd/include/simsimd/types.h +196 -0
  39. package/simsimd/javascript/bench.js +117 -0
  40. package/simsimd/javascript/lib.c +102 -0
  41. package/simsimd/javascript/simsimd.js +45 -0
  42. package/simsimd/javascript/test.js +29 -0
  43. package/simsimd/package.json +31 -2
  44. package/simsimd/pyproject.toml +5 -6
  45. package/simsimd/python/bench.ipynb +187 -0
  46. package/simsimd/python/bench.py +268 -0
  47. package/simsimd/python/lib.c +453 -72
  48. package/simsimd/python/test.py +167 -35
  49. package/simsimd/setup.py +51 -8
  50. package/wasmer.toml +1 -1
  51. package/simsimd/bench.cxx +0 -137
  52. package/simsimd/include/simsimd/simsimd_bio.h +0 -54
  53. package/simsimd/include/simsimd/simsimd_chem.h +0 -167
  54. package/simsimd/include/simsimd/simsimd_text.h +0 -92
  55. package/simsimd/python/run.sh +0 -1
  56. package/simsimd/python/test.c +0 -109
@@ -7,15 +7,13 @@ ARG docker_ip
7
7
  ARG user_pass
8
8
 
9
9
  RUN apt-get update && \
10
- apt-get install -y --no-install-recommends cmake g++-12 libc++-dev build-essential libjemalloc-dev golang openssh-client sshpass && \
10
+ apt-get install -y --no-install-recommends cmake g++-12 gcc-12 libc++-dev libc++abi-dev build-essential libjemalloc-dev openssh-client sshpass && \
11
11
  apt-get clean && \
12
12
  rm -rf /var/lib/apt/lists/*
13
13
 
14
14
  COPY . .
15
15
 
16
- RUN cd golang && make -C ../c libusearch_c.so && \
17
- mv ../c/libusearch_c.so libusearch_static_c.a && cp ../c/usearch.h usearch.h && \
18
- go test -v && cd ..
16
+ RUN cd c && make libusearch_c.so
19
17
 
20
18
  RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
21
19
  export arch="amd"; \
@@ -28,7 +26,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
28
26
  mkdir -p usearch_linux_"$arch"_"$version"/usr/local/lib && \
29
27
  mkdir usearch_linux_"$arch"_"$version"/usr/local/include && \
30
28
  cp c/usearch.h usearch_linux_"$arch"_"$version"/usr/local/include/ && \
31
- cp golang/libusearch_static_c.a usearch_linux_"$arch"_"$version"/usr/local/lib/ && \
32
- echo "Package: usearch\nVersion: $version\nMaintainer: Ashot Vardanian\nArchitecture: "$arch"\nDescription: Faster & Smaller Single-File Search Engine for Vectors & Texts" > usearch_linux_"$arch"_"$version"/DEBIAN/control && \
29
+ cp c/libusearch_so.a usearch_linux_"$arch"_"$version"/usr/local/lib/ && \
30
+ echo "Package: usearch\nVersion: $version\nMaintainer: Ash Vardanian\nArchitecture: "$arch"\nDescription: Faster & Smaller Single-File Search Engine for Vectors & Texts" > usearch_linux_"$arch"_"$version"/DEBIAN/control && \
33
31
  dpkg-deb --build usearch_linux_"$arch"_"$version" && \
34
32
  sshpass -p "$user_pass" scp -o StrictHostKeyChecking=no usearch_linux_"$arch"_"$version".deb "$user_name"@"$docker_ip":/home/$user_name/work/usearch/usearch/
@@ -277,7 +277,10 @@ jobs:
277
277
  run: |
278
278
  sudo apt update &&
279
279
  sudo apt install -y build-essential
280
-
280
+
281
+ # This is the weirdest step. GoLang runtime is having a hard time working with our static library...
282
+ # And doesn't want to link to the dynamic library... So instead, we rename the `.so` file `.a`, and
283
+ # it works just fine.
281
284
  - name: Build library
282
285
  run: |
283
286
  cd golang/
@@ -130,7 +130,7 @@ jobs:
130
130
  with:
131
131
  go-version: '^1.19.0'
132
132
 
133
- - name: Setup Mingw
133
+ - name: Setup MinGW
134
134
  uses: egor-tensin/setup-mingw@v2
135
135
  with:
136
136
  platform: ${{ matrix.arch }}
@@ -144,17 +144,8 @@ jobs:
144
144
 
145
145
  - name: Build library
146
146
  run: |
147
- cd c/ && g++ -std=c++11 -o libusearch_c.dll -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared && cd ..
148
- cp c/libusearch_c.dll golang/libusearch_c.dll && cp c/usearch.h golang/usearch.h
149
-
150
- - name: Golang test
151
- run: |
152
- cd golang/ && go test -v
153
- if: ${{ matrix.arch == 'x64' }}
154
-
155
- - name: Compress library
156
- run: |
157
- cd golang/
147
+ cd c
148
+ make libusearch_c.dll
158
149
  tar -cvf usearch_windows_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.tar .\libusearch_c.dll .\usearch.h
159
150
 
160
151
  - name: Upload archive
@@ -162,7 +153,7 @@ jobs:
162
153
  env:
163
154
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164
155
  with:
165
- file: "golang/usearch_windows_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.tar"
156
+ file: "c/usearch_windows_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.tar"
166
157
  update_latest_release: true
167
158
 
168
159
 
@@ -192,19 +183,8 @@ jobs:
192
183
 
193
184
  - name: Build library
194
185
  run: |
195
- cd c/ && clang++ -std=c++11 -o libusearch_c.so -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared -target ${{ matrix.arch }}-apple-macos11 && cd ..
196
- cp c/usearch.h golang/
197
- cp c/libusearch_c.so golang/libusearch_c.so
198
-
199
- - name: Golang test
200
- run: |
201
- cd golang/
202
- go test -v
203
- if: ${{ matrix.arch == 'x86_64' }}
204
-
205
- - name: Compress library
206
- run: |
207
- cd golang/
186
+ cd c
187
+ make libusearch_c.so -target ${{ matrix.arch }}-apple-macos11
208
188
  zip -r usearch_macOS_${{ matrix.arch }}_${{ steps.version.outputs.version }}.zip libusearch_c.so usearch.h
209
189
 
210
190
  - name: Upload archive
@@ -212,7 +192,7 @@ jobs:
212
192
  env:
213
193
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
214
194
  with:
215
- file: "golang/*.zip"
195
+ file: "c/*.zip"
216
196
  update_latest_release: true
217
197
 
218
198
 
@@ -475,7 +455,7 @@ jobs:
475
455
  - name: Execute Gradle build
476
456
  run: gradle clean build
477
457
  - name: Publish package
478
- run: gradle publish
458
+ run: gradle publish -PsignArtifacts=false
479
459
  env:
480
460
  MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
481
461
  MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
@@ -11,4 +11,5 @@ echo $1 > VERSION &&
11
11
  sed -i "s/<version>[0-9]\+\.[0-9]\+\.[0-9]\+/<version>$1/" README.md &&
12
12
  sed -i "s/version = {[0-9]\+\.[0-9]\+\.[0-9]\+}/version = {$1}/" README.md &&
13
13
  sed -i "s/>[0-9]\+\.[0-9]\+\.[0-9]\+<\/Version>/>$1<\/Version>/" ./csharp/nuget/nuget-package.props &&
14
+ sed -i "s/VERSION [0-9]\+\.[0-9]\+\.[0-9]\+/VERSION $1/" CMakeLists.txt &&
14
15
  sed -i "s/version=\".*\"/version=\"$1\"/" wasmer.toml
package/CITATION.cff CHANGED
@@ -5,7 +5,7 @@ authors:
5
5
  given-names: "Ash"
6
6
  orcid: "https://orcid.org/0000-0002-4882-1815"
7
7
  title: "USearch by Unum Cloud"
8
- version: 2.7.2
8
+ version: 2.7.6
9
9
  doi: 10.5281/zenodo.7949416
10
- date-released: 2022-06-12
10
+ date-released: 2023-10-22
11
11
  url: "https://github.com/unum-cloud/usearch"
package/CMakeLists.txt CHANGED
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.1)
4
4
  project(
5
5
  usearch
6
- VERSION 0.6.0
6
+ VERSION 2.7.2
7
7
  LANGUAGES C CXX
8
8
  )
9
9
 
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "usearch"
3
- version = "2.7.2"
3
+ version = "2.7.6"
4
4
  authors = ["Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
5
5
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
6
6
  edition = "2021"
package/README.md CHANGED
@@ -387,13 +387,13 @@ The search is based on the Haversine distance metric, but can easily be extended
387
387
  ## Citations
388
388
 
389
389
  ```txt
390
- @software{Vardanian_USearch_2022,
390
+ @software{Vardanian_USearch_2023,
391
391
  doi = {10.5281/zenodo.7949416},
392
392
  author = {Vardanian, Ash},
393
393
  title = {{USearch by Unum Cloud}},
394
394
  url = {https://github.com/unum-cloud/usearch},
395
- version = {2.7.2},
396
- year = {2022},
397
- month = jun,
395
+ version = {2.7.6},
396
+ year = {2023},
397
+ month = oct,
398
398
  }
399
399
  ```
package/binding.gyp CHANGED
@@ -10,7 +10,7 @@
10
10
  "simsimd/include",
11
11
  ],
12
12
  "dependencies": ["<!(node -p \"require('node-addon-api').gyp\")"],
13
- "defines": ["USEARCH_USE_SIMSIMD=1"],
13
+ "defines": ["USEARCH_USE_SIMSIMD=1", "USEARCH_USE_NATIVE_F16=0"],
14
14
  "cflags": [
15
15
  "-fexceptions",
16
16
  "-Wno-unknown-pragmas",
package/build.gradle CHANGED
@@ -74,6 +74,16 @@ model {
74
74
  }
75
75
  }
76
76
  }
77
+
78
+ toolChains {
79
+ gcc(Gcc) {
80
+ target("linux_aarch64") {
81
+ cppCompiler.withArguments { args ->
82
+ args << "-march=armv8-a"
83
+ }
84
+ }
85
+ }
86
+ }
77
87
  }
78
88
 
79
89
  test {
@@ -89,13 +99,16 @@ jar {
89
99
  dependsOn("usearchSharedLibrary")
90
100
  into("usearch") {
91
101
  from("$buildDir/libs/usearch/shared/libusearch.dylib")
102
+ from("$buildDir/libs/usearch/shared/libusearch.dll")
92
103
  from("$buildDir/libs/usearch/shared/libusearch.so")
93
104
  }
94
105
  }
95
106
 
96
- signing {
97
- useGpgCmd()
98
- sign publishing.publications
107
+ if (project.hasProperty('signArtifacts') && signArtifacts.toBoolean()) {
108
+ signing {
109
+ useGpgCmd()
110
+ sign publishing.publications
111
+ }
99
112
  }
100
113
 
101
114
  publishing {
@@ -105,8 +118,10 @@ publishing {
105
118
 
106
119
  artifact sourcesJar
107
120
 
108
- signing {
109
- sign publishing.publications.library
121
+ if (project.hasProperty('signArtifacts') && signArtifacts.toBoolean()) {
122
+ signing {
123
+ sign publishing.publications.library
124
+ }
110
125
  }
111
126
 
112
127
  pom {
package/conanfile.py CHANGED
@@ -7,7 +7,7 @@ required_conan_version = ">=1.53.0"
7
7
  class USearchConan(ConanFile):
8
8
 
9
9
  name = "usearch"
10
- version = '2.7.2'
10
+ version = '2.7.6'
11
11
  license = "Apache-2.0"
12
12
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
13
13
  homepage = "https://github.com/unum-cloud/usearch"
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project>
3
3
  <PropertyGroup>
4
- <Version Condition="'$(Version)' == ''">2.7.2</Version>
4
+ <Version Condition="'$(Version)' == ''">2.7.6</Version>
5
5
 
6
6
  <Authors>Unum</Authors>
7
7
  <Company>Unum</Company>
@@ -177,7 +177,6 @@ cmake --build ./build_release --config Release -j
177
177
  .\build_release\test_c.exe
178
178
  ```
179
179
 
180
-
181
180
  ## GoLang
182
181
 
183
182
  GoLang bindings are based on C.
@@ -194,7 +193,6 @@ cd golang && go test -v ; cd ..
194
193
  brew install --cask wolfram-engine
195
194
  ```
196
195
 
197
-
198
196
  ## Docker
199
197
 
200
198
  ```sh
package/golang/README.md CHANGED
@@ -30,7 +30,6 @@ Move the USearch library and the include file to their respective folders.
30
30
  wget https://github.com/unum-cloud/usearch/releases/download/<release_tag>/usearch_macOS_<arch>_<usearch_version>.zip
31
31
  unzip usearch_macOS_<arch>_<usearch_version>.zip
32
32
  sudo mv libusearch_c.so /usr/local/lib && sudo mv usearch.h /usr/local/include
33
-
34
33
  ```
35
34
 
36
35
  ## Quickstart
@@ -11,7 +11,7 @@
11
11
 
12
12
  #define USEARCH_VERSION_MAJOR 2
13
13
  #define USEARCH_VERSION_MINOR 7
14
- #define USEARCH_VERSION_PATCH 2
14
+ #define USEARCH_VERSION_PATCH 6
15
15
 
16
16
  // Inferring C++ version
17
17
  // https://stackoverflow.com/a/61552074