Tests: check 24-bit multiply/MAD, mul_hi and SAD ops on the GPU #1228
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1228
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1228"
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?
@plentilha on GitHub · 2026-11-24 13:24 UTC · original
plentilha:tests/mul24-sad-gpu→main· +83 −0 · 1 files · 1 commits · openAdds GPU execution tests for 14 translated 24-bit multiply/MAD, 32-bit high-multiply, sum-of-absolute-differences and byte-lerp VALU instructions:
v_mul_i32_i24,v_mul_hi_i32_i24,v_mul_u32_u24,v_mul_hi_u32_u24,v_mad_i32_i24,v_mad_u32_u24,v_mul_hi_i32,v_mul_hi_u32,v_sad_u32,v_sad_u16,v_sad_u8,v_sad_hi_u8,v_msad_u8andv_lerp_u8. Test-only change.What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_mul24_mul_hi_and_sad_opsverifying high-byte masking/sign-extension on 24-bit inputs, 64-bit high products, zero-byte masking inv_msad_u8and rounding-bit carries inv_lerp_u8acrossgpu_waves().Tested
./scripts/test.ps1: 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64))cargo test -p xcl --lib -- gpu_mul24_mul_hi_and_sad_ops --nocapture: 1 passed, 0 failed (wave32 pass on this adapter)Regression run
Not tested
XCL_SAMPLE_*unset), Wine, release build.AI use
emit.rscoverage, wrote the test and PR description, and ran the test suite locally.@dcastell1 on GitHub · 2026-11-24 13:28 UTC · original
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@47efa2e(baseline 741 passed, 0 failed, 41 ignored on this box):One more than the baseline: the 24-bit multiply/MAD,
mul_hiand SAD checks run green here.Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@DavidM1911 on GitHub · 2026-11-24 13:36 UTC · original
Verification on RTX 3060 Ti (Windows 11, latest Vulkan driver), branch merged with current
main:cargo test -p xcl --lib recomp: 190 passed, 0 failed, 18 ignored (includes the new 24-bit multiply/MAD/mul_hi/SAD GPU checks).Thanks!
@upipibi on GitHub · 2026-11-24 14:09 UTC · original
I checked the expected values against the RDNA2 definitions (read from the ISA, not run on AMD hardware). All 14 match:
v_mul_hi_{i32_i24,u32_u24}: bits 63..32 of the 48-bit product.v_msad_u8: a byte whose S1 byte is 0 adds nothing.v_sad_hi_u8: the SAD shifted left 16 before S2 is added.v_lerp_u8: the rounding bit of each byte is bit 0 of the matching S2 byte (bits 0, 8, 16, 24).The cases also cover the ignored top byte of the 24-bit ops, and a zero reference byte for
msad. No changes needed from my side.AI-assisted (Claude Code).
@DavidM1911 on GitHub · 2026-11-26 04:17 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.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.