fix: preserve wave64 first-lane reads on 32-lane hosts #317
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!317
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-317"
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?
@mauroalvare on GitHub · 2026-11-26 02:37 UTC · original
mauroalvare:codex/victory-wave64-firstlane→main· +139 −1 · 3 files · 4 commits · openVice-Tay
Vice-Tay now selects its cross-half exchange for lane-varying
v_readfirstlane_b32sources on 32-lane hosts. It uses the existing uniformity analysis and retains the descriptor waterfall cases.The GPU test stores every lane's result with the first active console lane in either half. All tested EXEC masks returned the expected lane.
Earlier Neptune description
Change
Neptune could translate a compute shader with
v_readfirstlane_b32on a 32-lane device using a first-lane operation per host wave. The DXIL passed validation and the PSO ran. In a 64-thread group with every console lane active, lane 32 read the value from lane 32 instead of lane 0.When the normal lowering lacks a cross-half exchange, a first-lane read from a potentially varying VGPR now requests the existing paired form through
emit_any. The paired form places both halves of the console wave in one host wave. The routing uses the existing wave-uniformity analysis and honors the existing descriptor waterfall handling. This change covers compute workgroups made up of complete console waves, the group shape supported by the paired form.Verification
Base
c4c93bdc413191a9dc909998d2d53080a3f0c880. Fix89df1b296c80da11a4d60fe6c0c2e0ac518285da.The synthetic shader puts each flat thread ID in its source VGPR, masks EXEC, reads the first active lane, then restores EXEC and stores a result for every thread. The tests run the same emitter used by the Neptune runtime behind
tools/lancer_victory.ps1, validate the emitted DXIL with the Windows SDK validator (1.8.2502.11), create a D3D12 compute PSO, dispatch, and compare the readback.On the RTX 5070 Ti (driver 621.40, 32-lane waves), the base returned 32 at lane 32 where the expected value was 0. The fix selected the paired 32-lane form and matched all 960 output dwords for groups of 64 and 128 threads with five EXEC masks, including an empty mask. The Python RDNA 2 interpreter independently agreed on every result. A second fixture verifies direct lowering for a uniform VGPR source. The new GPU repro ran on hardware. Local WARP reports a 4-lane wave.
From
third_party/victory:The full shader suite also reports four console-compiler comparisons that skip locally and two adapter-specific skips in existing wave-sum tests.
From the repository root, with
ANYXBOXX_REQUIRE_RUNTIME=1, the SDK's DXC, and the C++/Rust/TomBox binaries already built in this worktree from the same base:Oracle and test data
The fixtures generate their shader words and data in the test source. Section 12.8 of AMD's RDNA 2 ISA selects the lowest EXEC bit, with lane zero for empty EXEC. The earlier VIctory report recorded the per-half symptom on another emitter line. This PR validates Neptune's paired form on Windows, including two console waves in one workgroup with a varying EXEC mask. AMD RDNA 2 ISA · Prior VIctory report
AI assistance from OpenAI Codex for investigation, implementation, and validation.
Rebase verification
Rebased on
58d2f53after #387. The paired lowering preserves the current NVIDIA wave-uniformity analysis.cargo test --locked --offline -j 5 -p victory-shader -- --nocapture --test-threads=1reported 259 passed, 0 failed, and 2 ignored. The first-lane test ran on the RTX 5070 Ti for both group sizes. With the test applied to the base alone,cargo test --locked --offline -j 5 -p victory-shader readfirstlane_ -- --nocapture --test-threads=1reported 1 passed and 1 failed. The varying-source case returned 32 for lane 32 in a 64-thread group with all lanes active, where it should return 0.The size check in CI found that
lower.rsexceeded the 512 KiB limit. The first-lane and indexed-lane helpers now live inlane_read.rs. After the move,cargo xtask policypassed for all 215 files and the full shader suite again passed 259 tests, with 2 ignored.@LooperSalty on GitHub · 2026-11-26 16:48 UTC · original
This PR conflicts with main in
third_party/victory/crates/victory-shader/src/emit/lower.rsandwave64_tests.rs(main moved with the clamp/Wave32 work in #377 and the shader changes in #387-era merges). Please rebase on main, check the first-lane read fix still applies and its test still fails without it, re-run the victory-shader tests and force-push. CI has not run on this PR yet, so it also needs a maintainer approval once it is rebased.🤖 Generated with Claude Code
89df1b296cto8a181250fb8a181250fbto736509e3b4@mauroalvare on GitHub · 2026-11-26 18:25 UTC · original
Rebased and pushed over the shader work in #387. The regression still returned 32 instead of 0 at lane 32 on the base. With the fix, both workgroup sizes passed on the RTX 5070 Ti, and the full
victory-shadersuite passed 259 tests with two ignored.I moved the lane-read helpers into their own module after the branch exceeded the 512 KiB source-file limit. The asset-policy check now passes.
The latest CI run passed.
41aa5ce05atoa135307034a135307034to5bcae88c8bView 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.