Releases: toloco/warp_cache
0.2.1
0.2.0
Bug Fixes
-
Fix cross-process hashing for string/bytes keys (CRITICAL): The shared
memory backend previously computed key hashes from Python'shash(), which is
randomized per process (PYTHONHASHSEED) forstrandbytestypes. This
caused cross-process cache lookups to silently miss — breaking the core value
proposition of the shared backend. Key hashes are now computed from the
deterministic serialized bytes usingahashwith fixed seeds. -
Fix oversize early-exit check: The
__call__path in
SharedCachedFunctioncomparedkey_bytes.len()againstmax_size(the
maximum entry count), which almost never triggered. The check now correctly
delegates tois_oversize()only.
Improvements
-
Document approximate eviction ordering: Added doc comments to the internal
ACCESS_LOG_CAPACITYconstant and aNote:block to thecache()decorator
docstring explaining that eviction ordering (LRU, MRU, LFU) is approximate
under sustained hit-only workloads due to batched ordering updates. -
Add PEP 561 typing support: Added
py.typedmarker and
_warp_cache_rs.pyitype stubs forCacheInfo,SharedCacheInfo,
CachedFunction, andSharedCachedFunction. Type checkers (mypy, pyright)
can now understand the Rust extension's API.
Tests
- Add cross-process string key test: New
test_cross_process_str_key_different_hashseedspawns a subprocess with an
explicitPYTHONHASHSEED=12345to verify that string keys written by one
process are correctly found by another — directly validating the hashing fix.
Other
- Fix repository URL in
pyproject.toml(tolo→toloco). - Add
ahash = "0.8"dependency (Unix targets only).