Repository navigation
shader: pin v_fma_mix half selection per source position - #2806
Merged
tedin7 merged 1 commit intoNov 26, 2026
Merged
Conversation
Check each source of v_fma_mix_f32 and v_fma_mixlo_f16 on its own: op_sel_hi alone reads the low binary16 half, op_sel with op_sel_hi the high half, and op_sel alone is refused. Keeps a swapped-source control. Test only; Refs R0Y00#2103.
tedin7
reviewed
Nov 26, 2026
tedin7
left a comment
Collaborator
There was a problem hiding this comment.
Review of head fa2b5f7 (test-only change: tests/rdna2_tools_check.py, +86 lines, no tool code touched).
Findings: none blocking.
- The new test pins the half-select per source position for
v_fma_mix_f32andv_fma_mixlo_f16, with exact lowered text, the refusal class ("High-half selection requires an f16 operand") from bothparse_fma_mixandlower(), and a swapped-source control. This matches the maintainer's request on #2103. - No lowering is added or changed, so no new GPU readback is needed for this PR. The test checks the lowered text and parsed fields, as the existing fma_mix tests do.
- Overlap: no other open or merged PR adds this discriminator.
Commands run locally (worktree at the PR head, 4 commits behind main):
python3 -B tests/rdna2_tools_check.py: Ran 158 tests, OK (skipped=19).python3 tests/docs_links_check.py: ok.python3 tests/bidi_controls_check.py: ok.git diff --check origin/main...HEAD: clean.- Mutation 1 (
op_selpairing for positions 1 and 2 swapped inlower()): 5 failures. Restored. - Mutation 2 (high-half refusal limited to positions 0 and 1 in
parse_fma_mix): 2 failures. Restored.
AI-assisted; commands listed were executed locally.
Collaborator
|
Win2025 receipt for head fa2b5f7. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
5 tasks done
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.
Change
Adds
test_vop3p_fma_mix_half_select_per_source_positiontotests/rdna2_tools_check.py, next to the existing fma_mix test. No tool code changes:tools/pixel_aot.pyand every other tool are untouched.Refs #2103. When closing that PR the maintainer wrote: "Your test that isolates each source position is useful independently. Please rebase and keep that discriminator, removing the overlapping lowering. The merged parser rejects a half-select bit on a full-width input, so check the refusal class while keeping the swapped-source control."
For each source position (0, 1, 2) and for both
v_fma_mix_f32andv_fma_mixlo_f16(v_fma_mixhi_f16is covered by the existing test):op_sel_hialone widens the low half of that source only; the other sources stay binary32. Asserted on the exact loweredmad(...)text and on the parsed fields.op_selplusop_sel_hion that source selects the high half of that source only (exact text). A variant withop_sel_hi:[1,1,1]andop_selon one source checks that the half bit does not move to a neighbour.op_selalone is refused withValueErrormatching "High-half selection requires an f16 operand", both fromparse_fma_mixand throughlower(), also whenop_sel_hiis set on a different source.The test needs no LLVM: it feeds assembly text to
lower(). It runs on Windows and in the Linux CI list (the file is already registered).Verification
Commands from the worktree, with
C:\XBOX2Windows\repo\out\pe-env\Scripts\python.exe -B:tests/rdna2_tools_check.pygaveRan 157 tests,OK (skipped=19).Ran 158 tests,OK (skipped=19). The skips are LLVM-only tests.Mutants of
tools/pixel_aot.py(each applied by hand, then restored;git diff -- toolsempty after each):test_vop3p_fma_mix_inline_abs_neg_modifierslower()pairsop_sel[1]andop_sel[2]swappedparse_fma_mixlimited to positions 0 and 1op_sel aloneat position 2, both opcodes, 2 failures)zip(tokens, op_sel, op_sel_hi)plain swap inlower()Not run:
tests/pixel_aot_check.py(needs LLVM and a GPU/WARP device; not touched), the full CTest suite.Evidence and follow-up
Overlap:
gh pr list --state open --search "fma_mix"shows only #2753 (gfx2hlsl) and #532 (integer multiplies), neither editstests/rdna2_tools_check.py. Open PRs #1572 and #531 touch the file elsewhere (not near the fma_mix tests); the new method sits between the existing fma_mix test andtest_mubuf_opcode_table_synthetic_forms. The immediate handling from #2100 (-0,-16..-1) is not touched.AI-assisted.