Repository navigation
Conversation
… writes; glc accesses are coherent Title memory was read through each page's raw SRV and written through its UAV. A read through the SRV need not see this dispatch's writes: on an RTX 2080 a load after the program's own store to the same address gave the value from before the dispatch. The console reads the same memory it writes, and a `glc` access passes the compute unit's cache, so it sees stores of this wave and of other groups. - A program with vector-memory stores or atomics (`Lower::writes_memory`) reads title memory through the page's UAV too. - A `glc` access (SMEM, MUBUF, FLAT) gets a globally coherent handle. - Read-only programs still read through the SRV. Found in GTA VI's console BVH builder: its treelet pass (`ffd93c8a`) reads, with `glc`, the boxes its own refit has just written. It read them as they were before the dispatch, so treelet formation stopped early, and other groups' rewired nodes were read stale too. The trees came out broken: about 2,300 children not pointing back to their parents in a 23,011-leaf tree. The refit after it then never reached the root, and the device was removed. On a captured dispatch of that program, replayed on the RTX 2080, the trees come out valid with both changes (0 broken links). With UAV reads alone, 228 links are broken. A lockstep wave32 reference interpreter of the program gives the same bytes as the GPU for one group. Test: `memory_tests::a_program_reads_back_what_it_stored_to_title_memory`. 64 threads each load a dword, store it plus 1, load it again with `glc` and store what they read. On the RTX 2080 every thread read the old value before this change, and reads its own store with it. The whole `victory-shader --lib --features host` suite: 299 passed, 4 failed (the same 4 as `main` on this card). Clippy is clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018sSQTfPXZpSkjMMNa7RB5G
|
Matched Wine/NVIDIA verification: the synthetic store/readback fixture passes on both production head 0c1e615 and parent 63bcca4. This does not reproduce the reported native-Windows RTX 2080 stale-read result on this stack. Linux 6.17, i7-13620H/16 GiB, RTX 4060 Laptop 8 GiB/NVIDIA 590.48.1, Wine 11.0, diagnostic-relaxed-vtable vkd3d-proton 2576c0b4adfae4a+ (not stock certification), DXVK NVIDIA masking disabled. Both worktrees carry the identical test-only strengthened fixture; production unchanged. SDK DXIL validator, non-software physical NVIDIA adapter and dedicated VRAM are mandatory, without WARP fallback or silent skips. Command on each source: cargo-victory-wine.sh test -p victory-shader --features host --lib a_program_reads_back_what_it_stored_to_title_memory -- --nocapture --test-threads=1. Fresh intended-worktree Compiling lines: parent 5.93 s, head 5.81 s. Parent 1/1 pass in 0.77 s; head 1/1 pass in 0.76 s; zero ignored. Each executes the owner's original 64-thread, one-group instruction sequence and compares every word of both returned UAVs: 512 memory words and 256 write-mark words, 768 total, zero mismatches including untouched sentinels. Local evidence directories under .compat-runtime/logs/:
This single-group fixture does not establish cross-group glc ordering, the captured treelet program's integrity, or gameplay. No original BVH dispatched or title launched. A small publishable, non-spinning multi-wave/tree-integrity regression that distinguishes this parent on Wine would be the most useful next gate; retaining the same source-container identity and translation mode would help compare it with our local title corpus. The independent scalar/lane-loop backend promotion block remains separate. |
|
Hardware run, head 0c1e615: Windows 11, Radeon 780M (RDNA3 iGPU), toolchain 1.98.1.
AI-assisted (Claude). |
|
Before/after on the same 780M: with this PR's test file on main 63bcca4, AI-assisted (Claude). |
|
Native Windows, RTX 5080 (Blackwell, driver 617.42): the test fails without the change and passes with it, also on a large stack.
AI-assisted. |
What
Title memory was read through each page's raw SRV and written through its UAV. A read through the SRV doesn't have to see this dispatch's writes. On an RTX 2080, a load after the program's own store to the same address returned the value from before the dispatch. On the console, a program reads the same memory it writes, and a
glcaccess passes the compute unit's cache, so it sees what this wave and other groups stored.Lower::writes_memory) also reads title memory through the page's UAV. Read-only programs still read through the SRV.glcaccess (SMEM, MUBUF or FLAT) gets a globally coherent handle.lower.rsgrows by 1,114 bytes, to 521,677.Where it showed
GTA VI's console BVH builder (
XboxBvhBuilder.dll), on an RTX 2080. Its treelet-optimization pass,ffd93c8a, works like this:glc.The boxes came back as they were before the dispatch, mostly zero. So treelet formation stopped after its first step, and nodes rewired by other groups were also read stale. The trees came out broken: in one 23,011-leaf tree, about 2,300 children no longer pointed back to their parents and 150 nodes formed cycles. The refit after it then never reached the root, and the device was removed.
Measured
A captured dispatch of
ffd93c8a, with the exact inputs the game gave it, replayed on the 2080. The input tree is valid every time.glc)A lockstep wave32 reference interpreter of the program (a CPU model of the console's wave) agrees: with one group, the GPU's output is byte-identical to the interpreter's with this change, and differs without it.
Other things I ruled out on the same capture first. With SRV reads kept, none of these helped:
In the game (RTX 2080, Windows 10, my dump, on my stack with #2920): the BVH builder now runs with
ffd93c8ain and the refit on, with no caps and no builder program dropped. It ran for 6 minutes without a device loss: all 53 builder programs run, about 5,200 draws a frame, 23,002 instances and 57,253 BVH nodes at the stop. Before this change the device was lost in the builder's first frame unlessffd93c8awas dropped. The scene's remaining artefacts (a green cast, blocky patches at the bottom) were there withffd93c8adropped too.Test
memory_tests::a_program_reads_back_what_it_stored_to_title_memory:glc, and store what they read.7, 4103, …instead of8, 4104, …). With it, all of them read their own store.Whole
victory-shader --lib --features hostsuite: 299 passed, 4 failed, the same 4 asmainon this card.cargo clippy -p victory-shader --all-targets --all-features -- -D warningsis clean.AI-assisted (Claude Code). Synthetic tests only, no game data in the tree.
🤖 Generated with Claude Code
https://claude.ai/code/session_018sSQTfPXZpSkjMMNa7RB5G