shader: draw the e64 forms that pixel_aot accepts without a fixture #340

Manually merged
github merged 3 commits from gh-pr/340/head into gh-pr/340/base 2026-11-26 21:44:20 +00:00
Owner

@⁠Its3rr0rsWRLD on GitHub · 2026-11-21 22:42 UTC · original
Its3rr0rsWRLD:shader/e64-coverage → main · +128 −6 · 3 files · 3 commits · merged 2026-11-22 08:22 UTC

Change

This adds tests only; the translator is unchanged. pixel_aot already accepts the VOP3 (e64) encodings of these instructions, but no fixture drew them, so their translation was never checked against hardware and they did not count as covered:

  • Arithmetic: v_floor_f32_e64, v_fract_f32_e64, v_max_f32_e64, v_min_f32_e64 and v_fmac_f32_e64.
  • Comparisons: 14 of the v_cmp_*_f32_e64 predicates. ge and nlt were already covered; this draws all 16.

I found them by comparing the first words of every fixture program on main with the regular expressions the translator accepts and docs/coverage/gfx1013.tsv. The approximate v_exp, v_log, v_rcp, v_rsq and v_sqrt e64 forms are also accepted but undrawn. They are left out because they cannot be compared bitwise.

The new draws use what e64 adds over e32:

  • Arithmetic: source negation and absolute value on SGPR operands, two SGPR reads in one instruction, and fmac with modified sources.
  • Comparisons: every predicate writes an SGPR lane mask (s0) from negated operands.

This is independent of #337, the SDWA comparisons. It uses its own predicate_group_e64 and leaves predicate_group alone.

Verification

Commit b860dd5 plus this change, Windows 10 Enterprise 26H2 build 26300.9974, MSVC 14.51.36231, Windows SDK 10.0.26100.0 DXC.

ctest --preset dev --no-tests=error -R '^pixel_aot_' -V
  • pixel_aot_hardware: Passed on NVIDIA GeForce RTX 4070 Ti (10de:2782), driver 32.0.16.1088.
  • pixel_aot_warp: Passed on WARP 10.0.26100.9818.
  • Each test runs 76 draws with this change and 54 on b860dd5. The 22 extra draws are the two arithmetic programs and the four predicate groups × five input pairs. Every draw reports debug_errors=0 and max_absolute_error=0.
  • tests/pixel_aot_check.py binary passes with the six programs added to the binary fixtures: LLVM 15.0.6 llvm-mc and llvm-objcopy, disassembled through libLLVM-17.so and libLLVM-18.so on Linux. LLVM prints every form exactly as written. The controls, tests/docs_links_check.py and tests/bidi_controls_check.py pass.

Evidence and follow-up

Arithmetic. The inputs are 2.5, 1.25, 3.0 and -4.0. The draws compute:

  • floor(-|2.5|) = -3;
  • fract(-1.25) = 0.75;
  • max(-3, |-4|) = 4;
  • min(3, -|-4|) = -4;
  • 3 + (-2.5) × |1.25| = -0.125.

Each channel has a wrong reference for a dropped modifier or the swapped operation, and each one reports pixel_mismatch.

Comparisons. The five existing predicate inputs are used, including -0/+0 and NaN on either side. Negating both operands swaps less and greater and keeps equality and unordered. Wherever a lowering that dropped the negations would export different channels, that reference is drawn too and reports pixel_mismatch.

This branch merges cleanly with #288, #293, #324, #329, #334 and #337.

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. Written with Claude Opus 5.5; verified on the hardware listed above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc

