Shaders: lower v_permlane16_b32 and v_permlanex16_b32 #49
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/49"
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 Zettrox/ztrx. Originally posted by Altorru on 2026-11-25T05:58:47Z.
Both instructions decode and their operands were known, but neither had a lowering, so any shader using one failed with '
...is not supported' and its pipeline was dropped (issue #38 names a compute program stopped by v_permlanex16_b32). Each lane now reads src0 of a lane in its own 32-lane half, picked by nibble (lane & 15) of {src2, src1}: within its own row of 16 for v_permlane16, or the other row for v_permlanex16. The pick stays inside a half, so a console wave of 64 run as two host waves of 32 needs no exchange. Programs using either now ask for console lane order, as other cross-lane code does. The lowering is taken from fxceless/victory-fork@31714de; the console-lane detection and a host test are added here. Verification:cargo test -p victory-shaderpasses (171 tests; the new permlane16_and_x16_lower test builds both instructions and checks the cross-lane op is emitted).Imported from Zettrox/ztrx. Originally posted by hamdog0203 on 2026-11-25T11:50:53Z.
Independent verification on NVIDIA RTX 4060 (8 GB, Wave32, driver 621.35) + WARP + Windows SDK
dxil.dll(10.0.26100.0), Windows 11 x64 (26200.9974),rustc 1.98.1, audited at commite06eef85826bb942178fb2e8cabd3065996df158:v_permlane16_b32andv_permlanex16_b32restricted tocrates/victory-shader/src/emit/lower.rs(nounsafe, no external deps).cargo clippy --workspace --all-targets --locked -- -D warnings: passed (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed (0 warnings)cargo test --workspace --locked: all crates passed with 0 failures (victory_shader: 211 passed, 2 ignored;xtaskasset-policy: 4 passed)cargo test --locked -p victory-shader --lib permlane16_and_x16_lower -- --nocapture: passeddxil.dllexecution check: Since the PR's unit test only checks IR lowering (lower_with), I also temporarily ran a 32-lane compute test in an isolated worktree lowering bothv_permlane16_b32(0x377) andv_permlanex16_b32(0x378) and probing lanes across both 16-lane rows (0, 7, 8, 15, 16, 23, 24, 31) viav_readlane_b32. Both variants validated cleanly againstdxil.dlland returned the expected permuted values on the RTX 4060 (Wave32) without skipping.Note: I did not run a live game/title shader pack pass, only synthetic hardware and workspace verification.
Imported from Zettrox/ztrx. Originally posted by Aniseto on 2026-11-25T14:09:21Z.
Ran the shader tests at
e06eef8(clean PR head onmain90b529f):System
rust-toolchain.toml), MSVC 14.44.35207, DXIL validator 1.9.2609.5 (VICTORY_DXIL), debug buildResults
cargo test --locked -p victory-shader --lib permlane16_and_x16_lower -- --nocapture: 1 passed, 0 failed, 0 ignored, 212 filtered out (exit 0)cargo test --locked -p victory-shader --lib -- --test-threads=1: 211 passed, 0 failed, 2 ignored (exit 0)cargo test --locked -p victory-shader --lib emit::intersect_tests::the_32_bit_node_test_in_a_host_buffer_matches_the_reference_on_the_card -- --exact --nocapture: 1 passed, 0 failed, 0 ignored (exit 0). That test asserts an SM 6.6 device is available, so the GPU path ran on this adapter.What this adds
The existing report in this thread is on an RTX 4060 (Ampere) with the Windows SDK
dxil.dll10.0.26100.0. This adds a Blackwell wave32 part on driver 32.0.16.2124 with DXIL validator 1.9.2609.5. The newpermlane16_and_x16_lowertest passes here; it checks the emitted lowering only, so it does not by itself prove the permute runs on the GPU. The extra synthetic hardware probe in the earlier report used local changes and was not reproduced here.Not tested
The title's shader pack, live pipeline creation, retail runs, a WARP control lane, the console compiler's DXC, release profile, AMD and Intel GPUs.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
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.