Shaders: console threads of 2-D and 3-D groups come from the wave counter (#216, a-publier) #442
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/Belobug--VIctory-Belobug-AMD!442
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-442"
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?
@TinkerBell-90 on GitHub · 2026-11-27 01:55 UTC · original
TinkerBell-90:console-ids-tickets→a-publier· +111 −11 · 2 files · 1 commits · openRelated to #216, on
a-publier.On
a-publier, a console-lane compute program in a 2-D or 3-D group of more than one host wave still gets its console thread from its host wave's first flat id, rounded down to the wave size. @j-fuxa's probes in #216 (RTX 4060 Laptop, Radeon 780M) and @adrianmjim's (RX 7900 XT, 2 x 2 quads) show host waves that do not hold an aligned run of flat ids in such groups, so two waves get the same ids. @loyodea's #236 fixes this onmain. Nothing does it ona-publieryet.a-publieralready has what the fix needs:wave_base, the LDS counter from which each 32-lane host wave of a console wave64 program takes its block of console threads. This PR uses it for console lanes in 2-D and 3-D groups of more than one host wave too. Such a program gets one more LDS dword, one group barrier and one LDS atomic in the entry block. 1-D groups and groups of one host wave are unchanged.Writing the test showed a second problem, in the counter itself: it gave every host wave a block of 32, a partial one too. In a group that is not whole waves, the partial wave could take a block in the middle. A full wave now adds the wave size, and a partial wave takes the last block, which is what the console's last wave holds. I have not checked which of the title's programs have a group that is not whole host waves; @adrianmjim's census on #236 found none among the 2-D and 3-D ones.
Tested on an RX 9070 XT under Linux: Wine 10 + vkd3d-proton 3.1 with DXVK's dxgi, Mesa 26.0.8 RADV, at
a-publier4eb6cfd. Not Windows, and nothing was run in game.New GPU test
console_threads_of_multidimensional_groups_are_one_each: each thread adds 1 + lane 0's flat id at its own flat id, so every dword must get exactly one add, of 1 + its console wave's first id. It covers console waves of 32 on host waves of 32, of 64 on 64, and of 64 on 32, in groups of W x 2 (W the console wave size), 32 x 2 x 2, 10 x 10, 12 x 12 and 24 x 8. All 15 ran on the card.4eb6cfd+ the test onlyThe failure depends on the order the waves reach the counter, which is why 3 runs passed.
Without the change, a probe of 30 shapes gave exact ids in every form on this card, so I could not reproduce the 2 x 2 case of #216 here. That part of the fix is tested here only for not changing results, so a run of the new test on Windows or on an NVIDIA card would be welcome.
Full
victory-shader --lib, one binary per row. This PR does not need #363; I added #363's first commit only to run the suite in the 32-lane form too (VICTORY_TEST_HOST_WAVE=32):VICTORY_TEST_HOST_WAVE=324eb6cfd+ #363's first commitThe failures left are
stub_pipeline_is_created(vkd3d-proton accepts the zero-digest DXIL) and, in the 32-lane form, theds_bpermuterefusal that #363's second commit fixes.a_first_lane_read_of_a_wave_alike_sum_under_a_wave_alike_loopcrashes RADV's compiler on this machine and was skipped in every row.cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-gnu -- -D warningsis clean; rustfmt reports nothing on the changed lines.splitkeeps the rounding there. Ona-publier, wave64 programs on 32-lane hosts already take their block from this counter, so that case is covered here, and the partial-wave fix applies to it.If @loyodea would rather port #236 itself, I will close this one.
AI-assisted.
@Something6411 on GitHub · 2026-11-27 01:57 UTC · original
This is completely unrelated but how do you get the dump
@MamaLeVrai on GitHub · 2026-11-27 03:55 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
a023216:cargo test --release -p victory-shader --lib304 passed, 0 failed, 4 ignored.AI-assisted (Claude Code); no game data.
@adrianmjim on GitHub · 2026-11-27 06:27 UTC · original
Tested #442 (
a023216) againsta-publier4eb6cfdon an RX 7900 XT (RDNA3, Windows 11, driver 32.0.32029.2010), release builds. WARP too.New test, 20 runs each, on the card
4eb6cfd+ the test onlyProbe
The console program from my #216 comment, translated by each branch: 22 shapes, one group per dispatch, 16 dispatches per case.
4eb6cfdArchive programs
VICTORY_HOST_WAVE=32: no program changes state against4eb6cfd. Cs 2682/2682 validated.translate --validate --pipelines).a-publierat host wave 32, one 2-D group of more than one host wave is not whole host waves: terrainshadows CS_ComputeTerrainVisibility, console wave64 6x6 (32 + 4 threads). My census on #236 wasmain.Full
victory-shader --libon the card, default form, one binary per row4eb6cfd+ the test onlyWARP
Not tested:
VICTORY_TEST_HOST_WAVE=32suite form, NVIDIA, anything in game.@TinkerBell-90 on GitHub · 2026-11-27 06:57 UTC · original
@Something6411 hey bro, pm me , or mail in my bio ✌️
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.