**@⁠Its3rr0rsWRLD** on GitHub · 2026-11-21 22:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/340) `Its3rr0rsWRLD:shader/e64-coverage` → `main` · +128 −6 · 3 files · 3 commits · merged 2026-11-22 08:22 UTC ## Change This adds tests only; the translator is unchanged. `pixel_aot` already accepts the VOP3 (e64) encodings of these instructions, but no fixture drew them, so their translation was never checked against hardware and they did not count as covered: - **Arithmetic:** `v_floor_f32_e64`, `v_fract_f32_e64`, `v_max_f32_e64`, `v_min_f32_e64` and `v_fmac_f32_e64`. - **Comparisons:** 14 of the `v_cmp_*_f32_e64` predicates. `ge` and `nlt` were already covered; this draws all 16. I found them by comparing the first words of every fixture program on `main` with the regular expressions the translator accepts and `docs/coverage/gfx1013.tsv`. The approximate `v_exp`, `v_log`, `v_rcp`, `v_rsq` and `v_sqrt` e64 forms are also accepted but undrawn. They are left out because they cannot be compared bitwise. The new draws use what e64 adds over e32: - **Arithmetic:** source negation and absolute value on SGPR operands, two SGPR reads in one instruction, and `fmac` with modified sources. - **Comparisons:** every predicate writes an SGPR lane mask (`s0`) from negated operands. This is independent of #337, the SDWA comparisons. It uses its own `predicate_group_e64` and leaves `predicate_group` alone. ## Verification Commit b860dd5 plus this change, Windows 10 Enterprise 26H2 build 26300.9974, MSVC 14.51.36231, Windows SDK 10.0.26100.0 DXC. ```powershell ctest --preset dev --no-tests=error -R '^pixel_aot_' -V ``` - `pixel_aot_hardware`: Passed on NVIDIA GeForce RTX 4070 Ti (10de:2782), driver 32.0.16.1088. - `pixel_aot_warp`: Passed on WARP 10.0.26100.9818. - Each test runs 76 draws with this change and 54 on b860dd5. The 22 extra draws are the two arithmetic programs and the four predicate groups × five input pairs. Every draw reports `debug_errors=0` and `max_absolute_error=0`. - `tests/pixel_aot_check.py binary` passes with the six programs added to the binary fixtures: LLVM 15.0.6 `llvm-mc` and `llvm-objcopy`, disassembled through `libLLVM-17.so` and `libLLVM-18.so` on Linux. LLVM prints every form exactly as written. The controls, `tests/docs_links_check.py` and `tests/bidi_controls_check.py` pass. ## Evidence and follow-up **Arithmetic.** The inputs are 2.5, 1.25, 3.0 and -4.0. The draws compute: - `floor(-|2.5|) = -3`; - `fract(-1.25) = 0.75`; - `max(-3, |-4|) = 4`; - `min(3, -|-4|) = -4`; - `3 + (-2.5) × |1.25| = -0.125`. Each channel has a wrong reference for a dropped modifier or the swapped operation, and each one reports `pixel_mismatch`. **Comparisons.** The five existing predicate inputs are used, including -0/+0 and NaN on either side. Negating both operands swaps less and greater and keeps equality and unordered. Wherever a lowering that dropped the negations would export different channels, that reference is drawn too and reports `pixel_mismatch`. This branch merges cleanly with #288, #293, #324, #329, #334 and #337. ## 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. Written with Claude Opus 5.5; verified on the hardware listed above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
Draw v_floor, v_fract, v_max, v_min and v_fmac (_f32_e64) with source modifiers on SGPR operands, and all 16 v_cmp_*_f32_e64 predicates writing an SGPR mask from negated operands, with wrong references for dropped modifiers. The six programs join the gfx1013 binary fixtures; the translator is unchanged.

AI-assisted: yes (Claude Opus 5.5)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
pixel_aot_e64_hardware and pixel_aot_e64_warp run tests/pixel_aot_check.py
draw-e64, which draws only the e64 cases; pixel_aot_hardware and
pixel_aot_warp no longer include them, and the controls still run once in
the draw and binary modes. Each test keeps the 60 s budget and its own
form-coverage record, and the hardware entry reports a skip on exit 77.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:44:18 +00:00
github manually merged commit 57cef6f84c into gh-pr/340/base 2026-11-26 21:44:20 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-22 03:04 UTC · original

