Skip to content

v0.2.0

Choose a tag to compare

@titusz titusz released this 08 Feb 15:57
· 73 commits to main since this release
eb8b21f

Added

  • ShardedIndex128 — sharded index with 128-bit UUID keys (bytes(16) / np.dtype('V16'))
  • ShardedNphdIndex128 — sharded NPHD index with 128-bit UUID keys for variable-length vectors
  • _UuidKeyMixin providing key-handling hooks, validation, and dispatch for all 128-bit subclasses
  • ScalableBloomFilter support for bytes keys (add, contains, add_batch, contains_batch)
  • Strict validation on 128-bit key operations — wrong key type, length, or dtype raises ValueError
  • upsert() support for 128-bit UUID keys (single bytes(16) and batch V16 ndarray)
  • Python 3.10 and 3.11 support

Changed

  • Extract 6 key-handling hook methods on ShardedIndex (_is_single_key, _bloom_key, _bloom_keys, _normalize_batch_keys, _shard_batch_keys, _key_dtype) for subclass customization
  • Remove UUID workaround hooks — upstream usearch now supports Index.vectors, Indexes.merge(), and Indexes.search() for uuid-keyed indexes
  • UUID sharded indexes now use C++-optimized Indexes multi-shard search instead of Python-side per-shard iteration
  • Make _merge_batch_matches and _apply_radius_filter dtype-safe using np.zeros_like + mask-copy instead of np.where(..., 0) (V16 arrays do not support scalar 0 fill)
  • Rewrite ShardedIndexedKeys.__array__ to shard-aware concatenation preserving correct dtype
  • Use serialized_length instead of stats.allocated_bytes for shard rotation threshold check (exactly matches on-disk file size and is faster)
  • Amortize rotation size check to avoid O(n) serialized_length call on every add()

Fixed

  • Fix size property using wrong shard list — now sums _viewed_indexes which is always maintained
  • Enable serialized_length property test (fixed upstream in usearch-iscc fork)

Full Changelog: 0.1.0...0.2.0