Tests: check f16 rounding, frexp and v_ldexp_f16 ops on the GPU #1218

Open
plentilha wants to merge 1 commit from upstream-pr/1227 into main
plentilha commented 2026-11-24 13:24:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by plentilha on 2026-11-24T13:24:42Z.


Adds GPU execution tests for translated binary16 rounding, fraction, frexp and v_ldexp_f16 instructions: v_ceil_f16, v_floor_f16, v_trunc_f16, v_rndne_f16, v_fract_f16, v_frexp_mant_f32, v_frexp_exp_i32_f32, v_frexp_mant_f16, v_frexp_exp_i16_f16 and v_ldexp_f16. Test-only change.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: gpu_f16_rounding_and_frexp_ldexp covering positive/negative fractions, tie-to-even (2.5 -> 2.0), +0.0/-0.0, +inf and sub-unit scaling across gpu_waves(). Negative-sign mantissa outputs for v_frexp_mant_* are skipped (tracked in #580 / #587).

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce RTX 3070 (driver 32.0.16.2124, wave32 only), Intel Core i7-9700K, Windows 11 x64, rustc 1.100.0, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), debug
  • ./scripts/test.ps1: 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64))
  • cargo test -p xcl --lib -- gpu_f16_rounding_and_frexp_ldexp --nocapture: 1 passed, 0 failed (wave32 pass on this adapter)

Regression run

  • Not needed: test-only change.

Not tested

  • Negative-sign v_frexp_mant_* outputs (#580 / #587), native wave64 pass (AMD/Intel GPUs), retail game runs (XCL_SAMPLE_* unset), Wine, release build.

AI use

  • Antigravity (Gemini 4 Hydrogen): checked emit.rs coverage, wrote the test and PR description, and ran the test suite locally.
<!-- greyfinch-sync:ivall/xcl:issue:5472996774 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227). Originally posted by [plentilha](https://github.com/plentilha) on 2026-11-24T13:24:42Z. --- Adds GPU execution tests for translated binary16 rounding, fraction, `frexp` and `v_ldexp_f16` instructions: `v_ceil_f16`, `v_floor_f16`, `v_trunc_f16`, `v_rndne_f16`, `v_fract_f16`, `v_frexp_mant_f32`, `v_frexp_exp_i32_f32`, `v_frexp_mant_f16`, `v_frexp_exp_i16_f16` and `v_ldexp_f16`. Test-only change. **What is in it** - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_f16_rounding_and_frexp_ldexp` covering positive/negative fractions, tie-to-even (2.5 -> 2.0), `+0.0`/`-0.0`, `+inf` and sub-unit scaling across `gpu_waves()`. Negative-sign mantissa outputs for `v_frexp_mant_*` are skipped (tracked in #580 / #587). **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce RTX 3070 (driver 32.0.16.2124, wave32 only), Intel Core i7-9700K, Windows 11 x64, rustc 1.100.0, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), debug - `./scripts/test.ps1`: 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64)) - `cargo test -p xcl --lib -- gpu_f16_rounding_and_frexp_ldexp --nocapture`: 1 passed, 0 failed (wave32 pass on this adapter) **Regression run** - Not needed: test-only change. **Not tested** - Negative-sign `v_frexp_mant_*` outputs (#580 / #587), native wave64 pass (AMD/Intel GPUs), retail game runs (`XCL_SAMPLE_*` unset), Wine, release build. **AI use** - Antigravity (Gemini 4 Hydrogen): checked `emit.rs` coverage, wrote the test and PR description, and ran the test suite locally.
DavidM1911 commented 2026-11-24 14:06:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:39:20Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib recomp: 190 passed, 0 failed, 18 ignored (new GPU checks included).

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7133143031 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1227#issuecomment-7133143031). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T13:39:20Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib recomp`: 190 passed, 0 failed, 18 ignored (new GPU checks included). Thanks!
Mischief8713 commented 2026-11-24 16:07:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Mischief8713 on 2026-11-24T15:55:12Z.


GPU run of f30395b on Windows (NVIDIA GTX 1660 Ti, Turing): 699 passed, 0 failed; the new test passes

Tested

  • NVIDIA GeForce GTX 1660 Ti 6 GB (Turing, driver 32.0.16.2114), Ryzen 5 2600X, Windows 11 (10.0.26300), rustc 1.100.0, debug build
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64)
  • main at 930e8b4 on the same machine: lib 707 passed, 0 failed, 21 ignored; e2e 3 passed
  • The head does not contain current main (930e8b4). It was run as it is.
  • lib: 699 passed, 0 failed, 21 ignored. gpu::recomp::tests::gpu_f16_rounding_and_frexp_ldexp ran on the GPU and passed.

