fix(shader): keep the NaN case explicit for NGE, NGT, NLE and NLT #244

Manually merged
github merged 1 commit from gh-pr/244/head into gh-pr/244/base 2026-11-26 21:37:07 +00:00
Owner

@⁠rasptum on GitHub · 2026-11-21 19:09 UTC · original
rasptum:fix/pixel-aot-unordered-compares → main · +19 −14 · 2 files · 1 commits · merged 2026-11-21 19:14 UTC

Change

pixel_aot_warp fails on the Windows 10 in-box WARP (10.0.19041) in check_predicate_draws. This is the independent problem behind the Windows 10 result discussed in #179.

NGE, NGT, NLE and NLT were lowered as !(a >= b) and similar. DXC compiles each to one unordered relational compare (fcmp ult, ule, ugt, uge). The in-box WARP 10.0.19041 evaluates those as their ordered forms, so the four predicates return false for a NaN operand.

This PR lowers them the way #187 lowered NLG: the ordered relation, or an explicit isnan on either operand. The shared interface it touches is the COMPARE table in tools/pixel_aot.py. No open PR changes those entries.

Refs #179.

Verification

Commit 41669e2 on main f85723e. Windows 10 22H2 build 19045.6466, RTX 3060, SDK DXC 1.7.2308, D3D12 debug layer on.

ctest --preset dev
  • Default build (in-box WARP 10.0.19041): 118/118. pixel_aot_warp and pixel_aot_hardware pass. On main, pixel_aot_warp fails.
  • Agility SDK 1.620.2 + WARP 1.0.22: 116/118. The two failures are bvh_wave64_warp and wave_shuffle_warp (#145), unrelated to this PR.
  • Capability skips: unchanged from main.

I also replayed all 40 predicate draws (4 groups x 5 inputs) per backend without stopping at the first failure. On main, these are the only failing draws:

first left right Wrong channels (expected 1, got 0) In-box WARP 10.0.19041 WARP 1.0.22 RTX 3060
8 NaN 1 nge, ngt fail pass pass
8 1 NaN nge, ngt fail pass pass
12 NaN 1 nle, nlt fail pass pass
12 1 NaN nle, nlt fail pass pass

The same four fail with DXC 1.8.2502 and 1.9.2609. With this change, all 40 draws pass on all three backends with all three compilers.

Evidence and follow-up

  • No new fixture. The DXIL assertion that covered NLG now covers all five negated relations, and the control that checked the old NLT spelling checks the new one.
  • The NaN reaches the shader. u, nlg and neq pass on the failing draws, so fcmp uno and fcmp une are evaluated correctly. Only the four unordered relational compares are not.
  • Negative control: with the old lowering restored, the updated test fails.
  • Assumption: the WARP behaviour is inferred from the DXIL and the readback. I did not inspect WARP itself.

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. (None changed.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Claude Code). The Windows results were measured locally.

🤖 Generated with Claude Code

**@⁠rasptum** on GitHub · 2026-11-21 19:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/244) `rasptum:fix/pixel-aot-unordered-compares` → `main` · +19 −14 · 2 files · 1 commits · merged 2026-11-21 19:14 UTC ## Change `pixel_aot_warp` fails on the Windows 10 in-box WARP (10.0.19041) in `check_predicate_draws`. This is the independent problem behind the Windows 10 result discussed in #179. `NGE`, `NGT`, `NLE` and `NLT` were lowered as `!(a >= b)` and similar. DXC compiles each to one unordered relational compare (`fcmp ult`, `ule`, `ugt`, `uge`). The in-box WARP 10.0.19041 evaluates those as their ordered forms, so the four predicates return false for a NaN operand. This PR lowers them the way #187 lowered `NLG`: the ordered relation, or an explicit `isnan` on either operand. The shared interface it touches is the `COMPARE` table in `tools/pixel_aot.py`. No open PR changes those entries. Refs #179. ## Verification Commit `41669e2` on `main` `f85723e`. Windows 10 22H2 build 19045.6466, RTX 3060, SDK DXC 1.7.2308, D3D12 debug layer on. ```powershell ctest --preset dev ``` - **Default build (in-box WARP 10.0.19041):** 118/118. `pixel_aot_warp` and `pixel_aot_hardware` pass. On `main`, `pixel_aot_warp` fails. - **Agility SDK 1.620.2 + WARP 1.0.22:** 116/118. The two failures are `bvh_wave64_warp` and `wave_shuffle_warp` (#145), unrelated to this PR. - **Capability skips:** unchanged from `main`. I also replayed all 40 predicate draws (4 groups x 5 inputs) per backend without stopping at the first failure. On `main`, these are the only failing draws: | `first` | `left` | `right` | Wrong channels (expected 1, got 0) | In-box WARP 10.0.19041 | WARP 1.0.22 | RTX 3060 | |---|---|---|---|---|---|---| | 8 | NaN | 1 | `nge`, `ngt` | fail | pass | pass | | 8 | 1 | NaN | `nge`, `ngt` | fail | pass | pass | | 12 | NaN | 1 | `nle`, `nlt` | fail | pass | pass | | 12 | 1 | NaN | `nle`, `nlt` | fail | pass | pass | The same four fail with DXC 1.8.2502 and 1.9.2609. With this change, all 40 draws pass on all three backends with all three compilers. ## Evidence and follow-up - **No new fixture.** The DXIL assertion that covered `NLG` now covers all five negated relations, and the control that checked the old `NLT` spelling checks the new one. - **The NaN reaches the shader.** `u`, `nlg` and `neq` pass on the failing draws, so `fcmp uno` and `fcmp une` are evaluated correctly. Only the four unordered relational compares are not. - **Negative control:** with the old lowering restored, the updated test fails. - **Assumption:** the WARP behaviour is inferred from the DXIL and the readback. I did not inspect WARP itself. ## 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. (None changed.) - [x] I did not include game files, dumps, distribution links or secrets. _AI-assisted (Claude Code). The Windows results were measured locally._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The negated relations were lowered as !(a >= b) and similar, which DXC
compiles to a single unordered relational fcmp (ult, ule, ugt, uge). The
Windows 10 in-box WARP 10.0.19041 evaluates those as their ordered forms,
so the four predicates returned false for a NaN operand and pixel_aot_warp
failed in check_predicate_draws.

