v0.2.0: Early termination + rayon parallelism for high-dim performance#1
Merged
Merged
Conversation
…ormance Spatial index query_radius now uses early termination for Euclidean distance: squared differences are accumulated in chunks of 4 dimensions and bailed out early when the partial sum exceeds eps². For 996-dim embeddings with eps=1.2, most non-neighbor pairs are rejected after ~5-15% of dimensions. Above 1000 points, the brute-force scan is parallelized across CPU cores via rayon. Below that threshold, sequential scan avoids thread pool overhead. Benchmark (10 batches x 1500 points, 996-dim, eps=1.2): v0.1.0: 160.2s total v0.2.0: 24.9s total (6.4x faster) Bump version to 0.2.0 across Cargo.toml, pyproject.toml, and __init__.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Build wheels for Linux (x86_64, aarch64), macOS (x86_64, aarch64), and Windows (x86_64) on every push/PR. This catches packaging failures before merge rather than at release time. No publishing — just build verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Linux aarch64 cross-compilation container lacks Python interpreters, causing maturin to fail. Specify -i 3.12 explicitly (matching the release workflow pattern). One version is sufficient to verify the build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo bench --bench batch_scaling): 10 batches x 1,500 points, 996-dim L2-normalized vectors.__init__.py.Benchmark results (10 batches x 1500 points, 996-dim, eps=1.2)
Test plan
test_early_termination_correctness)🤖 Generated with Claude Code