usearch 2.10.3 → 2.11.0

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 (114) hide show
  1. package/README.md +28 -8
  2. package/binding.gyp +101 -0
  3. package/c/CMakeLists.txt +27 -0
  4. package/c/README.md +244 -0
  5. package/c/lib.cpp +459 -0
  6. package/c/test.c +386 -0
  7. package/c/usearch.h +451 -0
  8. package/cmake/clipp.cmake +7 -0
  9. package/cmake/config.cmake.in +15 -0
  10. package/cmake/emscripten.cmake +8 -0
  11. package/cmake/jemalloc.cmake +62 -0
  12. package/cmake/pkg-config.pc.in +4 -0
  13. package/cmake/usearchConfigVersion.cmake.in +20 -0
  14. package/cpp/CMakeLists.txt +14 -0
  15. package/cpp/README.md +161 -0
  16. package/cpp/bench.cpp +616 -0
  17. package/cpp/test.cpp +335 -0
  18. package/fp16/CMakeLists.txt +176 -0
  19. package/fp16/LICENSE +11 -0
  20. package/fp16/README.md +20 -0
  21. package/fp16/bench/alt-element.cc +89 -0
  22. package/fp16/bench/from-alt-array.cc +175 -0
  23. package/fp16/bench/from-ieee-array.cc +399 -0
  24. package/fp16/bench/ieee-element.cc +272 -0
  25. package/fp16/bench/to-alt-array.cc +91 -0
  26. package/fp16/bench/to-ieee-array.cc +303 -0
  27. package/fp16/cmake/DownloadGoogleBenchmark.cmake +15 -0
  28. package/fp16/cmake/DownloadGoogleTest.cmake +15 -0
  29. package/fp16/cmake/DownloadPSimd.cmake +15 -0
  30. package/fp16/configure.py +65 -0
  31. package/fp16/confu.yaml +8 -0
  32. package/fp16/include/fp16/__init__.py +0 -0
  33. package/fp16/include/fp16/avx.py +50 -0
  34. package/fp16/include/fp16/avx2.py +53 -0
  35. package/fp16/include/fp16/bitcasts.h +92 -0
  36. package/fp16/include/fp16/fp16.h +451 -0
  37. package/fp16/include/fp16/psimd.h +131 -0
  38. package/fp16/include/fp16.h +11 -0
  39. package/fp16/jni/Android.mk +6 -0
  40. package/fp16/jni/Application.mk +4 -0
  41. package/fp16/test/alt-from-fp32-value.cc +498 -0
  42. package/fp16/test/alt-to-fp32-bits.cc +263 -0
  43. package/fp16/test/alt-to-fp32-psimd.cc +145 -0
  44. package/fp16/test/alt-to-fp32-value.cc +348 -0
  45. package/fp16/test/alt-to-fp32x2-psimd.cc +245 -0
  46. package/fp16/test/bitcasts.cc +56 -0
  47. package/fp16/test/ieee-from-fp32-value.cc +523 -0
  48. package/fp16/test/ieee-to-fp32-bits.cc +333 -0
  49. package/fp16/test/ieee-to-fp32-psimd.cc +312 -0
  50. package/fp16/test/ieee-to-fp32-value.cc +420 -0
  51. package/fp16/test/ieee-to-fp32x2-psimd.cc +541 -0
  52. package/fp16/test/peachpy/alt-xmm-to-fp32-xmm-avx.cc +96 -0
  53. package/fp16/test/peachpy/alt-xmm-to-fp32-ymm-avx2.cc +96 -0
  54. package/fp16/test/peachpy/stubs.py +38 -0
  55. package/fp16/test/tables.cc +530 -0
  56. package/fp16/test/tables.h +13 -0
  57. package/fp16/third-party/THHalf.h +92 -0
  58. package/fp16/third-party/eigen-half.h +170 -0
  59. package/fp16/third-party/float16-compressor.h +80 -0
  60. package/fp16/third-party/half.hpp +2916 -0
  61. package/fp16/third-party/npy-halffloat.h +328 -0
  62. package/include/usearch/index.hpp +3838 -0
  63. package/include/usearch/index_dense.hpp +2022 -0
  64. package/include/usearch/index_plugins.hpp +2317 -0
  65. package/javascript/dist/cjs/usearch.js +5 -5
  66. package/javascript/dist/esm/usearch.js +2 -2
  67. package/javascript/dist-package-cjs.json +3 -0
  68. package/javascript/dist-package-esm.json +3 -0
  69. package/javascript/lib.cpp +350 -0
  70. package/javascript/node-gyp-build.d.ts +1 -0
  71. package/javascript/tsconfig-base.json +25 -0
  72. package/javascript/tsconfig-cjs.json +8 -0
  73. package/javascript/tsconfig-esm.json +8 -0
  74. package/javascript/usearch.test.js +84 -0
  75. package/javascript/usearch.ts +640 -0
  76. package/package.json +14 -7
  77. package/prebuilds/darwin-arm64+x64/usearch.node +0 -0
  78. package/prebuilds/linux-arm64/usearch.node +0 -0
  79. package/prebuilds/linux-x64/usearch.node +0 -0
  80. package/prebuilds/win32-ia32/usearch.node +0 -0
  81. package/prebuilds/win32-x64/usearch.node +0 -0
  82. package/simsimd/.releaserc +87 -0
  83. package/simsimd/CONTRIBUTING.md +114 -0
  84. package/simsimd/Cargo.lock +709 -0
  85. package/simsimd/Cargo.toml +44 -0
  86. package/simsimd/LICENSE +201 -0
  87. package/simsimd/README.md +708 -0
  88. package/simsimd/binding.gyp +36 -0
  89. package/simsimd/build.rs +51 -0
  90. package/simsimd/c/lib.c +110 -0
  91. package/simsimd/include/simsimd/binary.h +258 -0
  92. package/simsimd/include/simsimd/dot.h +1237 -0
  93. package/simsimd/include/simsimd/geospatial.h +37 -0
  94. package/simsimd/include/simsimd/probability.h +563 -0
  95. package/simsimd/include/simsimd/simsimd.h +1129 -0
  96. package/simsimd/include/simsimd/spatial.h +1019 -0
  97. package/simsimd/include/simsimd/types.h +309 -0
  98. package/simsimd/javascript/bench.js +127 -0
  99. package/simsimd/javascript/dist-package-cjs.json +3 -0
  100. package/simsimd/javascript/dist-package-esm.json +3 -0
  101. package/simsimd/javascript/fallback.ts +203 -0
  102. package/simsimd/javascript/lib.c +107 -0
  103. package/simsimd/javascript/node-gyp-build.d.ts +1 -0
  104. package/simsimd/javascript/simsimd.ts +135 -0
  105. package/simsimd/javascript/test.mjs +179 -0
  106. package/simsimd/javascript/tsconfig-base.json +37 -0
  107. package/simsimd/javascript/tsconfig-cjs.json +8 -0
  108. package/simsimd/javascript/tsconfig-esm.json +8 -0
  109. package/simsimd/package-lock.json +1709 -0
  110. package/simsimd/package.json +61 -0
  111. package/simsimd/rust/benches/cosine.rs +27 -0
  112. package/simsimd/rust/benches/native.rs +30 -0
  113. package/simsimd/rust/benches/sqeuclidean.rs +27 -0
  114. 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
+