GPU: buffer lookups also look through the buffers over 1 MiB when the 64 entries below an address hold none of it #2618
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2618
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2618"
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?
@101Leafy on GitHub · 2026-11-29 14:59 UTC · original
101Leafy:nv/lookup-big-buffers→main· +102 −19 · 1 files · 1 commits · openLookups in the shadow buffer map walk the 64 entries below an address. A parent buffer with many placed buffers inside it has more than 64 entries between its start and the address, so the walk stops short, the parent is never found, and the range falls through to a loose copy.
This keeps the 64-entry walk and, when it finds nothing, walks a second index that holds only the buffers over 1 MiB (again 64 entries below the address). Parents with many children are almost always that big, and there are few of them, so the second walk is short. A hit from the big index is checked against the buffer map's own end, so a buffer registered again shorter cannot be found at its old length.
extent,peek,lookup, andin_bufferuse it.VICTORY_LOOKUP_SPAN=0turns the second walk off (back to the 64 entries only).The stale entry is why the earlier take on this (b73bb8b473) was reverted: when a key was registered again with a smaller length, the big index still held the old length. Registering at or under 1 MiB now removes the key from it, and there is a test for that case.
#2556 bounds the walk by the largest registered size instead. On a miss that walk goes through every entry in that span; in the opening we counted about 480 entries per miss on average, up to 2,842, at about 330k misses every 5 seconds.
Numbers from the opening, game time 60 to 80 s, measured on our tree (which carries this change on top of a lot of other work), same PC, warm shader cache:
It is also a picture fix. With 64 entries only, the faces in the coffee shop scene go solid blue and green/red. With this change (or the wide walk) those solid faces are gone:
Top: 64 entries only. Bottom: this change. The frames are from separate runs, so they are not the same moment. The red specks still left on the right face show up in every mode, so they come from something else.
@dyshay on GitHub · 2026-11-29 15:40 UTC · original
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series X 1440p, and Series S with ray tracing, DLSS Quality). Frame times will follow here.@dyshay on GitHub · 2026-11-29 20:28 UTC · original
A measurement from our integration branch (RTX 4090, house scene, cache warm, 300 s, same exe with and without
VICTORY_LOOKUP_SPAN=0):VICTORY_LOOKUP_SPAN=0Both profiles show the same ~4 ms extra frame time, all on the CPU side (the card time is unchanged). I've taken the PR out of our branch for now. Did you measure the extra lookup cost when it was written? A narrower search, for example only for parents already known to be larger than 1 MiB, might keep the fix without the cost.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.