Recompiler: direct f32 compares test for NaN explicitly again #3539

Open
ArtuArtaza wants to merge 1 commit from upstream-pr/3539 into main
ArtuArtaza commented 2026-11-30 17:38:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ArtuArtaza on 2026-11-30T17:38:27Z.


Since a899ec90 (#3269) three GPU tests fail on my RX 6700 XT (driver 32.0.21045.29003): gpu_f32_compares_with_nan, gpu_float_compares_random and f32_programs_on_the_gpu. That commit lowered the direct translator's f32 compares (f16 ones go through f32) to one fcmp each and dropped the explicit NaN tests, which the translators have because of an AMD driver bug (#46). This PR puts the explicit form back for f32. Related: #46, #3269, #2258, #3023, #42.

The DXIL of a899ec90 is right; the driver does two wrong things with it:

  • it takes fcmp one (what v_cmp_lg became) for une: a NaN operand gives true instead of false;
  • it gives the second of two compares of the same operands that differ only in ordered / unordered (olt and ult, oeq and ueq, ...) the first one's result, in either order, also when one of them is written with its operands swapped (olt a, b and ugt b, a). v_cmp_lt_f32 then v_cmp_nge_f32 is such a pair.

How it was narrowed (local probes, not in this PR):

  • 5b0d5fa3 (the parent) passes the three tests, a899ec90 fails them (2 runs), main 9dfbe3ea with only this change passes them.
  • Two plain fcmps of the same two loaded floats in a compute kernel with no wave operation, all 182 ordered pairs of the 14 predicates, results against IEEE: RX 6700 XT 36 pairs wrong (26 of them contain one, 10 are the merged ones), WARP 0 wrong, from the same DXIL. The translator's own kernels give the same 36 in wave32 and wave64, also with XCL_DXIL_NO_OPT=all: no optimizer pass takes part.
  • #46 describes the second form on an RX 7900 XTX (32.0.32029.2010) and an RDNA2 iGPU through HLSL: DXC turns !(a >= b) into fcmp ult. #2258 (the same change as in a899ec90, open) was reported failing on an RX 9070 XT and an RX 6800M. #3269 lists AMD GPUs under "Not tested".
  • I did not see the driver's machine code (GetCachedBlob holds only a key), so "merges" is read from the results.

Other forms tried on this card:

form pairs wrong (of 182) the three tests DXIL of 567 sampled title programs
main (one fcmp) 36 fail 24,387,884 B
lg as olt or ogt, the rest one fcmp (amd-dev's form) 16 fail not measured
ordered predicates only, nX = xor (oX), true, lg = olt or ogt 0 pass 24,403,784 B (+0.07 %)
explicit NaN tests (this PR) 0 pass 24,789,936 B (+1.65 %)

The third form is much smaller, but it relies on the driver not folding the xor back into an unordered compare, and I can only measure one driver. The explicit form does not depend on what the driver makes of an fcmp of a NaN, and it is what main emitted until a899ec90. If the third form also passes on RDNA3 / RDNA4 drivers, it could replace this one.

What is in it

  • crates/xcl/src/gpu/dxil/lower_valu.rs: float_compare loses its f32 branch, so f32 takes the explicit form that f64 already takes; the comment gives the reason.
  • Same file, test f32_compares_use_no_predicate_that_amd_merges: the 14 f32 compares, wave32 and wave64, must not disassemble to one, ueq, ugt, uge, ult or ule. It needs no GPU: #3269's NVIDIA runs of the GPU tests passed, so they did not show this.
  • No TRANSLATOR_VERSION bump: a gpu/dxil edit changes the direct translations' cache identity by itself.

Tested

  • AMD Radeon RX 6700 XT (driver 32.0.21045.29003), Ryzen 5 5600X, 48 GB, Windows 11 build 26200.9974, rustc 1.100.0; tests in debug, title runs in release (both without debug info: CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_RELEASE_DEBUG=0).
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 on e921d6a9 (on main 9dfbe3ea): 2884 passed, 4 failed, 51 ignored (44 test binaries). The 4 are 3 tests, and all 3 fail with the same values on unmodified main 9dfbe3ea on this card (ran them there alone): gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form (what #3473 fixes), gpu_direct_image_get_resinfo_d16 (see #3513) and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (parent and child run). 4 SKIPPED (2 no heap windows, 1 no GPU_UPLOAD heaps, 1 cannot disable the driver cache).
  • The three tests of this PR (cargo test -p xcl --lib -- gpu_f32_compares_with_nan gpu_float_compares_random f32_programs_on_the_gpu --test-threads=1): pass on cfb9753a and 5b0d5fa3, fail on a899ec90, pass here. The new test fails with main's float_compare (fcmp one) and passes with this one.
  • Size: 567 programs of a retail title (xcl shaders <archive> --direct --sample 600 --seed 3 --max-bytes 40000 --split 0 --timeout 120, summed DXIL, both forms from one local build of 9dfbe3ea with a switch): 24,387,884 B on main, 24,789,936 B here (+1.65 %).
  • How common the compare is in that title, counted in the optimized IR of main's form by a local counter, 3,826 translated programs (--sample 4000 --seed 11 --max-bytes 60000 --split 0): 1,925 programs hold an fcmp one (15,852 of 929,962 f32 fcmps), 5 hold a pair the driver would merge. It only matters in lanes where an operand is NaN; whether the picture changes was not measured.

Regression run

60 s (menus), scripts/smoke.ps1, XCL_DEVICE_TYPE=lockhart XCL_PREPARE=0, A pressed every 15 s from 30 s: main 9dfbe3ea, then this PR's head (which ran first).

xcl-smoke v1
commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b
gpu: AMD Radeon RX 6700 XT
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1551 (PresentX 1551)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13647 MB
xcl-smoke v1
commit: e921d6a91e440d96ea1e3a650bde8955074f2002
gpu: AMD Radeon RX 6700 XT
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1550 (PresentX 1550)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13623 MB

Not tested

  • Any other GPU or driver. NVIDIA and Intel get the same change (the form they had until a899ec90).
  • RDNA3 and RDNA4: the reports cited above are other people's, on other forms of this change.
  • Driver compile time of the larger DXIL, and frame time in the world: the 60 s runs do not reach it.
  • The image of the title before and after.

AI use

  • Claude Code with Claude Opus 5.5 found the commit, wrote the probes and the fix, ran everything above on my machine and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5570495710 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3539). Originally posted by [ArtuArtaza](https://github.com/ArtuArtaza) on 2026-11-30T17:38:27Z. --- Since `a899ec90` (#3269) three GPU tests fail on my RX 6700 XT (driver 32.0.21045.29003): `gpu_f32_compares_with_nan`, `gpu_float_compares_random` and `f32_programs_on_the_gpu`. That commit lowered the direct translator's f32 compares (f16 ones go through f32) to one `fcmp` each and dropped the explicit NaN tests, which the translators have because of an AMD driver bug (#46). This PR puts the explicit form back for f32. Related: #46, #3269, #2258, #3023, #42. The DXIL of `a899ec90` is right; the driver does two wrong things with it: - it takes `fcmp one` (what `v_cmp_lg` became) for `une`: a NaN operand gives true instead of false; - it gives the second of two compares of the same operands that differ only in ordered / unordered (`olt` and `ult`, `oeq` and `ueq`, ...) the first one's result, in either order, also when one of them is written with its operands swapped (`olt a, b` and `ugt b, a`). `v_cmp_lt_f32` then `v_cmp_nge_f32` is such a pair. How it was narrowed (local probes, not in this PR): - `5b0d5fa3` (the parent) passes the three tests, `a899ec90` fails them (2 runs), main `9dfbe3ea` with only this change passes them. - Two plain `fcmp`s of the same two loaded floats in a compute kernel with no wave operation, all 182 ordered pairs of the 14 predicates, results against IEEE: RX 6700 XT 36 pairs wrong (26 of them contain `one`, 10 are the merged ones), WARP 0 wrong, from the same DXIL. The translator's own kernels give the same 36 in wave32 and wave64, also with `XCL_DXIL_NO_OPT=all`: no optimizer pass takes part. - #46 describes the second form on an RX 7900 XTX (32.0.32029.2010) and an RDNA2 iGPU through HLSL: DXC turns `!(a >= b)` into `fcmp ult`. #2258 (the same change as in `a899ec90`, open) was reported failing on an RX 9070 XT and an RX 6800M. #3269 lists AMD GPUs under "Not tested". - I did not see the driver's machine code (`GetCachedBlob` holds only a key), so "merges" is read from the results. Other forms tried on this card: | form | pairs wrong (of 182) | the three tests | DXIL of 567 sampled title programs | |---|---|---|---| | main (one `fcmp`) | 36 | fail | 24,387,884 B | | `lg` as `olt` or `ogt`, the rest one `fcmp` (amd-dev's form) | 16 | fail | not measured | | ordered predicates only, `nX` = `xor (oX), true`, `lg` = `olt` or `ogt` | 0 | pass | 24,403,784 B (+0.07 %) | | explicit NaN tests (this PR) | 0 | pass | 24,789,936 B (+1.65 %) | The third form is much smaller, but it relies on the driver not folding the `xor` back into an unordered compare, and I can only measure one driver. The explicit form does not depend on what the driver makes of an `fcmp` of a NaN, and it is what main emitted until `a899ec90`. If the third form also passes on RDNA3 / RDNA4 drivers, it could replace this one. **What is in it** - `crates/xcl/src/gpu/dxil/lower_valu.rs`: `float_compare` loses its f32 branch, so f32 takes the explicit form that f64 already takes; the comment gives the reason. - Same file, test `f32_compares_use_no_predicate_that_amd_merges`: the 14 f32 compares, wave32 and wave64, must not disassemble to `one`, `ueq`, `ugt`, `uge`, `ult` or `ule`. It needs no GPU: #3269's NVIDIA runs of the GPU tests passed, so they did not show this. - No `TRANSLATOR_VERSION` bump: a `gpu/dxil` edit changes the direct translations' cache identity by itself. **Tested** - AMD Radeon RX 6700 XT (driver 32.0.21045.29003), Ryzen 5 5600X, 48 GB, Windows 11 build 26200.9974, rustc 1.100.0; tests in debug, title runs in release (both without debug info: `CARGO_PROFILE_DEV_DEBUG=0`, `CARGO_PROFILE_RELEASE_DEBUG=0`). - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` on `e921d6a9` (on main `9dfbe3ea`): **2884 passed, 4 failed, 51 ignored** (44 test binaries). The 4 are 3 tests, and all 3 fail with the same values on unmodified main `9dfbe3ea` on this card (ran them there alone): `gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form` (what #3473 fixes), `gpu_direct_image_get_resinfo_d16` (see #3513) and `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (parent and child run). 4 `SKIPPED` (2 no heap windows, 1 no GPU_UPLOAD heaps, 1 cannot disable the driver cache). - The three tests of this PR (`cargo test -p xcl --lib -- gpu_f32_compares_with_nan gpu_float_compares_random f32_programs_on_the_gpu --test-threads=1`): pass on `cfb9753a` and `5b0d5fa3`, fail on `a899ec90`, pass here. The new test fails with main's `float_compare` (`fcmp one`) and passes with this one. - Size: 567 programs of a retail title (`xcl shaders <archive> --direct --sample 600 --seed 3 --max-bytes 40000 --split 0 --timeout 120`, summed DXIL, both forms from one local build of `9dfbe3ea` with a switch): 24,387,884 B on main, 24,789,936 B here (+1.65 %). - How common the compare is in that title, counted in the optimized IR of main's form by a local counter, 3,826 translated programs (`--sample 4000 --seed 11 --max-bytes 60000 --split 0`): 1,925 programs hold an `fcmp one` (15,852 of 929,962 f32 `fcmp`s), 5 hold a pair the driver would merge. It only matters in lanes where an operand is NaN; whether the picture changes was not measured. **Regression run** 60 s (menus), `scripts/smoke.ps1`, `XCL_DEVICE_TYPE=lockhart XCL_PREPARE=0`, A pressed every 15 s from 30 s: main `9dfbe3ea`, then this PR's head (which ran first). ``` xcl-smoke v1 commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b gpu: AMD Radeon RX 6700 XT title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1551 (PresentX 1551) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13647 MB ``` ``` xcl-smoke v1 commit: e921d6a91e440d96ea1e3a650bde8955074f2002 gpu: AMD Radeon RX 6700 XT title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1550 (PresentX 1550) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13623 MB ``` **Not tested** - Any other GPU or driver. NVIDIA and Intel get the same change (the form they had until `a899ec90`). - RDNA3 and RDNA4: the reports cited above are other people's, on other forms of this change. - Driver compile time of the larger DXIL, and frame time in the world: the 60 s runs do not reach it. - The image of the title before and after. **AI use** - Claude Code with Claude Opus 5.5 found the commit, wrote the probes and the fix, ran everything above on my machine and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Zippp69 commented 2026-11-30 19:06:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Zippp69 on 2026-11-30T19:06:45Z.

Review: COMMENTED


Skip the predicate regression test when DXC is unavailable

The new predicate regression test fails on hosts without DXC before it can check the predicates. Check dxc::location() up front and use skip_test("no DXC") if the compiler is unavailable. Keep validation and disassembly failures visible when DXC is installed.

Local verification on Windows 11, DXC 1.9.2602.17. I applied the PR diff to 9dfbe3e, verified that the changed source file matches e921d6a, and ran the original and guarded variants separately with cargo test --offline --locked -p xcl --lib <test> -- --exact --nocapture.

  • With DXC available, both variants passed (1 passed each).
  • With compiler discovery disabled by a test-only hook, the original failed during translation with dxcompiler.dll not found. The guarded variant reported SKIPPED: no DXC and exited successfully.

Codex assisted with the review, patch, and targeted test runs.

<!-- greyfinch-sync:ivall/xcl:review:6118682002 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3539#pullrequestreview-6118682002). Originally posted by [Zippp69](https://github.com/Zippp69) on 2026-11-30T19:06:45Z. **Review:** COMMENTED --- **Skip the predicate regression test when DXC is unavailable** The [new predicate regression test](https://github.com/xcl-dev/xcl/blob/e921d6a91e440d96ea1e3a650bde8955074f2002/crates/xcl/src/gpu/dxil/lower_valu.rs#L1542) fails on hosts without DXC before it can check the predicates. Check `dxc::location()` up front and use `skip_test("no DXC")` if the compiler is unavailable. Keep validation and disassembly failures visible when DXC is installed. **Local verification on Windows 11, DXC 1.9.2602.17.** I applied the PR diff to `9dfbe3e`, verified that the changed source file matches `e921d6a`, and ran the original and guarded variants separately with `cargo test --offline --locked -p xcl --lib <test> -- --exact --nocapture`. - With DXC available, both variants passed (`1 passed` each). - With compiler discovery disabled by a test-only hook, the original failed during translation with `dxcompiler.dll not found`. The guarded variant reported `SKIPPED: no DXC` and exited successfully. Codex assisted with the review, patch, and targeted test runs.
Gevroska commented 2026-11-30 20:23:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-30T20:23:56Z.


@ArtuArtaza I ran your predicate test unchanged on parent 9dfbe3ea and PR head e921d6a9. On the parent, DXIL validation succeeded, but the assertion caught fcmp one in the wave32 disassembly (wave64 false: fcmp one). On the head, the assertion passed in both wave32 and wave64 emission modes.

I also ran the three existing numerical tests on my RTX 3080 (driver 616.92, DXC 1.9.2609.5, XCL_DIRECT_DXIL=1). All three passed on both revisions. The random test checked 1,600 lanes × 33 comparisons per precision with zero distinct failures. The program test passed the same six wave32 cases and skipped the same six native-wave64 cases on both builds.

The regression test catches the old instruction on the parent. The numerical results showed no regression on this NVIDIA adapter. I didn’t test the reported AMD driver behavior.

I used Codex GPT-6.2 Sol to run the comparison. A separate GPT-6.2 Sol agent reviewed the source and test evidence. Codex GPT-6.2 Astra drafted this comment.

I reviewed and approved this comment before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7290851169 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3539#issuecomment-7290851169). Originally posted by [Gevroska](https://github.com/Gevroska) on 2026-11-30T20:23:56Z. --- @ArtuArtaza I ran your predicate test unchanged on parent `9dfbe3ea` and PR head `e921d6a9`. On the parent, DXIL validation succeeded, but the assertion caught `fcmp one` in the wave32 disassembly (`wave64 false: fcmp one`). On the head, the assertion passed in both wave32 and wave64 emission modes. I also ran the three existing numerical tests on my RTX 3080 (driver 616.92, DXC `1.9.2609.5`, `XCL_DIRECT_DXIL=1`). All three passed on both revisions. The random test checked 1,600 lanes × 33 comparisons per precision with zero distinct failures. The program test passed the same six wave32 cases and skipped the same six native-wave64 cases on both builds. The regression test catches the old instruction on the parent. The numerical results showed no regression on this NVIDIA adapter. I didn’t test the reported AMD driver behavior. I used Codex GPT-6.2 Sol to run the comparison. A separate GPT-6.2 Sol agent reviewed the source and test evidence. Codex GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting.
andresd-cerebras commented 2026-11-30 21:49:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andresd-cerebras on 2026-11-30T21:49:37Z.

Code review location: crates/xcl/src/gpu/dxil/lower_valu.rs; line 1552

@@ -1549,6 +1530,33 @@ impl Lw {
     }
 }
 
+#[cfg(test)]
+mod float_compare_tests {
+    use super::super::kernel::{translate, KernelOptions};
+    use super::super::validate;
+    use crate::gpu::rdna2::encode;
+
+    /// The predicates `float_compare` must leave out (its comment says why), without a GPU:
+    /// the GPU tests (`gpu_f32_compares_with_nan`) only fail on an AMD driver.
+    #[test]
+    fn f32_compares_use_no_predicate_that_amd_merges() {
+        let mut code = Vec::new();
+        for (i, op) in ["LT", "EQ", "LE", "GT", "LG", "GE", "O", "U", "NGE", "NLG", "NGT", "NLE", "NEQ", "NLT"].into_iter().enumerate() {
+            code.extend(encode(&format!("V_CMP_{op}_F32"), "ENC_VOP3", &[("VDST", 20 + 2 * i as u64), ("SRC0", 256), ("SRC1", 257)], None).unwrap());
+        }
+        code.extend(encode("S_ENDPGM", "ENC_SOPP", &[], None).unwrap());
+        for wave64 in [false, true] {
+            let dxil = translate(&code, KernelOptions { wave64, split: false, mem_windows: 1, sampler_base: 0 }).expect("translate f32 compares");
+            validate::validate(&dxil).expect("validate f32 compares");
+            let dis = validate::disassemble(&dxil).expect("disassemble f32 compares");
+            assert!(dis.contains("fcmp olt float"), "{dis}");

Suggest also asserting the IsNaN dx.op call is present. As written, a form with no NaN test at all passes.

<!-- greyfinch-sync:ivall/xcl:review-comment:4745984331 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3539#discussion_r4745984331). Originally posted by [andresd-cerebras](https://github.com/andresd-cerebras) on 2026-11-30T21:49:37Z. **Code review location:** `crates/xcl/src/gpu/dxil/lower_valu.rs`; line 1552 ~~~~diff @@ -1549,6 +1530,33 @@ impl Lw { } } +#[cfg(test)] +mod float_compare_tests { + use super::super::kernel::{translate, KernelOptions}; + use super::super::validate; + use crate::gpu::rdna2::encode; + + /// The predicates `float_compare` must leave out (its comment says why), without a GPU: + /// the GPU tests (`gpu_f32_compares_with_nan`) only fail on an AMD driver. + #[test] + fn f32_compares_use_no_predicate_that_amd_merges() { + let mut code = Vec::new(); + for (i, op) in ["LT", "EQ", "LE", "GT", "LG", "GE", "O", "U", "NGE", "NLG", "NGT", "NLE", "NEQ", "NLT"].into_iter().enumerate() { + code.extend(encode(&format!("V_CMP_{op}_F32"), "ENC_VOP3", &[("VDST", 20 + 2 * i as u64), ("SRC0", 256), ("SRC1", 257)], None).unwrap()); + } + code.extend(encode("S_ENDPGM", "ENC_SOPP", &[], None).unwrap()); + for wave64 in [false, true] { + let dxil = translate(&code, KernelOptions { wave64, split: false, mem_windows: 1, sampler_base: 0 }).expect("translate f32 compares"); + validate::validate(&dxil).expect("validate f32 compares"); + let dis = validate::disassemble(&dxil).expect("disassemble f32 compares"); + assert!(dis.contains("fcmp olt float"), "{dis}"); ~~~~ --- Suggest also asserting the IsNaN `dx.op` call is present. As written, a form with no NaN test at all passes.
andresd-cerebras commented 2026-11-30 21:49:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andresd-cerebras on 2026-11-30T21:49:37Z.

Review: COMMENTED


Withdrawn.

<!-- greyfinch-sync:ivall/xcl:review:6121176021 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3539#pullrequestreview-6121176021). Originally posted by [andresd-cerebras](https://github.com/andresd-cerebras) on 2026-11-30T21:49:37Z. **Review:** COMMENTED --- Withdrawn.
Foniass commented 2026-12-01 07:36:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:36:25Z.


Review (head 261483f8, diff read, not a merge-check: the PR description check fails, so not built or run here yet):

  • The test counts and both smoke blocks name e921d6a9, not the head 261483f8, which is why PR description fails. The two differ only in the new test's DXC skip_test guard, so rerunning scripts/smoke.ps1 on the head and updating the counts should do.
  • Outside this PR: lower_image.rs ~473 still emits fcmp une.

Fine: removing the f32 branch brings back exactly the explicit NaN form (isnan through isSpecialFloat plus ordered compares) main had before a899ec90 (#3269); f16 compares become f32 first and f64 already used this form (lower_wide.rs ~889); the fcmp the translator emits carries no fast-math flags (lower.rs ~722); f32_compares_use_no_predicate_that_amd_merges fails on main's fcmp one, needs no GPU and skips without DXC, and its positive fcmp olt float check keeps the other assertions from passing vacuously. The cost is about two isnan and one or two logic ops per compare (+1.65 % DXIL as measured by the author, not checked here).

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7304263092 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3539#issuecomment-7304263092). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:36:25Z. --- Review (head 261483f8, diff read, not a merge-check: the `PR description` check fails, so not built or run here yet): - **The test counts and both smoke blocks name e921d6a9, not the head 261483f8**, which is why `PR description` fails. The two differ only in the new test's DXC `skip_test` guard, so rerunning `scripts/smoke.ps1` on the head and updating the counts should do. - Outside this PR: `lower_image.rs` ~473 still emits `fcmp une`. Fine: removing the f32 branch brings back exactly the explicit NaN form (`isnan` through `isSpecialFloat` plus ordered compares) main had before a899ec90 (#3269); f16 compares become f32 first and f64 already used this form (`lower_wide.rs` ~889); the `fcmp` the translator emits carries no fast-math flags (`lower.rs` ~722); `f32_compares_use_no_predicate_that_amd_merges` fails on main's `fcmp one`, needs no GPU and skips without DXC, and its positive `fcmp olt float` check keeps the other assertions from passing vacuously. The cost is about two `isnan` and one or two logic ops per compare (+1.65 % DXIL as measured by the author, not checked here). AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Foniass commented 2026-12-01 10:10:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:10:50Z.


Triage (#1607) – head 261483f

No other open PR restores the explicit NaN tests for f32 compares. #2258 goes the other way: one fcmp per compare, for f64 too. a899ec90 (#3269) brought that form to main for f32, and this PR reverts it for f32.
No problems found in the diff: f32 now goes through the same rel/isnan_any path as f64. f32_compares_use_no_predicate_that_amd_merges checks, after the optimizer, that no one/ueq/ugt/uge/ult/ule comes back in wave32 or wave64.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7307792868 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3539#issuecomment-7307792868). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T10:10:50Z. --- **Triage (#1607)** – head 261483f No other open PR restores the explicit NaN tests for f32 compares. #2258 goes the other way: one `fcmp` per compare, for f64 too. a899ec90 (#3269) brought that form to main for f32, and this PR reverts it for f32. No problems found in the diff: f32 now goes through the same `rel`/`isnan_any` path as f64. `f32_compares_use_no_predicate_that_amd_merges` checks, after the optimizer, that no `one`/`ueq`/`ugt`/`uge`/`ult`/`ule` comes back in wave32 or wave64. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
bmjask commented 2026-12-02 14:11:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:11:44Z.


@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.

<!-- greyfinch-sync:ivall/xcl:comment:7348143361 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3539#issuecomment-7348143361). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T14:11:44Z. --- @Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3539:upstream-pr/3539'
git switch 'upstream-pr/3539'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3539'
git switch 'upstream-pr/3539'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3539'
git switch 'upstream-pr/3539'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3539'
git switch 'main'
git merge --squash 'upstream-pr/3539'
git switch 'main'
git merge --ff-only 'upstream-pr/3539'
git switch 'main'
git merge 'upstream-pr/3539'
git push origin 'main'
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
xcl-dev/xcl!3539
No description provided.