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

Merged
rasptum merged 1 commit from upstream-pr/244 into main 2026-11-21 19:14:23 +00:00
rasptum commented 2026-11-21 19:09:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-21T19:09:07Z.


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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6533196732 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/244). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-21T19:09:07Z. --- ## 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)
upstream-sync closed this pull request 2026-11-24 06:41:59 +00:00
denn0x commented 2026-11-24 06:47:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-21T19:13:57Z.


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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067864179 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/244#issuecomment-7067864179). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-21T19:13:57Z. --- 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)._
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!241
No description provided.