torann 0.2.1__tar.gz

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 (55) hide show
  1. torann-0.2.1/.cargo/config.toml +13 -0
  2. torann-0.2.1/.github/workflows/docs.yml +87 -0
  3. torann-0.2.1/.github/workflows/main.yml +84 -0
  4. torann-0.2.1/.github/workflows/publish.yml +127 -0
  5. torann-0.2.1/.gitignore +31 -0
  6. torann-0.2.1/CITATION.cff +25 -0
  7. torann-0.2.1/Cargo.lock +306 -0
  8. torann-0.2.1/Cargo.toml +21 -0
  9. torann-0.2.1/LICENSE +21 -0
  10. torann-0.2.1/PKG-INFO +261 -0
  11. torann-0.2.1/README.md +232 -0
  12. torann-0.2.1/assets/bench_ess.png +0 -0
  13. torann-0.2.1/assets/bench_query.png +0 -0
  14. torann-0.2.1/assets/logo.svg +54 -0
  15. torann-0.2.1/assets/method_collision.png +0 -0
  16. torann-0.2.1/assets/method_hash.png +0 -0
  17. torann-0.2.1/assets/method_index.svg +93 -0
  18. torann-0.2.1/assets/method_region.png +0 -0
  19. torann-0.2.1/assets/region.gif +0 -0
  20. torann-0.2.1/examples/bench_backends.py +145 -0
  21. torann-0.2.1/examples/bench_ess_quality.py +182 -0
  22. torann-0.2.1/examples/bench_ess_suite.py +237 -0
  23. torann-0.2.1/examples/bench_lifecycle.py +128 -0
  24. torann-0.2.1/examples/bench_recall_ablation.py +291 -0
  25. torann-0.2.1/examples/bench_refine_rounds.py +168 -0
  26. torann-0.2.1/examples/benchmark.py +414 -0
  27. torann-0.2.1/examples/compare_faiss.py +102 -0
  28. torann-0.2.1/examples/compare_faiss_flat.py +108 -0
  29. torann-0.2.1/examples/crossover.py +96 -0
  30. torann-0.2.1/examples/ess_sim.py +227 -0
  31. torann-0.2.1/examples/figures.py +167 -0
  32. torann-0.2.1/examples/lifecycle_backends.py +117 -0
  33. torann-0.2.1/examples/out/recall_ablation.html +342 -0
  34. torann-0.2.1/examples/out/session_report.html +519 -0
  35. torann-0.2.1/examples/plot_benchmarks.py +106 -0
  36. torann-0.2.1/examples/report_recall_ablation.py +478 -0
  37. torann-0.2.1/examples/report_session.py +606 -0
  38. torann-0.2.1/exploration/exp_1d.py +149 -0
  39. torann-0.2.1/exploration/exp_2d.py +168 -0
  40. torann-0.2.1/exploration/exp_cellsize.py +116 -0
  41. torann-0.2.1/exploration/exp_lp_recall.py +97 -0
  42. torann-0.2.1/exploration/exp_metric_contrast.py +119 -0
  43. torann-0.2.1/exploration/exp_update.py +112 -0
  44. torann-0.2.1/exploration/vizstyle.py +44 -0
  45. torann-0.2.1/pyproject.toml +64 -0
  46. torann-0.2.1/requirements.txt +1 -0
  47. torann-0.2.1/src/lib.rs +1512 -0
  48. torann-0.2.1/test/__init__.py +0 -0
  49. torann-0.2.1/test/test_torann.py +581 -0
  50. torann-0.2.1/torann/__init__.py +35 -0
  51. torann-0.2.1/torann/base.py +68 -0
  52. torann-0.2.1/torann/brute.py +208 -0
  53. torann-0.2.1/torann/lsh.py +368 -0
  54. torann-0.2.1/torann/rust.py +95 -0
  55. torann-0.2.1/torann/wrapper.py +472 -0
