Tests: check integer min3 / max3 / med3 on the GPU #1199

Open
github-bot wants to merge 1 commit from github-bot/gh-1199 into main AGit
Owner

@⁠jesuarchive on GitHub · 2026-11-24 13:08 UTC · original
jesuarchive:tests/vminmax3-int → main · +69 −0 · 1 files · 1 commits · open

v_min3/max3/med3 for i32, u32 and i16 are translated (emit.rs) but had no GPU test. The open test PRs cover the f32, f16 and u16 forms (#686, #738, #739). This adds the integer ones, test-only.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: gpu_min3_max3_med3_integers. It runs triples of six values that order differently as signed and unsigned, with repeats: 0, 1, the signed maximum and minimum, -1 and a middle value. These are 32-bit for the i32 / u32 forms. For the _i16 forms they sit in the low halves and the high halves hold other values. Only the low half of an _i16 result is checked, since what a 16-bit VALU op leaves in the high half is discussed in #1115. Runs on every adapter through gpu_waves().

Tested

  • NVIDIA GeForce RTX 3060 12 GB (32-lane waves only), driver 32.0.16.1088; AMD Ryzen 7 5800XT; Windows 11 Pro build 26300; rustc 1.95.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 from the Windows SDK; debug.
  • cargo test --workspace -- --test-threads=4: 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). main 47efa2e on the same machine: 741 / 0 / 41, the same two skipped.
  • cargo test -p xcl --lib -- gpu_min3_max3_med3_integers --nocapture --test-threads=1: 1 passed, not skipped (wave32 pass only on this adapter).
  • Negative controls, each a temporary edit of emit.rs, reverted: v_min3_i32 comparing unsigned, v_med3_u32 returning the maximum, v_max3_i16 comparing unsigned. The test fails on each, naming the instruction.

Regression run

  • Not needed: test-only change.

Not tested

  • The wave64 pass (no 64-lane waves on this GPU): AMD and Intel GPUs.
  • The high half of the _i16 results (see above); OP_SEL on the _i16 forms.
  • Wine, release build.

AI use

  • Claude Code with Claude Opus 5.5: found the untested instructions, wrote the test and this description, ran the tests and negative controls on the machine above.
**@⁠jesuarchive** on GitHub · 2026-11-24 13:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1199) `jesuarchive:tests/vminmax3-int` → `main` · +69 −0 · 1 files · 1 commits · open `v_min3/max3/med3` for `i32`, `u32` and `i16` are translated (`emit.rs`) but had no GPU test. The open test PRs cover the `f32`, `f16` and `u16` forms (#686, #738, #739). This adds the integer ones, test-only. **What is in it** - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_min3_max3_med3_integers`. It runs triples of six values that order differently as signed and unsigned, with repeats: 0, 1, the signed maximum and minimum, -1 and a middle value. These are 32-bit for the `i32` / `u32` forms. For the `_i16` forms they sit in the low halves and the high halves hold other values. Only the low half of an `_i16` result is checked, since what a 16-bit VALU op leaves in the high half is discussed in #1115. Runs on every adapter through `gpu_waves()`. **Tested** - NVIDIA GeForce RTX 3060 12 GB (32-lane waves only), driver 32.0.16.1088; AMD Ryzen 7 5800XT; Windows 11 Pro build 26300; rustc 1.95.0 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2602.17 from the Windows SDK; debug. - `cargo test --workspace -- --test-threads=4`: 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). `main` `47efa2e` on the same machine: 741 / 0 / 41, the same two skipped. - `cargo test -p xcl --lib -- gpu_min3_max3_med3_integers --nocapture --test-threads=1`: 1 passed, not skipped (wave32 pass only on this adapter). - Negative controls, each a temporary edit of `emit.rs`, reverted: `v_min3_i32` comparing unsigned, `v_med3_u32` returning the maximum, `v_max3_i16` comparing unsigned. The test fails on each, naming the instruction. **Regression run** - Not needed: test-only change. **Not tested** - The wave64 pass (no 64-lane waves on this GPU): AMD and Intel GPUs. - The high half of the `_i16` results (see above); `OP_SEL` on the `_i16` forms. - Wine, release build. **AI use** - Claude Code with Claude Opus 5.5: found the untested instructions, wrote the test and this description, ran the tests and negative controls on the machine above.
v_min3/max3/med3 for i32, u32 and i16 were translated but had no GPU
test. The new test runs every triple of six values that order differently
as signed and unsigned (with repeats): 0, 1, the signed maximum and
minimum, -1 and a middle value, in 32 bits and, for the _i16 forms, on the
low halves while the high halves hold other values. Only the low half of
an _i16 result is checked.

It fails if v_min3_i32 compares unsigned, if v_med3_u32 returns the
maximum, or if v_max3_i16 compares unsigned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:46:49 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 13:18 UTC · original

Independent verification on current main 384f7f7 (branch already contains it — clean).

Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11.

  • cargo test -p xcl --lib med3: 1 passed, 0 failed — gpu_min3_max3_med3_integers on real hardware.

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

**@⁠DavidM1911** on GitHub · 2026-11-24 13:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/1199#issuecomment-7132634240) Independent verification on current `main` `384f7f7` (branch already contains it — clean). **Machine:** Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11. - `cargo test -p xcl --lib med3`: **1 passed, 0 failed** — `gpu_min3_max3_med3_integers` on real hardware. AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Author
Owner

@⁠bjarngard on GitHub · 2026-11-24 13:23 UTC · original

Test report for head 6849439 (AMD, native wave64)

Tested

  • AMD Radeon(TM) Graphics (Ryzen 9 9950X iGPU, RDNA2, native wave64), driver 32.0.21043.5001; Windows 11 build 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPED
  • With XCL_REQUIRE_GPU=wave64: gpu_min3_max3_med3_integers passed
  • The test loops over gpu_waves(), so on this adapter both the wave64 and the wave32 pass ran

Not tested: the high half and OP_SEL of the _i16 forms (beyond what the test checks), Intel, Wine.

AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.

**@⁠bjarngard** on GitHub · 2026-11-24 13:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/1199#issuecomment-7132769835) Test report for head `6849439` (AMD, native wave64) **Tested** - AMD Radeon(TM) Graphics (Ryzen 9 9950X iGPU, RDNA2, native wave64), driver 32.0.21043.5001; Windows 11 build 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4`: 742 passed, 0 failed, 41 ignored, no SKIPPED - With `XCL_REQUIRE_GPU=wave64`: `gpu_min3_max3_med3_integers` passed - The test loops over `gpu_waves()`, so on this adapter both the wave64 and the wave32 pass ran **Not tested:** the high half and `OP_SEL` of the `_i16` forms (beyond what the test checks), Intel, Wine. **AI use:** the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1199/head:github-bot/gh-1199'
git switch 'github-bot/gh-1199'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1199'
git switch 'github-bot/gh-1199'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1199'
git switch 'github-bot/gh-1199'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1199'
git switch 'main'
git merge --squash 'github-bot/gh-1199'
git switch 'main'
git merge --ff-only 'github-bot/gh-1199'
git switch 'main'
git merge 'github-bot/gh-1199'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.