Repository navigation
Conversation
`V_FMA_MIXHI_F16` had no test anywhere, `V_FMA_MIX_F32` had one case with no modifier, and nothing locked the part of VOP3P MIX that is easiest to get wrong: in this family `NEG_HI` is `abs`, not a negation of the high half, and it applies before `NEG`. A change that "fixed" that pair, or that dropped the preservation of the half a MIXLO/MIXHI destination does not write, would have passed the suite and broken every mixed-f16 shader silently. The test runs 12 encodings on each of the three opcodes against a CPU reference: which sources are f16 (`OP_SEL_HI`), which half each one takes (`OP_SEL`), `OP_SEL` on a source that is not f16 (ignored), `NEG`, `NEG_HI`, the two together, `CLAMP` above 1 and below 0, and the untouched half of the destination, which starts from a marker value. Operands differ between four lane groups, so a reference that ignored them could not pass. Every operand is a small dyadic value, so each product and sum is exact in f32 and each result is representable in f16: the expectations do not depend on the f16 rounding mode, which has its own tests, nor on whether `mad()` fuses. Measured on an RTX 5070 Ti (driver 621.01), Windows 11, Rust 1.98.1 MSVC, debug: `cargo test --workspace --no-fail-fast -- --test-threads=4` gives 752 passed, 0 failed, 41 ignored over 19 test binaries. Eight deliberate regressions in `emit.rs` (NEG/NEG_HI swapped, NEG_HI not doing abs, abs after neg instead of before, OP_SEL taking the other half, OP_SEL_HI ignored, MIXLO writing the high half, the other half not preserved, CLAMP ignored) are each caught by this test; `emit.rs` is unchanged in this commit. Assisted-by: Claude Code (Claude Opus 5) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
AMD run with 64-lane waves, which this PR lists as not tested. Tested: pass, head
Not tested: release profile; Intel; the whole workspace suite. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
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.
Superseded by #1122, which came first and covers more. I wrote this before seeing that PR;
it also exercises SGPR operands, both wave32 and wave64, the dynamic
S_ROUND_MODErounding andchained
mixlo+mixhi, none of which are here. I ran #1122 on an RTX 5070 Ti and it catches eightdeliberate
emit.rsregressions out of eight (report in that thread). Close this one in its favour.The only thing this test reaches that #1122 does not:
NEG = 0b111andNEG_HI = 0b111, themodifiers set on all three sources at once. If that is worth having, it belongs as two encodings
added to #1122, not as a second test.
What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_fma_mix_halves_modifiers_clamp_and_preserved_half,12 encodings on each of the three MIX opcodes against a CPU reference —
OP_SEL_HI,OP_SEL,OP_SELon a non-f16 source (ignored),NEG,NEG_HI(which isabshere, applied beforeNEG),CLAMPabove 1 and below 0, and the untouched half of the destination.Tested
stable-x86_64-pc-windows-msvc, DXC 1.9.2602.17, debug. No game data.cargo test --workspace --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignoredover 18 test binaries.
SKIPPED, 2, both "no wave64":gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.emit.rs(NEG/NEG_HI swapped; NEG_HI not doingabs; abs after neg; OP_SEL taking the other half; OP_SEL_HI ignored; MIXLO writing the high half;
the other half not preserved; CLAMP ignored) are each caught.
emit.rsis unchanged here.Not tested
scripts/smoke.ps1; the diff touches onlytests.rs, whichpr_check.pyexempts.AI use
this description. I checked the diff and every count against the logs.