Keep the freezes of idle regions back after slow ones and around area loads.

After a slow freeze the passes wait 250 ms, doubled for each further slow one, but the first fast freeze after a hold started the doubling over, so in the seconds after a load a 4-5 ms freeze came every 250 ms (Kakariko, 2026-11-13: five in a row, 16 frames apart), and freezes of 4-10 ms pushed frames of 25-52 ms over the stutter line. The doubling now starts over only after freeze_quiet_ms (default 5000; 0: the old rule) without a slow freeze. No pass runs while the texture pool makes an area's textures, when the frames are held anyway and one freeze took 32.4 ms, nor for freeze_load_hold_ms (default 3000; 0: off) after that or after an area's load. The regions that go idle meanwhile stay queued and are frozen later; their write-watch queries go on until then. A region is now queued once instead of again every freeze_idle submissions while the passes are held.

The rules are in runtime/freeze_hold.h, checked by tests/freeze_hold_check.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 12:29:51 -05:00
parent f7487ceee5
commit 0e0cfe0827
8 changed files with 220 additions and 19 deletions

View File

@@ -1098,6 +1098,14 @@
# area's textures are there, instead of showing the ground and the walls black for the first seconds. 0: never.
# pool_load_backlog = 512
# pool_load_ms = 50
# Idle 2 MiB regions of game memory are made read-only so that the per-frame checks for CPU writes skip them. Right
# after an area load such a freeze can take 4-30 ms instead of microseconds, so after a slow one the freezes wait
# (250 ms, doubled for each further slow one up to 2 s) and start the doubling over only after freeze_quiet_ms without
# a slow one (0: after any fast freeze, as in 0.10.1). None is made while an area's textures load nor for
# freeze_load_hold_ms after that or after an area loads (0: no such hold). The regions wait meanwhile; their checks
# cost a few microseconds per MiB each submission until they are frozen.
# freeze_quiet_ms = 5000
# freeze_load_hold_ms = 3000
# Written storage-buffer ranges up to this size in MiB (1 to 256) go back to game memory as a merge, in 4 MiB pieces:
# copied within video memory and only the words that changed written over PCIe. Larger ones are copied back whole at
# the end of every submission. Raising it from 4 to 16 took a 5.5 MiB range off the plain copies (about 46 MiB a frame