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

Merged
Its3rr0rsWRLD merged 3 commits from upstream-pr/340 into main 2026-11-22 08:22:21 +00:00
Its3rr0rsWRLD commented 2026-11-21 22:42:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-21T22:42:00Z.


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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6535350381 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/340). Originally posted by [Its3rr0rsWRLD](https://github.com/Its3rr0rsWRLD) on 2026-11-21T22:42:00Z. --- ## 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
upstream-sync closed this pull request 2026-11-24 06:42:31 +00:00
R0Y00 commented 2026-11-24 06:48:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T03:04:08Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7073305709 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/340#issuecomment-7073305709). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T03:04:08Z. --- 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 commented 2026-11-24 06:48:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T03:12:15Z.


@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!

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7073390633 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/340#issuecomment-7073390633). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T03:12:15Z. --- @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!
Its3rr0rsWRLD commented 2026-11-24 06:48:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-22T03:23:34Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7073506720 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/340#issuecomment-7073506720). Originally posted by [Its3rr0rsWRLD](https://github.com/Its3rr0rsWRLD) on 2026-11-22T03:23:34Z. --- *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.
R0Y00 commented 2026-11-24 06:48:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T08:10:12Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7076351690 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/340#issuecomment-7076351690). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T08:10:12Z. --- 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.
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!335
No description provided.