shader: add end-to-end v_fma_mix modifier lowering controls #766

Merged
Ammmae0x merged 1 commit from upstream-pr/772 into main 2026-11-23 02:29:01 +00:00
Ammmae0x commented 2026-11-23 02:01:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-23T02:01:25Z.


Change

Follow-up to PR #762 (Refs #745, Refs #762) to add end-to-end disasm_rdna2 -> pixel_aot.lower regression controls and gfx1013 parity test cases in tests/rdna2_tools_check.py:

  • Added an end-to-end disasm_rdna2 -> pixel_aot.lower check on a minimal synthetic pixel shader exercising asymmetric v_fma_mix_f32 and v_fma_mixhi_f16 modifiers (abs, neg, op_sel, op_sel_hi, clamp) alongside packed v_pk_add_f16 / v_pk_mul_f16 (op_sel, op_sel_hi, neg_lo, neg_hi).
  • Verified a swapped-modifier control changes the lowered HLSL output and a negative control with invalid neg_lo on v_fma_mix_f32 raises ValueError.
  • Added v_pk_add_f16, v_pk_mul_f16, v_fma_mix_f32, and v_fma_mixhi_f16 modifier test cases to the gfx1013 LLVM parity comparison list.

Verification

Verified on Windows (commit deb02d6 on main fdd7158) after loading .\tools\dev.ps1:

  • .\out\pe-env\Scripts\python.exe -B tests/rdna2_tools_check.py -> 57 passed, 1 skipped (test_llvm_comparison: LLVM_LIB environment variable not set on this host), 0 failed (58 total).
  • ctest --preset dev --no-tests=error -R "^rdna2_tools_check$" -V -> 1/1 passed (inner unittest: 57 passed, 1 skipped test_llvm_comparison, 0 failed).
  • ctest --preset release --no-tests=error -R "^rdna2_tools_check$" -V -> 1/1 passed (inner unittest: 57 passed, 1 skipped test_llvm_comparison, 0 failed).
  • .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py -> passed (13 Markdown files, 143 links, 0 failed; self-test passed).
  • .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py -> passed (626 tracked files, 0 bidirectional controls; self-test passed).
  • .\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py -> passed.

Note: test_llvm_comparison requires LLVM_LIB (LLVM 15 gfx1013), which is not configured locally and is expected to run in CI where LLVM_LIB is set.

Evidence and follow-up

All tests use synthetic instruction encodings constructed directly in tests/rdna2_tools_check.py (no external or game shader binaries). Both a positive control (swapped abs/neg modifiers producing distinct HLSL) and a negative control (rejecting neg_lo on v_fma_mix_f32 with ValueError) are included. No build steps or README capabilities changed.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6550736474 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/772). Originally posted by [Ammmae0x](https://github.com/Ammmae0x) on 2026-11-23T02:01:25Z. --- ## Change Follow-up to PR #762 (Refs #745, Refs #762) to add end-to-end `disasm_rdna2` -> `pixel_aot.lower` regression controls and `gfx1013` parity test cases in `tests/rdna2_tools_check.py`: - Added an end-to-end `disasm_rdna2` -> `pixel_aot.lower` check on a minimal synthetic pixel shader exercising asymmetric `v_fma_mix_f32` and `v_fma_mixhi_f16` modifiers (`abs`, `neg`, `op_sel`, `op_sel_hi`, `clamp`) alongside packed `v_pk_add_f16` / `v_pk_mul_f16` (`op_sel`, `op_sel_hi`, `neg_lo`, `neg_hi`). - Verified a swapped-modifier control changes the lowered HLSL output and a negative control with invalid `neg_lo` on `v_fma_mix_f32` raises `ValueError`. - Added `v_pk_add_f16`, `v_pk_mul_f16`, `v_fma_mix_f32`, and `v_fma_mixhi_f16` modifier test cases to the `gfx1013` LLVM parity comparison list. ## Verification Verified on Windows (commit `deb02d6` on `main` `fdd7158`) after loading `.\tools\dev.ps1`: - `.\out\pe-env\Scripts\python.exe -B tests/rdna2_tools_check.py` -> `57` passed, `1` skipped (`test_llvm_comparison`: `LLVM_LIB` environment variable not set on this host), `0` failed (`58` total). - `ctest --preset dev --no-tests=error -R "^rdna2_tools_check$" -V` -> `1/1` passed (inner unittest: `57` passed, `1` skipped `test_llvm_comparison`, `0` failed). - `ctest --preset release --no-tests=error -R "^rdna2_tools_check$" -V` -> `1/1` passed (inner unittest: `57` passed, `1` skipped `test_llvm_comparison`, `0` failed). - `.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py` -> passed (`13` Markdown files, `143` links, `0` failed; self-test passed). - `.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py` -> passed (`626` tracked files, `0` bidirectional controls; self-test passed). - `.\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py` -> passed. Note: `test_llvm_comparison` requires `LLVM_LIB` (LLVM 15 `gfx1013`), which is not configured locally and is expected to run in CI where `LLVM_LIB` is set. ## Evidence and follow-up All tests use synthetic instruction encodings constructed directly in `tests/rdna2_tools_check.py` (no external or game shader binaries). Both a positive control (swapped `abs`/`neg` modifiers producing distinct HLSL) and a negative control (rejecting `neg_lo` on `v_fma_mix_f32` with `ValueError`) are included. No build steps or README capabilities changed. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:44:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!766
No description provided.