Recompiler: v_swaprel_b32 indexes the destination with M0[25:16] #797

Open
upipibi wants to merge 2 commits from upstream-pr/803 into main
upipibi commented 2026-11-24 05:37:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T05:37:20Z.


v_swaprel_b32 exchanged the fixed VDST with VGPR[SRC0 + M0] and switched on all of M0. The RDNA 2 ISA gives each side its own index (VOP1 opcode 104): addr_src = SRC0 + M0.u[9:0], addr_dst = DST + M0.u[25:16], then tmp = VGPR[addr_dst]; VGPR[addr_dst] = VGPR[addr_src]; VGPR[addr_src] = tmp, with the example m0 = (20 << 16) | 10, v_swaprel_b32 v5, v7 swapping v25 and v17. Section 6.6 (table 25) also uses separate fields for source and destination; it prints the low field as M0[7:0], and this PR follows the opcode table's M0[9:0], as v_movrelsd_2_b32 already does. LLVM defines the instruction (VOP1Instructions.td, Uses = [M0]) but no compiler I know of emits it.

On main, with m0 = (2 << 16) | 3, no case of switch (m0) matched. XCL wrote 0 to v5 and left v7 and v13 alone, where the ISA swaps v7 and v13 and leaves v5 untouched. The existing test only used m0 = 3 and m0 = 1, where both readings agree.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs: swaprel reads and writes both sides through the bounded switches that movrel uses for v_movrelsd_2_b32 (m0 & 0x3FF, (m0 >> 16) & 0x3FF). Both old values are still read before either write, so an overlapping pair is a no-op, and the writes stay EXEC-gated as for any VOP1 write.
  • crates/xcl/src/gpu/dxil/lower_wide.rs (added 2026-12-03, after the merge-check reviews): the direct-DXIL lowering Lw::swaprel had the same old reading (fixed VDST, switch on all of M0), and the direct backend is now the default for kernels, so gpu_v_swaprel_b32 failed there. It now mirrors emit.rs: destination VDST + M0[25:16], source SRC0 + M0[9:0], both & 0x3FF, both old values read before either write, writes EXEC-gated.
  • crates/xcl/src/gpu/recomp/tests.rs: gpu_v_swaprel_b32 gets m0 = (2 << 16) | 3, v_swaprel_b32 v5, v10 (swaps v7 and v13, v5 untouched), and m0 = 0xFC01FC02, v_swaprel_b32 v16, v20 (bits outside the two fields ignored: swaps v17 and v22). v_swaprel_b32_uses_the_m0_relative_switch checks the two index expressions in the HLSL.

Tested

At the current head 94bcb7c (rebased onto main e99b0bd on 2026-12-03): NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug.

  • cargo test -p xcl --lib -- --test-threads=4 (direct backend, the default): 2863 passed, 0 failed, 37 ignored. The 24 SKIPPED lines are the usual ones for this card: 22 need wave64, 1 needs heap windows, and 1 needs the driver cache off.
  • The swaprel tests (gpu_v_swaprel_b32, v_swaprel_b32_uses_the_m0_relative_switch, upper_lanes::tests::swaprel_writes_any_register), 3 runs each with XCL_DIRECT_DXIL=0 and =1: 3 passed, 0 failed every run.
  • Red on the direct path: the rebased head without the lower_wide.rs change fails gpu_v_swaprel_b32 with XCL_DIRECT_DXIL=1 (lane 0: v5 = 0, expected 2000), as the reviews found; it passes on XCL_DIRECT_DXIL=0.

Earlier, at 4db1a2a (driver 616.56):

  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 4db1a2a: 704 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests: gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64)
  • Both changed tests fail on main (d5442d2) without the emit.rs change. gpu_v_swaprel_b32 fails at lane 0 with v5 = 0, expected 2000 (untouched), and v_swaprel_b32_uses_the_m0_relative_switch fails on the old switch (m0). Both pass with the change. upper_lanes::tests::swaprel_writes_any_register passes before and after.

Regression run

From eizispark's run (https://github.com/ivall/xcl/pull/803#issuecomment-7123874976), thanks. It is for the previous head 4db1a2a, before the rebase and the direct-DXIL change, so a pair on 94bcb7c is still needed:

main:

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR:

xcl-smoke v1
commit: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1665 (PresentX 1665)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14857 MB

Not tested

  • Retail titles beyond the 60 s smoke run above; AMD GPUs and native wave64. The test's wave64 program ran in the split form on the 3070.
  • An index past the program's highest VGPR still reads 0 and skips the write, as before. The ISA does not say what the hardware does there.
  • Whether any title uses v_swaprel_b32 with a non-zero M0[25:16]. Low impact: neither LLVM nor ACO emits the instruction.

AI use

  • AI-assisted (Claude Code, Claude Opus 5.5): found the bug in a read-through of the recompiler, checked it against the ISA and LLVM, wrote the fix, the tests and this description, and ran the tests above.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5466753526 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T05:37:20Z. --- `v_swaprel_b32` exchanged the fixed `VDST` with `VGPR[SRC0 + M0]` and switched on all of M0. The RDNA 2 ISA gives each side its own index (VOP1 opcode 104): `addr_src = SRC0 + M0.u[9:0]`, `addr_dst = DST + M0.u[25:16]`, then `tmp = VGPR[addr_dst]; VGPR[addr_dst] = VGPR[addr_src]; VGPR[addr_src] = tmp`, with the example `m0 = (20 << 16) | 10`, `v_swaprel_b32 v5, v7` swapping v25 and v17. Section 6.6 (table 25) also uses separate fields for source and destination; it prints the low field as M0[7:0], and this PR follows the opcode table's M0[9:0], as `v_movrelsd_2_b32` already does. LLVM defines the instruction (`VOP1Instructions.td`, `Uses = [M0]`) but no compiler I know of emits it. On `main`, with `m0 = (2 << 16) | 3`, no case of `switch (m0)` matched. XCL wrote 0 to v5 and left v7 and v13 alone, where the ISA swaps v7 and v13 and leaves v5 untouched. The existing test only used m0 = 3 and m0 = 1, where both readings agree. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: `swaprel` reads and writes both sides through the bounded switches that `movrel` uses for `v_movrelsd_2_b32` (`m0 & 0x3FF`, `(m0 >> 16) & 0x3FF`). Both old values are still read before either write, so an overlapping pair is a no-op, and the writes stay EXEC-gated as for any VOP1 write. - `crates/xcl/src/gpu/dxil/lower_wide.rs` (added 2026-12-03, after the merge-check reviews): the direct-DXIL lowering `Lw::swaprel` had the same old reading (fixed `VDST`, switch on all of M0), and the direct backend is now the default for kernels, so `gpu_v_swaprel_b32` failed there. It now mirrors `emit.rs`: destination `VDST + M0[25:16]`, source `SRC0 + M0[9:0]`, both `& 0x3FF`, both old values read before either write, writes EXEC-gated. - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_v_swaprel_b32` gets `m0 = (2 << 16) | 3`, `v_swaprel_b32 v5, v10` (swaps v7 and v13, v5 untouched), and `m0 = 0xFC01FC02`, `v_swaprel_b32 v16, v20` (bits outside the two fields ignored: swaps v17 and v22). `v_swaprel_b32_uses_the_m0_relative_switch` checks the two index expressions in the HLSL. **Tested** At the current head 94bcb7c (rebased onto `main` e99b0bd on 2026-12-03): NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug. - `cargo test -p xcl --lib -- --test-threads=4` (direct backend, the default): 2863 passed, 0 failed, 37 ignored. The 24 SKIPPED lines are the usual ones for this card: 22 need wave64, 1 needs heap windows, and 1 needs the driver cache off. - The `swaprel` tests (`gpu_v_swaprel_b32`, `v_swaprel_b32_uses_the_m0_relative_switch`, `upper_lanes::tests::swaprel_writes_any_register`), 3 runs each with `XCL_DIRECT_DXIL=0` and `=1`: 3 passed, 0 failed every run. - Red on the direct path: the rebased head without the `lower_wide.rs` change fails `gpu_v_swaprel_b32` with `XCL_DIRECT_DXIL=1` (lane 0: v5 = 0, expected 2000), as the reviews found; it passes on `XCL_DIRECT_DXIL=0`. Earlier, at 4db1a2a (driver 616.56): - `cargo test --workspace --no-fail-fast -- --test-threads=4` on 4db1a2a: 704 passed, 0 failed, 41 ignored - SKIPPED GPU tests: `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64) - Both changed tests fail on `main` (d5442d2) without the `emit.rs` change. `gpu_v_swaprel_b32` fails at lane 0 with `v5 = 0`, expected 2000 (untouched), and `v_swaprel_b32_uses_the_m0_relative_switch` fails on the old `switch (m0)`. Both pass with the change. `upper_lanes::tests::swaprel_writes_any_register` passes before and after. **Regression run** From eizispark's run (https://github.com/ivall/xcl/pull/803#issuecomment-7123874976), thanks. It is for the previous head 4db1a2a, before the rebase and the direct-DXIL change, so a pair on 94bcb7c is still needed: main: ``` xcl-smoke v1 commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1660 (PresentX 1660) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14862 MB ``` PR: ``` xcl-smoke v1 commit: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1665 (PresentX 1665) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14857 MB ``` **Not tested** - Retail titles beyond the 60 s smoke run above; AMD GPUs and native wave64. The test's wave64 program ran in the split form on the 3070. - An index past the program's highest VGPR still reads 0 and skips the write, as before. The ISA does not say what the hardware does there. - Whether any title uses `v_swaprel_b32` with a non-zero M0[25:16]. Low impact: neither LLVM nor ACO emits the instruction. **AI use** - AI-assisted (Claude Code, Claude Opus 5.5): found the bug in a read-through of the recompiler, checked it against the ISA and LLVM, wrote the fix, the tests and this description, and ran the tests above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MesshM commented 2026-11-24 07:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:46:09Z.


Test run of 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c on AMD RDNA4. I merged it onto current main e50836b 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: 704 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 663 passed, 0 failed, 21 ignored
  • 0 SKIPPED; gpu_v_swaprel_b32, v_swaprel_b32_uses_the_m0_relative_switch and swaprel_writes_any_register pass.

Review: Separate indices for the two sides (SRC0 + M0[9:0], DST + M0[25:16]) are what the RDNA2 ISA's pseudo-code for VOP1 opcode 104 gives, including its m0 = (20 << 16) | 10 example. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, 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:7123255927 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/803#issuecomment-7123255927). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T05:46:09Z. --- Test run of `4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c` on AMD RDNA4. I merged it onto current `main` `e50836b` 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: **704 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 663 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `gpu_v_swaprel_b32`, `v_swaprel_b32_uses_the_m0_relative_switch` and `swaprel_writes_any_register` pass. **Review:** Separate indices for the two sides (`SRC0 + M0[9:0]`, `DST + M0[25:16]`) are what the RDNA2 ISA's pseudo-code for VOP1 opcode 104 gives, including its `m0 = (20 << 16) | 10` example. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, 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.
ethandepstein-del commented 2026-11-24 07:06:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ethandepstein-del on 2026-11-24T05:57:38Z.


Independent native Windows NVIDIA RTX 5080 (wave32) + D3D12 debug layer build/test run and code review at head 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c.

Code Review

  • Clean fix matching RDNA2 ISA VOP1 v_swaprel_b32 (VDST + M0[25:16] <-> SRC0 + M0[9:0]), capturing both old values before either EXEC-gated write and masking both indices to 10 bits (0x3FFu). Both CPU HLSL and GPU tests cover the destination index and ignored upper M0 bits. No issues found.

Tested

  • Environment: NVIDIA GeForce RTX 5080 (16 GB, wave32, driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), D3D12 debug layer installed (d3d12SDKLayers.dll), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC from Windows SDK 10.0.26100.0, debug build.
  • Command: cargo build --workspace && cargo test --workspace -- --test-threads=4
  • Result:
    • Run 2 (full workspace): 704 passed, 0 failed, 41 ignored (0 new warnings).
    • (Note: Run 1 hit an unrelated pre-existing transient flake in hle::d3d12x::cpu_writes::tests::writes_land_after_the_queue at cpu_writes.rs:184, while both PR tests passed in both Run 1 and Run 2.)
  • PR-specific tests (2/2 ok, executed on RTX 5080, not skipped):
    • gpu::recomp::tests::v_swaprel_b32_uses_the_m0_relative_switch
    • gpu::recomp::tests::gpu_v_swaprel_b32
  • SKIPPED (2):
    • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64)
    • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)

Not tested

  • AMD/wave64 hardware (already covered above), release build, and retail titles.

AI use: Antigravity (Gemini 4 Neon reviewed the diff; Gemini 4 Hydrogen ran the RTX 5080 workspace tests) drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7123437745 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/803#issuecomment-7123437745). Originally posted by [ethandepstein-del](https://github.com/ethandepstein-del) on 2026-11-24T05:57:38Z. --- Independent native Windows **NVIDIA RTX 5080 (wave32)** + **D3D12 debug layer** build/test run and code review at head `4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c`. ### Code Review - Clean fix matching RDNA2 ISA VOP1 `v_swaprel_b32` (`VDST + M0[25:16]` <-> `SRC0 + M0[9:0]`), capturing both old values before either EXEC-gated write and masking both indices to 10 bits (`0x3FFu`). Both CPU HLSL and GPU tests cover the destination index and ignored upper M0 bits. No issues found. ### Tested - **Environment:** NVIDIA GeForce RTX 5080 (16 GB, wave32, driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), D3D12 debug layer installed (`d3d12SDKLayers.dll`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC from Windows SDK `10.0.26100.0`, debug build. - **Command:** `cargo build --workspace && cargo test --workspace -- --test-threads=4` - **Result:** - Run 2 (full workspace): **704 passed, 0 failed, 41 ignored** (0 new warnings). - *(Note: Run 1 hit an unrelated pre-existing transient flake in `hle::d3d12x::cpu_writes::tests::writes_land_after_the_queue` at `cpu_writes.rs:184`, while both PR tests passed in both Run 1 and Run 2.)* - **PR-specific tests (2/2 `ok`, executed on RTX 5080, not skipped):** - `gpu::recomp::tests::v_swaprel_b32_uses_the_m0_relative_switch` - `gpu::recomp::tests::gpu_v_swaprel_b32` - **SKIPPED (2):** - `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (`no wave64`) - `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (`no wave64`) ### Not tested - AMD/wave64 hardware (already covered above), release build, and retail titles. **AI use:** Antigravity (Gemini 4 Neon reviewed the diff; Gemini 4 Hydrogen ran the RTX 5080 workspace tests) drafted this report.
eizispark commented 2026-11-24 07:06:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T06:22:58Z.


Hardware check of 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c (verified clean merge with main beaa245): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace -- --test-threads=4: 704 passed, 0 failed, 41 ignored (GPU tests skipped on this adapter: none)
  • gpu_v_swaprel_b32, v_swaprel_b32_uses_the_m0_relative_switch, swaprel_writes_any_register: 3 passed, 0 failed

Regression run
main (beaa245):

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR (4db1a2a):

xcl-smoke v1
commit: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1665 (PresentX 1665)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14857 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7123874976 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/803#issuecomment-7123874976). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-24T06:22:58Z. --- Hardware check of `4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c` (verified clean merge with `main` `beaa245`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace -- --test-threads=4`: `704 passed, 0 failed, 41 ignored` (GPU tests skipped on this adapter: `none`) - `gpu_v_swaprel_b32`, `v_swaprel_b32_uses_the_m0_relative_switch`, `swaprel_writes_any_register`: `3 passed, 0 failed` **Regression run** `main` (`beaa245`): ``` xcl-smoke v1 commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1660 (PresentX 1660) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14862 MB ``` PR (`4db1a2a`): ``` xcl-smoke v1 commit: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1665 (PresentX 1665) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14857 MB ``` **Not tested** - wave32-only GPUs (NVIDIA / Intel); gameplay past the menus **AI use** - Antigravity (Gemini 4 Carbon) ran the build, test suite, and `scripts/smoke.ps1` harness on this machine and formatted this report.
SlopTart commented 2026-11-24 07:06:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T06:41:28Z.


