Optionaloptions: DecompressedChunkCacheOptionsPrivate Static ReadonlyMETADATA_Metadata overhead estimate per chunk (shape array, stride array, object wrapper)
PrivatecachePrivate ReadonlyinflightIn-flight decodes keyed by the full L0 key (makeKey(arrayPath, coords),
so the array identity is part of the key). Lives on the CACHE — not on a
proxy — so the foreground loaders and the SlicePrefetcher's shadow loaders,
which wrap the same arrays through different proxies, share one decode.
Private_Bumped by every clear(); see generation.
PrivatedebugPrivate ReadonlymaxResolved byte budget — surfaced in getStats() for runtime introspection.
Incremented by every clear (the invalidation / dispose path). Holders of state derived from this cache's contents — e.g. the range loader's memoised, L0-wrapped array_ref targets — compare it to know when to re-derive.
Number of decodes currently in flight (diagnostics / tests).
Private StaticdefaultDefault cache size derived from config.cache.l0MaxSizeMB. A method, not a
static initializer, like SliceCache.defaultMaxSize: reading config at
module-load time couples every transitive importer to a fully-populated
config mock in tests.
Get a cached decompressed chunk.
Cache key (use makeKey() to generate)
Optionaloptions: { countStats?: boolean }
OptionalcountStats?: booleanfalse for a warm-up: the lookup promotes
the chunk but moves no hit/miss statistic (see getStats).
Cached chunk or undefined if not found
Cache a decompressed chunk.
Cache key (use makeKey() to generate)
Decompressed chunk to cache
Check if a chunk is cached.
Cache key to check
true if chunk is in cache
Register entry as THE in-flight decode for key.
Forget the in-flight decode for key — only if it is still entry (a
later decode for the same key may already have replaced an abandoned one).
Clear all cached chunks. Also forgets the in-flight decodes: a decode
started before the clear still settles for its waiters, but no longer
commits its result (only a still-registered entry may set), and a new
request starts afresh rather than joining pre-clear work.
Dispose the cache, releasing all cached chunks.
Get cache statistics for monitoring.
Cache statistics including size, count, hits, misses, and hit rate
StaticmakeGenerate a cache key from array path and chunk coordinates.
Full path to the zarr array (e.g., "/points/positions")
Chunk coordinates (e.g., [0, 1, 2])
Cache key string
L0 Decompressed Chunk Cache.
Uses LRU eviction with byte-size tracking to cache decompressed zarr chunks. Key format:
${arrayPath}:${chunkCoords.join(',')}(e.g., "/points/positions:0,1,2")Example