scan_unsupported_shaders: track lowered scalar, VOP3P, SDWA and conversion ops #532

Merged
alexander-src merged 1 commit from upstream-pr/538 into main 2026-11-22 10:17:26 +00:00
alexander-src commented 2026-11-22 10:09:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by alexander-src on 2026-11-22T10:09:40Z.


Change

Align tools/scan_unsupported_shaders.py with the instructions already lowered by tools/pixel_aot.py so scan_unsupported_shaders.py and tools/pso_readiness.py stop flagging accepted shaders as blocked (unsupported_opcodes) or reporting lowered opcodes as unrecognized:

  • Strip _sdwa suffixes in is_opcode_recognized() alongside _e32, _e64 and _dpp* so v_mov_b32_sdwa, v_cvt_f32_f16_sdwa and v_cmp_*_f32_sdwa classify as recognized RDNA 2 opcodes.
  • Extend KNOWN_RDNA2_BASE_OPCODES from pixel_aot.SCALAR, SALU_BIT64, VOP3P_F16, VOP3P_INT16 and HINT_LIMITS, plus lowered VOP3P, cube, conversion and scalar compare ops.
  • Extend SUPPORTED_INSTRUCTIONS_REGEX to cover lowered scalar ALU, 64-bit scalar bitops, s_bfe/s_bfm/s_cmp/s_bitcmp/s_cselect, s_clause/s_setprio/s_sleep/s_waitcnt vmcnt(0..63), v_mov_b32[_sdwa], v_cvt_f32_f16[_sdwa], v_cvt_f16_f32, v_cvt_f32_ubyte[0-3], v_cvt_off_f32_i4, v_ldexp_f32, v_cube*_f32, v_fmaak/v_fmamk, v_add_nc_u32/v_sub_nc_u32, v_min/max/min3/max3/med3_{i32,u32}, v_cmp_*_{f32,i32,u32}, v_cmp_class_f32, v_cndmask_b32, v_pk_*, v_fma_mix*, v_dot*, image_sample ... dmask:0x[7f], exp mrt0 ... off, off and s_buffer_load_dword[x2].
  • Add end-to-end pso_readiness_check.py coverage (with_lowered_ops, plus negative controls that still block v_rcp_f64 and s_branch) and rdna2_tools_check.py regression checks.

No shared interface changed; all changes are confined to the scanner and its tests.

Verification

Tested on Linux x64 at commit f0dc6e2 (based on 914d241) with Python 3 (requirements-dev.txt installed) and LLVM 23.1.4 (llvm-mc, llvm-objcopy, /usr/lib/libLLVM.so):

  • Across all 73 tests/pixel_aot_check.py fixtures (2,650 instructions): origin/main reported 111 unrecognized instructions (60 unique opcodes) and 723 falsely unsupported instructions; after this change, 0 unrecognized and 0 unsupported.
  • python -B tests/pso_readiness_check.py: passed (PSO census, evidence states, and native hash control passed).
  • LLVM_LIB=/usr/lib/libLLVM.so LLVM_MC=llvm-mc LLVM_OBJCOPY=llvm-objcopy python -B tests/rdna2_tools_check.py: passed (33 tests, OK).
  • python -B tests/form_coverage_check.py: passed.
  • python -B tests/docs_links_check.py: passed (10 Markdown files, 112 links).
  • python -B tests/bidi_controls_check.py: passed (506 tracked files).

Windows CI runs the full Windows test suite; this change does not modify DXC or D3D12 shader output.

Evidence and follow-up