Not tested

  • No retail title and no scripts/smoke.ps1 run, so no regression run
  • AMD GPUs; only Turing was run here
  • Not merged with current main

AI use

  • Claude Code with Claude Sonnet 5.5 ran the commands and wrote this report. I checked the output.
<!-- greyfinch-sync:ivall/xcl:comment:7136831818 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1227#issuecomment-7136831818). Originally posted by [Mischief8713](https://github.com/Mischief8713) on 2026-11-24T15:55:12Z. --- **GPU run of `f30395b` on Windows (NVIDIA GTX 1660 Ti, Turing): 699 passed, 0 failed; the new test passes** **Tested** - NVIDIA GeForce GTX 1660 Ti 6 GB (Turing, driver 32.0.16.2114), Ryzen 5 2600X, Windows 11 (10.0.26300), rustc 1.100.0, debug build - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64) - `main` at `930e8b4` on the same machine: lib 707 passed, 0 failed, 21 ignored; `e2e` 3 passed - The head does not contain current `main` (`930e8b4`). It was run as it is. - lib: 699 passed, 0 failed, 21 ignored. `gpu::recomp::tests::gpu_f16_rounding_and_frexp_ldexp` ran on the GPU and passed. **Not tested** - No retail title and no `scripts/smoke.ps1` run, so no regression run - AMD GPUs; only Turing was run here - Not merged with current `main` **AI use** - Claude Code with Claude Sonnet 5.5 ran the commands and wrote this report. I checked the output.
Toons29 commented 2026-11-24 18:08:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-24T17:12:29Z.


AMD RDNA4 run of f30395b: the new test fails here at v_ldexp_f16 of -0. The runs above are all on NVIDIA.

Tested

  • f30395b merged into main 930e8b4 (clean merge), debug
  • AMD Radeon RX 9070 (RDNA4, native wave64), Adrenalin 26.11.2 (driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0 (stable MSVC)
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 751 passed, 1 failed, 41 ignored, 0 GPU tests SKIPPED
  • gpu_f16_rounding_and_frexp_ldexp alone (--exact): failed 8 of 8, the same way every run, also in the suite run:
panicked at crates\xcl\src\gpu\recomp\tests.rs:7065:17:
wave64 lane 5 v_ldexp_f16(0x8000): got 0x0000, want 0x8000

So the sign of -0.0 is lost (+0 comes back).

Not tested

  • No regression run (scripts/smoke.ps1): I have no retail title.
  • The other cases of the test after lane 5 (it stops at the first mismatch).

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and tests and drafted this report on the machine above; I checked each point against the logs before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7138847795 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7138847795). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-24T17:12:29Z. --- AMD RDNA4 run of `f30395b`: the new test fails here at `v_ldexp_f16` of `-0`. The runs above are all on NVIDIA. **Tested** - `f30395b` merged into `main` `930e8b4` (clean merge), debug - AMD Radeon RX 9070 (RDNA4, native wave64), Adrenalin 26.11.2 (driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0 (stable MSVC) - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 751 passed, 1 failed, 41 ignored, 0 GPU tests SKIPPED - `gpu_f16_rounding_and_frexp_ldexp` alone (`--exact`): **failed 8 of 8**, the same way every run, also in the suite run: ``` panicked at crates\xcl\src\gpu\recomp\tests.rs:7065:17: wave64 lane 5 v_ldexp_f16(0x8000): got 0x0000, want 0x8000 ``` So the sign of `-0.0` is lost (`+0` comes back). **Not tested** - No regression run (`scripts/smoke.ps1`): I have no retail title. - The other cases of the test after lane 5 (it stops at the first mismatch). **AI use** - Claude Code (Claude Opus 5.5) ran the builds and tests and drafted this report on the machine above; I checked each point against the logs before posting.
joeypercia commented 2026-11-24 18:09:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-24T17:52:15Z.


The -0 case fails because of main's v_ldexp_f16, which #672 fixes: main translates it to HLSL ldexp, and on AMD ldexp(-0.0, n) comes back as +0.

Tested (f30395b merged onto main 9e3831e, debug; Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11)

  • AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2, native wave64), driver 26.11.2: gpu_f16_rounding_and_frexp_ldexp fails the same way as on the RX 9070 above (wave64 lane 5 v_ldexp_f16(0x8000): got 0x0000, want 0x8000). With #672 (6ec4036) merged on top, it passes.
  • RTX 4070 Ti (wave32), driver 616.56: passes with and without #672.

