shader: pin v_fma_mix half selection per source position #2798
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2806"
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 R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-26T11:00:53Z.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:07:20Z.
Review: COMMENTED
Review of head
fa2b5f73(test-only change:tests/rdna2_tools_check.py, +86 lines, no tool code touched).Findings: none blocking.
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.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.op_selpairing for positions 1 and 2 swapped inlower()): 5 failures. Restored.parse_fma_mix): 2 failures. Restored.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:08:06Z.
Win2025 receipt for head
fa2b5f73.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
fa2b5f73d03b9faa75f49bc3c37a1af054819248:tests/rdna2_tools_check.pyok (4.0s),PYCHECK name=tests/rdna2_tools_check.py rc=0AI-assisted; commands listed were executed locally.