Lower them the way NLG already is: the ordered relation or an explicit
isnan on either operand. The DXIL assertion that covered NLG now covers
all five negated relations.

Refs #179.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:37:05 +00:00
github manually merged commit 41669e2ba1 into gh-pr/244/base 2026-11-26 21:37:07 +00:00
Author
Owner

@⁠denn0x on GitHub · 2026-11-21 19:13 UTC · original

No-regression check at 41669e2 on the RX 9070 XT where #179 was first seen. This machine does not reproduce the Windows 10 failure: main already passes all 40 predicate draws here on hardware and on in-box WARP 10.0.26100. So this shows the new lowering keeps RDNA 4 and current WARP correct; it does not confirm the fix itself.

Environment: Windows 11 build 26200, MSVC 19.50.35720, Windows SDK 10.0.26100.0, DXC 1.8.2502.11, D3D12 debug layer enabled on both backends.

  • AMD Radeon RX 9070 XT (vendor 1002, device 7550), driver 32.0.32015.7029
  • WARP: Microsoft Basic Render Driver 10.0.26100.9818
ctest --preset dev --no-tests=error -R '^pixel_aot_' -V
1/2 Test #101: pixel_aot_hardware ...............   Passed    6.35 sec
2/2 Test #104: pixel_aot_warp ...................   Passed    2.44 sec
100% tests passed, 0 tests failed out of 2

Full suite: ctest --preset dev --no-tests=error gives 116 passed, 0 failed. bvh_wave64_warp and wave_shuffle_warp reported capability skips, as on main.

AI-assisted (Claude Code).

**@⁠denn0x** on GitHub · 2026-11-21 19:13 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/244#issuecomment-7067864179) No-regression check at `41669e2` on the RX 9070 XT where #179 was first seen. This machine does not reproduce the Windows 10 failure: `main` already passes all 40 predicate draws here on hardware and on in-box WARP 10.0.26100. So this shows the new lowering keeps RDNA 4 and current WARP correct; it does not confirm the fix itself. **Environment:** Windows 11 build 26200, MSVC 19.50.35720, Windows SDK 10.0.26100.0, DXC 1.8.2502.11, D3D12 debug layer enabled on both backends. - AMD Radeon RX 9070 XT (vendor 1002, device 7550), driver 32.0.32015.7029 - WARP: Microsoft Basic Render Driver 10.0.26100.9818 ```powershell ctest --preset dev --no-tests=error -R '^pixel_aot_' -V ``` ```text 1/2 Test #101: pixel_aot_hardware ............... Passed 6.35 sec 2/2 Test #104: pixel_aot_warp ................... Passed 2.44 sec 100% tests passed, 0 tests failed out of 2 ``` **Full suite:** `ctest --preset dev --no-tests=error` gives 116 passed, 0 failed. `bvh_wave64_warp` and `wave_shuffle_warp` reported capability skips, as on `main`. _AI-assisted (Claude Code)._
This discussion has been locked. Commenting is limited to contributors.
No description provided.