shader: lower gfx1013 v_rndne_f32 in pixel_aot #506

Merged
PrivacyOnion merged 2 commits from upstream-pr/512 into main 2026-11-22 09:58:08 +00:00
PrivacyOnion commented 2026-11-22 08:39:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by PrivacyOnion on 2026-11-22T08:39:55Z.


## Summary

  • Add v_rndne_f32 (_e32 and _e64, including -src, abs(src), and clamp) to tools/pixel_aot.py, lowering to HLSL round(...) (DXIL Round_ne, IEEE 754 round-to-nearest-even preserving -0.0).
  • Because tools/scan_unsupported_shaders.py derives PIXEL_ALU_NAMES directly from pixel_aot.ALU, scanner and PSO readiness tracking pick up v_rndne_f32 automatically.
  • Add tests/pixel_rndne_check.py and register pixel_aot_rndne_warp and pixel_aot_rndne_hardware in CMakeLists.txt (with FORM_COVERAGE_RECORD and SKIP_RETURN_CODE 77 on hardware):
    • Rejects whole-quad mask use, wrong arity, and unwaited vmcnt(0) sample reads.
    • Verifies positive and negative half-way ties (0.5, 1.5, 2.5, 3.5, -0.5, -1.5, -2.5, -3.5) including -0.0 sign preservation, non-ties (+/-0.25, +/-0.75), and _e64 modifiers (-, abs(), clamp).
    • Includes mutation controls against v_trunc_f32_e32, v_floor_f32_e32, v_ceil_f32_e32, and unclamped _e64.

Verification

  • Environment: Windows 11, VS Build Tools MSVC, DXC 10.0.26100.0, D3D12 debug layer enabled
  • Hardware adapter: NVIDIA GeForce RTX 5070 (vendor=10de device=2f04, driver=32.0.16.1664)
  • WARP adapter: Microsoft Basic Render Driver (vendor=1414 device=008c, driver=10.0.26100.9818)
  • Commands run:
    • ctest --preset dev --no-tests=error -R "^(pixel_aot_rndne_warp|pixel_aot_rndne_hardware|pixel_aot_e64_warp)$" -V -> PASSED (max_absolute_error=0, debug_errors=0 debug_warnings=0 on both WARP and RTX 5070)
    • out/pe-env/Scripts/python.exe -B tests/pso_readiness_check.py -> PASS
    • out/pe-env/Scripts/python.exe -B tests/rdna2_tools_check.py -> OK (31 tests, 1 skipped)
    • out/pe-env/Scripts/python.exe -B tests/form_coverage_check.py -> PASS
    • out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.py -> PASS
    • out/pe-env/Scripts/python.exe -B tests/docs_links_check.py -> PASS
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6540368883 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/512). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-22T08:39:55Z. --- ## Summary - Add `v_rndne_f32` (`_e32` and `_e64`, including `-src`, `abs(src)`, and `clamp`) to `tools/pixel_aot.py`, lowering to HLSL `round(...)` (DXIL `Round_ne`, IEEE 754 round-to-nearest-even preserving `-0.0`). - Because `tools/scan_unsupported_shaders.py` derives `PIXEL_ALU_NAMES` directly from `pixel_aot.ALU`, scanner and PSO readiness tracking pick up `v_rndne_f32` automatically. - Add `tests/pixel_rndne_check.py` and register `pixel_aot_rndne_warp` and `pixel_aot_rndne_hardware` in `CMakeLists.txt` (with `FORM_COVERAGE_RECORD` and `SKIP_RETURN_CODE 77` on hardware): - Rejects whole-quad mask use, wrong arity, and unwaited `vmcnt(0)` sample reads. - Verifies positive and negative half-way ties (`0.5`, `1.5`, `2.5`, `3.5`, `-0.5`, `-1.5`, `-2.5`, `-3.5`) including `-0.0` sign preservation, non-ties (`+/-0.25`, `+/-0.75`), and `_e64` modifiers (`-`, `abs()`, `clamp`). - Includes mutation controls against `v_trunc_f32_e32`, `v_floor_f32_e32`, `v_ceil_f32_e32`, and unclamped `_e64`. ## Verification - Environment: Windows 11, VS Build Tools MSVC, DXC `10.0.26100.0`, D3D12 debug layer enabled - Hardware adapter: `NVIDIA GeForce RTX 5070` (`vendor=10de device=2f04`, `driver=32.0.16.1664`) - WARP adapter: `Microsoft Basic Render Driver` (`vendor=1414 device=008c`, `driver=10.0.26100.9818`) - Commands run: - `ctest --preset dev --no-tests=error -R "^(pixel_aot_rndne_warp|pixel_aot_rndne_hardware|pixel_aot_e64_warp)$" -V` -> PASSED (`max_absolute_error=0`, `debug_errors=0 debug_warnings=0` on both WARP and RTX 5070) - `out/pe-env/Scripts/python.exe -B tests/pso_readiness_check.py` -> PASS - `out/pe-env/Scripts/python.exe -B tests/rdna2_tools_check.py` -> OK (31 tests, 1 skipped) - `out/pe-env/Scripts/python.exe -B tests/form_coverage_check.py` -> PASS - `out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.py` -> PASS - `out/pe-env/Scripts/python.exe -B tests/docs_links_check.py` -> PASS
upstream-sync closed this pull request 2026-11-24 06:43:26 +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!506
No description provided.