So on AMD this test needs #672 first; that may be worth a line in its description.

AI use: Claude Code (Claude Opus 5.5) ran the tests and drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7139823545 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7139823545). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-24T17:52:15Z. --- The `-0` case fails because of `main`'s `v_ldexp_f16`, which #672 fixes: `main` translates it to HLSL `ldexp`, and on AMD `ldexp(-0.0, n)` comes back as `+0`. **Tested** (`f30395b` merged onto `main` `9e3831e`, debug; Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11) - AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2, native wave64), driver 26.11.2: `gpu_f16_rounding_and_frexp_ldexp` fails the same way as on the RX 9070 above (`wave64 lane 5 v_ldexp_f16(0x8000): got 0x0000, want 0x8000`). With #672 (`6ec4036`) merged on top, it passes. - RTX 4070 Ti (wave32), driver 616.56: passes with and without #672. So on AMD this test needs #672 first; that may be worth a line in its description. **AI use**: Claude Code (Claude Opus 5.5) ran the tests and drafted this comment.
JJAutoCompare commented 2026-11-25 05:08:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:54:07Z.


Tested

Clean detached PR head f30395be11f4e5b52b66bc122b02991afe725e6b. STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5, unoptimized test profile.

cargo test --locked -p xcl --lib --no-run exited 0 in 31.37 s outside the GPU mutex. With XCL_ADAPTER=A770, XCL_DIRECT_DXIL=0, and the specified DXC directory, ran:

& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & 'L:/XclTooling/pr2008-dc0d25fe/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' gpu::recomp::tests::gpu_f16_rounding_and_frexp_ldexp --exact --nocapture --test-threads=1
}

1 passed, 0 failed, 0 ignored, 0 skipped, 719 filtered out, 0.22 s. Child and wrapper exited 0. An initial wrapper launch stopped before the fixture because of PowerShell execution policy. The successful launch used process-scoped RemoteSigned and ran the fixture once.

All 296 standalone wave32 lane-operation assertions passed. In particular, v_ldexp_f16(-0.0, -5) retained 0x8000 on lanes 5, 13, 21, and 29. The AMD wave64 report exercised a PR-plus-main merge and found positive zero at lane 5.

Not tested

Native or split wave64, negative-sign frexp mantissas outside this fixture, direct DXIL, other revisions and adapters, full suite, and retail smoke.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in fixtures and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7153266956 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7153266956). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T04:54:07Z. --- **Tested** Clean detached PR head `f30395be11f4e5b52b66bc122b02991afe725e6b`. STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5, unoptimized test profile. `cargo test --locked -p xcl --lib --no-run` exited 0 in 31.37 s outside the GPU mutex. With `XCL_ADAPTER=A770`, `XCL_DIRECT_DXIL=0`, and the specified DXC directory, ran: ```powershell & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & 'L:/XclTooling/pr2008-dc0d25fe/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' gpu::recomp::tests::gpu_f16_rounding_and_frexp_ldexp --exact --nocapture --test-threads=1 } ``` **1 passed, 0 failed, 0 ignored, 0 skipped**, 719 filtered out, 0.22 s. Child and wrapper exited 0. An initial wrapper launch stopped before the fixture because of PowerShell execution policy. The successful launch used process-scoped RemoteSigned and ran the fixture once. All 296 standalone wave32 lane-operation assertions passed. In particular, `v_ldexp_f16(-0.0, -5)` retained `0x8000` on lanes 5, 13, 21, and 29. The [AMD wave64 report](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7138847795) exercised a PR-plus-main merge and found positive zero at lane 5. **Not tested** Native or split wave64, negative-sign `frexp` mantissas outside this fixture, direct DXIL, other revisions and adapters, full suite, and retail smoke. **AI use** T3 Code / Codex (`gpt-6.2-sol`) ran the checked-in fixtures and prepared this report.
zhouzhidong3-hash commented 2026-11-25 08:08:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by zhouzhidong3-hash on 2026-11-25T07:57:33Z.


