Skip to content

Posters: a backdrop left behind by a page is evicted before the posters, so tiles stop blinking - #1105

Merged
GLinnik21 merged 1 commit into
plxnative:mainfrom
tiper:up/evict-heavy-first
Oct 29, 2026
Merged

GLinnik21 merged 1 commit into
plxnative:mainfrom
tiper:up/evict-heavy-first

Conversation

@tiper

@tiper tiper commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

When the texture cache is full, an arrival evicted the oldest entries one by one. A backdrop (3.7 to 8.3 MB decoded) that a page had left behind could stay resident while dozens of older posters went first, and each of those tiles blinked when it came back. The eviction loop now takes the heavy entries (a Class::Residency upload, per class_for) before the light ones, oldest first within each class. What is on screen stays protected as before; the byte and slot ceilings are unchanged.

How it was checked:

  • New unit test a_heavy_entry_is_evicted_before_an_older_light_one; it fails against the old oldest-first order (watched red, then green). The test fixture builder is now one shared helper next to ready().
  • make check and make check-nodef pass on the branch.
  • On a television (webOS 6, one scripted route run once per build, cold image cache both times: Home rows, then six Detail opens from a library grid): 5 poster textures lost with this change against 16 without. Image fetch and decode times were the same (median about 205 to 218 ms). One run per build, so it shows the direction, not the size.
  • Not checked on a television: the cost of returning to a page whose backdrop was evicted (it decodes again; this route only enters and leaves Detail pages).

…rs, so tiles stop blinking

A backdrop (3.7 to 8.3 MB decoded) that a page left behind stayed resident while the texture
cache evicted dozens of older posters one by one to make room for an arrival, and each of those
tiles blinked when it came back. The cache now evicts the heavy entries (a Residency upload, per
class_for) first, oldest first within each class. What is on screen stays protected exactly as
before, and the byte and slot ceilings are unchanged.

A backdrop that is evicted comes back through the same disk-first path as any other picture.

The new unit test, a_heavy_entry_is_evicted_before_an_older_light_one, fails against the old
oldest-first order. Its fixture builder is now one shared helper next to ready() instead of a
closure copied into each test.

Signed-off-by: Tiago Pereira <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 0e1949c into plxnative:main Oct 29, 2026
13 checks passed
@GLinnik21

Copy link
Copy Markdown
Collaborator

Merged, thank you!

@tiper
tiper deleted the up/evict-heavy-first branch November 2, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants