Recompiler tests: ds_swizzle_b32 lanes match RDNA2 hardware for every offset #513
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/518"
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 AC-Storm-YT on 2026-11-24T01:12:21Z.
swizzle_lane, which decides which lane eachds_swizzle_b32lane reads, was only checked against the ISA's examples – about ten of the 65,536 offsets. This adds a test that checks it for every offset against what the hardware does. Test only: nothing outsidetests.rschanges, and no behaviour changes (swizzle_lanealready matched everywhere).What is in it
ds_swizzle_lanes_match_rdna2_hardware_for_every_offset(crates/xcl/src/gpu/recomp/tests.rs):swizzle_lanefor all 65,536 offsets × 32 lanes, hashed (FNV-1a 64) per mode – bit mode, quad permute, rotate, FFT – and compared with the same hash of a hardware table. The table (2 MiB) was measured by runningds_swizzle_b32natively (OpenCL C with inline RDNA assembly, AMD driver OpenCL 3679.0, 32-lane waves, each lane holding its lane id) for every offset on the Ryzen 7 9800X3D's integrated RDNA2 GPU (gfx1036, the console's GPU generation) and on an RX 9070 XT (gfx1201). Both GPUs gave the same table. The measuring script is not part of this PR.Tested
stable-x86_64-pc-windows-msvc, debug; DXC 1.8.2502.11cargo test --workspace -- --test-threads=4on this branch's head: 678 passed, 0 failed, 41 ignored. No SKIPPED tests.swizzle_laneis broken, and names the mode: with each of these changes made toemit.rsby hand (and reverted) – rotate ignoringoffset[10], FFT keeping the unmasked bits, quad permute reading 1-bit fields, bit mode applyingorbeforeand– it failed for rotate, FFT, quad permute and bit mode respectively.Regression run
Not needed: the PR changes only
crates/xcl/src/gpu/recomp/tests.rs.Not tested
swizzle_lane;gpu_ds_swizzle_modesalready runs 7 offsets end to end.AI use
Imported from ivall/xcl. Originally posted by towiice on 2026-11-24T01:32:39Z.
Review: COMMENTED
Tested PR head
c0946e9on NVIDIA GeForce GTX 1650 SUPER (Turing / TU116, wave32, driver 610.88), Windows 11 build 10.0.26300 (26H2), Rust 1.100.0 (stable-x86_64-pc-windows-gnullvm), DXCv1.9.2609:cargo test -p xcl --lib ds_swizzle -- --test-threads=4: 4 passed, 0 failed (0.61 s), includinggpu::recomp::tests::ds_swizzle_lanes_match_rdna2_hardware_for_every_offset,gpu_ds_swizzle_modes, andgpu_ds_swizzle_and_bpermute_zero_inactive_lanes.All
ds_swizzletests pass on Turing.Imported from ivall/xcl. Originally posted by arcwiser on 2026-11-24T01:23:46Z.
Tested
c0946e9ed7745b9cede03de73da3bbcbc69957e5stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 from Windows SDK 10.0.28000.0; debugcargo test -p xcl --lib ds_swizzle_lanes_match_rdna2_hardware_for_every_offset -- --nocapture: 1 passed, 0 failed, 0 ignored.\scripts\test.ps1: 678 passed, 0 failed, 41 ignoredno wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareXCL_SAMPLE_*variables were set. The new exhaustiveds_swizzletest ran and passed in the full suite.Not tested
AI use
Imported from ivall/xcl. Originally posted by PHeitor1 on 2026-11-24T01:26:22Z.
Tested
c0946e9merged ontomain508a0c7.RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed), rustc 1.100.0 MSVC, debug,
cargo test --workspace --no-fail-fast -- --test-threads=4, noXCL_SAMPLE_*.Pass: 681 passed, 0 failed, 41 ignored. SKIPPED: only the 2
no wave64tests.ds_swizzle_lanes_match_rdna2_hardware_for_every_offsetpasses. The existinggpu_ds_swizzle_modesandgpu_ds_swizzle_and_bpermute_zero_inactive_lanesstill pass on the GPU.Run and written with Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T13:53:40Z.
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!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:41:33Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by AC-Storm-YT on 2026-11-29T21:15:27Z.
Still merges cleanly onto main. It adds a test checking
swizzle_laneagainst RDNA2 hardware for all 65,536ds_swizzle_b32offsets, where only about ten were checked before; it only waits for a maintainer.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:38:10Z.
Triage (#1607) – head
c0946e9No open or merged PR makes the same change. Main has
ds_swizzle_modes_follow_the_isa, which checks only the ISA's example offsets, andswizzle_laneinrecomp/emit.rshas not changed since this PR's base. The test is CPU-only, so CI ran it and it passed.No problems found in the diff. The hardware hashes cannot be checked without the measured table or the OpenCL program that produced it. Consider adding that program (or how to rerun it) to the commit.
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.