Ray tracing: the structure builder's inputs are found by faults, and faulted pages are served anywhere under one budget #3285

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

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

What happens

With VICTORY_BVH_BUILDER=1 the title's structure builder reads its inputs by address: the instance arrays at LoadInstances, the bottom levels those name, and the index and vertex buffers at Load/ReloadTriangles. It writes structures by address too. Here, pages it touches that have no copy on the card are found only when shaders fault on them (title memory by address: shaders touched pages that had no copy (those accesses read 0 or were dropped)). They come in a frame later, and every faulted page anywhere is served under one budget (VICTORY_RT_FAULT_MB, 1024 MiB). In our Series S ray-tracing runs on an RTX 4090 that warning appears 60 to 85 times in 5 minutes.

Evidence

  • Our logs: the warning above, 60 to 85 times per 5-minute Series S ray-tracing run (house scene), each with a list of pages; their accesses read zeros for that frame.
  • BackseatDrivers-Unbound (VIctory-AMD-RT, AMD with ray tracing) had VICTORY_BVH_AHEAD=1 on in every one of their clean ray-tracing runs. They did not test it alone.
  • On our RTX 4090 a run with both switches on (Series S, ray tracing, house scene) is queued; numbers to follow.

The fix (two switches, both off)

  • VICTORY_BVH_AHEAD=1: the builder's inputs are made ready up front (a registry of its structures and inputs by address, in memory/known.rs). A view the builder writes is made as long as its structure's known size. Pages the builder writes are taken from title memory once and kept.
  • VICTORY_BVH_KNOWN=1: a faulted page is served only inside a structure or input the registry knows, outside VICTORY_RT_FAULT_MB but under the 3 GiB held. Other faulted pages are refused.
  • With either on, a bvh known line every 5 s counts faulted pages served (by kind), refused and unplaced, and the pages that came up front.

PR: #(to follow)

What to check on other cards

  • With ray tracing on: does the count of shaders touched pages that had no copy warnings drop with VICTORY_BVH_AHEAD=1? What does the bvh known line say came up front?
  • VICTORY_BVH_KNOWN=1 refuses faults outside known extents. Does any ray-traced picture get worse (missing lighting, black patches), and does VRAM go down?
  • Frame time and CPU preparing time against the same build without the switches.
**@⁠dyshay** on GitHub · 2026-11-29 21:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3285) ## What happens With `VICTORY_BVH_BUILDER=1` the title's structure builder reads its inputs by address: the instance arrays at LoadInstances, the bottom levels those name, and the index and vertex buffers at Load/ReloadTriangles. It writes structures by address too. Here, pages it touches that have no copy on the card are found only when shaders fault on them (`title memory by address: shaders touched pages that had no copy (those accesses read 0 or were dropped)`). They come in a frame later, and every faulted page anywhere is served under one budget (`VICTORY_RT_FAULT_MB`, 1024 MiB). In our Series S ray-tracing runs on an RTX 4090 that warning appears 60 to 85 times in 5 minutes. ## Evidence - Our logs: the warning above, 60 to 85 times per 5-minute Series S ray-tracing run (house scene), each with a list of pages; their accesses read zeros for that frame. - BackseatDrivers-Unbound (VIctory-AMD-RT, AMD with ray tracing) had `VICTORY_BVH_AHEAD=1` on in every one of their clean ray-tracing runs. They did not test it alone. - On our RTX 4090 a run with both switches on (Series S, ray tracing, house scene) is queued; numbers to follow. ## The fix (two switches, both off) - `VICTORY_BVH_AHEAD=1`: the builder's inputs are made ready up front (a registry of its structures and inputs by address, in `memory/known.rs`). A view the builder writes is made as long as its structure's known size. Pages the builder writes are taken from title memory once and kept. - `VICTORY_BVH_KNOWN=1`: a faulted page is served only inside a structure or input the registry knows, outside `VICTORY_RT_FAULT_MB` but under the 3 GiB held. Other faulted pages are refused. - With either on, a `bvh known` line every 5 s counts faulted pages served (by kind), refused and unplaced, and the pages that came up front. PR: #(to follow) ## What to check on other cards - With ray tracing on: does the count of `shaders touched pages that had no copy` warnings drop with `VICTORY_BVH_AHEAD=1`? What does the `bvh known` line say came up front? - `VICTORY_BVH_KNOWN=1` refuses faults outside known extents. Does any ray-traced picture get worse (missing lighting, black patches), and does VRAM go down? - Frame time and CPU preparing time against the same build without the switches.
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/3285#issuecomment-7262771508) 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/3285#issuecomment-7263046101) 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.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 04:23 UTC · original

Closing this one. Our runs of the port on an RTX 4090 didn't show a gain on the software walk (one run slower, one confounded by an old build), and the hardware DXR path proposed in #3704 replaces the title's software builder and traversal that this tuned. The idea stays with its original author if they want to propose it.

**@⁠dyshay** on GitHub · 2026-11-30 04:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3285#issuecomment-7268729960) Closing this one. Our runs of the port on an RTX 4090 didn't show a gain on the software walk (one run slower, one confounded by an old build), and the hardware DXR path proposed in #3704 replaces the title's software builder and traversal that this tuned. The idea stays with its original author if they want to propose it.
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#3285
No description provided.