Shaders: a multi-dword access by title address that crosses a 64 KiB page reads or writes the wrong title page (copies in arenas) #3283

Open
opened 2026-11-29 21:22:06 +00:00 by github-bot · 2 comments
Owner

@⁠dyshay on GitHub · 2026-11-29 21:18 UTC · original

What happens

A translated shader that loads or stores several dwords by title address takes every dword from the page copy of the access's first byte. Examples: global_load/store_dwordx2..x4, scalar loads split into pieces, global loads through root views by address, and the walking programs' shared looks. Copies of title memory by address live in arenas where the next 64 KiB is usually a different title page. So when an access straddles a page boundary, its last dwords come from (or go to) whatever page sits next in the arena, not the next page of title memory.

Evidence

  • WARP tests (no game data) reproduce it. A store across a page writes its last dwords into the arena's next page instead of the next title page, and a load across a page reads them from there. With the fix, both land on the right title page. (seam_tests.rs: a_store_across_a_page_writes_its_last_dwords_in_the_next_title_page_on_warp, a_load_across_a_page_reads_its_last_dwords_from_the_next_title_page_on_warp.)
  • In the game we have no picture yet that we can pin on it. The author of the fix (BackseatDrivers-Unbound, VIctory-AMD-RT, AMD with ray tracing) reports that "alone it changed nothing we could measure". It was on in all their good ray-tracing runs. Our run on an RTX 4090 (Series S, ray tracing, house scene) is queued, with the count mode, to see how many accesses actually cross a page per frame.

The fix (switch, off)

VICTORY_SEAM_LOADS=1: lanes whose access crosses a page read/write each dword through its own page, in a branch. Lanes that do not cross take the existing path. VICTORY_SEAM_LOADS=count (diagnostics builds) only counts such accesses and reports them on the memory frame line. The shader cache keys on the switch only while it is set, so leaving it off retranslates nothing. PR: #(to follow)

What to check on other cards

  • With VICTORY_SEAM_LOADS=count in a diagnostics build: how many crossing accesses a frame does your scene have (the memory frame line)? Zero would mean the fix has nothing to do there.
  • With =1: anything that looked wrong by address (ray-traced lighting, particles, skinned meshes) that changes? And what does it cost in frame time against the same run without it? It changes the translator, so a full retranslation/preload comes first.
**@⁠dyshay** on GitHub · 2026-11-29 21:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3283) ## What happens A translated shader that loads or stores several dwords by title address takes every dword from the page copy of the access's **first** byte. Examples: `global_load/store_dwordx2..x4`, scalar loads split into pieces, global loads through root views by address, and the walking programs' shared looks. Copies of title memory by address live in arenas where the next 64 KiB is usually a **different** title page. So when an access straddles a page boundary, its last dwords come from (or go to) whatever page sits next in the arena, not the next page of title memory. ## Evidence - WARP tests (no game data) reproduce it. A store across a page writes its last dwords into the arena's next page instead of the next title page, and a load across a page reads them from there. With the fix, both land on the right title page. (`seam_tests.rs`: `a_store_across_a_page_writes_its_last_dwords_in_the_next_title_page_on_warp`, `a_load_across_a_page_reads_its_last_dwords_from_the_next_title_page_on_warp`.) - In the game we have no picture yet that we can pin on it. The author of the fix (BackseatDrivers-Unbound, VIctory-AMD-RT, AMD with ray tracing) reports that "alone it changed nothing we could measure". It was on in all their good ray-tracing runs. Our run on an RTX 4090 (Series S, ray tracing, house scene) is queued, with the count mode, to see how many accesses actually cross a page per frame. ## The fix (switch, off) `VICTORY_SEAM_LOADS=1`: lanes whose access crosses a page read/write each dword through its own page, in a branch. Lanes that do not cross take the existing path. `VICTORY_SEAM_LOADS=count` (diagnostics builds) only counts such accesses and reports them on the memory frame line. The shader cache keys on the switch only while it is set, so leaving it off retranslates nothing. PR: #(to follow) ## What to check on other cards - With `VICTORY_SEAM_LOADS=count` in a diagnostics build: how many crossing accesses a frame does your scene have (the memory frame line)? Zero would mean the fix has nothing to do there. - With `=1`: anything that looked wrong by address (ray-traced lighting, particles, skinned meshes) that changes? And what does it cost in frame time against the same run without it? It changes the translator, so a full retranslation/preload comes first.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:22:06 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-29 21:18 UTC · original

Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

**@⁠github-actions[bot]** on GitHub · 2026-11-29 21:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3283#issuecomment-7262770423) Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
Author
Owner

@⁠dyshay on GitHub · 2026-11-29 21:39 UTC · original

Not a crash report: this is a development issue (a code change and how to test it). The relevant log lines and the numbers from our runs are quoted in the issue body, and the pull request linked here has the tests.

**@⁠dyshay** on GitHub · 2026-11-29 21:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3283#issuecomment-7263045690) Not a crash report: this is a development issue (a code change and how to test it). The relevant log lines and the numbers from our runs are quoted in the issue body, and the pull request linked here has the tests.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA#3283
No description provided.