records: descriptor lookups skip the key hash and the table row (VICTORY_RECORD_PLACES, VICTORY_RECORD_RANGES) #329
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!329
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-329"
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?
@t-jonesy on GitHub · 2026-12-03 15:36 UTC · original
t-jonesy:upstream/records-places-ranges→main· +770 −37 · 9 files · 4 commits · merged 2026-12-03 17:11 UTCProblem
RGP thread traces of the hot translated shaders (decoded with AMD's rocprof-trace-decoder) put waits at 47% and scalar ALU at 30% of instruction cycles. Slicing the hottest shaders' disassembly, 51–86% of their scalar ALU (37% frame-wide) is the per-wave resolution of descriptor records in the title's heap, and the
s_wait_kmcntstalls wait on its chains of dependent scalar loads:record_slot): record load, key hash (~18 instructions, 6 multiplies), two cuckoo probes, compare. About 34 SALU and 3 SMEM in 2 dependent steps.record_range+address_view): record load, table-row load, ~41–45 instructions of decode, chunk descriptor load. 3 dependent SMEM.Changes (two switches, both off by default)
VICTORY_RECORD_PLACES=1: the host writes the record's two cuckoo place offsets into words 4–5 of each 32-byte view record. They depend only on the key, so whole-record copies stay valid. Textures read them instead of hashing.=2also covers typed buffers. That is riskier, because a 16-byte partial copy of a buffer record would leave stale places.VICTORY_RECORD_RANGES=1:With the switches on, the shader cache key changes, so shaders need translating and warming again (
./run.sh shaders, then a warm). With both off, translations and the cache key are unchanged. The only host-side difference is that view records also get the two place offsets written into words 4–5 (8 bytes per view made; nothing reads them when off). Both switches are listed indocs/SETTINGS.md.examples/isa_probe.rs(victory-shader,--features host) translates shader containers and builds a host pipeline of each, so RADV'sRADV_DEBUG=asmdumps show the resulting ISA. The table below was made with it.Results
Host ISA (RADV, GFX1201): scalar ALU in the hottest shaders, default vs
PLACES=1+RANGES=1.In game, alternating A/B runs of 60 s each:
PLACES=1PLACES=1+RANGES=1There were 0 errors, and screenshots showed textures, skin and prints intact. Both switches have since stayed on in longer hands-on play with no visual problems seen.
All of these numbers come from one machine:
They were measured on a fork whose base is about 150 commits behind current
main; this branch is the same change rebased. Untested on other GPUs (RDNA2/3 in particular), and not re-measured in game after the rebase.Risk
Under
RANGES, a partial copy of a raw buffer record (the first 16 bytes only) would read as an empty view rather than a wrong one. No such copy turned up in the host code, but a title doing a 16-byte memcpy of a raw-buffer record would hit it.Testing
./build.sh(release) builds.descriptor::tests::buffer_records_carry_their_range_when_askedpasses. The full suite has 309 passed and 6 failed; the same 6 tests (indirect::tests::host_list_*andwatch::*) fail on unmodifiedmainin the same environment.🤖 Generated with Claude Code
https://claude.ai/code/session_01ETU6PfySRvsjk18uHFtWya