M5.6: the pinned original no longer evicts the photo's other sources (64 MP edits decoded the raw again)

MediaCache::enforce_budget never evicts the original of the photo on screen (set_on_screen), but it still
counted it. A 64 MP original (Sony A7R VI: 9984×6656 linear float, 760 MiB) nearly fills the default cache
share (768 MiB) alone, so the loop evicted everything else instead: the photo's preview and thumbnail sources,
the rendered previews and the prefetched neighbours. Every edit at 1:1 (the whole-frame render and the
thumbnail), every zoom out and every step to the next photo then decoded the raw again.

The pinned original is now left out of what is compared with the budget. The rest still fits the share; the
original sits over it, as the first commit of this PR already allowed.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
dev-null-undefined
2026-10-13 00:41:09 +02:00
co-authored by Claude
parent 63bcaa147f
commit dead4367b0
2 changed files with 26 additions and 1 deletions
+3
View File
@@ -13,6 +13,9 @@
- A zoomed view keeps the GPU copy of the original while it is on screen: pausing for a few seconds between pans no
longer frees it, which cost a re-upload of about a second on the next pan (800 MB for a 64 MP raw). It is freed
once you zoom out or move on.
- The kept original no longer pushes everything else out of the cache: on a 64 MP raw it filled the cache share
alone, so the photo's preview and thumbnail sources and its neighbours' were decoded from the raw again on every
edit at 1:1, every zoom out and every step to the next photo.
## 2026-10-11