Independent RTX 5070 check of this fixture on a newer runtime tree.

Applied the unchanged test-only diff from #1227 f30395be11 cleanly onto 7a1f5a2e65 (#1994 original head). No runtime changes were applied. This is not a clean #1227-head run.

Windows 10 x64, i7-12700KF, RTX 5070 driver 591.86, Rust 1.100.0 MSVC debug, DXC/DXIL 1.8.2502.11 and local Agility SDK, XCL_ADAPTER=5070.

cargo test --locked -p xcl --lib gpu_f16_rounding_and_frexp_ldexp -- --test-threads=1 --nocapture

  • XCL_DIRECT_DXIL=0: 1 passed, 0 failed, 0 ignored, 972 filtered out, 0.49 s.
  • XCL_DIRECT_DXIL=all: 1 passed, 0 failed, 0 ignored, 972 filtered out, 0.30 s.
  • No GPU skips in either log. Original fixture retains its deliberate exclusion of negative frexp mantissa checks. NaN comparison accepts any NaN encoding.

Not tested: clean original PR runtime, AMD/Intel, native wave64, full workspace, Release, retail, or fallback instrumentation. Temporary fixture addition restored byte-for-byte; no tracked diff after execution.

Logs: pr1227-modern-0.log and pr1227-modern-all.log under I:\neospace\work\xcl-1994-5070.
AI assistance: OpenAI Codex applied the existing fixture temporarily, ran both configurations, checked logs, restored source and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7156443777 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7156443777). Originally posted by [zhouzhidong3-hash](https://github.com/zhouzhidong3-hash) on 2026-11-25T07:57:33Z. --- Independent RTX 5070 check of this fixture on a newer runtime tree. Applied the unchanged test-only diff from #1227 f30395be11f4e5b52b66bc122b02991afe725e6b cleanly onto 7a1f5a2e6541c9fa0ef921e319fa81a2fdc2e42f (#1994 original head). No runtime changes were applied. This is not a clean #1227-head run. Windows 10 x64, i7-12700KF, RTX 5070 driver 591.86, Rust 1.100.0 MSVC debug, DXC/DXIL 1.8.2502.11 and local Agility SDK, XCL_ADAPTER=5070. `cargo test --locked -p xcl --lib gpu_f16_rounding_and_frexp_ldexp -- --test-threads=1 --nocapture` - XCL_DIRECT_DXIL=0: 1 passed, 0 failed, 0 ignored, 972 filtered out, 0.49 s. - XCL_DIRECT_DXIL=all: 1 passed, 0 failed, 0 ignored, 972 filtered out, 0.30 s. - No GPU skips in either log. Original fixture retains its deliberate exclusion of negative frexp mantissa checks. NaN comparison accepts any NaN encoding. Not tested: clean original PR runtime, AMD/Intel, native wave64, full workspace, Release, retail, or fallback instrumentation. Temporary fixture addition restored byte-for-byte; no tracked diff after execution. Logs: pr1227-modern-0.log and pr1227-modern-all.log under I:\neospace\work\xcl-1994-5070. AI assistance: OpenAI Codex applied the existing fixture temporarily, ran both configurations, checked logs, restored source and drafted this report.
DavidM1911 commented 2026-11-26 05:05:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:17:16Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7182461876 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7182461876). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T04:17:16Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
github-actions[bot] commented 2026-11-30 08:42:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:42:43Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273247770 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7273247770). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:42:43Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
saintwolf commented 2026-11-30 17:48:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T17:48:20Z.


merge-check claim
head: f30395be11

<!-- greyfinch-sync:ivall/xcl:comment:7286871745 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7286871745). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T17:48:20Z. --- merge-check claim head: f30395be11f4e5b52b66bc122b02991afe725e6b
saintwolf commented 2026-11-30 17:55:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T17:55:12Z.


