Repository navigation
shader: add hardware semantics tests for SAD/MSAD, 64-bit MAD, and v_perm_b32 (T12) - #51
Merged
Merged
Conversation
2 of 23 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements T12 from #29: adds hardware + WARP semantics tests in
crates/viport-shader/src/emit/semantics_tests.rsfor three lowered arithmetic instruction families that previously had no hardware semantics probes:sad_and_msad_match_the_hardware—v_sad_u8(0x15A),v_sad_hi_u8(0x15B),v_sad_u16(0x15C),v_sad_u32(0x15D), andv_msad_u8(0x171) across 600 edge inputs each (zero mask bytes forv_msad_u8, max byte/half/dword differences,a < bvsa > b, and 32-bit wrapping accumulators).wide_mad_matches_the_hardware—v_mad_u64_u32(0x176, checking both 64-bitv[5:6]and carry-out in VCC viav_cndmask_b32) andv_mad_i64_i32(0x177, signed 32×32 → 64 product plus 64-bit addend) across 384 edge inputs each (0,1,i32::MAX,i32::MIN,u32::MAX, and 64-bit carry boundaries).byte_permute_matches_the_hardware—v_perm_b32(0x344) across both the runtime VGPR selector path (216 inputs covering0..=3src1bytes,4..=7src0bytes,8..=11sign-fill of bytes 1 & 3 for both positive and negative sign bits,12→0x00, and13..=255→0xFF) and the literal constant selector path (36 inputs with0x0D0C_0904).Tested
Windows 11, Rust
1.100.0(stable-x86_64-pc-windows-gnu, no game data), onmain7f8320cplus this commit:cargo fmt --all -- --check: passed.cargo xtask policy: passed (asset policy: 220 files ok).cargo clippy -p viport-shader --no-deps --all-targets: zero warnings insemantics_tests.rs.cargo test -p viport-shader --lib -- --nocapture sad_and_msad_match_the_hardware wide_mad_matches_the_hardware byte_permute_matches_the_hardware: 3 passed, 0 failed (all 9 probes ran on both the hardware adapter and WARP with 0 model mismatches on hardware, 0 on WARP, and 0 hardware/WARP disagreements).--workspacesuite.Checklist
cargo fmt --all -- --checkandcargo xtask policypass; no game files or data from them.