Give a texture bucket the generation its state had before, for releases as well as take-backs.

The first version put a bucket's generation back only when a take-back undid the release just before it. A town run
with it showed half the take-backs going back and the fullest bucket (1,315 slots) still bumped 7,736 times per
3,600 submissions: the game keeps those textures released and takes them back for a moment, so every release was a
new generation and the pool refresh still refilled 5,220 slots per submission.
A bucket's state is now named by its epoch (changes other than a release or a take-back) and the XOR of the uids of
its released entries. A release or a take-back that brings the bucket to a state it was in before gets that state's
generation, whichever way round, and in any order of several entries; a new state gets a new one, never one used.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-09 23:01:18 -05:00
parent 6994563613
commit 04de04bc28
2 changed files with 59 additions and 32 deletions

View File

@@ -154,9 +154,9 @@
# made again within a few frames. The first start after changing it builds the pipelines again. 0: such textures stay.
# 2 (diagnosis): the same marks, and such textures give way to stand-ins in the texture pool, but none is freed.
# tex_disuse = 1
# 1: a texture the game releases and takes straight back, with nothing else changed at its address, leaves the texture
# table's slots there as they were, instead of having them all looked up again (large towns release and take back
# thousands a second). 0: every release and take-back counts as a change, as before.
# 1: a texture the game releases or takes back, with nothing else changed at its address, puts the texture table's
# slots there back in a state they were in before, and they are not all looked up again (large towns release and take
# back thousands a second). 0: every release and take-back counts as a new state.
# tex_gen_undo = 1
# Host zstd decoder in place of the game's (0 = the game's), and a check that decodes every call both ways and logs
# the differences (1 = on; slow). Ocarina of Time 1.1.1 keeps the game's decoder while zstd_native is unset: its host