2|
3|AMD/wave64 + release-build datapoint - the axes your row lists as not tested. Plus one flake sighting to log.
4|
5|Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross x86_64-pc-windows-gnu, release profile, XCL_NETWORK=0, native wave64. Same rig as my Linux rows in #42 / #718.
6|
7|Merged state: head 4db1a2a onto main beaa245, clean merge.
8|
9|Full suite, cargo test --workspace --release --no-fail-fast -- --test-threads=4: 702 passed, 11 failed, 41 ignored (17 suites). The 11 = this rig's 7 stable Wine-lane failures (my #42 row) + the #718 flaky trio + one hit of gpu_geometry_wave32_prefix_count_over_a_mask - that one is AMD-only (skipped on your wave32 boxes); 2 hits in 12 full-suite runs and 5 of 20 isolated runs at beaa245 (load-sensitive - see #847). Nothing failed because of your change. Your tests pass on RDNA3 native wave64: gpu_v_swaprel_b32 ok, v_swaprel_b32_uses_the_m0_relative_switch ok, upper_lanes::tests::swaprel_writes_any_register ok - and your two skipped GPU tests actually execute here, including the geometry one above.
10|
11|Not tested: retail titles (none here), Windows, RDNA4.
12|Counts only, no game data.
13|AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7124192432 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/803#issuecomment-7124192432). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T06:41:28Z. --- 2| 3|AMD/wave64 + release-build datapoint - the axes your row lists as not tested. Plus one flake sighting to log. 4| 5|**Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross `x86_64-pc-windows-gnu`, **release** profile, `XCL_NETWORK=0`, native wave64. Same rig as my Linux rows in #42 / #718. 6| 7|**Merged state:** head `4db1a2a` onto main `beaa245`, clean merge. 8| 9|**Full suite, `cargo test --workspace --release --no-fail-fast -- --test-threads=4`:** **702 passed, 11 failed, 41 ignored** (17 suites). The 11 = this rig's 7 stable Wine-lane failures (my #42 row) + the #718 flaky trio + one hit of `gpu_geometry_wave32_prefix_count_over_a_mask` - that one is AMD-only (skipped on your wave32 boxes); 2 hits in 12 full-suite runs and 5 of 20 isolated runs at `beaa245` (load-sensitive - see #847). Nothing failed because of your change. Your tests pass on RDNA3 native wave64: `gpu_v_swaprel_b32` ok, `v_swaprel_b32_uses_the_m0_relative_switch` ok, `upper_lanes::tests::swaprel_writes_any_register` ok - and your two skipped GPU tests actually execute here, including the geometry one above. 10| 11|**Not tested:** retail titles (none here), Windows, RDNA4. 12|Counts only, no game data. 13|AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
DavidM1911 commented 2026-11-25 11:09:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:58:31Z.


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:7160420261 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7160420261). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:58:31Z. --- 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 20:41:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:41:25Z.


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:7262280438 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7262280438). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:41:25Z. --- 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:14:54 +00:00 (Migrated from github.com)

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


merge-check claim
head: 4db1a2a4a3

<!-- greyfinch-sync:ivall/xcl:comment:7285957023 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7285957023). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T17:14:54Z. --- merge-check claim head: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c
saintwolf commented 2026-11-30 17:22:03 +00:00 (Migrated from github.com)

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


