Repository navigation
Switches for slow storage and low-memory Macs - #200
Conversation
…lags A memory's host texture takes the uses of every title texture there, so streamed textures sharing memory with a render target got its flags, were never uploaded and were never given up: 2 GB of them, viewed by heap slots alone, on an 8 GB M1 (pragyaangaur#135). A texture now counts as GPU-written once a list moves it to a render target, depth write or unordered access state, or a heap slot gives shaders unordered access to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clwb faults under Rosetta, and each write-back loop cost an exception through Wine: about 15,000 a second on the job threads during world load (pragyaangaur#135). The clwb of each loop the emulator already recognises becomes a NOP of its length before any title thread runs; the loop's add, cmp and jbe stay, so its registers end as before. A PC's memory is coherent, so the write-back had nothing to do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found on an 8 GB M1 with the game on a Wi-Fi NFS share backed by a spinning disk (pragyaangaur#135): world streaming queued thousands of reads at about 20 MB/s, the title's hang watchdog killed it, and once it loaded, memory ran out. All off unless set. - VICTORY_NO_HANG_WATCHDOG=1: the title's three jumps to its deliberate crash (stale thread heartbeat, and both forms of its 30-check "no finished frame" countdown) become two-byte NOPs, on the known 1.0.2.1 build only and only where the original bytes are found. - VICTORY_DSTORAGE_WORKERS=<n>: DirectStorage reads in flight (default one per core); 32 gave a network share 30-50% more throughput. - VICTORY_EVICT_HEAP_UAV=1: textures viewed for unordered access in shader-visible heaps may be given up while no shader has written through a heap (none did in this title's runs); an unordered texture view left null is made again for a draw reading it through a table, and all of them before the submission of the first heap write. Host textures fell from 1.7 GB to 0.15-0.3 GB. - VICTORY_SPILL_SHADERS=1: shader containers wait on disk under the cache folder until translated instead of in memory (19,000 of them, 224 MB); written under a temporary name and renamed, reused across runs. - VICTORY_READ_STATS=1: requests and bytes per title file (DirectStorage and ReadFile), the 30 most read every 30 s: which files to copy off a slow share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed and merging. Main had already taken parts of this work (the GPU-written tracking and a narrower clwb patch that only runs under Rosetta), so I merged main in and kept main's versions of those. What remains is all opt-in: VICTORY_NO_HANG_WATCHDOG (known 1.0.2.1 build only, patches only where the original bytes match), VICTORY_DSTORAGE_WORKERS, VICTORY_EVICT_HEAP_UAV, VICTORY_SPILL_SHADERS and VICTORY_READ_STATS. I fitted shader spilling to main's new Shader layout and its mesh/pixel linking, which reads the container after translation, and the container is read back from disk before it is translated. I also fixed one clippy lint in read_stats.rs. Windows-target clippy (with and without all features), native tests and cargo xtask policy pass, and CI is green. |
Switches for Macs with slow storage or little memory, found while getting an 8 GB M1 Air (Series S, macOS 27.2.1) to the game world (#135). Builds on #152 (its two commits are the first two here). Everything is off unless set.
VICTORY_NO_HANG_WATCHDOG=1+0x2215bdc) and both forms of its 30-check "no finished frame" countdown (+0x2215c70,+0x2215d84). Known 1.0.2.1 build only, and only where the original bytes are found.+0x2215c35/+0x23cf683(the one MaxNiftyNine hit on an M2 in #140) while the world loads slowly or its first frames take secondsVICTORY_DSTORAGE_WORKERS=<n>VICTORY_EVICT_HEAP_UAV=1mirror's lazy path), and all of them before the submission of the first heap write (Host::execute).VICTORY_SPILL_SHADERS=1cache/shader-containers/, by BLAKE3) until translated, instead of in memory. Written under a temporary name and renamed; reused across runs.VICTORY_READ_STATS=1ReadFile), the 30 most read every 30 sshaders.rpfalone: 105,000ReadFilecalls in 11 min; copying 15 GB of 109 files to local SSD removed ~74% of network readsTests
spilled_containers_round_trip_through_their_file.tools/macos/test-wine.sh -p victory-gpu -p victory-loader -p victory-game -p victory-hle --lib: 230, 46, 15 and 155 passed.🤖 Generated with Claude Code