Repository navigation
Pari 0.3.0 alpha
Pre-releasePari 0.3.0 alpha
Pari 0.3.0 alpha makes saving large persistent indexes 2.5 times faster with
30% less peak memory, adds similarity scores to the in-memory and read-only
lazy indexes, and adds a getting-started tutorial.
Installation
python -m pip install "pari-similarity==0.3.0"
cargo add pari-core@0.3.0 pari-index@0.3.0 pari-store@0.3.0Python imports remain import pari. Keep all four public Rust crates on the
same release version. CLI archives, checksums, and the dependency SBOM are
attached to this release with GitHub build provenance attestations.
Faster, lighter persistent commits
Persistent commits now stream the snapshot to disk one section at a time
instead of assembling the whole file in memory, and sort bucket memberships in
parallel. This affects PersistentIndex32, PersistentIndex64, Index,
Index64, DedupeIndex(backend="local"), and pari index. Snapshot bytes are
unchanged, so files written by 0.3.0 and 0.2.x are interchangeable.
Measured on the same dedicated 12-vCPU, 130 GiB host as the 0.2.2 evidence:
| 10M items | 0.2.2 | 0.3.0 |
|---|---|---|
| Persistent construction | 345.97 s | 136.78 s |
| Peak RSS during persistent construction | 36.16 GiB | 25.37 GiB |
DedupeIndex(backend="local") close |
315.2 s | 147.2 s |
DedupeIndex(backend="local") peak RSS |
37.08 GiB | 26.72 GiB |
Both 10M and 1M bundles passed scalar/batch, persistent/lazy, and persistent
mutation candidate parity before their timings were accepted.
Scored queries everywhere
- In-memory
LshIndex32/LshIndex64built withwith_signature_storage()
answerquery_scoredandquery_scored_many, returning each candidate with
its estimated Jaccard similarity, filtered byScoreFilter. - Read-only
LazyIndex32/LazyIndex64answer the same scored queries from
files written with stored signatures, reading only the signature rows of the
candidates they score.
Tutorial
The new tutorial deduplicates a CSV of product titles and
searches the kept rows by similarity in about five minutes. It walks through
the runnable examples/quickstart.py, which a test executes on every change.
Upgrading from 0.2
Python code needs no changes. Rust code may need these:
ScoreFilterandScoredCandidatenow live inpari-index. They are still
re-exported frompari-store, so existing imports keep working.ScoreFilter::validatereturnsResult<(), ScoreFilterError>instead of
Result<(), StoreError>.?inside a function returningStoreErrorstill
works through the newFrom<ScoreFilterError>conversion; code that matched
on the returnedStoreErrorshould match onScoreFilterError::reason().LshErrorgainsSignaturesUnavailableandInvalidScoreFilter, and
LazyStoreErrorgainsSignature,SignaturesUnavailable, and
InvalidScoreFilter. Exhaustivematchstatements over these enums need
new arms or a wildcard.
Compatibility
.pari format version 1, the affine32/affine64 signature identities, and CLI
machine-output revision 1 retain their contracts. Public crates retain Rust
1.81; the Python extension retains Rust 1.83 and CPython 3.10+ abi3 wheels.
This is an alpha release. See the
compatibility policy.