merge-check
base: 9dfbe3ea66
head: f30395be11
merge: clean (trial merge 1b639fdf84ac6f0c8231e8f0a4ae427bd59c454e; git diff --check clean; +71/-0 in crates/xcl/src/gpu/recomp/tests.rs)
build: cargo build --workspace -> ok (pre-existing warnings only, none from the PR's lines)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2885 passed, 2 failed, 51 ignored (base + 1 new test); SKIPPED: 27, the standard set for this card (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"). Failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 — pre-existing on this machine, identical on base 9dfbe3ea; and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs — a known machine-state flake here (its child process's "warm:" case failed; it passes when rerun alone, exit 0, 1 passed), and it is what makes the raw log print 44 "test result" lines (the child prints its own) instead of 43. The new gpu_f16_rounding_and_frexp_ldexp passes both in a targeted run and inside the full suite.
review: read the whole diff. The change is one new test, gpu_f16_rounding_and_frexp_ldexp: 8 hand-written edge vectors (1.5, -1.5, the 2.5 tie, -0.25, +0.0, -0.0, +inf, 0.0625) across 10 ops — v_ceil/floor/trunc/rndne/fract_f16, v_frexp_mant_f32, v_frexp_exp_i32_f32, v_frexp_mant_f16, v_frexp_exp_i16_f16, v_ldexp_f16 — run per lane over gpu_waves() (wave32 only on this card). I verified every vector by hand against the RDNA2 semantics and the f16 format: ceil/floor/trunc/rndne including the 2.5 tie-to-even, fract(x) = x - floor(x) (so fract(-1.5) = 0x3800, fract(-0) = +0), sign preservation through rounding of -0.0, fract(+inf) = NaN (the checker accepts any f16 NaN encoding), frexp exp = 0 for zero/inf, frexp(0.0625) = mantissa 0.5 / exp -3, and ldexp results 12.0 = 0x4A00, -0.375 = 0xB600, -4.0 = 0xC400, -0 stays 0x8000. The v[12] read as (v[12] & 0xFFFF) as i16 matches the encoder (emit.rs: "(uint)frexp_exp(&) & 0xFFFFu"), and the frexp mantissa checks are skipped for sign-negative inputs, which the test comments as the separate #580/#587 sign-handling issue while the exponent checks still run. The test goes through run_wave -> runner::run with precompiled DXIL, i.e. the HLSL path regardless of XCL_DIRECT_DXIL, like the neighbouring gpu_ldexp_f32. The thread's AMD wave64 failure (v_ldexp_f16(-0.0) returning +0) was the pre-existing main ldexp quirk on older bases; the fix, #672 (merge commit b76563b9), is already an ancestor of 9dfbe3ea, so that failure mode is gone on the current main, and the wave64 loop does not run at all on this wave32-only card. Thread: clean full runs on an RTX 3060 Ti (twice, including a re-verification at the current head), a GTX 1660 Ti (699/0/21), an RTX 5070 under both XCL_DIRECT_DXIL settings, and an Intel Arc A770 wave32 run (all 296 lane assertions, -0.0 preserved); the two AMD wave64 rigs (RX 9070, RDNA2 iGPU) hit exactly the pre-#672 quirk only. Dupe note: #1639 (test-only, same file, not yet in the queue) adds gpu_frexp_ldexp_and_unary_f16_ops over the same 10 ops with randomized lanes; the two test functions are disjoint by name, so both can merge without conflict. One file, test-only, no unsafe, no new dependencies, no stop-criteria files.
performance: none; test-only.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B

