Tests: packed 16-bit integer VOP3P ops on the GPU, with swapped halves #652

Open
acaracargo wants to merge 1 commit from upstream-pr/657 into main
acaracargo commented 2026-11-24 02:57:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by acaracargo on 2026-11-24T02:57:27Z.


Adds GPU coverage for v_pk_mul_lo_u16, the three packed shifts, v_pk_min / v_pk_max (u16 and i16), and v_pk_mad_u16 / i16 without clamp.

Each half is compared against the ISA's pseudo-code using eight lanes of edge values, including sign boundaries, shift counts past 15 and 16-bit wraparound.

Every instruction runs twice: once with the usual half selection (op_sel 0, op_sel_hi 1) and once with the halves swapped (op_sel 1, op_sel_hi 0). This also checks that the low result correctly reads the high halves of the sources when selected.

The existing gpu_clamp_and_omod_per_instruction test covers packed add / sub / mad with clamp. #445 and #545 cover non-packed VOP3 instructions.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: gpu_packed_16_bit_integer.

Tested

  • NVIDIA GeForce RTX 4060 (32-lane waves only), driver 610.88; Intel Core i5-13400F; Windows 11 Pro 26300; Rust 1.100.0 x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug.
  • cargo test --workspace -- --test-threads=4 on 8213152: 685 passed, 0 failed, 41 ignored (main 9ce2070: 684 / 0 / 41).
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).
  • Making v_pk_min_i16 unsigned or removing the 16-bit mask from v_pk_lshlrev_b16 causes the test to fail (checked locally, reverted).

Regression run

  • Test-only change, no runtime regression run.

Not tested

  • AMD GPUs and native wave64; console hardware.
  • op_sel combinations other than the two tested above.