All new fixtures are synthetic RDNA 2 assembly sequences owned by the repository (MIT). SUPPORTED_INSTRUCTIONS_REGEX tracks the syntax accepted by pixel_aot.py today; future pixel_aot.py opcodes can extend KNOWN_RDNA2_BASE_OPCODES and the matcher alongside their lowering PRs.

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: yes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6541123638 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/538). Originally posted by [alexander-src](https://github.com/alexander-src) on 2026-11-22T10:09:40Z. --- ## Change Align `tools/scan_unsupported_shaders.py` with the instructions already lowered by `tools/pixel_aot.py` so `scan_unsupported_shaders.py` and `tools/pso_readiness.py` stop flagging accepted shaders as `blocked` (`unsupported_opcodes`) or reporting lowered opcodes as unrecognized: - Strip `_sdwa` suffixes in `is_opcode_recognized()` alongside `_e32`, `_e64` and `_dpp*` so `v_mov_b32_sdwa`, `v_cvt_f32_f16_sdwa` and `v_cmp_*_f32_sdwa` classify as recognized RDNA 2 opcodes. - Extend `KNOWN_RDNA2_BASE_OPCODES` from `pixel_aot.SCALAR`, `SALU_BIT64`, `VOP3P_F16`, `VOP3P_INT16` and `HINT_LIMITS`, plus lowered VOP3P, cube, conversion and scalar compare ops. - Extend `SUPPORTED_INSTRUCTIONS_REGEX` to cover lowered scalar ALU, 64-bit scalar bitops, `s_bfe`/`s_bfm`/`s_cmp`/`s_bitcmp`/`s_cselect`, `s_clause`/`s_setprio`/`s_sleep`/`s_waitcnt vmcnt(0..63)`, `v_mov_b32[_sdwa]`, `v_cvt_f32_f16[_sdwa]`, `v_cvt_f16_f32`, `v_cvt_f32_ubyte[0-3]`, `v_cvt_off_f32_i4`, `v_ldexp_f32`, `v_cube*_f32`, `v_fmaak`/`v_fmamk`, `v_add_nc_u32`/`v_sub_nc_u32`, `v_min/max/min3/max3/med3_{i32,u32}`, `v_cmp_*_{f32,i32,u32}`, `v_cmp_class_f32`, `v_cndmask_b32`, `v_pk_*`, `v_fma_mix*`, `v_dot*`, `image_sample ... dmask:0x[7f]`, `exp mrt0 ... off, off` and `s_buffer_load_dword[x2]`. - Add end-to-end `pso_readiness_check.py` coverage (`with_lowered_ops`, plus negative controls that still block `v_rcp_f64` and `s_branch`) and `rdna2_tools_check.py` regression checks. No shared interface changed; all changes are confined to the scanner and its tests. ## Verification Tested on Linux x64 at commit `f0dc6e2` (based on `914d241`) with Python 3 (`requirements-dev.txt` installed) and LLVM 23.1.4 (`llvm-mc`, `llvm-objcopy`, `/usr/lib/libLLVM.so`): - Across all 73 `tests/pixel_aot_check.py` fixtures (2,650 instructions): `origin/main` reported 111 unrecognized instructions (60 unique opcodes) and 723 falsely unsupported instructions; after this change, 0 unrecognized and 0 unsupported. - `python -B tests/pso_readiness_check.py`: passed (`PSO census, evidence states, and native hash control passed`). - `LLVM_LIB=/usr/lib/libLLVM.so LLVM_MC=llvm-mc LLVM_OBJCOPY=llvm-objcopy python -B tests/rdna2_tools_check.py`: passed (33 tests, OK). - `python -B tests/form_coverage_check.py`: passed. - `python -B tests/docs_links_check.py`: passed (10 Markdown files, 112 links). - `python -B tests/bidi_controls_check.py`: passed (506 tracked files). Windows CI runs the full Windows test suite; this change does not modify DXC or D3D12 shader output. ## Evidence and follow-up All new fixtures are synthetic RDNA 2 assembly sequences owned by the repository (MIT). `SUPPORTED_INSTRUCTIONS_REGEX` tracks the syntax accepted by `pixel_aot.py` today; future `pixel_aot.py` opcodes can extend `KNOWN_RDNA2_BASE_OPCODES` and the matcher alongside their lowering PRs. ## 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: yes.
upstream-sync closed this pull request 2026-11-24 06:43:34 +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!532
No description provided.