<!-- greyfinch-sync:ivall/xcl:comment:7287043947 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7287043947). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T17:55:12Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: f30395be11f4e5b52b66bc122b02991afe725e6b merge: clean (trial merge 1b639fdf84ac6f0c8231e8f0a4ae427bd59c454e; git diff --check clean; +71/-0 in crates/xcl/src/gpu/recomp/tests.rs) build: cargo build --workspace -> ok (pre-existing warnings only, none from the PR's lines) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2885 passed, 2 failed, 51 ignored (base + 1 new test); SKIPPED: 27, the standard set for this card (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"). Failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 — pre-existing on this machine, identical on base 9dfbe3ea; and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs — a known machine-state flake here (its child process's "warm:" case failed; it passes when rerun alone, exit 0, 1 passed), and it is what makes the raw log print 44 "test result" lines (the child prints its own) instead of 43. The new gpu_f16_rounding_and_frexp_ldexp passes both in a targeted run and inside the full suite. review: read the whole diff. The change is one new test, gpu_f16_rounding_and_frexp_ldexp: 8 hand-written edge vectors (1.5, -1.5, the 2.5 tie, -0.25, +0.0, -0.0, +inf, 0.0625) across 10 ops — v_ceil/floor/trunc/rndne/fract_f16, v_frexp_mant_f32, v_frexp_exp_i32_f32, v_frexp_mant_f16, v_frexp_exp_i16_f16, v_ldexp_f16 — run per lane over gpu_waves() (wave32 only on this card). I verified every vector by hand against the RDNA2 semantics and the f16 format: ceil/floor/trunc/rndne including the 2.5 tie-to-even, fract(x) = x - floor(x) (so fract(-1.5) = 0x3800, fract(-0) = +0), sign preservation through rounding of -0.0, fract(+inf) = NaN (the checker accepts any f16 NaN encoding), frexp exp = 0 for zero/inf, frexp(0.0625) = mantissa 0.5 / exp -3, and ldexp results 12.0 = 0x4A00, -0.375 = 0xB600, -4.0 = 0xC400, -0 stays 0x8000. The v[12] read as (v[12] & 0xFFFF) as i16 matches the encoder (emit.rs: "(uint)frexp_exp(&) & 0xFFFFu"), and the frexp mantissa checks are skipped for sign-negative inputs, which the test comments as the separate #580/#587 sign-handling issue while the exponent checks still run. The test goes through run_wave -> runner::run with precompiled DXIL, i.e. the HLSL path regardless of XCL_DIRECT_DXIL, like the neighbouring gpu_ldexp_f32. The thread's AMD wave64 failure (v_ldexp_f16(-0.0) returning +0) was the pre-existing main ldexp quirk on older bases; the fix, #672 (merge commit b76563b9), is already an ancestor of 9dfbe3ea, so that failure mode is gone on the current main, and the wave64 loop does not run at all on this wave32-only card. Thread: clean full runs on an RTX 3060 Ti (twice, including a re-verification at the current head), a GTX 1660 Ti (699/0/21), an RTX 5070 under both XCL_DIRECT_DXIL settings, and an Intel Arc A770 wave32 run (all 296 lane assertions, -0.0 preserved); the two AMD wave64 rigs (RX 9070, RDNA2 iGPU) hit exactly the pre-#672 quirk only. Dupe note: #1639 (test-only, same file, not yet in the queue) adds gpu_frexp_ldexp_and_unary_f16_ops over the same 10 ops with randomized lanes; the two test functions are disjoint by name, so both can merge without conflict. One file, test-only, no unsafe, no new dependencies, no stop-criteria files. performance: none; test-only. verdict: safe to merge hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B
AAsobu commented 2026-11-30 18:05:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by AAsobu on 2026-11-30T18:05:40Z.


merge-check claim
head: f30395be11