AI use

  • Claude Code (Claude Opus 5.5) wrote the test and the original description and ran the tests and mutation checks. ChatGPT assisted with editing the PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5465226109 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/657). Originally posted by [acaracargo](https://github.com/acaracargo) on 2026-11-24T02:57:27Z. --- Adds GPU coverage for `v_pk_mul_lo_u16`, the three packed shifts, `v_pk_min` / `v_pk_max` (u16 and i16), and `v_pk_mad_u16` / `i16` without clamp. Each half is compared against the ISA's pseudo-code using eight lanes of edge values, including sign boundaries, shift counts past 15 and 16-bit wraparound. Every instruction runs twice: once with the usual half selection (`op_sel 0`, `op_sel_hi 1`) and once with the halves swapped (`op_sel 1`, `op_sel_hi 0`). This also checks that the low result correctly reads the high halves of the sources when selected. The existing `gpu_clamp_and_omod_per_instruction` test covers packed add / sub / mad with clamp. #445 and #545 cover non-packed VOP3 instructions. **What is in it** - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_packed_16_bit_integer`. **Tested** - NVIDIA GeForce RTX 4060 (32-lane waves only), driver 610.88; Intel Core i5-13400F; Windows 11 Pro 26300; Rust 1.100.0 `x86_64-pc-windows-msvc`; DXC 1.9.2602.17; debug. - `cargo test --workspace -- --test-threads=4` on `8213152`: 685 passed, 0 failed, 41 ignored (`main` `9ce2070`: 684 / 0 / 41). - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). - Making `v_pk_min_i16` unsigned or removing the 16-bit mask from `v_pk_lshlrev_b16` causes the test to fail (checked locally, reverted). **Regression run** - Test-only change, no runtime regression run. **Not tested** - AMD GPUs and native wave64; console hardware. - `op_sel` combinations other than the two tested above. **AI use** - Claude Code (Claude Opus 5.5) wrote the test and the original description and ran the tests and mutation checks. ChatGPT assisted with editing the PR description.
MonkeyPython commented 2026-11-24 07:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MonkeyPython on 2026-11-24T03:05:29Z.


AMD / native-wave64 data point (the "Not tested" axis): gpu_packed_16_bit_integer (VOP3P with swapped halves) passes on an AMD Raphael iGPU (RDNA2, native wave64) and on NVIDIA wave32.

Setup: Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB; adapters: AMD Radeon(TM) Graphics (Raphael iGPU, wave64) and RTX 3080 Ti 12 GB (driver 621.01, wave32-only). PR head 8213152, release.

Runs (cargo test -p xcl --release --lib gpu_packed_16_bit_integer):

  • XCL_ADAPTER=Radeon (selects the iGPU; the selector errors on no match, so a pass means it ran there): 1 passed / 0 failed, 0.11 s.
  • Default adapter (3080 Ti): 1 passed / 0 failed, 0.26 s.

The packed op_sel halves agree on native wave64 and on the wave32 split path.

Not tested: discrete AMD GPUs, other titles.

AI use: Gentle Shell (Pi coding agent), model qwen4-max: ran the tests and wrote this report from their logs; a human reviews it before posting. No code changes.

<!-- greyfinch-sync:ivall/xcl:comment:7120762077 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/657#issuecomment-7120762077). Originally posted by [MonkeyPython](https://github.com/MonkeyPython) on 2026-11-24T03:05:29Z. --- AMD / native-wave64 data point (the "Not tested" axis): `gpu_packed_16_bit_integer` (VOP3P with swapped halves) passes on an AMD Raphael iGPU (RDNA2, native wave64) and on NVIDIA wave32. **Setup:** Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB; adapters: AMD Radeon(TM) Graphics (Raphael iGPU, wave64) and RTX 3080 Ti 12 GB (driver 621.01, wave32-only). PR head `8213152`, release. **Runs (`cargo test -p xcl --release --lib gpu_packed_16_bit_integer`):** - `XCL_ADAPTER=Radeon` (selects the iGPU; the selector errors on no match, so a pass means it ran there): **1 passed / 0 failed**, 0.11 s. - Default adapter (3080 Ti): **1 passed / 0 failed**, 0.26 s. The packed `op_sel` halves agree on native wave64 and on the wave32 split path. **Not tested:** discrete AMD GPUs, other titles. **AI use:** Gentle Shell (Pi coding agent), model qwen4-max: ran the tests and wrote this report from their logs; a human reviews it before posting. No code changes.
MesshM commented 2026-11-24 07:05:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T03:18:18Z.


Test run of 8213152573670933e75ba5fc558e74566d77baf3 on AMD RDNA4 (native wave64). I merged it onto current main 63cdc25 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 693 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 653 passed, 0 failed, 21 ignored
  • 0 SKIPPED; gpu_packed_16_bit_integer passes.

Review: The references and the swapped (op_sel 1 / op_sel_hi 0) half selection match the VOP3P definitions I checked (shift counts from the low 4 bits, signed variants through the sign-extended half). This adds RDNA4 next to the RDNA2 iGPU result above.

Not tested: no retail title (not needed for a test-only change), release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7120963812 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/657#issuecomment-7120963812). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T03:18:18Z. --- Test run of `8213152573670933e75ba5fc558e74566d77baf3` on AMD RDNA4 (native wave64). I merged it onto current `main` `63cdc25` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **693 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 653 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `gpu_packed_16_bit_integer` passes. **Review:** The references and the swapped (op_sel 1 / op_sel_hi 0) half selection match the VOP3P definitions I checked (shift counts from the low 4 bits, signed variants through the sign-extended half). This adds RDNA4 next to the RDNA2 iGPU result above. **Not tested:** no retail title (not needed for a test-only change), release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
lordon1a commented 2026-11-24 07:05:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lordon1a on 2026-11-24T03:38:05Z.


Independent GPU test report on 8213152:

Tested

  • Hardware: NVIDIA GeForce RTX 3070 Ti Laptop GPU (driver 616.64, wave32, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200), rustc 1.100.0 (x86_64-pc-windows-gnullvm), debug build, DXC 1.9.2609.5 (01b62ad4)
  • Command: cargo test -p xcl --lib gpu_packed_16_bit_integer -- --nocapture
  • Result: 1 passed, 0 failed, 0 ignored in 0.74s (gpu::recomp::tests::gpu_packed_16_bit_integer ok)

Not tested

  • AMD / wave64, Intel GPU, retail title

AI use

  • Antigravity (Google DeepMind agent) — fetched 8213152 in a detached worktree, audited the diff, ran the GPU test, and posted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7121279067 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/657#issuecomment-7121279067). Originally posted by [lordon1a](https://github.com/lordon1a) on 2026-11-24T03:38:05Z. --- Independent GPU test report on `8213152`: **Tested** - Hardware: NVIDIA GeForce RTX 3070 Ti Laptop GPU (driver `616.64`, wave32, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200), `rustc 1.100.0` (`x86_64-pc-windows-gnullvm`), debug build, DXC `1.9.2609.5` (`01b62ad4`) - Command: `cargo test -p xcl --lib gpu_packed_16_bit_integer -- --nocapture` - Result: **1 passed, 0 failed, 0 ignored** in `0.74s` (`gpu::recomp::tests::gpu_packed_16_bit_integer` ok) **Not tested** - AMD / wave64, Intel GPU, retail title **AI use** - Antigravity (Google DeepMind agent) — fetched `8213152` in a detached worktree, audited the diff, ran the GPU test, and posted this report.
JJAutoCompare commented 2026-11-25 07:05:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:30:14Z.


Empirical test report (82131525)

Hardware / environment

  • PR #657 at commit 8213152573670933e75ba5fc558e74566d77baf3 on a clean, detached worktree.
  • Intel Arc A770 Graphics, driver 32.0.101.9175. AMD Ryzen 7 3800X 8-Core Processor. Windows build 10.0.26200.9974.
  • rustc 1.100.0 (0ef1bc386 2026-11-09), host x86_64-pc-windows-msvc. DXC loaded dxcompiler 1.9.2609.5 (01b62ad4) and dxil 1.9.2609.5.

Commands and results

  • cargo test -p xcl --lib --no-run completed outside the Arc lock with exit code 0. Cargo built the unoptimized test executable xcl-00e28da3621caf64.exe and emitted one deprecation warning for AtomicU32::fetch_update. This step compiled the test binary.
  • & $testExe gpu::recomp::tests::gpu_packed_16_bit_integer --exact --nocapture --test-threads=1 ran inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Here $testExe is the executable from the build step. The wrapper acquired and released the Arc lock and returned exit code 0.
  • Focused run recorded 1 passed / 0 failed / 0 ignored / 0 skipped, with 665 filtered out. Libtest reported 0.41s. Skips were counted from case-sensitive lines beginning with SKIPPED in the combined stdout and stderr log.

Observed behavior

The new D3D12 test matched the CPU reference across eight input triples, ten packed 16-bit VOP3P operations and two half-selection modes, totaling 160 packed-result comparisons. The cases covered low-half multiply, three shifts, signed and unsigned min/max, and unclamped signed and unsigned multiply-add.

Not tested

The full GPU workspace suite and game smoke runs were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr657-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7154857244 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/657#issuecomment-7154857244). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T06:30:14Z. --- ### Empirical test report (82131525) **Hardware / environment** - PR #657 at commit `8213152573670933e75ba5fc558e74566d77baf3` on a clean, detached worktree. - Intel Arc A770 Graphics, driver `32.0.101.9175`. AMD Ryzen 7 3800X 8-Core Processor. Windows build `10.0.26200.9974`. - `rustc 1.100.0 (0ef1bc386 2026-11-09)`, host `x86_64-pc-windows-msvc`. DXC loaded `dxcompiler 1.9.2609.5 (01b62ad4)` and `dxil 1.9.2609.5`. **Commands and results** - `cargo test -p xcl --lib --no-run` completed outside the Arc lock with exit code 0. Cargo built the unoptimized test executable `xcl-00e28da3621caf64.exe` and emitted one deprecation warning for `AtomicU32::fetch_update`. This step compiled the test binary. - `& $testExe gpu::recomp::tests::gpu_packed_16_bit_integer --exact --nocapture --test-threads=1` ran inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. Here `$testExe` is the executable from the build step. The wrapper acquired and released the Arc lock and returned exit code 0. - Focused run recorded **1 passed / 0 failed / 0 ignored / 0 skipped**, with 665 filtered out. Libtest reported 0.41s. Skips were counted from case-sensitive lines beginning with `SKIPPED ` in the combined stdout and stderr log. **Observed behavior** The new D3D12 test matched the CPU reference across eight input triples, ten packed 16-bit VOP3P operations and two half-selection modes, totaling 160 packed-result comparisons. The cases covered low-half multiply, three shifts, signed and unsigned min/max, and unclamped signed and unsigned multiply-add. **Not tested** The full GPU workspace suite and game smoke runs were omitted. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr657-focused.log and published.
DavidM1911 commented 2026-11-25 13:05:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T12:21:07Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7162256594 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/657#issuecomment-7162256594). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T12:21:07Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
github-actions[bot] commented 2026-11-29 07:42:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:42:28Z.


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:7252639971 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/657#issuecomment-7252639971). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:42:28Z. --- 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.
BBareth commented 2026-11-30 13:24:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T13:24:40Z.


merge-check claim
head: 8213152573

<!-- greyfinch-sync:ivall/xcl:comment:7279805086 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/657#issuecomment-7279805086). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T13:24:40Z. --- merge-check claim head: 8213152573670933e75ba5fc558e74566d77baf3
BBareth commented 2026-11-30 13:36:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T13:36:35Z.


merge-check
base: 9dfbe3ea66
head: 8213152573
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. The new test gpu::recomp::tests::gpu_packed_16_bit_integer passed and ran on the GPU here (no new SKIPPED line).
review: no blocking finding; one new test in one test file, no change outside tests. It runs ten packed 16-bit VOP3P instructions (mul_lo, three shifts, u16 / i16 min and max, mad_u16 / mad_i16) on eight input triples, once with the usual half selection and once with the halves swapped, and compares each half with a reference closure written from the ISA pseudo-code.
performance: none at run time; one more GPU test in the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7280091549 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/657#issuecomment-7280091549). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T13:36:35Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 8213152573670933e75ba5fc558e74566d77baf3 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. The new test `gpu::recomp::tests::gpu_packed_16_bit_integer` passed and ran on the GPU here (no new SKIPPED line). review: no blocking finding; one new test in one test file, no change outside tests. It runs ten packed 16-bit VOP3P instructions (mul_lo, three shifts, u16 / i16 min and max, mad_u16 / mad_i16) on eight input triples, once with the usual half selection and once with the halves swapped, and compares each half with a reference closure written from the ISA pseudo-code. performance: none at run time; one more GPU test in the suite. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
tiagonleal commented 2026-11-30 14:29:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-30T14:29:01Z.


merge-check
base: 9dfbe3ea66
head: 8213152573
merge: clean, alone and together with #645 (aee6962b, which touches another file, tests/gpu_compute_e2e.rs): both heads merged onto the base in one tree (c4c23abe) without conflicts
build: cargo build --workspace -> ok on the combined tree
tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 on the combined tree of this head and #645's head on the base (one suite run for the two test-only PRs, not one per PR) -> 2886 passed, 1 failed, 51 ignored; SKIPPED: 24 lines, the same lines as on the base; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails the same way on the base alone (2885 passed, 1 failed, 51 ignored; #3513 fixes it). The new test gpu::recomp::tests::gpu_packed_16_bit_integer runs on this card and passes: gpu_ready (recomp/tests.rs:13) accepts a card with 32-lane waves only (runner.rs:595), so it runs as wave32 here, with no SKIPPED line, in the suite and alone. It really compares GPU results: with the V_PK_MAX_U16 reference changed to min on purpose, it fails with lines such as V_PK_MAX_U16 a=0x00030011 b=0x8001ffff c=0x7fff0001: got 0x8001ffff, want 0x00030011, for both half selections; file restored after.
review: whole diff read (+72/-0, gpu/recomp/tests.rs only). I checked each reference closure against the lowering it tests, dxil/lower_wide.rs:199-229: mul_lo and mad keep the low 16 bits of a * b (+ c); the three shifts take the count from source 0 masked to 4 bits and shift source 1; ashr sign-extends the half first; min / max u16 compare unsigned halves and the i16 forms compare sign-extended halves. The test's hs helper sign-extends the same way, and mad_i16 truncated to 16 bits gives the same bits as the unsigned product, so the references and the lowering agree, and the GPU results agree with both. The second half selection (op_sel 1, op_sel_hi 0) reads the high halves for the low result and the low halves for the high result, which the expected values model. Partial overlap only: integer_programs_on_the_gpu (recomp/lower.rs:2827-2828) already runs V_PK_MUL_LO_U16 and V_PK_MAD_U16 once each; the shifts, the min / max forms, mad_i16 and the swapped selection are new.
performance: no smoke run: the PR changes only a test file, and nothing in the emulator binary.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite and tests, reviewed the diff against the merged source and wrote this)

  • Tiago
