docs: Phase 4 Tier 2 (decoded ImageCache LRU) done; note Tier 1 + prefetch

This commit is contained in:
Skyler Lehmkuhl 2026-06-21 00:55:17 -04:00
parent fcc8102a9d
commit d05cbfcde5
1 changed files with 13 additions and 0 deletions

View File

@ -461,6 +461,19 @@ it resident. The heavy, evictable thing is the **image assets** referenced by fi
from blob row or external `path`); Tier 2 = decoded pixels (`ImageCache` + GPU textures — from blob row or external `path`); Tier 2 = decoded pixels (`ImageCache` + GPU textures —
the heavy one). the heavy one).
**Progress (2026-06-21):**
- **[DONE] Tier 2 — bound the decoded `ImageCache`.** 256 MB **usage-LRU**: every
`get_or_decode`/`_cpu` bumps the asset's recency; inserts past budget evict the least-recently-used
(a miss re-decodes from `asset.data`). Achieves usage-based eviction via render-access recency
(simpler than the frame→asset enumeration below; that enumeration is only needed for *prefetch*).
- **[TODO] Tier 1 — lazy/droppable compressed bytes.** Currently `asset.data` is **eager-read** from
the container on load (Phase 3.5b). Make it lazy: give `ImageCache` the container path, load bytes
on a decode miss via `read_packed_media_readonly(path, asset_id)` (don't eager-read on open → instant
load; don't accumulate compressed bytes). Wiring wrinkle: the `ImageCache` lives in the stage, not the
App that holds the container path → thread the path through `SharedPaneState`.
- **[TODO, optional] Prefetch via frame→asset enumeration** (4a below) — only if Tier-2 misses during
scrub/playback prove visible; the access-recency LRU already keeps rendered images resident.
### 4a. Frame→asset enumeration (incl. nested clips — see note below) ### 4a. Frame→asset enumeration (incl. nested clips — see note below)
A function `assets_needed_at(time) -> HashSet<Uuid>`: walk each visible vector layer's active A function `assets_needed_at(time) -> HashSet<Uuid>`: walk each visible vector layer's active
`ShapeKeyframe`, collect `fill.image_fill` across its `VectorGraph.fills`, **recursing into `ShapeKeyframe`, collect `fill.image_fill` across its `VectorGraph.fills`, **recursing into