Tests: check bit-scan, reverse, bitfield and byte-permute ops on the GPU #1217
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1226"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by plentilha on 2026-11-24T13:24:39Z.
Adds GPU execution tests for nine translated bitwise and bitfield VALU instructions that had no existing GPU test coverage:
v_not_b32,v_xnor_b32,v_bfrev_b32,v_ffbh_u32,v_ffbh_i32,v_ffbl_b32,v_bfm_b32,v_bfi_b32andv_perm_b32. Test-only change.What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_bitwise_and_bitfield_opsexercising zero, all-ones, sign-bit, bitmask wrap, and allv_perm_b32selector classes (byte picks, half/word sign extensions,0x00and0xFFfills) throughgpu_waves().Tested
./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_bitwise_and_bitfield_ops --nocapture: 1 passed, 0 failed (wave32 pass on this adapter)Regression run
Not tested
XCL_SAMPLE_*unset), Wine, release build.AI use
emit.rscoverage, wrote the test and PR description, and ran the test suite locally.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:39:21Z.
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!
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T14:09:17Z.
I checked the expected values against the RDNA2 definitions (read from the ISA, not run on AMD hardware). All 9 match:
v_perm_b32: over{S0, S1}with S1 the low dword, a selector of 0–3 picks an S1 byte and 4–7 an S0 byte. 8, 9, 10 and 11 give the sign of bit 15 and bit 31 of S1, then of S0. 12 gives0x00; 13 and above give0xFF.v_ffbh_i32: the position, counted from the MSB, of the first bit that differs from the sign bit, and-1for 0 and -1.v_bfm_b32: 0 at width 0.perm_refandffbh_i_refencode exactly these. No changes needed from my side.AI-assisted (Claude Code).
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:17:15Z.
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
Imported from ivall/xcl. Originally posted by Luislariosss on 2026-11-26T23:04:25Z.
Compatibility note, in case it saves a conflict later: I have a local change to
Shader::bfrev(crates/xcl/src/gpu/dxil/ops.rs) that reverses a dynamicBfrev.i32with shifts instead ofdx.op unary30, because amdxc64 returnsx | bfrev(x)when the operand descends from a 64-bit op (#2115, fuzz seed 1599's dynamic form). It is posted as a patch in https://github.com/xcl-dev/xcl/issues/2115#issuecomment-7205170040 and is not a PR yet (it needs a retail smoke run I cannot do).I merged this PR on top of it and ran
cargo test -p xcl --lib gpu::recomp::testson an RX 9060 XT (driver 32.0.32029.2010): 168 passed, 0 failed, 17 ignored. So thev_bfrev_b32coverage here still passes when the direct path stops using the nativeBfrev.i32for dynamic operands - the tests exercise the translated output, not the dx.op.Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:24:46Z.
Tested: Clean
f09c1d44ac0185521ac98be091d7914902d7514c, Windows 11 build 26200.9974, Ryzen 7 3800X, Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC debug.cargo test -j 2 -p xcl --lib --locked --no-runthen exactgpu::recomp::tests::gpu_bitwise_and_bitfield_ops,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware, andgpu::recomp::dxc::version_tests::the_loaded_dxc_is_identifiedwith--nocapture --test-threads=1. One GPU fixture passed all nine VOP3 operations across 32 lanes, and the DXC identity test passed. The native-wave64 fixture emittedSKIPPED … no wave64and counted as a pass in libtest. No failures or ignores.Not tested: Native wave64, direct DXIL, full workspace suite and retail smoke.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran and reran the checks and wrote this report.Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T10:45:20Z.
Independent desktop NVIDIA verification of PR #1226 at head
f09c1d44ac0185521ac98be091d7914902d7514c(1commit; exact parent & merge-base:47efa2ecea0a12934719ae69b81930cf02a4b1c3, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted GPU tests & build (
f09c1d44)cargo test --release -p xcl --lib gpu_bitwise_and_bitfield_ops -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 719 filtered out× 3 (0.28s,0.23s,0.22s,0skipped; live RTX 4060 execution compiled with DXC1.9.2609.5)cargo build --release -p xcl1m 20stest compile +0.06sincremental--releasebuild, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)(Note:
scripts/smoke.ps1at47efa2ecpredates9683e7a6and printed the local folder basename ontitle:; replaced below with the standard9683e7a6title hash29640639, with all measured fields verbatim.)Exact parent & merge-base (
47efa2ecea0a12934719ae69b81930cf02a4b1c3):PR #1226 (
f09c1d44ac0185521ac98be091d7914902d7514c):Limits of coverage
crates/xcl/src/gpu/recomp/tests.rs,0production-code changes);gpu_bitwise_and_bitfield_opscompiled and executed3/3on desktop RTX 4060 (Wave32-only Ada; native Wave64 paths are not exercised).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:10:18Z.
Triage (#1607) – head
f09c1d4Overlaps the open GPU test PRs of #1607 group D171 for some ops: v_bfi_b32, v_bfm_b32 and v_perm_b32 are also tested by #445 and #1576, v_perm_b32 by #1057, and v_ffbh_u32/v_ffbh_i32/v_ffbl_b32 by #1576. v_not_b32, v_xnor_b32 and v_bfrev_b32 are tested by none of them and none of these ops is tested on main. Unlike #1576 (wave64 only), this test also runs wave32 through
gpu_waves().The reference functions (byte selectors 8-12 in
perm_ref, all-same-bits = -1 inffbh_i_ref, width & 31 in bfm) match the RDNA2 definitions.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.