Wave64 on 32-lane hosts: one console wave sharing LDS runs in the console flow (+2 NVIDIA fixes) #68
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!68
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-68"
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?
@God489 on GitHub · 2026-11-25 13:17 UTC · original
God489:wave64/one-wave-lds→main· +324 −59 · 5 files · 2 commits · openOn 32-lane hosts (every NVIDIA card) the title's loading never finishes (#9) or the world stays black (#15), and both reports give the same reason. About 90 compute programs stop at translation:
a wave64 group sharing LDS without barriers on a host without 64-lane waves;console wave64 lanes on a host without 64-lane waves.docs/wave64-on-wave32.mdlists "one-wave LDS sharing" as the open half of step 6. This PR does that half, and fixes a wrong result the console flow had on the same hosts.What
1. A console wave sharing LDS runs in the console flow (
Lower::lds_meet)The console runs a wave's lanes in step, so its compiler leaves out barriers inside one wave. Split into two 32-lane halves, those LDS accesses need an order. The halves now meet at a group barrier between any two LDS accesses of which one writes:
s_barriercounts as a meeting.Lower::exchangestay a separate group-shared variable.Eligibility is
console_flow_ok: wave64 compute, a host without 64-lane waves, at most 64 threads, nods_(b)permute, no whole-wave sections. Two kinds of program meet it now that were refused before:WaveSize(64)and stop);lds_dwords == 0).2. Scalars after a divergent loop were per half on 32-lane hosts (bug)
leave_loopstakes a loop's scalars from the lane that ran it longest, using a wave maximum. Over a host wave of 32 that covers half the console wave: inscalar_counted_in_a_divergent_loop_read_after_it, lanes 0–31 read 32 where the console reads 64. Such programs (loop_exitswith values read after the loop) now go to the console flow whereconsole_flow_okholds. Where the console flow cannot lower them, they keep the per-lane form as before.3. A capped view heap keeps the title's own slot count (bug, NVIDIA)
The doubled
DYNAMIC(1 << 20) does not fit next to any title heap under NVIDIA's 1,000,000-view cap, so every view heap there takes the capped branch. That branch forcedPORTABLE_VIEWS - DYNAMIC_CAPPED - memory::SLOTStitle slots whatever the title asked for: a 4-slot heap got 933,440 title slots and its dynamic slots started past them. Now:min(wanted, that)slots and the dynamic slots take the rest;lostno longer underflows for small heaps;dynamic_slots_are_held_until_releasedfailed on every NVIDIA machine because of this.Nothing changes on hosts with 64-lane waves, by construction: (1) and (2) require
!target.runs(64), and (3) is only the capped branch.Tests
On an NVIDIA GeForce RTX 3050 (32-32 lanes, driver 610.88), Windows 11 Pro build 26200, debug build:
5 new tests in
split_tests, run on each hardware adapter and checked lane by lane against the console:v_readlanetogether with LDS;On
mainall 5 fail with exactly the two reasons from #9 and #15. With this PR they pass, exact.valu_tests: the four "counted" tests built their shader forTarget::ANYwithout the console-flow retry, so on a 32-lane card the pipeline was refused or the halves disagreed. They are now built for the host's own target throughemit, as the title's programs are. Two of them then pass; the two scalar-loop ones also needed fix 2.Full suite,
cargo test --workspace --locked --no-fail-fast, this machine:main71652a2dynamic_slots_are_held_until_released,loop_exit_mask_counted_after_the_loop,mask_grown_inside_a_branch_counted_after_it,scalar_counted_in_a_divergent_loop_read_after_it,scalar_counted_in_nested_divergent_loops.main: fivexmemtests on Windows 26200 (as in #8), andrepository_passes_policy(lower.rsis 630 KB onmain, over xtask's 512 KiB limit).main(10 findings invictory-shader, more invictory-gpu). This PR adds none on the lines it changes, checked with both clippy passes and-p victory-gpuon its own.Not tested
victory translate --host-lanes 32-32on the title's shaders would count them, and I'd be glad to see that number.AI use: Claude Code (Claude Opus 5.5) wrote the change and the tests, ran them on my machine and wrote this description.
🤖 Generated with Claude Code
@MamaLeVrai on GitHub · 2026-11-25 14:01 UTC · original
Tested on an RX 6950 XT (RDNA2, a host that runs 64-lane waves), Windows 11 build 26300, Rust 1.98.1: this PR merged on
main71652a2(head0e9b505, no conflict),cargo test --release -p victory-shader --lib.main: 264 passed, 2 failed; so 5 more tests, all passing). The 2 failures are the same two as onmain,valu_tests::scalar_counted_in_a_divergent_loop_read_after_itandscalar_counted_in_nested_divergent_loops(what #92 fixes). This PR is about 32-lane hosts and does not change them here.main). Run directly on this tree, 3 of 6 runs gave the same 269 passed, 2 failed, and 3 exited with 139.I cannot say anything about the 32-lane case the PR is for: no 32-lane-only host here. Not run in the game.
harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300
AI-assisted (Claude Code); no game data.
@Yoshi-233 on GitHub · 2026-11-25 14:23 UTC · original
Tested PR head
0e9b505independently on an RTX 4070 Ti SUPER, Windows 11, driver 32.0.16.1742. In a fixed set of 285 compute shaders rejected by our previous local build targeting 32 lanes, PR #68 emitted and DXIL-validated 147. Our separate local implementation validated 146, all within those 147. The four existing divergent-loop and mask tests also passed on this GPU with PR #68. This was an offline corpus and GPU readback comparison. The in-game measurements in my local report were taken on a separate build.@ySKELLETONX on GitHub · 2026-11-25 16:35 UTC · original
Tested on an RX 7600 XT 16 GB (RDNA3, Navi 33), driver 32.0.32015.2008, Windows 11 Pro build 26300, Rust 1.98.1, at
0e9b505:cargo test -p victory-shader --lib --locked: 271 passed, 0 failed, 6 ignored, hardware dispatch tests included (mainat01aadd1: 266 passed). Workspace tests only; not run in the title.@adrianmjim on GitHub · 2026-11-25 17:41 UTC · original
Offline numbers for the 32-lane case, from the game's
shaders.rpfon an RX 7900 XT, withvictory translate --validate --list(no NVIDIA card here, so the 32-lane host is set with--host-lanes 32-32; translation and validation only, no pipelines or readback). Head0e9b505on01aadd1:--host-lanes 32-3201aadd1VS/PS (14,247) and mesh (8,694 of 8,765) are unchanged. So 155 more compute programs translate and validate, which agrees with Yoshi-233's 147 of 285 from a different starting set.
On a 64-lane host (
--host-lanes 32-64) the PR changes nothing: a hash of every program's DXIL is the same as on01aadd1for all 25,623 emitted programs.cargo test -p victory-shader --lib -- --test-threads=1gave 271 passed, 0 failed here.@gut0to on GitHub · 2026-11-25 16:06 UTC · original · reviewed
AI-assisted static review; I did not run tests or launch the game. For one wave64 console group split across 32-lane host waves, lds_meet inserts group barriers between conflicting LDS accesses in console flow. The checked-in regression cases cover cross-half reads, read-before-write ordering, branch writes, and translation without 64-lane waves. The PR reports GPU execution, which I did not run here.
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.