I tested dc3a261 together with #384 and #400 on an RTX 4060 Laptop GPU, driver 32.0.16.1656, debug layer enabled. The combined pixel_aot_warp passed in 11.24 s. The first pixel_aot_hardware CTest invocation hit its 60 s timeout. Running the same draw command directly then passed in 57.25 s, with zero final pixel error and no debug-layer errors. The same hardware command with #384 and #400 alone took 52.98 s and passed. Those two PRs have now landed.

Please give the new e64 draw cases their own CTest entry per backend, keeping the existing pixel cases and controls covered once. Please preserve hardware capability-skip behavior and the hardware test naming convention. Run both the existing and new cases with ctest --preset dev --no-tests=error -R '^pixel_aot_' --output-on-failure and include the individual timings. The remaining concern is reproducible completion under the existing test budget.

**@⁠R0Y00** on GitHub · 2026-11-22 03:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/340#issuecomment-7073305709) I tested dc3a261 together with #384 and #400 on an RTX 4060 Laptop GPU, driver 32.0.16.1656, debug layer enabled. The combined pixel_aot_warp passed in 11.24 s. The first pixel_aot_hardware CTest invocation hit its 60 s timeout. Running the same draw command directly then passed in 57.25 s, with zero final pixel error and no debug-layer errors. The same hardware command with #384 and #400 alone took 52.98 s and passed. Those two PRs have now landed. Please give the new e64 draw cases their own CTest entry per backend, keeping the existing pixel cases and controls covered once. Please preserve hardware capability-skip behavior and the hardware test naming convention. Run both the existing and new cases with ctest --preset dev --no-tests=error -R '^pixel_aot_' --output-on-failure and include the individual timings. The remaining concern is reproducible completion under the existing test budget.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-22 03:12 UTC · original

@⁠Vonsek, you tested how the renderer handles capability skips in #303. Once the e64 draw cases here have their own CTest entry, would you have time to check that the new hardware test still reports a skip when the renderer returns 77? A review of that one path would help. Thanks!

**@⁠R0Y00** on GitHub · 2026-11-22 03:12 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/340#issuecomment-7073390633) @⁠Vonsek, you tested how the renderer handles capability skips in #303. Once the e64 draw cases here have their own CTest entry, would you have time to check that the new hardware test still reports a skip when the renderer returns 77? A review of that one path would help. Thanks!
Author
Owner

@⁠Its3rr0rsWRLD on GitHub · 2026-11-22 03:23 UTC · original

I'm Claude Opus 5.5, replying from Its3rr0rsWRLD's account.

Rebased onto 8afb68c, and the e64 draw cases now have their own CTest entry per backend:

  • tests/pixel_aot_check.py draw-e64 draws only the e64 cases; pixel_aot_hardware and pixel_aot_warp (mode draw) no longer include them. The controls still run once, in the draw and binary modes, and draw-e64 skips them.
  • pixel_aot_e64_hardware and pixel_aot_e64_warp follow the existing naming, keep the 60 s budget, and write their own form-coverage record (form_coverage/pixel_aot_e64_<adapter>.txt), so tools/form_coverage.py still counts the e64 forms with no change to it.
  • pixel_aot_e64_hardware is in the SKIP_RETURN_CODE 77 list with the other hardware tests. In draw-e64, a renderer exit of 77 is returned as 77 instead of raising.

At c7f76d9 (8afb68c plus this branch), Windows 10 Enterprise 26H2 build 26300.9974, NVIDIA GeForce RTX 4070 Ti (10de:2782), driver 32.0.16.1088, WARP 10.0.26100.9818:

ctest --preset dev --no-tests=error -R '^pixel_aot_' --output-on-failure
Test Result Time
pixel_aot_hardware Passed 42.28 s
pixel_aot_e64_hardware Passed 10.62 s
pixel_aot_warp Passed 8.33 s
pixel_aot_e64_warp Passed 1.93 s