merge-check
base: 9dfbe3ea66
head: 4db1a2a4a3
merge: clean (trial merge 67cf3ece007da0bd66cf245fb88a6d2e88ffbd03; git diff --check clean; +50/-26 in crates/xcl/src/gpu/recomp/emit.rs and 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 -> 2884 passed, 2 failed, 51 ignored (same test count as base: the PR reworks two existing tests rather than adding new ones); 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: (1) gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 — pre-existing on this machine, identical on base 9dfbe3ea; (2) gpu_v_swaprel_b32 in the default environment: kernel tests run on the direct-DXIL backend when XCL_DIRECT_DXIL is unset, and that backend's own swaprel (dxil/lower_wide.rs:350) still implements the old fixed-VDST / unmasked-full-M0 behavior — this PR changes only the HLSL recompiler, so the direct-path counterpart is a separate follow-up, the same shape as #1296's. I reproduced the identical failure on a clean base worktree with only the PR's tests.rs applied (lane 0: v5 = 0 vs 2000), so this is not a regression. On the HLSL path the PR actually changes (XCL_DIRECT_DXIL=0) I confirmed first-hand: both swaprel tests fail on base and pass with the change, every lane bit-exact on this card.
review: read the whole diff and the surrounding code. The fix matches the RDNA2 ISA: v_swaprel_b32 (VOP1 opcode 104) exchanges the VGPR at VDST + M0[25:16] with the VGPR at SRC0 + M0[9:0], while the old code treated the destination as the fixed VDST and compared the unmasked full M0 against the source index — so any instruction with M0[25:16] != 0 or out-of-field bits swapped the wrong registers (the source read stays 0u when the full M0 matches no case, zeroing the destination). The new code mirrors the v_movrelsd_2_b32 path in the same file (emit.rs:3440): the same masked two indices, the same bounded switches, both old values captured before either write, both writes EXEC-gated, an overlapping pair degenerating to a no-op. I verified every GPU-test vector by hand (m0 = 3 ordinary swap; the EXEC-gated even-lane swap via 0x55555555; m0 = 1 giving v7 <-> v7; m0 = (2 << 16) | 3, the case that discriminates old from new — destination 5 + 2 = v7, source 10 + 3 = v13, v5 untouched; m0 = 0xFC01_FC02, whose out-of-field bits are ignored, giving indices 1 and 2). The reworked unit test pins the generated HLSL of both indexed switches and the DXC compile. Thread: full-suite passes on an RX 9060 XT (RDNA4 wave64, 704/0/41), an RX 9070 XT (704/0/41) with an xcl-smoke main-vs-head regression pair, and an RTX 5080 (wave32, 704/0/41); RTX 3060 Ti lib clean; SlopTart's RADV wave64 release run shows only that rig's known failures with this PR's tests passing. No duplicates (#1616 is the SALU sibling S_MOVRELSD_2_B32 in upper_lanes, a different concern). Only emit.rs and tests.rs, no unsafe, no new dependencies, no stop-criteria files.
performance: none; the generated switches are the same shape as v_movrelsd_2_b32's.
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:7286159053 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7286159053). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T17:22:03Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c merge: clean (trial merge 67cf3ece007da0bd66cf245fb88a6d2e88ffbd03; git diff --check clean; +50/-26 in crates/xcl/src/gpu/recomp/emit.rs and 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 -> 2884 passed, 2 failed, 51 ignored (same test count as base: the PR reworks two existing tests rather than adding new ones); 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: (1) gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 — pre-existing on this machine, identical on base 9dfbe3ea; (2) gpu_v_swaprel_b32 in the default environment: kernel tests run on the direct-DXIL backend when XCL_DIRECT_DXIL is unset, and that backend's own swaprel (dxil/lower_wide.rs:350) still implements the old fixed-VDST / unmasked-full-M0 behavior — this PR changes only the HLSL recompiler, so the direct-path counterpart is a separate follow-up, the same shape as #1296's. I reproduced the identical failure on a clean base worktree with only the PR's tests.rs applied (lane 0: v5 = 0 vs 2000), so this is not a regression. On the HLSL path the PR actually changes (XCL_DIRECT_DXIL=0) I confirmed first-hand: both swaprel tests fail on base and pass with the change, every lane bit-exact on this card. review: read the whole diff and the surrounding code. The fix matches the RDNA2 ISA: v_swaprel_b32 (VOP1 opcode 104) exchanges the VGPR at VDST + M0[25:16] with the VGPR at SRC0 + M0[9:0], while the old code treated the destination as the fixed VDST and compared the unmasked full M0 against the source index — so any instruction with M0[25:16] != 0 or out-of-field bits swapped the wrong registers (the source read stays 0u when the full M0 matches no case, zeroing the destination). The new code mirrors the v_movrelsd_2_b32 path in the same file (emit.rs:3440): the same masked two indices, the same bounded switches, both old values captured before either write, both writes EXEC-gated, an overlapping pair degenerating to a no-op. I verified every GPU-test vector by hand (m0 = 3 ordinary swap; the EXEC-gated even-lane swap via 0x55555555; m0 = 1 giving v7 <-> v7; m0 = (2 << 16) | 3, the case that discriminates old from new — destination 5 + 2 = v7, source 10 + 3 = v13, v5 untouched; m0 = 0xFC01_FC02, whose out-of-field bits are ignored, giving indices 1 and 2). The reworked unit test pins the generated HLSL of both indexed switches and the DXC compile. Thread: full-suite passes on an RX 9060 XT (RDNA4 wave64, 704/0/41), an RX 9070 XT (704/0/41) with an xcl-smoke main-vs-head regression pair, and an RTX 5080 (wave32, 704/0/41); RTX 3060 Ti lib clean; SlopTart's RADV wave64 release run shows only that rig's known failures with this PR's tests passing. No duplicates (#1616 is the SALU sibling S_MOVRELSD_2_B32 in upper_lanes, a different concern). Only emit.rs and tests.rs, no unsafe, no new dependencies, no stop-criteria files. performance: none; the generated switches are the same shape as v_movrelsd_2_b32's. 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
coolpersonnn commented 2026-11-30 17:27:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T17:27:21Z.


merge-check claim
head: 4db1a2a4a3

<!-- greyfinch-sync:ivall/xcl:comment:7286319036 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7286319036). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-11-30T17:27:21Z. --- merge-check claim head: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c
brainhay5 commented 2026-11-30 17:28:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T17:28:50Z.


merge-check claim
head: 4db1a2a4a3

<!-- greyfinch-sync:ivall/xcl:comment:7286365913 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7286365913). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T17:28:50Z. --- merge-check claim head: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c
brainhay5 commented 2026-11-30 17:31:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T17:31:05Z.


merge-check claim
head: 4db1a2a4a3

Withdrawn: the checking tool was stopped mid-run before it could post a check, so this claim is released. The head is unchanged and nobody has lost work - anyone may take it.

<!-- greyfinch-sync:ivall/xcl:comment:7286429812 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7286429812). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T17:31:05Z. --- merge-check claim head: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c Withdrawn: the checking tool was stopped mid-run before it could post a check, so this claim is released. The head is unchanged and nobody has lost work - anyone may take it.
coolpersonnn commented 2026-11-30 17:54:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T17:54:09Z.


