Shaders: hardware probe for s_mul_hi_i32 #1364
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1364"
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 Marvisak/VIctory. Originally posted by LouisRiverstone on 2026-11-24T17:36:44Z.
Adds
sop2_probe(0x36, ...)fors_mul_hi_i32(signed 64-bit product, high dword) next to the existings_mul_i32ands_mul_hi_u32probes inscalar_probes. Reduced after triage: the other two ops are already covered on main.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T17:42:40Z.
Review: APPROVED
Hardware test only: s_mul_i32/s_mul_hi_u32/s_mul_hi_i32 (SOP2 0x26/0x35/0x36) with wrapping and 64-bit high-half references. Encodings match the ISA. Windows-only execution. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main
ffe310e,cargo test -p <crate> --locked. Shader execution tests (valu_tests/host/diff_tests) are#[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. 96 passed, 0 failed.Imported from Marvisak/VIctory. Originally posted by matheusfermiano-source on 2026-11-24T18:08:21Z.
First GPU run of this PR's test that I could find, on an AMD GPU under Proton on Linux:
s_mul_and_s_mul_hi_match_rdna2: pass on a Radeon 660M (RDNA2).26f7098. Built on Linux with llvm-mingw forx86_64-pc-windows-gnullvm(Rust 1.98.1) and run under Proton Experimental (11.0-20261027b) with its vkd3d-proton 3.1.0, one GPU at a time;dxil.dllfrom DXC 1.9.2609 was loaded, so the test modules were validated.victory-shadersuite 120 passed, 1 failed, 1 ignored. Nothing fails that passes onmain(ffe310e). The one failure,emit::tests::stub_pipeline_is_created, fails onmainhere too: vkd3d-proton accepts the zeroed DXIL hash that the Windows runtime refuses (one of the Wine failures listed in #1218).This is RADV, not AMD's Windows driver, so it adds to a Windows run rather than replacing it. Synthetic tests only, no game files. AI-assisted (Claude Code, Opus 5.5); every run was on this machine.
Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-24T19:13:00Z.
Native Windows run on AMD RDNA2: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head
26f7098on mainffe310e(clean merge).cargo test -p victory-shader --lib -- --test-threads=1: 121 passed, 0 failed, 1 ignored (main alone: 120 passed).s_mul_and_s_mul_hi_match_rdna2ran on the hardware adapter and then on WARP, and passed on both. The earlier RDNA2 runs on this PR went through vkd3d-proton on Linux; this one is AMD's own D3D12 driver.Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:50:15Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Hardware/valu tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers structure/lowering unit tests.Hardware test for s_mul_i32/s_mul_hi_u32/s_mul_hi_i32 (s_mul_and_s_mul_hi_match_rdna2).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T02:36:54Z.
Automated triage for the maintainers.
Merge candidate.
The PR is now what the last triage asked for: one
sop2_probe(0x36, ab.clone(), ...)entry fors_mul_hi_i32inscalar_probes(crates/victory-shader/src/emit/semantics_tests.rs), next to main's existings_mul_i32(0x26) ands_mul_hi_u32(0x35) probes. The model takes the high dword of the signed 64-bit product, which matches the RDNA2 ISA. 0x36 iss_mul_hi_i32ingfx10/opcodes.rs, and the lowering inlower.rscovers it. No SCC is expected, which is correct. The earlier duplicated cases are gone.CI: passing (
check).Generated by Claude Code
[PR #1364] Shaders: hardware test for s_mul_i32, s_mul_hi_u32 and s_mul_hi_i32to [PR #1364] Shaders: hardware probe for s_mul_hi_i32Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:00:19Z.
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing as covered by #2015, which adds the same probe (opcode 0x36, same model) among many others and was shown to fail when the signedness of the lowering is broken. The probe here is right and passes.
If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed