Expand description
Shared, immutable, byte-bounded decoded-tile cache with single-flight loading.
- Values are
Arc<[f32]>; readers never mutate them. - A key is decoded at most once while resident: concurrent requests wait for the loader.
- Eviction is least-recently-used among unpinned entries (no outside
Archolder), so the resident byte total, including in-use and loading tiles, never exceeds the budget. If the budget cannot be met because everything is pinned, the request fails with a budget error rather than exceeding it. The session validatesthreads * max_tiles_per_item * tile_bytes <= budget, which makes that failure unreachable for planned work. - The budget covers decoded resident slots only. Decoder transients of a concurrent miss
(terrio window buffer, tiff chunk buffer, compressed bytes, chunk offset tables and the
Arc<[f32]>copy) are outside it;peak_concurrent_loadslets callers estimate them. - Unwind safety: a loader that returns an error or panics releases its
Loadingslot and its bytes, counts a load error and wakes every waiter (drop guard). A panic is caught and returned as a typedMapError::Terrain; waiters then retry the load themselves.