Shader tests: v_pk_mul_lo_u16 keeps each half to 16 bits #1289
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1289
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1289"
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?
@bvtterbroot on GitHub · 2026-11-24 17:09 UTC · original
bvtterbroot:shader-pk-mul-lo-mask→main· +49 −0 · 1 files · 1 commits · openv_pk_mul_lo_u16has no test, and its lowering,(x * y) & 0xffffper half, is the case where an AMD driver has been seen to drop the 16-bit mask when the other half of the result is a constant 0. That was in another translator, on the Vulkan path (RDNA2 iGPU, driver 26.10.1,0x1234 * 0xaaaaread back as0x0c229e88instead of0x00009e88). This adds a test that would catch it here.What
v_pk_mul_lo_u16_keeps_each_half_to_16_bitsincrates/victory-shader/src/emit/valu_tests.rs, plus a smallvop3pencoder beside the existingvop1/vop3ones. All four forms take run-time operands from the root constants, so no compiler can fold them:v_pk_mul_lo_u16 v0, v1, 0xaaaa0000 op_sel:[0,1] op_sel_hi:[0,0](v1 =0x00011234)0x00009e88v_pk_mul_lo_u16 v0, s1, v3 op_sel_hi:[1,0](s1 =0x0003ffff, v3 =0x1234abcd)0x03675433v_pk_mul_lo_u16 v0, v4, 0x00050000(v4 =0x0007beef)0x00230000v_pk_mul_lo_u16 v0, v1, 7 op_sel_hi:[1,0]0x00077f6cThe expected words are the RDNA2 ISA rule (each half is the low 16 bits of the product of the selected source halves). The same four cases were measured on native RDNA2 hardware (gfx1036) in that other project. No translator change: the current lowering gets all four right.
Tested
Windows 11, Rust 1.98.1, at
ffe310e:cargo test -p victory-shader(121 passed). The test host picks the default adapter, so for this run I pointed it at the iGPU with a local, uncommitted change toHost::new.cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.rustfmt --checkon the file: clean.So the AMD D3D12 drivers here do not show the dropped mask. The test is a guard for when the lowering or a driver changes.
🤖 Generated with Claude Code
@geiyiliyabumo on GitHub · 2026-11-24 17:34 UTC · original
Independent verification of \␀03944a\ on Windows 11 / AMD Radeon RX 9060 XT (RDNA4, \gfx1200) / Rust 1.98.1 MSVC:
AI-assisted; synthetic tests only, no game files.
@Marvisak on GitHub · 2026-11-25 01:21 UTC · original · edited 2026-11-25 22:28 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/valu_tests.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.