Shaders: v_writelane_b32 takes its lane from S1[4:0] (wave32) or S1[5:0] (wave64) #650
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/650"
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?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by 11run11 on 2026-11-27T16:28:07Z.
v_writelane_b32selects its lane with S1[4:0] in a 32-lane wave and S1[5:0] in a 64-lane one. The lowering compared the console lane with the whole of S1, so a select past the wave (for example 33 in a 32-lane wave) matched no lane and the write was lost. The console writes lane 1.The change
emit/lower.rs: thev_writelane_b32lane select is masked to the console wave (wave() - 1) before the comparison.TRANSLATOR_VERSION2 → 3. #634 makes the same bump, so whichever lands second needs the next number.lane_selects_past_the_wave_wrap(emit/valu_tests.rs, hardware, because WARP refuses wave-size-32 cross-lane code). A read of lane 33 gives lane 1's value; this already wrapped on the host, and the test now pins it. A write to lane 33 lands in lane 1. That half failed before (left: 0, right: 7on an RX 9070 XT).Tested
Windows 11, RX 9070 XT, Rust 1.98.1.
cargo test -p victory-shader: 303 passed, 0 failed.size_tests::the_record_count_of_a_structured_buffer_read_by_indexcrashes the process on this machine with or without the change, so I skipped it (see #634).cargo clippy -p victory-shader --all-targets --all-features -- -D warningsis clean.The bug was first reported as AvatarManz #404. This implementation is written independently from the ISA definition.
CI
Belobug's own
ci.yml, unmodified, passes on this branch in my fork (Clippy with-D warnings, default and diagnostics tests): https://github.com/11run11/VIctory-Belobug-11run/actions/runs/46032477888 (commit91666aa).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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.