Builder memory: key a dword by every bit of its address (addresses 8 GiB apart shared one, #202) #243
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!243
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/243/head"
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?
@sharan104 on GitHub · 2026-11-26 12:29 UTC · original
sharan104:fix/202-bvh-key-alias→main· +27 −2 · 1 files · 1 commits · closed without mergingFixes #202.
memory::readyasks a list'sfirst_useonce per dword a builder dispatch writes (kind 4), and once per small buffer whose results come back (kind 5). Both keys kept 31 bits of the dword (at >> 2 & 0x7FFF_FFFF). So within one recording, two title addresses 8 GiB apart shared a key, and the second was left closed, got VIEW pages instead of BUILT ones, or never came back. The console's GPU addresses have 40 bits, and ours start at 4 GiB.dword_key(kind, at)=usize::MAX - (kind << 40) - (at >> 2)gives each address below 4 TiB a key of its own. The two kinds stay apart, and the keys stay clear of every otherfirst_usekey in the crate:(k << 33)keys andnamed's(k << 26)keys inmemory.rsusize::MAX - 0x5e…0x7aconstantstexture.rs's1 << 63 | …The bytes of one dword still share one key. The keys live in the list's set until it is reset, and nothing is kept on disk.
New test:
addresses_8_gib_apart_have_keys_of_their_own.Tests:
cargo test -p victory-gpu --locked: 375 passed, 0 failed, 34 ignored. Clippy has no new warnings. The crate's one-D warningsfailure is thewatch.rs:3205lint already onmain, which #241 fixes.Not covered: the kind-3 key
(3 << 33) - (at >> 8)is exact only below 2^41. I left it as it was.🤖 Generated with Claude Code
@sharan104 on GitHub · 2026-11-26 12:29 UTC · original
Closing: #236 by @feanorsun fixes #202 the same way and was opened first. Sorry for the noise.
Pull request closed