<!-- greyfinch-sync:ivall/xcl:comment:7281444014 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/657#issuecomment-7281444014). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-30T14:29:01Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 8213152573670933e75ba5fc558e74566d77baf3 merge: clean, alone and together with #645 (aee6962b, which touches another file, `tests/gpu_compute_e2e.rs`): both heads merged onto the base in one tree (c4c23abe) without conflicts build: cargo build --workspace -> ok on the combined tree tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 on the combined tree of this head and #645's head on the base (one suite run for the two test-only PRs, not one per PR) -> 2886 passed, 1 failed, 51 ignored; SKIPPED: 24 lines, the same lines as on the base; failing: `gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16`, which fails the same way on the base alone (2885 passed, 1 failed, 51 ignored; #3513 fixes it). The new test `gpu::recomp::tests::gpu_packed_16_bit_integer` runs on this card and passes: `gpu_ready` (`recomp/tests.rs:13`) accepts a card with 32-lane waves only (`runner.rs:595`), so it runs as wave32 here, with no SKIPPED line, in the suite and alone. It really compares GPU results: with the V_PK_MAX_U16 reference changed to `min` on purpose, it fails with lines such as `V_PK_MAX_U16 a=0x00030011 b=0x8001ffff c=0x7fff0001: got 0x8001ffff, want 0x00030011`, for both half selections; file restored after. review: whole diff read (+72/-0, `gpu/recomp/tests.rs` only). I checked each reference closure against the lowering it tests, `dxil/lower_wide.rs:199-229`: mul_lo and mad keep the low 16 bits of a * b (+ c); the three shifts take the count from source 0 masked to 4 bits and shift source 1; ashr sign-extends the half first; min / max u16 compare unsigned halves and the i16 forms compare sign-extended halves. The test's `hs` helper sign-extends the same way, and mad_i16 truncated to 16 bits gives the same bits as the unsigned product, so the references and the lowering agree, and the GPU results agree with both. The second half selection (op_sel 1, op_sel_hi 0) reads the high halves for the low result and the low halves for the high result, which the expected values model. Partial overlap only: `integer_programs_on_the_gpu` (`recomp/lower.rs:2827-2828`) already runs V_PK_MUL_LO_U16 and V_PK_MAD_U16 once each; the shifts, the min / max forms, mad_i16 and the swapped selection are new. performance: no smoke run: the PR changes only a test file, and nothing in the emulator binary. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite and tests, reviewed the diff against the merged source and wrote this) - Tiago
Foniass commented 2026-12-01 03:54:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:54:14Z.


Triage (#1607) – head 8213152

#1576 checks eight of the same ops (v_pk_mul_lo_u16, the three shifts, u16/i16 min and max) with the normal half selection, inside a larger bitops test. This PR also checks swapped halves (op_sel 1, op_sel_hi 0) and v_pk_mad_u16/i16 without clamp. Main has the mads only with CLAMP 1. #1823 compares direct DXIL against HLSL rather than against the ISA, so it is a different check. No problems found in the reference functions or the op_sel encoding.
The PR conflicts with main and needs a rebase.
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:7300179758 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/657#issuecomment-7300179758). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:54:14Z. --- **Triage (#1607)** – head 8213152 #1576 checks eight of the same ops (`v_pk_mul_lo_u16`, the three shifts, u16/i16 min and max) with the normal half selection, inside a larger bitops test. This PR also checks swapped halves (`op_sel` 1, `op_sel_hi` 0) and `v_pk_mad_u16/i16` without clamp. Main has the mads only with `CLAMP` 1. #1823 compares direct DXIL against HLSL rather than against the ISA, so it is a different check. No problems found in the reference functions or the op_sel encoding. The PR conflicts with main and needs a rebase. 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/657:upstream-pr/657'
git switch 'upstream-pr/657'

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