<!-- greyfinch-sync:ivall/xcl:comment:7287337370 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7287337370). Originally posted by [AAsobu](https://github.com/AAsobu) on 2026-11-30T18:05:40Z. --- merge-check claim head: f30395be11f4e5b52b66bc122b02991afe725e6b
AAsobu commented 2026-11-30 18:15:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by AAsobu on 2026-11-30T18:15:57Z.


merge-check
base: abec7ce9ee
head: f30395be11
merge: clean (merge commit d3025ecd; git diff --check clean; +71/-0 in crates/xcl/src/gpu/recomp/tests.rs)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 0 failed, 51 ignored; SKIPPED: 29 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 no GPU_UPLOAD heaps, 1 cannot disable the driver cache without Developer Mode); failing: none. The new gpu::recomp::tests::gpu_f16_rounding_and_frexp_ldexp passes (wave32 only on this adapter).
review: test-only, inside the existing recomp GPU test file; no runtime change. I checked the expected values of all 8 cases by hand (ceil/floor/trunc/rndne/fract f16, frexp mant/exp f32 and f16, ldexp f16): they match the ISA, including 2.5 -> 2.0 for rndne, -0.25 -> -0.0 for ceil, fract(+inf) as NaN and frexp_exp(+inf) = 0. Negative inputs skip only the frexp_mant checks, as the comment says (#580 / #587). Note, not a blocker: the still-open #1639 tests all ten of these instructions too (among others); whichever lands second overlaps. wave64 path not run here (no wave64 on this GPU).
performance: none (test-only).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB, driver 621.24, Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0, debug / Claude Code (Claude Opus 5.5), results checked by me

<!-- greyfinch-sync:ivall/xcl:comment:7287590479 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7287590479). Originally posted by [AAsobu](https://github.com/AAsobu) on 2026-11-30T18:15:57Z. --- merge-check base: abec7ce9ee2f25efe8c089ca4128ddf171c37afa head: f30395be11f4e5b52b66bc122b02991afe725e6b merge: clean (merge commit d3025ecd; `git diff --check` clean; +71/-0 in crates/xcl/src/gpu/recomp/tests.rs) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 0 failed, 51 ignored; SKIPPED: 29 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 no GPU_UPLOAD heaps, 1 cannot disable the driver cache without Developer Mode); failing: none. The new `gpu::recomp::tests::gpu_f16_rounding_and_frexp_ldexp` passes (wave32 only on this adapter). review: test-only, inside the existing recomp GPU test file; no runtime change. I checked the expected values of all 8 cases by hand (ceil/floor/trunc/rndne/fract f16, frexp mant/exp f32 and f16, ldexp f16): they match the ISA, including 2.5 -> 2.0 for rndne, -0.25 -> -0.0 for ceil, fract(+inf) as NaN and frexp_exp(+inf) = 0. Negative inputs skip only the frexp_mant checks, as the comment says (#580 / #587). Note, not a blocker: the still-open #1639 tests all ten of these instructions too (among others); whichever lands second overlaps. wave64 path not run here (no wave64 on this GPU). performance: none (test-only). verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB, driver 621.24, Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0, debug / Claude Code (Claude Opus 5.5), results checked by me
Foniass commented 2026-12-01 05:10:34 +00:00 (Migrated from github.com)

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


Triage (#1607) – head f30395b

Main has no GPU test of v_ceil/floor/trunc/rndne/fract_f16, v_frexp_mant_f16/f32, v_frexp_exp_i16_f16 or v_ldexp_f16. #1639 (opened later) tests the same ops inside a broader test, but in their VOP1 encodings and wave64 only. This PR uses the VOP3 encodings and runs wave32 and wave64, so the two complement each other.
I checked the expected values by hand (e.g. fract(-0.25) = 0.75, ldexp(-1.5, -2) = -0.375 = 0xB600, frexp(0.0625) = 0.5 * 2^-3) and they match the RDNA2 definitions. Negative frexp_mant is skipped on purpose, with a note pointing to #580 / #587.
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:7301497007 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1227#issuecomment-7301497007). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:10:34Z. --- **Triage (#1607)** – head f30395b Main has no GPU test of v_ceil/floor/trunc/rndne/fract_f16, v_frexp_mant_f16/f32, v_frexp_exp_i16_f16 or v_ldexp_f16. #1639 (opened later) tests the same ops inside a broader test, but in their VOP1 encodings and wave64 only. This PR uses the VOP3 encodings and runs wave32 and wave64, so the two complement each other. I checked the expected values by hand (e.g. fract(-0.25) = 0.75, ldexp(-1.5, -2) = -0.375 = 0xB600, frexp(0.0625) = 0.5 * 2^-3) and they match the RDNA2 definitions. Negative frexp_mant is skipped on purpose, with a note pointing to #580 / #587. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/1227:upstream-pr/1227'
git switch 'upstream-pr/1227'

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/1227'
git switch 'upstream-pr/1227'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1227'
git switch 'upstream-pr/1227'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1227'
git switch 'main'
git merge --squash 'upstream-pr/1227'
git switch 'main'
git merge --ff-only 'upstream-pr/1227'
git switch 'main'
git merge 'upstream-pr/1227'
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!1218
No description provided.