@@ -0,0 +1,13 @@
1
+ # Local builds use the same ISA floor the published x86-64 wheels do, so a
2
+ # number measured here is a number a user gets. `target-cpu=native` was the
3
+ # previous setting and is not worth restoring: measured on the reference
4
+ # shape (n=50k, d=32, k=5), native and this floor are 404 ms and 406 ms —
5
+ # the native build really does emit AVX-512, and it buys nothing over AVX2.
6
+ # Baseline x86-64 is 542 ms, because `wide::f32x8` has no 256-bit register to
7
+ # lower to and falls back to two `f32x4`.
8
+ #
9
+ # Building on a pre-AVX2 CPU: override with
10
+ # RUSTFLAGS="-C target-cpu=native" cargo build --release
11
+ # (the environment variable replaces this section wholesale).
12
+ [target.'cfg(any(target_arch = "x86_64", target_arch = "x86"))']
13
+ rustflags = ["-C", "target-feature=+avx2,+fma"]
@@ -0,0 +1,87 @@
1
+ name: Generate and Deploy Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ # Allow one concurrent deployment
15
+ concurrency:
16
+ group: "pages"
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+ deploy:
21
+ environment:
22
+ name: github-pages
23
+ url: ${{ steps.deployment.outputs.page_url }}
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Checkout
27
+ uses: actions/checkout@v4
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.12"
33
+ cache: "pip"
34
+
35
+ - name: Set up Rust
36
+ uses: dtolnay/rust-toolchain@stable
37
+
38
+ - name: Install dependencies
39
+ run: |
40
+ python -m pip install --upgrade pip
41
+ pip install pdoc numpy
42
+ pip install .
43
+
44
+ - name: Generate Docs
45
+ run: |
46
+ pdoc --math -d google -o docs_build \
47
+ torann torann.wrapper torann.base torann.brute torann.lsh torann.rust \
48
+ --logo "assets/logo.svg" \
49
+ --favicon "assets/logo.svg"
50
+ # The logo is resolved relative to each page: copy the assets both
51
+ # to the root (torann.html) and beside the submodule pages
52
+ # (torann/*.html) so it appears correctly everywhere.
53
+ cp -r assets docs_build/assets
54
+ cp -r assets docs_build/torann/assets
55
+ touch docs_build/.nojekyll
56
+
57
+ # Dropping either copy leaves a set of pages with a broken logo, and
58
+ # nothing else would notice: the build still succeeds and the site
59
+ # still deploys. Verified here rather than by eye.
60
+ - name: Every page must resolve its logo
61
+ run: |
62
+ python - <<'PY'
63
+ import pathlib, re, sys
64
+ root = pathlib.Path("docs_build")
65
+ pages = list(root.rglob("*.html"))
66
+ missing = [f"{p.relative_to(root)} -> {r}" for p in pages
67
+ for r in set(re.findall(r'(?:src|href)="([^"]*logo\.svg)"',
68
+ p.read_text()))
69
+ if not (p.parent / r).exists()]
70
+ if missing:
71
+ print("::error::logo references that do not resolve:")
72
+ print("\n".join(missing))
73
+ sys.exit(1)
74
+ print(f"checked {len(pages)} pages, all logo references resolve")
75
+ PY
76
+
77
+ - name: Setup Pages
78
+ uses: actions/configure-pages@v4
79
+
80
+ - name: Upload Artifact
81
+ uses: actions/upload-pages-artifact@v3
82
+ with:
83
+ path: 'docs_build'
84
+
85
+ - name: Deploy to GitHub Pages
86
+ id: deployment
87
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,84 @@
1
+ name: Python CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.12", "3.14"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ cache: "pip"
24
+
25
+ - name: Set up Rust
26
+ uses: dtolnay/rust-toolchain@stable
27
+
28
+ - name: Install dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ pip install ruff basedpyright vulture
32
+ pip install .
33
+
34
+ - name: Lint with Ruff
35
+ run: ruff check torann
36
+
37
+ - name: Type-check with basedpyright
38
+ run: basedpyright
39
+
40
+ - name: Dead code with Vulture
41
+ run: vulture
42
+
43
+ - name: Run tests
44
+ run: python -m unittest discover -s test
45
+
46
+ # The Rust core gets the same treatment: rustfmt + clippy as errors.
47
+ lint-rust:
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+
52
+ - name: Set up Rust
53
+ uses: dtolnay/rust-toolchain@stable
54
+ with:
55
+ components: rustfmt, clippy
56
+
57
+ - name: Format check
58
+ run: cargo fmt --check
59
+
60
+ - name: Clippy
61
+ run: cargo clippy --release -- -D warnings
62
+
63
+ # The package must keep working without the compiled module: this job
64
+ # runs the same suite against the pure-Python reference implementation.
65
+ # It is also what backs the AVX2 gate in `torann/rust.py` — a CPU without
66
+ # AVX2 lands on exactly this path, so it has to stay green.
67
+ test-pure-python:
68
+ runs-on: ubuntu-latest
69
+ steps:
70
+ - uses: actions/checkout@v4
71
+
72
+ - name: Set up Python
73
+ uses: actions/setup-python@v5
74
+ with:
75
+ python-version: "3.12"
76
+ cache: "pip"
77
+
78
+ - name: Install dependencies
79
+ run: |
80
+ python -m pip install --upgrade pip
81
+ pip install numpy
82
+
83
+ - name: Run tests (python backend only)
84
+ run: python -m unittest discover -s test
@@ -0,0 +1,127 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ # The wheels are built with maturin (mixed Rust/Python package).
11
+ #
12
+ # x86-64 wheels are built with an **AVX2 + FMA floor**, which the committed
13
+ # .cargo/config.toml already applies, so these jobs leave it alone. That
14
+ # floor is worth 25% and is not optional in practice: without AVX there is
15
+ # no 256-bit register for `wide::f32x8` to lower to, it falls back to two
16
+ # `f32x4`, and the query kernel goes 406 ms -> 542 ms on the reference shape.
17
+ # AVX-512 buys nothing further, so there is no third variant to build.
18
+ #
19
+ # These jobs previously did `rm -f .cargo/config.toml` to strip a
20
+ # `target-cpu=native` setting. That removed the crash risk *and* the 25%:
21
+ # every wheel published that way ran the SSE fallback. Portability is now
22
+ # handled where it belongs, at import — `torann/rust.py` checks for AVX2 and
23
+ # falls back to the pure-Python backend rather than taking SIGILL.
24
+ #
25
+ # aarch64 needs no flags: NEON is baseline on arm64 and the config section is
26
+ # gated on x86, so it does not apply there.
27
+
28
+ jobs:
29
+ wheels-linux:
30
+ runs-on: ubuntu-latest
31
+ strategy:
32
+ fail-fast: false
33
+ matrix:
34
+ target: [x86_64, aarch64]
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - name: Build wheels
38
+ uses: PyO3/maturin-action@v1
39
+ with:
40
+ target: ${{ matrix.target }}
41
+ args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
42
+ manylinux: auto
43
+ # The bug this replaced was a wheel that silently lost its AVX2 floor,
44
+ # so assert the floor is in the artifact rather than trusting the
45
+ # config to have been picked up through maturin's container. Every
46
+ # wheel is checked, not just one: `dist/*.whl` is one wheel per
47
+ # interpreter, and they are separate builds.
48
+ - name: Verify the x86-64 wheels carry the AVX2 floor
49
+ if: matrix.target == 'x86_64'
50
+ run: |
51
+ set -euo pipefail
52
+ for whl in dist/*.whl; do
53
+ rm -rf /tmp/whl && mkdir -p /tmp/whl
54
+ python -m zipfile -e "$whl" /tmp/whl
55
+ find /tmp/whl -name '_native*.so' | while read -r so; do
56
+ n=$(objdump -d "$so" | grep -c '%ymm' || true)
57
+ echo "$(basename "$whl"): $n 256-bit instructions"
58
+ if [ "$n" -eq 0 ]; then
59
+ echo "::error::$(basename "$whl") has no AVX2 code"
60
+ exit 1
61
+ fi
62
+ done
63
+ done
64
+ - uses: actions/upload-artifact@v4
65
+ with:
66
+ name: wheels-linux-${{ matrix.target }}
67
+ path: dist
68
+
69
+ wheels-macos:
70
+ runs-on: macos-latest
71
+ strategy:
72
+ fail-fast: false
73
+ matrix:
74
+ target: [x86_64, aarch64]
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+ - name: Build wheels
78
+ uses: PyO3/maturin-action@v1
79
+ with:
80
+ target: ${{ matrix.target }}
81
+ args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
82
+ - uses: actions/upload-artifact@v4
83
+ with:
84
+ name: wheels-macos-${{ matrix.target }}
85
+ path: dist
86
+
87
+ wheels-windows:
88
+ runs-on: windows-latest
89
+ steps:
90
+ - uses: actions/checkout@v4
91
+ - name: Build wheels
92
+ uses: PyO3/maturin-action@v1
93
+ with:
94
+ target: x64
95
+ args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
96
+ - uses: actions/upload-artifact@v4
97
+ with:
98
+ name: wheels-windows-x64
99
+ path: dist
100
+
101
+ sdist:
102
+ runs-on: ubuntu-latest
103
+ steps:
104
+ - uses: actions/checkout@v4
105
+ - name: Build sdist
106
+ uses: PyO3/maturin-action@v1
107
+ with:
108
+ command: sdist
109
+ args: --out dist
110
+ - uses: actions/upload-artifact@v4
111
+ with:
112
+ name: sdist
113
+ path: dist
114
+
115
+ publish:
116
+ needs: [wheels-linux, wheels-macos, wheels-windows, sdist]
117
+ runs-on: ubuntu-latest
118
+ steps:
119
+ - uses: actions/download-artifact@v4
120
+ with:
121
+ path: dist
122
+ merge-multiple: true
123
+
124
+ - name: Publish to PyPI
125
+ uses: pypa/gh-action-pypi-publish@release/v1
126
+ with:
127
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,31 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv/
4
+ dist/
5
+ build/
6
+ *.egg-info/
7
+ *.so
8
+ target/
9
+ examples/out/
10
+ exploration/out/
11
+
12
+ # Benchmark and exploration results: regenerate them, never review them.
13
+ *.json
14
+
15
+ # Working notes: session handoffs, plans, measurement logs. They record
16
+ # intermediate results and are rewritten constantly, so they are kept on
17
+ # disk rather than in history. README.md is documentation and stays.
18
+ *.md
19
+ !README.md
20
+
21
+ # Generated documentation. Built by .github/workflows/docs.yml and pushed
22
+ # straight to Pages -- it exists on GitHub and nowhere else, so generated
23
+ # HTML never lands in a diff, a review, or a working tree.
24
+ docs/
25
+ docs_build/
26
+
27
+ # Agent scratch
28
+ .claude/
29
+ .goose/
30
+ .goosehints
31
+ .agy/
@@ -0,0 +1,25 @@
1
+ cff-version: 1.2.0
2
+ title: torann
3
+ message: >-
4
+ If you use this software, please cite it using the
5
+ metadata from this file.
6
+ type: software
7
+ authors:
8
+ - given-names: Mário
9
+ family-names: Antunes
10
+ email: mario.antunes@ua.pt
11
+ affiliation: University of Aveiro
12
+ orcid: 'https://orcid.org/0000-0002-6504-9441'
13
+ abstract: >-
14
+ TORoidal Approximate Nearest Neighbours — exact and
15
+ LSH-based k-NN and range search under toroidal L1 on the
16
+ unit torus, built for Empty-Space-Search (ESS) epoch
17
+ workloads.
18
+ keywords:
19
+ - nearest-neighbours
20
+ - locality-sensitive-hashing
21
+ - torus
22
+ - L1
23
+ - high-dimensional
24
+ license: MIT
25
+ repository-code: 'https://github.com/mariolpantunes/torann'
@@ -0,0 +1,306 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.5.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
10
+
11
+ [[package]]
12
+ name = "bytemuck"
13
+ version = "1.25.2"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
16
+
17
+ [[package]]
18
+ name = "crossbeam-deque"
19
+ version = "0.8.7"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb"
22
+ dependencies = [
23
+ "crossbeam-epoch",
24
+ "crossbeam-utils",
25
+ ]
26
+
27
+ [[package]]
28
+ name = "crossbeam-epoch"
29
+ version = "0.9.20"
30
+ source = "registry+https://github.com/rust-lang/crates.io-index"
31
+ checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f"
32
+ dependencies = [
33
+ "crossbeam-utils",
34
+ ]
35
+
36
+ [[package]]
37
+ name = "crossbeam-utils"
38
+ version = "0.8.22"
39
+ source = "registry+https://github.com/rust-lang/crates.io-index"
40
+ checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
41
+
42
+ [[package]]
43
+ name = "either"
44
+ version = "1.16.0"
45
+ source = "registry+https://github.com/rust-lang/crates.io-index"
46
+ checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
47
+
48
+ [[package]]
49
+ name = "heck"
50
+ version = "0.5.0"
51
+ source = "registry+https://github.com/rust-lang/crates.io-index"
52
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
53
+
54
+ [[package]]
55
+ name = "libc"
56
+ version = "0.2.186"
57
+ source = "registry+https://github.com/rust-lang/crates.io-index"
58
+ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
59
+
60
+ [[package]]
61
+ name = "matrixmultiply"
62
+ version = "0.3.11"
63
+ source = "registry+https://github.com/rust-lang/crates.io-index"
64
+ checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
65
+ dependencies = [
66
+ "autocfg",
67
+ "rawpointer",
68
+ ]
69
+
70
+ [[package]]
71
+ name = "ndarray"
72
+ version = "0.17.2"
73
+ source = "registry+https://github.com/rust-lang/crates.io-index"
74
+ checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
75
+ dependencies = [
76
+ "matrixmultiply",
77
+ "num-complex",
78
+ "num-integer",
79
+ "num-traits",
80
+ "portable-atomic",
81
+ "portable-atomic-util",
82
+ "rawpointer",
83
+ ]
84
+
85
+ [[package]]
86
+ name = "num-complex"
87
+ version = "0.4.6"
88
+ source = "registry+https://github.com/rust-lang/crates.io-index"
89
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
90
+ dependencies = [
91
+ "num-traits",
92
+ ]
93
+
94
+ [[package]]
95
+ name = "num-integer"
96
+ version = "0.1.46"
97
+ source = "registry+https://github.com/rust-lang/crates.io-index"
98
+ checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
99
+ dependencies = [
100
+ "num-traits",
101
+ ]
102
+
103
+ [[package]]
104
+ name = "num-traits"
105
+ version = "0.2.19"
106
+ source = "registry+https://github.com/rust-lang/crates.io-index"
107
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
108
+ dependencies = [
109
+ "autocfg",
110
+ ]
111
+
112
+ [[package]]
113
+ name = "numpy"
114
+ version = "0.29.0"
115
+ source = "registry+https://github.com/rust-lang/crates.io-index"
116
+ checksum = "6a5b15d63a5ff39e378daed0e1340d3a5964703ea9712eb09a0dc66fade996f4"
117
+ dependencies = [
118
+ "libc",
119
+ "ndarray",
120
+ "num-complex",
121
+ "num-integer",
122
+ "num-traits",
123
+ "pyo3",
124
+ "pyo3-build-config",
125
+ "rustc-hash",
126
+ ]
127
+
128
+ [[package]]
129
+ name = "once_cell"
130
+ version = "1.21.4"
131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
132
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
133
+
134
+ [[package]]
135
+ name = "portable-atomic"
136
+ version = "1.13.1"
137
+ source = "registry+https://github.com/rust-lang/crates.io-index"
138
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
139
+
140
+ [[package]]
141
+ name = "portable-atomic-util"
142
+ version = "0.2.7"
143
+ source = "registry+https://github.com/rust-lang/crates.io-index"
144
+ checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618"
145
+ dependencies = [
146
+ "portable-atomic",
147
+ ]
148
+
149
+ [[package]]
150
+ name = "proc-macro2"
151
+ version = "1.0.106"
152
+ source = "registry+https://github.com/rust-lang/crates.io-index"
153
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
154
+ dependencies = [
155
+ "unicode-ident",
156
+ ]
157
+
158
+ [[package]]
159
+ name = "pyo3"
160
+ version = "0.29.0"
161
+ source = "registry+https://github.com/rust-lang/crates.io-index"
162
+ checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
163
+ dependencies = [
164
+ "libc",
165
+ "once_cell",
166
+ "portable-atomic",
167
+ "pyo3-build-config",
168
+ "pyo3-ffi",
169
+ "pyo3-macros",
170
+ ]
171
+
172
+ [[package]]
173
+ name = "pyo3-build-config"
174
+ version = "0.29.0"
175
+ source = "registry+https://github.com/rust-lang/crates.io-index"
176
+ checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
177
+ dependencies = [
178
+ "target-lexicon",
179
+ ]
180
+
181
+ [[package]]
182
+ name = "pyo3-ffi"
183
+ version = "0.29.0"
184
+ source = "registry+https://github.com/rust-lang/crates.io-index"
185
+ checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
186
+ dependencies = [
187
+ "libc",
188
+ "pyo3-build-config",
189
+ ]
190
+
191
+ [[package]]
192
+ name = "pyo3-macros"
193
+ version = "0.29.0"
194
+ source = "registry+https://github.com/rust-lang/crates.io-index"
195
+ checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
196
+ dependencies = [
197
+ "proc-macro2",
198
+ "pyo3-macros-backend",
199
+ "quote",
200
+ "syn",
201
+ ]
202
+
203
+ [[package]]
204
+ name = "pyo3-macros-backend"
205
+ version = "0.29.0"
206
+ source = "registry+https://github.com/rust-lang/crates.io-index"
207
+ checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
208
+ dependencies = [
209
+ "heck",
210
+ "proc-macro2",
211
+ "quote",
212
+ "syn",
213
+ ]
214
+
215
+ [[package]]
216
+ name = "quote"
217
+ version = "1.0.46"
218
+ source = "registry+https://github.com/rust-lang/crates.io-index"
219
+ checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
220
+ dependencies = [
221
+ "proc-macro2",
222
+ ]
223
+
224
+ [[package]]
225
+ name = "rawpointer"
226
+ version = "0.2.1"
227
+ source = "registry+https://github.com/rust-lang/crates.io-index"
228
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
229
+
230
+ [[package]]
231
+ name = "rayon"
232
+ version = "1.12.0"
233
+ source = "registry+https://github.com/rust-lang/crates.io-index"
234
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
235
+ dependencies = [
236
+ "either",
237
+ "rayon-core",
238
+ ]
239
+
240
+ [[package]]
241
+ name = "rayon-core"
242
+ version = "1.13.0"
243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
244
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
245
+ dependencies = [
246
+ "crossbeam-deque",
247
+ "crossbeam-utils",
248
+ ]
249
+
250
+ [[package]]
251
+ name = "rustc-hash"
252
+ version = "2.1.3"
253
+ source = "registry+https://github.com/rust-lang/crates.io-index"
254
+ checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
255
+
256
+ [[package]]
257
+ name = "safe_arch"
258
+ version = "1.1.0"
259
+ source = "registry+https://github.com/rust-lang/crates.io-index"
260
+ checksum = "3a52ec151f024d703f9fd65abb7cbe81e7cdb39f18917a3a37e3014470dc7c59"
261
+ dependencies = [
262
+ "bytemuck",
263
+ ]
264
+
265
+ [[package]]
266
+ name = "syn"
267
+ version = "2.0.118"
268
+ source = "registry+https://github.com/rust-lang/crates.io-index"
269
+ checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
270
+ dependencies = [
271
+ "proc-macro2",
272
+ "quote",
273
+ "unicode-ident",
274
+ ]
275
+
276
+ [[package]]
277
+ name = "target-lexicon"
278
+ version = "0.13.5"
279
+ source = "registry+https://github.com/rust-lang/crates.io-index"
280
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
281
+
282
+ [[package]]
283
+ name = "torann"
284
+ version = "0.2.1"
285
+ dependencies = [
286
+ "numpy",
287
+ "pyo3",
288
+ "rayon",
289
+ "wide",
290
+ ]
291
+
292
+ [[package]]
293
+ name = "unicode-ident"
294
+ version = "1.0.24"
295
+ source = "registry+https://github.com/rust-lang/crates.io-index"
296
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
297
+
298
+ [[package]]
299
+ name = "wide"
300
+ version = "1.5.0"
301
+ source = "registry+https://github.com/rust-lang/crates.io-index"
302
+ checksum = "dfdfe6a32973f2d1b268b8895845a8a96cac2f0191e72c27cc929036060dbf89"
303
+ dependencies = [
304
+ "bytemuck",
305
+ "safe_arch",
306
+ ]
@@ -0,0 +1,21 @@
1
+ [package]
2
+ name = "torann"
3
+ version = "0.2.1"
4
+ edition = "2021"
5
+ description = "Rust core of torann — toroidal L1 LSH index"
6
+ readme = "README.md"
7
+
8
+ [lib]
9
+ name = "torann"
10
+ crate-type = ["cdylib"]
11
+
12
+ [dependencies]
13
+ pyo3 = { version = "0.29", features = ["extension-module"] }
14
+ numpy = "0.29"
15
+ rayon = "1.12"
16
+ wide = "1.5.0"
17
+
18
+ [profile.release]
19
+ opt-level = 3
20
+ lto = true
21
+ codegen-units = 1