merge-check
base: 9dfbe3ea66
head: 4db1a2a4a3
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2884 passed, 2 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (also fails on base 9dfbe3ea alone with identical assertion left: (0, 0), right: (3735928559, 3405691582)), gpu::recomp::tests::gpu_v_swaprel_b32 (passes on base 9dfbe3ea alone; fails on merged tree at lane 0: left: 0, right: 2000 because runner::direct_dxil() defaults to true and dxil/lower_wide.rs:350 still uses fixed VDST and unmasked M0; with XCL_DIRECT_DXIL=0, v_swaprel_b32_uses_the_m0_relative_switch, gpu_v_swaprel_b32, and swaprel_writes_any_register pass: 3 passed, 0 failed)
review: PR #803 updates only the HLSL recompiler (emit.rs:3480-3516) and not Direct DXIL (crates/xcl/src/gpu/dxil/lower_wide.rs:350-380), while Direct DXIL is now enabled by default on main (dxil/kernel.rs:46-61), causing cargo test --workspace to fail gpu_v_swaprel_b32 on GPU machines once merged. The HLSL fix itself matches RDNA2 ISA VOP1 opcode 104 (VDST + M0[25:16] <-> SRC0 + M0[9:0], matching v_movrelsd_2_b32 at emit.rs:3440, capturing both old values before either EXEC-gated write), and the updated tests cover M0[25:16] vs M0[9:0] and ignored high/mid bits. Clean scope (emit.rs and tests.rs only, no unsafe, no new dependencies, no duplicates in #1607 or open/merged PRs).
performance: none in runtime cost (two bounded switches matching v_movrelsd_2_b32). Extra 60 s retail smoke (scripts/smoke.ps1, release): base 9dfbe3ea -> 1702 frames shown (PresentX 1702), 60 60 61 presents/2s, 0 device removals, 0 crashes, 16028 MB peak commit; merged b705d643 -> 1700 frames shown (PresentX 1700), 60 60 60 presents/2s, 0 device removals, 0 crashes, 16340 MB peak commit (title a93b40d7).
verdict: not yet: gpu::recomp::tests::gpu_v_swaprel_b32 passes on base 9dfbe3ea and fails on the merged tree under the default Direct DXIL backend (dxil/lower_wide.rs:350 still uses fixed VDST and unmasked M0); merging as-is breaks cargo test --workspace on GPU hardware until either Direct DXIL swaprel is updated to match or the test selects the HLSL path.
hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.2101), AMD Ryzen 9 9950X3D, Windows 11 Pro 26H2 build 26300, rustc 1.100.0 / T3 Code (Antigravity), Gemini 4 Hydrogen

<!-- greyfinch-sync:ivall/xcl:comment:7287017913 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7287017913). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-11-30T17:54:09Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2884 passed, 2 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (also fails on base 9dfbe3ea alone with identical assertion left: (0, 0), right: (3735928559, 3405691582)), gpu::recomp::tests::gpu_v_swaprel_b32 (passes on base 9dfbe3ea alone; fails on merged tree at lane 0: left: 0, right: 2000 because runner::direct_dxil() defaults to true and dxil/lower_wide.rs:350 still uses fixed VDST and unmasked M0; with XCL_DIRECT_DXIL=0, v_swaprel_b32_uses_the_m0_relative_switch, gpu_v_swaprel_b32, and swaprel_writes_any_register pass: 3 passed, 0 failed) review: PR #803 updates only the HLSL recompiler (emit.rs:3480-3516) and not Direct DXIL (crates/xcl/src/gpu/dxil/lower_wide.rs:350-380), while Direct DXIL is now enabled by default on main (dxil/kernel.rs:46-61), causing cargo test --workspace to fail gpu_v_swaprel_b32 on GPU machines once merged. The HLSL fix itself matches RDNA2 ISA VOP1 opcode 104 (VDST + M0[25:16] <-> SRC0 + M0[9:0], matching v_movrelsd_2_b32 at emit.rs:3440, capturing both old values before either EXEC-gated write), and the updated tests cover M0[25:16] vs M0[9:0] and ignored high/mid bits. Clean scope (emit.rs and tests.rs only, no unsafe, no new dependencies, no duplicates in #1607 or open/merged PRs). performance: none in runtime cost (two bounded switches matching v_movrelsd_2_b32). Extra 60 s retail smoke (scripts/smoke.ps1, release): base 9dfbe3ea -> 1702 frames shown (PresentX 1702), 60 60 61 presents/2s, 0 device removals, 0 crashes, 16028 MB peak commit; merged b705d643 -> 1700 frames shown (PresentX 1700), 60 60 60 presents/2s, 0 device removals, 0 crashes, 16340 MB peak commit (title a93b40d7). verdict: not yet: gpu::recomp::tests::gpu_v_swaprel_b32 passes on base 9dfbe3ea and fails on the merged tree under the default Direct DXIL backend (dxil/lower_wide.rs:350 still uses fixed VDST and unmasked M0); merging as-is breaks cargo test --workspace on GPU hardware until either Direct DXIL swaprel is updated to match or the test selects the HLSL path. hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.2101), AMD Ryzen 9 9950X3D, Windows 11 Pro 26H2 build 26300, rustc 1.100.0 / T3 Code (Antigravity), Gemini 4 Hydrogen
Chrysana commented 2026-12-01 00:14:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-01T00:14:08Z.


