Ray tracing on AMD RDNA 4: about 1 run in 3 clean indoors on identical settings; what we found, and questions #2109
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by BackseatDrivers-Unbound on 2026-11-29T09:33:52Z.
Problem. With the title's own ray tracing on (
VICTORY_BVH_BUILDER=1), on an RX 9070 XT, the house interior is either right or broken for the whole visit. Right means warm wood floors that reflect the room and glass that shows what is behind it. Broken means flickering black patches, cold blue-grey floors and outdoor scenery in indoor glass. On identical settings and the same replayed route, about 1 run in 3 is clean (3 of 8 in a noise baseline, 11 of 50 blind-rated runs overall). Which one you get is decided around arrival at the house. We have seen moments almost 1:1 with the console, but we cannot reproduce them reliably.Hardware and settings. RX 9070 XT 16 GB (driver 32.0.32029.2010), Ryzen 7 5800X3D, 32 GB, Windows 11. 4K output (title told 3840x2160), console mode Series X. No FSR, DLSS or frame generation: only the console's own upscaler. Ray-tracing base:
VICTORY_BVH_BUILDER=1,VICTORY_BVH_AHEAD=1,VICTORY_BVH_GAPS=quiet,VICTORY_LIST_VIEW_TWINS=1,VICTORY_EARLY_DEPTH=0. Our full list of 39 commonVICTORY_*settings is in the write-up. About 10-12.7 fps with ray tracing on, and CPU-bound.AMD vs NVIDIA, as far as we know
host wave lanes min=32 max=32). That costs a lot in the builder and the ray walks (29 ms forCS_ScreenProbes_TraceRaysalone on an RTX 40-series card).PrefixSum256(Marvisak/VIctory#3486, fixes #2836 and #3023). We ported both behind a switch: it changes 0 of 25,689 title shaders and 0 of 34 builder programs, and our translation ofPrefixSum256gives 0 of 256 wrong results without it. Our structure dumps also show no radix-sort key-loss signature.What works
VICTORY_LIST_VIEW_TWINS, from RAZDA4A-XEN) works.VICTORY_EARLY_DEPTH=0gives better glass refraction with ray tracing on, and does not cause the patches.VICTORY_SEAM_LOADS=1) fixes a real bug: multi-dword loads across a 64 KiB page took their later dwords from the wrong page, 18-28 such loads a frame. But it does not change the clean rate: a first 3 of 7 vs 0 of 6 did not hold up (1 of 12 base runs clean with it on overnight).What doesn't, or is unclear
VICTORY_RT_NATIVE+VICTORY_RT_SIZES_CPU). The race is real: about 92 % of compaction copies were made before the size was answered, and answers landed 9-12 frames late (see #1412). The fix removes about 2/3 of the overlaps our detector sees, but blind ratings did not show it as better.JOIN_PARTS=1, a full barrier after every builder dispatch, a fixed 60 ms GPU time, or serving faults to the builder only or the walks only.MEMORY_LAND_SENTandREADY_SKIPmove about 0 bytes here.WC_NO_BACK=0(1 of 5 vs 0 of 5), the out-of-range index check (#690 / Marvisak #3670 port: 1 of 4 vs 1 of 6), leaving out the heat-haze and decal-defrag passes (1 of 2 vs 0 of 2).Main hypothesis. The run-wide fault budget (2,048 pages) is spent before the house in 37 of 43 runs (compare #688). Pages the builder reads or writes are often not ready before it runs, so it builds from zeros or stale bytes, or places compacted copies by sizes it does not know yet. Dumps show broken trees overlapping their neighbours: 44 of 69 broken trees overlap, against 3 of 95 healthy ones. The root node is the last node of a structure, so a tail overwrite kills the whole tree. Timing decides which structures are hit, so runs differ. Another private NVIDIA build has
VICTORY_RT_POINTED/VICTORY_RT_INPUTS(making ready what builder root views point at, and the build inputs); there they removed white blocks and sky light indoors. We ported and tested them (6 vs 6): same clean rate (1 of 6 each), but every run with them had warm floors (base: 5 of 6 cold), and the black patches stayed. Their counters show they bring 0 new pages in our tree: ourVICTORY_BVH_AHEADalready had 15,027 of 15,028 of those addresses ready. So in our tree the missing-input explanation does not hold as such, and the run-to-run split is still unexplained.Full details and code: branch
pub-rt-amdof https://github.com/BackseatDrivers-Unbound/VIctory-AMD. The write-up is https://github.com/BackseatDrivers-Unbound/VIctory-AMD/blob/pub-rt-amd/docs/RT-AMD-INVESTIGATION.md. It covers how ray tracing works in this tree, every switch with our verdict, the method (game-clock route replay, 16-frame bursts, blind ratings, a picture scorer at about 94 % agreement with them) and what we got wrong. All new switches are off by default.Related: #688 (fault budget), #689 (sizes answered at the call), #690 (OOB_SELECT index check), #1412 (compacted-size race at scale). Upstream Marvisak/VIctory: #3486, #2836, #3023, #3670.
Questions
Credits: Kemerd/VIctory-NVIDIA-RT (builder calls), crossducking/RAZDA4A-XEN (tree fix), DexNom/VIctory PR 62 by MrToucann (RDNA 4 compiler crash), avatarmanz (fault bounds), Belobug (input log), and another private NVIDIA build (sizes on the CPU,
LAND_SENT, GPU stamps).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-29T09:33:59Z.
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.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU, Windows version (10 or 11)
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ProjectUnknownVI on 2026-11-29T16:24:46Z.
Tested extensively on an RX 9070 XT 16 GB (Windows 11, native 1440p,
BVH_BUILDER=1+HW_BVH=1). A few findings that directly address Questions #2, #4, and #5:Why
RT_POINTED/RT_INPUTSbrought 0 pages yet interiors still broke (Q2):BVH_AHEADmaps the root-view table address itself, but the 1,024-thread leaf-unpacking dispatch (constants = [0, 0, 0, _, _, _, _, 1, ..]) dereferences 48-byte D3D12 triangle-geometry records inside that table to read raw(ib, ib_len)and(vb, vb_len)addresses that no view names. Once the 2,048-page fault budget is spent, those leaf-unpacking reads return zeros and unpack degenerate triangles. Pre-mapping(ib, vb)from those 48-byte records (fivenine/victory-proton f7ace5b8e), raisingFAULTS_ALLfrom2,048to16,384(869860482), and adding the builder UAV barrier (ae1624b69) made our primary interior consistently clean (warm floors, no outdoor sky bleeding into indoor glass). We still see an occasional shifting dark RT-GI patch in a secondary interior, so it may not explain 100% of every indoor artifact, but it eliminated the 1-in-3 roulette on the main interior.Preventing the 4 GiB / 64-arena cap (
MOST=65536) after pre-mapping geometry buffers (Q5):Pre-mapping leaf-unpacking
(ib, vb)buffers causesmemory.rsarenas to hit64/64(4,096 MB) on longer drives (~18 min), after which new RT pages read zeros (580+faults/frame). Tagging pages allocated exclusively by leaf-unpacking (geometry_only, cleared if any other path/fault touches them) and reclaiming both uncommitted unowned pages (>= 8frames) and idlegeometry_onlypages (>= 120frames) through an 8-frame retiring grace queue dropped active arenas from 62 (3,902 MB) down to 22 (1,105 MB) on RX 9070 XT with 0 refaults.Compacted sizes (Q4):
Answering compacted-size queries immediately at recording/dispatch with the prebuild upper bound (
BVH_SIZES_BOUND+BVH_SIZE_COPY) avoids the 9–12 frame readback race without stalling the GPU and stops compacted copies from overwriting neighbours' tails.RDNA 4
HW_BVHnote:Native RDNA 4 hardware BVH traversal (
HW_BVH=1) is also working on RX 9070 XT (verified with per-ray divergence counters against SW traversal) and helps RT frame times noticeably alongside wave64, though it's still a work in progress — while it looks clean most of the time, there are still some small visual issues we're tracking down.(Working on an RDNA 4 RT fork based on
mandy— not published yet, happy to share thememory.rsreclamation diff if it helps with your investigation.)