Tests: check 24-bit multiply/MAD, mul_hi and SAD ops on the GPU #1219
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by plentilha on 2026-11-24T13:24:44Z.
Adds 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.Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T13:28:26Z.
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:36:05Z.
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!
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T14:09:16Z.
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).
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:17:28Z.
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.Imported from ivall/xcl. Originally posted by throny on 2026-11-28T07:48:49Z.
Two contributors checked independently and found that this PR makes the same change as #699: #1607, group D144. They suggest keeping #699. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-28T21:14:02Z.
Closing as a duplicate of #699 (confirmed by 2+ contributors in #1607, group D144). Thanks for the contribution — feel free to comment if this covers something #699 does not.
Pull request closed