merge-check
base: d0832e614f
head: 4db1a2a4a3
merge: clean (git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2881 passed, 10 failed, 51 ignored (base: 2882 passed, 9 failed, 51 ignored); SKIPPED: 6, the same as on base (2 no heap windows, 1 cannot disable the driver cache without Developer Mode, 3 no D3D12 debug layer). failing: the same 8 tests as on base (fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3, gpu_smem_flat_descriptor_windows_and_limits, f32_programs_on_the_gpu, gpu_f32_compares_with_nan, gpu_float_compares_random, gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, counted twice), plus gpu_v_swaprel_b32, which passes on base and fails on the merge: "lane 0 ordinary swap; v5 untouched by the second", left 0, right 2000. Run alone with XCL_DIRECT_DXIL=0 it passes. v_swaprel_b32_uses_the_m0_relative_switch passes.
review: I read the whole diff. The HLSL swaprel now indexes VDST with M0[25:16] and SRC0 with M0[9:0], as v_movrelsd_2_b32 does. Both old values are captured before either write, and the writes are EXEC-gated. On AMD that passes the updated test. The default direct-DXIL swaprel (gpu/dxil/lower_wide.rs:350) still swaps with the fixed VDST and compares all of M0 against the source offset. So I see the same failure as coolpersonnn on NVIDIA, now on AMD too: it isn't vendor-specific.
performance: on the HLSL path one more bounded switch per v_swaprel_b32; the default path is unchanged. Not measured (Tier 1, no title run).
verdict: not yet: gpu_v_swaprel_b32 passes on base and fails on the merge under the default direct-DXIL path (AMD RDNA 4, as on NVIDIA); gpu/dxil/lower_wide.rs swaprel needs the same two M0 fields
hardware / tool and model: AMD Radeon RX 9070 XT 16 GB (RDNA 4, driver 32.0.32015.2008), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.1 / Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7296092069 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7296092069). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-01T00:14:08Z. --- merge-check base: d0832e614fa7d6ae027bb4feb27ccb9121f54a8f head: 4db1a2a4a3d03b3f5eb559670c1f584fbbdd055c merge: clean (git diff --check clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2881 passed, 10 failed, 51 ignored (base: 2882 passed, 9 failed, 51 ignored); SKIPPED: 6, the same as on base (2 no heap windows, 1 cannot disable the driver cache without Developer Mode, 3 no D3D12 debug layer). failing: the same 8 tests as on base (fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3, gpu_smem_flat_descriptor_windows_and_limits, f32_programs_on_the_gpu, gpu_f32_compares_with_nan, gpu_float_compares_random, gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, counted twice), plus gpu_v_swaprel_b32, which passes on base and fails on the merge: "lane 0 ordinary swap; v5 untouched by the second", left 0, right 2000. Run alone with XCL_DIRECT_DXIL=0 it passes. v_swaprel_b32_uses_the_m0_relative_switch passes. review: I read the whole diff. The HLSL swaprel now indexes VDST with M0[25:16] and SRC0 with M0[9:0], as v_movrelsd_2_b32 does. Both old values are captured before either write, and the writes are EXEC-gated. On AMD that passes the updated test. The default direct-DXIL swaprel (gpu/dxil/lower_wide.rs:350) still swaps with the fixed VDST and compares all of M0 against the source offset. So I see the same failure as coolpersonnn on NVIDIA, now on AMD too: it isn't vendor-specific. performance: on the HLSL path one more bounded switch per v_swaprel_b32; the default path is unchanged. Not measured (Tier 1, no title run). verdict: not yet: gpu_v_swaprel_b32 passes on base and fails on the merge under the default direct-DXIL path (AMD RDNA 4, as on NVIDIA); gpu/dxil/lower_wide.rs swaprel needs the same two M0 fields hardware / tool and model: AMD Radeon RX 9070 XT 16 GB (RDNA 4, driver 32.0.32015.2008), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.1 / Claude Code (Claude Opus 5.5)
Foniass commented 2026-12-01 04:09:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:09:47Z.


Triage (#1607) – head 4db1a2a

No open or merged PR changes v_swaprel_b32 to the two M0 fields. #1975 and #1976 only add M0 bound analysis that mentions swaprel.
Main's emit.rs::swaprel still switches on all of M0.
Main has also gained a direct-DXIL Lw::swaprel (gpu/dxil/lower_wide.rs) since this PR's base, and it has the same old reading (m0 == k, fixed VDST). On a rebase it needs the same fix, or the two backends will disagree.
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:7300443286 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7300443286). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:09:47Z. --- **Triage (#1607)** – head 4db1a2a No open or merged PR changes `v_swaprel_b32` to the two M0 fields. #1975 and #1976 only add M0 bound analysis that mentions swaprel. Main's `emit.rs::swaprel` still switches on all of M0. Main has also gained a direct-DXIL `Lw::swaprel` (`gpu/dxil/lower_wide.rs`) since this PR's base, and it has the same old reading (`m0 == k`, fixed VDST). On a rebase it needs the same fix, or the two backends will disagree. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
upipibi commented 2026-12-03 17:08:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-12-03T17:08:15Z.


Test report for the new head 94bcb7c (rebased onto main e99b0bd). The new commit ports the fix to the direct-DXIL lowering (Lw::swaprel in dxil/lower_wide.rs), where gpu_v_swaprel_b32 failed on the default path, as the merge-checks above found.

NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug:

  • cargo test -p xcl --lib -- --test-threads=4 (default, direct backend): 2863 passed, 0 failed, 37 ignored
  • gpu_v_swaprel_b32, v_swaprel_b32_uses_the_m0_relative_switch, upper_lanes::tests::swaprel_writes_any_register, 3 runs each:
    • XCL_DIRECT_DXIL=1: 3 passed, 0 failed (each run)
    • XCL_DIRECT_DXIL=0: 3 passed, 0 failed (each run)
  • Red: the same head without the lower_wide.rs change, XCL_DIRECT_DXIL=1: 2 passed, 1 failed (gpu_v_swaprel_b32, lane 0: v5 = 0, expected 2000)

The smoke pair in the description is for the old head 4db1a2a, so a new pair on 94bcb7c is needed.

Tested with the help of Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7386020438 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7386020438). Originally posted by [upipibi](https://github.com/upipibi) on 2026-12-03T17:08:15Z. --- Test report for the new head `94bcb7c` (rebased onto `main` `e99b0bd`). The new commit ports the fix to the direct-DXIL lowering (`Lw::swaprel` in `dxil/lower_wide.rs`), where `gpu_v_swaprel_b32` failed on the default path, as the merge-checks above found. NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug: - `cargo test -p xcl --lib -- --test-threads=4` (default, direct backend): 2863 passed, 0 failed, 37 ignored - `gpu_v_swaprel_b32`, `v_swaprel_b32_uses_the_m0_relative_switch`, `upper_lanes::tests::swaprel_writes_any_register`, 3 runs each: - `XCL_DIRECT_DXIL=1`: 3 passed, 0 failed (each run) - `XCL_DIRECT_DXIL=0`: 3 passed, 0 failed (each run) - Red: the same head without the `lower_wide.rs` change, `XCL_DIRECT_DXIL=1`: 2 passed, 1 failed (`gpu_v_swaprel_b32`, lane 0: v5 = 0, expected 2000) The smoke pair in the description is for the old head `4db1a2a`, so a new pair on `94bcb7c` is needed. *Tested with the help of Claude Code (Claude Opus 5.5).*
Foniass commented 2026-12-03 17:08:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T17:08:33Z.


Follow-up review of 94bcb7ce, since 4db1a2a (code reading only, not a merge-check; PR description red) · 2 medium, 1 nit

In short: Rebased, with a second commit that fixes the direct-DXIL Lw::swaprel (dxil/lower_wide.rs) the same way as the HLSL path. That answers the earlier triage point that the two backends would disagree. The destination is now VDST + M0[25:16] and the source SRC0 + M0[9:0]. Both old values are read before either write, and the writes are EXEC-gated, matching emit.rs. Two process points remain: the first commit alone fails the default backend's test, and the whole workspace was not run on this head.

Medium

  1. The first commit alone fails gpu_v_swaprel_b32 on the default backend. 1042ba13 changes the test to the new reading but fixes only emit.rs. The direct backend, the default for kernels, still has the old reading until 94bcb7ce. Tested confirms this (lane 0: v5 = 0, expected 2000). CONTRIBUTING.md asks that every commit build and pass the tests, so git bisect works. Squash the two into one commit: it is one logical change, the same instruction in both backends.
  2. The whole workspace is not reported on this head. Tested gives cargo test -p xcl --lib on 94bcb7ce (2863 passed, 0 failed, 37 ignored). The workspace run (with the integration tests) is from 4db1a2a, before the rebase and the new commit. CONTRIBUTING.md asks for cargo test --workspace -- --test-threads=4 on the head under review.

Nit

  1. Direct DXIL: is not one of the commit areas. CONTRIBUTING.md lists Recompiler for this code, as the first commit uses. Squashing (point 1) settles it.
Checked and fine
  • Earlier triage point fixed: the direct-DXIL Lw::swaprel no longer compares all of M0 and no longer writes a fixed VDST.
  • The new lowering mirrors emit.rs::swaprel step by step:
    • both indices are masked with 0x3FF;
    • the source index is M0[9:0] and the destination index M0[25:16];
    • each side's old value is selected over first..=top (0 past the program's VGPRs, like the HLSL default);
    • then VGPR[dst] = old src and VGPR[src] = old dst, each gated by act() && idx == k.
  • When both indices name the same register, both writes store the value it already holds, so the instruction does nothing, as the comment says.
  • top = top_vgpr().max(vdst).max(base) matches the HLSL path's max_vgpr bound.
  • Tested runs the three swaprel tests three times each with XCL_DIRECT_DXIL=0 and =1, and shows the direct path failing without the new commit.
  • The first commit is only rebased: its range-diff has no code change.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7386028793 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/803#issuecomment-7386028793). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T17:08:33Z. --- **Follow-up review** of `94bcb7ce`, since `4db1a2a` (code reading only, not a merge-check; `PR description` red) · 2 medium, 1 nit **In short:** Rebased, with a second commit that fixes the direct-DXIL `Lw::swaprel` (`dxil/lower_wide.rs`) the same way as the HLSL path. That answers the earlier triage point that the two backends would disagree. The destination is now `VDST + M0[25:16]` and the source `SRC0 + M0[9:0]`. Both old values are read before either write, and the writes are EXEC-gated, matching `emit.rs`. Two process points remain: the first commit alone fails the default backend's test, and the whole workspace was not run on this head. #### Medium 1. **The first commit alone fails `gpu_v_swaprel_b32` on the default backend.** `1042ba13` changes the test to the new reading but fixes only `emit.rs`. The direct backend, the default for kernels, still has the old reading until `94bcb7ce`. **Tested** confirms this (lane 0: `v5 = 0`, expected 2000). CONTRIBUTING.md asks that every commit build and pass the tests, so `git bisect` works. Squash the two into one commit: it is one logical change, the same instruction in both backends. 2. **The whole workspace is not reported on this head.** **Tested** gives `cargo test -p xcl --lib` on `94bcb7ce` (2863 passed, 0 failed, 37 ignored). The workspace run (with the integration tests) is from `4db1a2a`, before the rebase and the new commit. CONTRIBUTING.md asks for `cargo test --workspace -- --test-threads=4` on the head under review. #### Nit 3. **`Direct DXIL:` is not one of the commit areas.** CONTRIBUTING.md lists `Recompiler` for this code, as the first commit uses. Squashing (point 1) settles it. <details><summary>Checked and fine</summary> - Earlier triage point fixed: the direct-DXIL `Lw::swaprel` no longer compares all of M0 and no longer writes a fixed VDST. - The new lowering mirrors `emit.rs::swaprel` step by step: - both indices are masked with `0x3FF`; - the source index is `M0[9:0]` and the destination index `M0[25:16]`; - each side's old value is selected over `first..=top` (0 past the program's VGPRs, like the HLSL `default`); - then `VGPR[dst] = old src` and `VGPR[src] = old dst`, each gated by `act() && idx == k`. - When both indices name the same register, both writes store the value it already holds, so the instruction does nothing, as the comment says. - `top = top_vgpr().max(vdst).max(base)` matches the HLSL path's `max_vgpr` bound. - **Tested** runs the three `swaprel` tests three times each with `XCL_DIRECT_DXIL=0` and `=1`, and shows the direct path failing without the new commit. - The first commit is only rebased: its range-diff has no code change. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
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/803:upstream-pr/803'
git switch 'upstream-pr/803'

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