Fix Windows shader warm-up, wave permutes, and BVH residency #1166
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1166
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1166"
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?
@Lkxex on GitHub · 2026-11-25 22:24 UTC · original
Lkxex:fix/windows-shader-cache→main· +469 −116 · 11 files · 3 commits · openWhat changes
Tested
Windows x64 diagnostics build and the synthetic BVH GPU regression using the runtime page-table bindings. This implementation was also exercised in wave32 and wave64 on an RX 6600.
Not tested
In-game lighting, stability, and frame rate.
AI use
Codex (GPT-6.2 Sol) assisted with implementation and tests.
@Dathinel on GitHub · 2026-11-25 22:41 UTC · original · edited 2026-11-25 22:49 UTC
RTX 3050 Laptop (native wave32), synthetic D3D12 readback. On
77cbca8I get a mismatch with 33 threads in a variant of the permute test that saves/restores EXEC and predicates lanes below 47. The 16-thread case passes. At 33 threads that predicate leaves every launched thread enabled.Smallest reproducer on my local integration of the shader change: in
backward_permute_stays_inside_each_half_of_a_console_wave, change only[64, 16]to[64, 16, 33]. Runcargo test -p victory-shader --lib backward_permute_stays_inside -- --nocapture. Both original sizes pass. For 33, the first four output words are[0, 1, 2, 3], expected[1, 2, 3, 4]. This also reproduces without any explicit EXEC manipulation.The first divergence is in the full first half, even though only the second half is partial. The result warrants checking the mapping between group thread IDs and physical wave lanes for odd group sizes before attributing it to the permute itself. Native wave64 remains untested here. AI-assisted investigation.
Follow-up A/B on the same RTX: the isolated wave_base() hunk from #561 (
745305c) resolves this reproducer with the #1166 shader path. Across three rounds (alternating build order), 16/32/64/96 passed in both builds. With 33/47/48/63/65/100 threads the original allocation gave 31/31/31/2/31/31 wrong output words respectively in every round. With #561 all ten sizes matched every output in every round. With the EXEC-mask variant, all 160 outputs across 16/33/47/64 also matched on the combined build.A separate PC-DXC wave32 HLSL probe, instrumenting the same atomic counter at group size 33, observed the singleton thread (ID 32) take base 0 and the full wave take base 32 in 3/3 dispatches. Thread IDs 0–31 occupied physical lanes 0–31. The emitted translated DXIL then computes X modulo 33, explaining the wrapped indices. The result points to the existing tail-wave allocator fix for this case. No native wave64 or rendering claim.
@HAL9000RELOADED on GitHub · 2026-11-25 23:25 UTC · original
RDNA3 run of
d3dd585(native wave64): RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 22H2 (19045), Agility SDK 1.620 (#402). Base:3151ccf(maind827419+ #402).victory-shader: 219 passed, 0 failed.backward_permute_stays_inside_each_half_of_a_console_waveandbackward_permute_with_predicated_lanes_on_partial_groupspass on the card, so the per-half permute holds on RDNA3 too, not only on the RX 6600.traversal_requires_resident_bvh_pages_and_requests_only_the_pages_it_readspasses as well.victory-gpu, three runs: each had one different unrelated outcome (awatch::test, thewarp_budgettest that #849 fixes, and one 0xc0000005 exit, see #850), nothing in the files this PR touches.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.