From 42eb3270a8f64a9a4a946fb2324e3e9e721550d6 Mon Sep 17 00:00:00 2001 From: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:13:32 +0000 Subject: [PATCH 1/5] Make: Upgrade Gradle CI --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d111df6e..4e4c1fcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -614,7 +614,7 @@ jobs: publish_java: name: Publish Java needs: versioning - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: contents: read packages: write @@ -633,12 +633,12 @@ jobs: - name: Pull Git submodules run: git submodule update --init --recursive - name: Set up Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v4.5.0 with: java-version: "21" distribution: "adopt" - name: Setup Gradle - uses: gradle/gradle-build-action@v2.4.2 + uses: gradle/gradle-build-action@v3.5.0 - name: Execute Gradle build run: gradle sign && gradle build - name: Publish package From e7c9e2929040aca503b41fd31b9261f8430e7ec5 Mon Sep 17 00:00:00 2001 From: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:32:05 +0000 Subject: [PATCH 2/5] Make: Upgrade SimSIMD & StringZilla --- include/usearch/index_plugins.hpp | 9 +++++---- simsimd | 2 +- stringzilla | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/usearch/index_plugins.hpp b/include/usearch/index_plugins.hpp index 8da701f0..94d050d2 100644 --- a/include/usearch/index_plugins.hpp +++ b/include/usearch/index_plugins.hpp @@ -1651,7 +1651,7 @@ enum class metric_punned_signature_t { /** * @brief Type-punned metric class, which unlike STL's `std::function` avoids any memory allocations. * It also provides additional APIs to check, if SIMD hardware-acceleration is available. - * Wraps the `simsimd_metric_punned_t` when available. The auto-vectorized backend otherwise. + * Wraps the `simsimd_metric_dense_punned_t` when available. The auto-vectorized backend otherwise. */ class metric_punned_t { public: @@ -1860,9 +1860,10 @@ class metric_punned_t { case scalar_kind_t::b1x8_k: datatype = simsimd_datatype_b8_k; break; default: break; } - simsimd_metric_punned_t simd_metric = NULL; + simsimd_metric_dense_punned_t simd_metric = NULL; simsimd_capability_t simd_kind = simsimd_cap_any_k; - simsimd_find_metric_punned(kind, datatype, simd_caps, allowed, &simd_metric, &simd_kind); + simsimd_find_kernel_punned(kind, datatype, simd_caps, allowed, (simsimd_kernel_punned_t*)&simd_metric, + &simd_kind); if (simd_metric == nullptr) return false; @@ -1885,7 +1886,7 @@ class metric_punned_t { invoke_simsimd(uptr_t a, uptr_t b) const noexcept { simsimd_distance_t result; // Here `reinterpret_cast` raises warning and UBSan reports an issue... we know what we are doing! - auto function_pointer = (simsimd_metric_punned_t)(metric_ptr_); + auto function_pointer = (simsimd_metric_dense_punned_t)(metric_ptr_); function_pointer(reinterpret_cast(a), reinterpret_cast(b), metric_third_arg_, &result); return (result_t)result; diff --git a/simsimd b/simsimd index 935fef29..c1244103 160000 --- a/simsimd +++ b/simsimd @@ -1 +1 @@ -Subproject commit 935fef2964bc38e995c5f465b42259a35b8cf0d3 +Subproject commit c12441039d7dbc8dabdf750779117bae8c55732d diff --git a/stringzilla b/stringzilla index 91d0a1a0..30d3e212 160000 --- a/stringzilla +++ b/stringzilla @@ -1 +1 @@ -Subproject commit 91d0a1a02faae90a41c60a30855d5935eb3eaef1 +Subproject commit 30d3e2129654d8269b3f66726414f9694c834e25 From c6c75de81298d565f1030290d265c5128427f394 Mon Sep 17 00:00:00 2001 From: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:34:51 +0000 Subject: [PATCH 3/5] Fix: Interface name spelling --- javascript/usearch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/usearch.ts b/javascript/usearch.ts index a04ca1aa..a91eb783 100644 --- a/javascript/usearch.ts +++ b/javascript/usearch.ts @@ -203,7 +203,7 @@ function normalizeVectors( return flattenedVectors; } -export interface IndexCongif { +export interface IndexConfig { dimensions: number; metric: MetricKind; quantization: ScalarKind; @@ -227,7 +227,7 @@ export class Index { * @throws Will throw an error if any of the parameters are of incorrect type or invalid value. */ constructor( - dimensionsOrConfigs: number | bigint | IndexCongif, + dimensionsOrConfigs: number | bigint | IndexConfig, metric: MetricKind = MetricKind.Cos, quantization: ScalarKind = ScalarKind.F32, connectivity: number = 0, From fed4d98e2585de125a7ff54c8cf7f4df82fdccd5 Mon Sep 17 00:00:00 2001 From: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:41:34 +0000 Subject: [PATCH 4/5] Make: Bump PyPi dependency --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 643796fe..11949c4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ requires = [ "cmake>=3.22", "pybind11", "numpy", - "simsimd>=5.9.3,<6.0.0", + "simsimd>=6.0.5,<7.0.0", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 61c85d6d..929c8b52 100644 --- a/setup.py +++ b/setup.py @@ -162,7 +162,7 @@ def get_bool_env_w_name(name: str, preference: bool) -> tuple: ] if use_simsimd: include_dirs.append("simsimd/include") - install_requires.append("simsimd>=5.9.3,<6.0.0") + install_requires.append("simsimd>=6.0.5,<7.0.0") if use_fp16lib: include_dirs.append("fp16/include") From 12b84112155caff92182568ba766818d969c10a4 Mon Sep 17 00:00:00 2001 From: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com> Date: Mon, 18 Nov 2024 20:00:34 +0000 Subject: [PATCH 5/5] Make: Python 3.13 support Closes #530 Co-authored-by: James Braza <8990777+jamesbraza@users.noreply.github.com> --- .github/workflows/prerelease.yml | 2 +- .github/workflows/release.yml | 2 +- pyproject.toml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 3472977f..428ce2a0 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -390,7 +390,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["37", "38", "39", "310", "311", "312"] + python-version: ["37", "38", "39", "310", "311", "312", "313"] steps: - uses: actions/checkout@v4 - name: Set up Python diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e4c1fcf..68a0656b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -420,7 +420,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["37", "38", "39", "310", "311", "312"] + python-version: ["37", "38", "39", "310", "311", "312", "313"] steps: - name: Check out refreshed version uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 11949c4e..f3855f22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ -# This file configures wheels compilation for `cibuilwheel` for StringZilla CPython bindings. +# This file configures wheels compilation for `cibuilwheel` for USearch CPython bindings. # On a good day it will produce: # - `macos` wheels for x86_64, arm64, and universal2; # - `windows` wheels for AMD64, and ARM64. But not x86. # - `manylinux` and `musllinux` wheels for Linux on x86_64, aarch64. But not i686, ppc64le, s390x; -# * for CPython versions from 3.7 to 3.12. +# * for CPython versions from 3.7 to 3.13. # * for PyPy versions from 3.7 to 3.10. -# = meaning 7 platforms * 10 Python versions = 70 builds. +# = meaning 7 platforms * 11 Python versions = 77 builds. [build-system] requires = [ "setuptools>=42", @@ -90,4 +90,4 @@ before-build = [ # https://black.readthedocs.io/en/latest/usage_and_configuration/the_basics.html#where-black-looks-for-the-file [tool.black] line-length = 120 # Set line length to the same value as in `.clang-format` for modern wide screens -target-version = ['py36', 'py312'] +target-version = ['py36', 'py313']