usearch 2.10.2 → 2.10.5
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 +1 -1
- package/binding.gyp +101 -0
- package/c/CMakeLists.txt +27 -0
- package/c/README.md +34 -0
- package/c/lib.cpp +362 -0
- package/c/test.c +382 -0
- package/c/usearch.h +356 -0
- package/cmake/clipp.cmake +7 -0
- package/cmake/config.cmake.in +15 -0
- package/cmake/emscripten.cmake +8 -0
- package/cmake/jemalloc.cmake +62 -0
- package/cmake/pkg-config.pc.in +4 -0
- package/cmake/usearchConfigVersion.cmake.in +20 -0
- package/cpp/CMakeLists.txt +14 -0
- package/cpp/README.md +161 -0
- package/cpp/bench.cpp +616 -0
- package/cpp/test.cpp +324 -0
- package/fp16/CMakeLists.txt +176 -0
- package/fp16/LICENSE +11 -0
- package/fp16/README.md +20 -0
- package/fp16/bench/alt-element.cc +89 -0
- package/fp16/bench/from-alt-array.cc +175 -0
- package/fp16/bench/from-ieee-array.cc +399 -0
- package/fp16/bench/ieee-element.cc +272 -0
- package/fp16/bench/to-alt-array.cc +91 -0
- package/fp16/bench/to-ieee-array.cc +303 -0
- package/fp16/cmake/DownloadGoogleBenchmark.cmake +15 -0
- package/fp16/cmake/DownloadGoogleTest.cmake +15 -0
- package/fp16/cmake/DownloadPSimd.cmake +15 -0
- package/fp16/configure.py +65 -0
- package/fp16/confu.yaml +8 -0
- package/fp16/include/fp16/__init__.py +0 -0
- package/fp16/include/fp16/avx.py +50 -0
- package/fp16/include/fp16/avx2.py +53 -0
- package/fp16/include/fp16/bitcasts.h +92 -0
- package/fp16/include/fp16/fp16.h +451 -0
- package/fp16/include/fp16/psimd.h +131 -0
- package/fp16/include/fp16.h +11 -0
- package/fp16/jni/Android.mk +6 -0
- package/fp16/jni/Application.mk +4 -0
- package/fp16/test/alt-from-fp32-value.cc +498 -0
- package/fp16/test/alt-to-fp32-bits.cc +263 -0
- package/fp16/test/alt-to-fp32-psimd.cc +145 -0
- package/fp16/test/alt-to-fp32-value.cc +348 -0
- package/fp16/test/alt-to-fp32x2-psimd.cc +245 -0
- package/fp16/test/bitcasts.cc +56 -0
- package/fp16/test/ieee-from-fp32-value.cc +523 -0
- package/fp16/test/ieee-to-fp32-bits.cc +333 -0
- package/fp16/test/ieee-to-fp32-psimd.cc +312 -0
- package/fp16/test/ieee-to-fp32-value.cc +420 -0
- package/fp16/test/ieee-to-fp32x2-psimd.cc +541 -0
- package/fp16/test/peachpy/alt-xmm-to-fp32-xmm-avx.cc +96 -0
- package/fp16/test/peachpy/alt-xmm-to-fp32-ymm-avx2.cc +96 -0
- package/fp16/test/peachpy/stubs.py +38 -0
- package/fp16/test/tables.cc +530 -0
- package/fp16/test/tables.h +13 -0
- package/fp16/third-party/THHalf.h +92 -0
- package/fp16/third-party/eigen-half.h +170 -0
- package/fp16/third-party/float16-compressor.h +80 -0
- package/fp16/third-party/half.hpp +2916 -0
- package/fp16/third-party/npy-halffloat.h +328 -0
- package/include/usearch/index.hpp +3838 -0
- package/include/usearch/index_dense.hpp +2004 -0
- package/include/usearch/index_plugins.hpp +2255 -0
- package/javascript/dist-package-cjs.json +3 -0
- package/javascript/dist-package-esm.json +3 -0
- package/javascript/lib.cpp +350 -0
- package/javascript/node-gyp-build.d.ts +1 -0
- package/javascript/tsconfig-base.json +25 -0
- package/javascript/tsconfig-cjs.json +8 -0
- package/javascript/tsconfig-esm.json +8 -0
- package/javascript/usearch.test.js +84 -0
- package/javascript/usearch.ts +640 -0
- package/package.json +10 -3
- package/prebuilds/darwin-arm64+x64/usearch.node +0 -0
- package/prebuilds/linux-arm64/usearch.node +0 -0
- package/prebuilds/linux-x64/usearch.node +0 -0
- package/prebuilds/win32-ia32/usearch.node +0 -0
- package/prebuilds/win32-x64/usearch.node +0 -0
- package/simsimd/.releaserc +87 -0
- package/simsimd/CONTRIBUTING.md +114 -0
- package/simsimd/Cargo.lock +709 -0
- package/simsimd/Cargo.toml +44 -0
- package/simsimd/LICENSE +201 -0
- package/simsimd/README.md +708 -0
- package/simsimd/binding.gyp +36 -0
- package/simsimd/build.rs +51 -0
- package/simsimd/c/lib.c +110 -0
- package/simsimd/include/simsimd/binary.h +258 -0
- package/simsimd/include/simsimd/dot.h +1237 -0
- package/simsimd/include/simsimd/geospatial.h +37 -0
- package/simsimd/include/simsimd/probability.h +563 -0
- package/simsimd/include/simsimd/simsimd.h +1129 -0
- package/simsimd/include/simsimd/spatial.h +1019 -0
- package/simsimd/include/simsimd/types.h +309 -0
- package/simsimd/javascript/bench.js +127 -0
- package/simsimd/javascript/dist-package-cjs.json +3 -0
- package/simsimd/javascript/dist-package-esm.json +3 -0
- package/simsimd/javascript/fallback.ts +203 -0
- package/simsimd/javascript/lib.c +107 -0
- package/simsimd/javascript/node-gyp-build.d.ts +1 -0
- package/simsimd/javascript/simsimd.ts +135 -0
- package/simsimd/javascript/test.mjs +179 -0
- package/simsimd/javascript/tsconfig-base.json +37 -0
- package/simsimd/javascript/tsconfig-cjs.json +8 -0
- package/simsimd/javascript/tsconfig-esm.json +8 -0
- package/simsimd/package-lock.json +1709 -0
- package/simsimd/package.json +61 -0
- package/simsimd/rust/benches/cosine.rs +27 -0
- package/simsimd/rust/benches/native.rs +30 -0
- package/simsimd/rust/benches/sqeuclidean.rs +27 -0
- package/simsimd/rust/lib.rs +778 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"main"
|
|
4
|
+
],
|
|
5
|
+
"debug": true,
|
|
6
|
+
"ci": true,
|
|
7
|
+
"dryRun": false,
|
|
8
|
+
"plugins": [
|
|
9
|
+
[
|
|
10
|
+
"@semantic-release/commit-analyzer",
|
|
11
|
+
{
|
|
12
|
+
"preset": "eslint",
|
|
13
|
+
"releaseRules": [
|
|
14
|
+
{
|
|
15
|
+
"tag": "Break",
|
|
16
|
+
"release": "major"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"tag": "Add",
|
|
20
|
+
"release": "minor"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"tag": "Improve",
|
|
24
|
+
"release": "patch"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"tag": "Make",
|
|
28
|
+
"release": "patch"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"tag": "Refactor",
|
|
32
|
+
"release": false
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"@semantic-release/release-notes-generator",
|
|
39
|
+
{
|
|
40
|
+
"preset": "eslint",
|
|
41
|
+
"releaseRules": [
|
|
42
|
+
{
|
|
43
|
+
"tag": "Break",
|
|
44
|
+
"release": "major"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"tag": "Add",
|
|
48
|
+
"release": "minor"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"tag": "Improve",
|
|
52
|
+
"release": "patch"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"tag": "Make",
|
|
56
|
+
"release": "patch"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"tag": "Refactor",
|
|
60
|
+
"release": false
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"@semantic-release/github",
|
|
66
|
+
[
|
|
67
|
+
"@semantic-release/exec",
|
|
68
|
+
{
|
|
69
|
+
"prepareCmd": "bash .github/workflows/update_version.sh '${nextRelease.version}'"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"@semantic-release/git",
|
|
74
|
+
{
|
|
75
|
+
"assets": [
|
|
76
|
+
"VERSION",
|
|
77
|
+
"package.json",
|
|
78
|
+
"Cargo.toml",
|
|
79
|
+
"Cargo.lock",
|
|
80
|
+
"CMakeLists.txt",
|
|
81
|
+
"include/simsimd/simsimd.h"
|
|
82
|
+
],
|
|
83
|
+
"message": "Build: Released ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
]
|
|
87
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## C and C++
|
|
4
|
+
|
|
5
|
+
To rerun experiments utilize the following command:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
sudo apt install libopenblas-dev # BLAS installation is optional
|
|
9
|
+
cmake -DCMAKE_BUILD_TYPE=Release -DSIMSIMD_BUILD_BENCHMARKS=1 -DSIMSIMD_BUILD_TESTS=1 -B ./build_release
|
|
10
|
+
cmake --build build_release --config Release
|
|
11
|
+
build_release/simsimd_bench
|
|
12
|
+
build_release/simsimd_bench --benchmark_filter=js
|
|
13
|
+
build_release/simsimd_test_run_time
|
|
14
|
+
build_release/simsimd_test_compile_time
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Python
|
|
18
|
+
|
|
19
|
+
Testing:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
pip install -e . # to install the package in editable mode
|
|
23
|
+
pip install pytest pytest-repeat # testing dependencies
|
|
24
|
+
pytest python/test.py -s -x -Wd # to run tests
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Here, `-s` will output the logs.
|
|
28
|
+
The `-x` will stop on the first failure.
|
|
29
|
+
The `-Wd` will silence overflows and runtime warnings.
|
|
30
|
+
|
|
31
|
+
Benchmarking:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
pip install numpy scipy scikit-learn # for comparison baselines
|
|
35
|
+
python python/bench.py # to run default benchmarks
|
|
36
|
+
python python/bench.py --n 1000 --ndim 1000000 # batch size and dimensions
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Before merging your changes you may want to test your changes against the entire matrix of Python versions USearch supports.
|
|
40
|
+
For that you need the `cibuildwheel`, which is tricky to use on MacOS and Windows, as it would target just the local environment.
|
|
41
|
+
Still, if you have Docker running on any desktop OS, you can use it to build and test the Python bindings for all Python versions for Linux:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
pip install cibuildwheel
|
|
45
|
+
cibuildwheel
|
|
46
|
+
cibuildwheel --platform linux # works on any OS and builds all Linux backends
|
|
47
|
+
cibuildwheel --platform linux --archs x86_64 # 64-bit x86, the most common on desktop and servers
|
|
48
|
+
cibuildwheel --platform linux --archs aarch64 # 64-bit Arm for mobile devices, Apple M-series, and AWS Graviton
|
|
49
|
+
cibuildwheel --platform linux --archs i686 # 32-bit Linux
|
|
50
|
+
cibuildwheel --platform linux --archs s390x # emulating big-endian IBM Z
|
|
51
|
+
cibuildwheel --platform macos # works only on MacOS
|
|
52
|
+
cibuildwheel --platform windows # works only on Windows
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
You may need root previligies for multi-architecture builds:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
sudo $(which cibuildwheel) --platform linux
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
On Windows and MacOS, to avoid frequent path resolution issues, you may want to use:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
python -m cibuildwheel --platform windows
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Rust
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
cargo test -p simsimd
|
|
71
|
+
cargo test -p simsimd -- --nocapture # To see the output
|
|
72
|
+
cargo bench
|
|
73
|
+
open ./target/criterion/report/index.html
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## JavaScript
|
|
77
|
+
|
|
78
|
+
If you don't have NPM installed:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
|
82
|
+
nvm install 20
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Testing and benchmarking:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
npm install -g typescript
|
|
89
|
+
npm run build-js
|
|
90
|
+
npm test
|
|
91
|
+
npm run bench
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Running with Deno:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
deno test --allow-read
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Running with Bun:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
npm install -g bun
|
|
104
|
+
bun test
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## GoLang
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
cd golang
|
|
111
|
+
go test # To test
|
|
112
|
+
go test -run=^$ -bench=. -benchmem # To benchmark
|
|
113
|
+
```
|
|
114
|
+
|