Shaders: hardware test for the 16-bit integer ops #1877
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!1877
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1877"
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?
@LouisRiverstone on GitHub · 2026-11-24 23:58 UTC · original
LouisRiverstone:shaders/v-int16-test→main· +46 −0 · 1 files · 2 commits · openv_add_nc_u16,v_sub_nc_u16,v_mul_lo_u16,v_lshrrev_b16,v_ashrrev_i16,v_lshlrev_b16,v_max_u16,v_max_i16,v_min_u16andv_min_i16(VOP3 0x303..0x30c, 0x314) are lowered inlower.rsthrough one arm that works on the low halves, sign-extending for thei16forms and masking the shift amount to four bits. No hardware test ran them.New test
v_16_bit_integer_ops_match_rdna2runs all 64 ordered pairs of eight 16-bit values (the sign boundary, shift amounts 16 and 17, all-ones) through each op, with garbage in the high halves of the sources. The result's low half is compared withu16operations in Rust.Test only, no production change.
Verify:
cargo test -p victory-shader v_16_bit_integer(Windows, hardware GPU or WARP). I type-checked it with clippy forx86_64-pc-windows-msvc, but could not run it locally: the shader test module is Windows-only.🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-25 08:18 UTC · original · edited 2026-11-26 02:18 UTC
Automated triage for the maintainers.
Merge candidate (recommending a look, not an approval). Reviewed at
9520cf3, which merges cleanly intomain. Test only:v_16_bit_integer_ops_match_rdna2incrates/victory-shader/src/emit/valu_tests.rs.The ten opcodes match
gfx10/opcodes.rs, and the expected values follow the RDNA2 definitions: low halves only,i16forms signed, and the shifts take a 4-bit amount from the first operand with the value in the second. That is what the_ =>16-bit arm ofemit/lower.rsimplements. The high halves of the sources are filled with garbage, and only the low half of the result is compared. CI:checkpassing.Nit, not blocking:
vop3(...)is built twice per op to take[0]and[1]. Binding it once would read better.Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 11:55 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
85af2ca2ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@catminou4 on GitHub · 2026-11-25 02:09 UTC · original · approved these changes
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
940d32f), cargo test → 144 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows.victory-shader. Hardware test for the 16-bit integer ops: RDNA2-matched (Windows-gated).
@fuzeofficlal on GitHub · 2026-11-26 19:35 UTC · original · approved these changes
Looks good to me — solid test coverage for the 10 lowered VOP3 16-bit integer ops, with the first Windows hardware + WARP run confirming they pass.
Verified locally on Windows 11 with head
9520cf3acleanly merged ontomain(63bcca43):v_16_bit_integer_ops_match_rdna2(crates/victory-shader/src/emit/valu_tests.rs:1313-1356) againstgfx10/opcodes.rsand RDNA2 ISA: all 10 opcodes (0x303..=0x305,0x307..=0x30C,0x314), operand ordering (src0 = v1shift count / left operand,src1 = v2shifted value / right operand), sign-extension fori16forms, 4-bit shift masking (& 15), and high-half source garbage (0xABCD_0000 | a,0x1234_0000 | b) match expected semantics.rustfmt --edition 2024 --config skip_children=true) shows no diffs on the added lines.cargo run -p xtask -- policy(191 files ok) andcargo clippy --locked -p victory-shader --all-targets -- -D warnings(both default and--all-features) pass.cargo test --locked -p victory-shader --lib v_16_bit_integer_ops_match_rdna2passes on bothVICTORY_WARP=0(RTX 5090,32.57s) andVICTORY_WARP=1(WARP,0.56s):1 passed; 0 failed(305 filtered out).Two minor non-blocking notes:
v0is zero-initialized (vop1(0x001, 0, 128)) and the assertion masksgot & 0xFFFF, so upper-half preservation inv0[31:16]is left untested here.valu_tests.rs:1314writes0x303..0x30c, which spans0x306(not present ingfx10/opcodes.rsor tested).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.