Skip path: with a stand-in renderer that only exits 77, pixel_aot_check.py draw-e64 dxc <renderer> hardware exits 77, and ctest -N --show-only=json-v1 lists pixel_aot_e64_hardware with SKIP_RETURN_CODE=77 and TIMEOUT=60. @⁠Vonsek, that is the path to look at when you have time.

The controls, tests/pixel_aot_check.py binary (LLVM 15.0.6 tools with libLLVM 17 and 18) and docs_links_check.py pass. This branch also merges cleanly with #293 as rebased today.

**@⁠Its3rr0rsWRLD** on GitHub · 2026-11-22 03:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/340#issuecomment-7073506720) *I'm Claude Opus 5.5, replying from Its3rr0rsWRLD's account.* Rebased onto 8afb68c, and the e64 draw cases now have their own CTest entry per backend: - `tests/pixel_aot_check.py draw-e64` draws only the e64 cases; `pixel_aot_hardware` and `pixel_aot_warp` (mode `draw`) no longer include them. The controls still run once, in the `draw` and `binary` modes, and `draw-e64` skips them. - `pixel_aot_e64_hardware` and `pixel_aot_e64_warp` follow the existing naming, keep the 60 s budget, and write their own form-coverage record (`form_coverage/pixel_aot_e64_<adapter>.txt`), so `tools/form_coverage.py` still counts the e64 forms with no change to it. - `pixel_aot_e64_hardware` is in the `SKIP_RETURN_CODE 77` list with the other hardware tests. In `draw-e64`, a renderer exit of 77 is returned as 77 instead of raising. At c7f76d9 (8afb68c plus this branch), Windows 10 Enterprise 26H2 build 26300.9974, NVIDIA GeForce RTX 4070 Ti (10de:2782), driver 32.0.16.1088, WARP 10.0.26100.9818: ```powershell ctest --preset dev --no-tests=error -R '^pixel_aot_' --output-on-failure ``` | Test | Result | Time | |---|---|---| | `pixel_aot_hardware` | Passed | 42.28 s | | `pixel_aot_e64_hardware` | Passed | 10.62 s | | `pixel_aot_warp` | Passed | 8.33 s | | `pixel_aot_e64_warp` | Passed | 1.93 s | Skip path: with a stand-in renderer that only exits 77, `pixel_aot_check.py draw-e64 dxc <renderer> hardware` exits 77, and `ctest -N --show-only=json-v1` lists `pixel_aot_e64_hardware` with `SKIP_RETURN_CODE=77` and `TIMEOUT=60`. @⁠Vonsek, that is the path to look at when you have time. The controls, `tests/pixel_aot_check.py binary` (LLVM 15.0.6 tools with libLLVM 17 and 18) and `docs_links_check.py` pass. This branch also merges cleanly with #293 as rebased today.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-22 08:10 UTC · original

On the RTX 4060 Laptop GPU (driver 32.0.16.1656) the combined hardware draw hit the 60-second limit again. I split the predicate/rounding and blend/scalar draws into separate CTests per backend. The full draw command still runs all three groups. All eight hardware/WARP tests passed locally with the 60-second limit and separate coverage records. The hardware e64 test retains its return-77 skip rule.

**@⁠R0Y00** on GitHub · 2026-11-22 08:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/340#issuecomment-7076351690) On the RTX 4060 Laptop GPU (driver 32.0.16.1656) the combined hardware draw hit the 60-second limit again. I split the predicate/rounding and blend/scalar draws into separate CTests per backend. The full draw command still runs all three groups. All eight hardware/WARP tests passed locally with the 60-second limit and separate coverage records. The hardware e64 test retains its return-77 skip rule.
This discussion has been locked. Commenting is limited to contributors.
No description provided.