Repository navigation
Conversation
…ate on 32-lane GPUs Two gaps kept the ray-tracing programs off on a host whose waves are 32 lanes. 1. Buffer views picked from the view heap at a computed index. The shadow-ray trace programs read the address of their structure out of a heap descriptor they choose with a per-wave index, and walk the memory behind it. The translator could only take such an address from a fixed table position. The host now keeps, after the strides of `SLOT_STRIDES`, two more dwords per heap slot (low and high of the title address of the buffer view there), written where the strides are written, and the shader reads them by heap slot (`SLOT_ADDRESSES`). No new root parameter; the table grows from 8 MB to 24 MB per view heap. 2. `lane_uniform` proves three more things where no lane of a wave can part from the others: `tid >> 6` of the entry thread number (in a group whose x size is a multiple of 64) is the same in all lanes of a console wave; an `ds_read_b32` at such an address is; and a value joined by a phi, also at a loop header, is when its arguments are and every predecessor is entered by all the arriving lanes or none (a greatest fixed point over the loop's carried values and lane masks). The structure builder's block-scan programs fetch a wave-uniform running total with `v_readfirstlane` in such a loop; without the proof they asked for an exchange between the two host waves where not every lane runs. Effect, with `VICTORY_HOST_WAVE=32` on a 32-lane card: - 4 of the 5 shadow-ray trace programs (and their screen-space variants) now translate and validate; the adaptive one still stops at a lane mask read as data. - 52 of the 52 structure-builder programs now translate, validate and create a host pipeline (3 did not). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
I found a wrong-code case in The regression initializes I put a fix and the synthetic test in fb57dd0, directly on your PR head. All three divergent cases failed before the change and pass afterward. The paired cases still take the optimization when the old VGPR is uniform too. AI-assisted. Tested the shader library on Linux with |
|
Tested Machine: Windows 10 Pro 22H2 (19045), NVIDIA GeForce RTX 3050 8 GB (driver 32.0.16.2124), AMD Ryzen 5 3600, 16 GB. D3D12 Agility SDK 1.620.2 (Marvisak/VIctory#175/#362, needed on Windows 10 for SM 6.6).
The three that failed before are the same three the runtime names on this machine as the stages that keep the builder off ( Without Tests: Not done yet: a title run with Tested and written with Claude Code (Claude Opus 5.5). |
|
In-game result with the builder on, RTX 3070 8 GB, Windows 10 22H2 + Agility 1.620, Series X profile. Tree: main at 4e17478 + #81 + #150 + this PR + ryotdev's fb57dd0 (+ #40, #51, #52, #63 and a local save-folder fix). Diagnostics build,
With the builder off (default), the same tree runs fine, at ~1.8 fps in a diagnostics build. Faces in cutscene close-ups come out black with only the eye rims lit, in every run. They also go black in a dark shot without this PR, so I read it as the missing ray-traced bounce light rather than a bug here. |
|
RTX 3070 Ti, fork main 4e17478 + #23 #24 #25 #51 #52 #32 #58 #71 + #92 #115 + this PR,
AI-assisted (Claude Code). |
Keep both export lists in emit/mod.rs: main's view_heap_limit and this branch's SLOT_ADDRESSES and SLOT_STRIDES_DWORDS. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
What
Two translator/host gaps kept the title's ray-tracing programs from running on a host whose waves are 32 lanes (the console's are 64). This PR closes both.
With
VICTORY_HOST_WAVE=32on a 32-lane card:the ray-tracing structure builder stays off ... missing=3.Changes
1. Buffer views picked from the view heap at a computed index (
shader.rs,mod.rs,descriptor/host.rs,lower.rs)The shadow-ray trace programs read the address of their structure out of a heap descriptor they choose with a per-wave index, then walk the memory behind it. The translator could only take such an address from a fixed table position (
view_addressrefusesa.dynamic).The host now keeps, after the strides of
SLOT_STRIDES, two more dwords per heap slot: the low and high dword of the title address of the buffer view there. They are written where the strides are written. The shader reads them by heap slot (SLOT_ADDRESSES,Lower::slot_address). No new root parameter and no change todraw.rsor the pipeline code.Cost: the table grows from 8 MB to 24 MB per view heap.
2.
lane_uniformproves three more things (lower.rs)Each only where no lane of a wave can part from the others:
tid >> 6of the entry thread number, in a group whose x size is a multiple of 64, is the same in all lanes of a console wave;ds_read_b32at such an address is;The structure builder's block-scan programs fetch a wave-uniform running total with
v_readfirstlaneinside such a loop. Without the proof they asked for an exchange between the two host waves where not every lane runs, which cannot be done (it needs a group barrier).shortcut:(marked in the code) an LDS read is taken to see what a read by another wave of the same instruction would. A write by another wave between the two host waves' reads is not looked for; the scan programs read after a barrier.Testing
Hardware: one NVIDIA RTX 3090, Windows 11 (32-lane waves). Nothing else was tried.
cargo clippy --release -p victory-shader -p victory-gpu: clean.cargo test --release -p victory-shader -p victory-gpu: 110 + 210 passed, 0 failed.victory translate --validate --pipelineswithVICTORY_HOST_WAVE=32over the structure-builder library: 52 emitted, 52 validated, 52 pipelines.What this does not do
VICTORY_BVH_BUILDER=1(also withVICTORY_BVH_QUARANTINE=1) the builder now does start (all 53 programs have host pipelines), but in my runs the frame time went from about 0.3 s to about 4 s and the scene came out washed out in white. I did not try it without quarantine. Nothing here changes its default.Does it only work on this GPU?
I only know it on the 3090. By construction:
lane_uniformproofs only matter where a console wave64 program runs as two host waves of 32 and would need an exchange between them. On a host with 64-lane waves that path is not taken, so it should be inert there.🤖 Generated with Claude Code