Texture disk tiers: one budget, GPU-ready cache as a reuse-admitted hot tier, caching strategy option, disk-space-based default sizes #705
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream#705
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #715 (cache rewrite epic).
Today: two separate texture caches with separate budgets -- LL's J2C cache (
texturecache, the server's format) and the GPU-ready cache (gputex, the GPU's block-compressed mip chains, #274). Measured on one install: J2C 11.0 GB / 42.9k textures, GPU-ready 8.2 GB / 29.8k textures (at its budget, evicting). Per texel, GPU-ready is ~3-5x larger than J2C (BC1 4 bpp, BC3/5/7 8 bpp + mips; ~10 bits/texel measured). It stays affordable only because it stores each texture at the size actually shown -- for the same textures the two caches are about equal on disk (8.19 vs 8.34 GB).Design
Ndays (setting, default 30) -- LL's cache entries already record last access, no new index;A one-off visit costs no GPU-ready disk; a place revisited within the window gets it from the second visit. An entry older than the window counts as new again.
Caching strategy (Preferences > Advanced, beside the cache sizes)
Default sizes, explicit sizes and the disk-full guard: moved to #711.
Duplicates: a J2C entry whose texture the GPU-ready tier holds at full size (or the 2048 cap) is kept while space is free and is first in line for eviction when it isn't (measured: 6,090 such textures, 1.78 GB of J2C, on one install). Aggressive keeps both.
Interface audit (step 1 of #715): what the texture tiers sit on and which store hooks they need.
Touches today
initCache(budget split: 36% entry reserve, 1M entries cap), :1786purgeTexturesLazy, :1876purgeTexturesEntry::mTimeCacheSizex (100 -DiskCachePercentOfTotal)%; GPU-ready budget =SlipstreamGpuTexCacheSizeMB(separate)evict(LRU), :200add_entry(a new capture replaces the old file)canWrite, capture rate limit), :12170 (write)mFileSize, partial flagged as size + 1)Slice of the interface
TEXTURES= {J2C, GPUTEX}, with a share cap for GPUTEX (Normal ~30%, Aggressive larger):Store::addBudgetGroup,setBudget.EvictionPolicyfor the group:keepScore(info, now)= reuses x decode time saved / bytes;isDuplicate(info)= J2C covered by a full-size (or 2048-capped) GPU-ready record. Duplicates go first.RecordInfo.prev_session_access(last access in an earlier session, persisted in the index snapshot) andreuse_count. The rule "found in J2C with an earlier-session access within N days, or decoded twice this session" becomes alookup(J2C key)beforewrite(GPUTEX key).mImageSize). GPUTEX meta: w, h, enc, enc_level, encoder version, full size (today'sInfo+ header).Drop-in plan
After the store carries J2C and GPU-ready (#708 steps 2-3). Policy-only work: the admission check goes in the renderer's capture decision (llcleanrenderervk.cpp ~6241), and the eviction policy is registered for the TEXTURES group. Separate budget settings merge into one texture budget (+ strategy setting); this needs the budget-group decision asked in #715.
Region-recency eviction (decided 2026-10-18, see #715 / #708 placement)
The eviction score of a record is reuse × decode time saved ÷ bytes, weighted by the recency of the regions that use it. A shared record takes the most recent region, or avatar sighting, that referenced it.