Recompiler: VOP3 abs / neg on the shift-add and align ops act on the sign bit #2048

Merged
upipibi merged 2 commits from upstream-pr/2058 into main 2026-11-30 02:52:59 +00:00
upipibi commented 2026-11-25 02:17:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T02:17:40Z.


Both paths dropped the VOP3 ABS / NEG source modifiers of the shift-add ops (v_lshl_add_u32, v_add_lshl_u32) and the align ops (v_alignbit_b32, v_alignbyte_b32). RDNA2 applies them to the source's sign bit, as for a float: abs is x & 0x7fffffff and neg is x ^ 0x80000000. With neg on the addend, v_lshl_add_u32 5, 2, 1 gave 21, where the hardware gives 0x80000015.

Sources for the rule: boykopovar/AnyPS5#25964 measured both opcodes with every abs/neg combination on gfx1036 (RDNA2) and gfx1201 (RDNA4) with their hardware oracle: 196/196 words match the sign-bit operations on each. boykopovar/AnyPS5#25799 measured the align ops on gfx1036: on src1, abs clears and neg flips bit 31, which a shift brings into the result. On src0 and the shift amount they can't change the result, so applying them there is harmless. With neg on src1, v_alignbit_b32 0, 1, 31 gave 0 where the hardware gives 1.

What is in it

  • recomp/emit.rs and dxil/lower_valu.rs: the shift-adds and the align ops apply abs then neg to each source as bit operations. Other integer VOP3 ops are unchanged, since only these four are measured.
  • recomp/tests.rs: gpu_shift_add_abs_neg_act_on_the_sign_bit covers neg on src2 of v_lshl_add_u32 and abs on src0 of v_add_lshl_u32 with a zero shift, chosen so the modifier can't be shifted out. gpu_align_abs_neg_act_on_the_sign_bit covers neg and abs on src1 of both align ops.

Tested

  • AMD, run by oni-swr (comment, thanks) at the exact head 30457b2, as-is: Radeon RX 7800 XT (RDNA3, driver 32.0.31035.1003), Windows 11, debug, DXC 1.9.0.5512. gpu_shift_add_abs_neg_act_on_the_sign_bit and gpu_align_abs_neg_act_on_the_sign_bit pass; cargo test --workspace --no-fail-fast -- --test-threads=4: 1243 passed, 2 failed, 46 ignored. The 2 failures are not this PR's: fuzz_validate_and_gpu_1 fails the same way on main 1a0bbe3 there, and gpu_image_get_resinfo_past_last_level comes from this head's base, which predates main's fix ea088a5.
  • At 30457b21 (rebased onto main 426a5a74, the first main with green CI after 5478c4a7, whose two failing tests main fixed in 0d13b071), RTX 3070 (616.56): gpu_ suite (--skip gpu_sparse_vram) 145 passed, 0 failed with XCL_DIRECT_DXIL=0 and with =1. main 426a5a74 gives 143 passed on both.
  • On an RTX 3070 (Ampere, driver 616.56), Windows 11, debug, on main 5ce558f:
  • new tests: main fails both on both paths (21 for 0x80000015; 0 for 1). This branch passes them with XCL_DIRECT_DXIL=0 and 1.
  • gpu_ tests (--skip gpu_sparse_vram): 134 passed with XCL_DIRECT_DXIL=0; with 1, 133 passed and 1 failed, gpu_image_get_resinfo_1d_array, which also fails on main (#2046 fixes it).
  • dxil:: units: 136 passed.

Regression run
Pair for the current head 30457b2 against main 1a0bbe3, run by thehollowedone (comment, thanks): RTX 3080 Ti (621.35), stock scripts/smoke.ps1, clean release builds, 60 s offline. Pasted unedited.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1638 (PresentX 1638)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14333 MB
xcl-smoke v1
commit: 30457b210086c924df4be115feaded0128cfcc2e
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14269 MB

Earlier: The earlier pair, comment, was for 7a62a79, before the rebase onto main 5478c4a7..

A second pair, by ThiagoAlexsander on an RTX 5080 (comment, thanks): main 426a5a7 1529 frames shown, this head 30457b2 1641, 0 crashes and 0 device removals on both.

Not tested

  • Titles. On AMD, only the runs above.

AI use

  • AI-assisted (Claude Code, Claude Opus 5.5): wrote the change, the tests and this description, and ran the tests above. Synthetic tests only; no game files.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5483863022 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T02:17:40Z. --- Both paths dropped the VOP3 `ABS` / `NEG` source modifiers of the shift-add ops (`v_lshl_add_u32`, `v_add_lshl_u32`) and the align ops (`v_alignbit_b32`, `v_alignbyte_b32`). RDNA2 applies them to the source's sign bit, as for a float: `abs` is `x & 0x7fffffff` and `neg` is `x ^ 0x80000000`. With `neg` on the addend, `v_lshl_add_u32 5, 2, 1` gave 21, where the hardware gives `0x80000015`. Sources for the rule: boykopovar/AnyPS5#25964 measured both opcodes with every `abs`/`neg` combination on gfx1036 (RDNA2) and gfx1201 (RDNA4) with their hardware oracle: 196/196 words match the sign-bit operations on each. boykopovar/AnyPS5#25799 measured the align ops on gfx1036: on src1, `abs` clears and `neg` flips bit 31, which a shift brings into the result. On src0 and the shift amount they can't change the result, so applying them there is harmless. With `neg` on src1, `v_alignbit_b32 0, 1, 31` gave 0 where the hardware gives 1. **What is in it** - `recomp/emit.rs` and `dxil/lower_valu.rs`: the shift-adds and the align ops apply `abs` then `neg` to each source as bit operations. Other integer VOP3 ops are unchanged, since only these four are measured. - `recomp/tests.rs`: `gpu_shift_add_abs_neg_act_on_the_sign_bit` covers `neg` on src2 of `v_lshl_add_u32` and `abs` on src0 of `v_add_lshl_u32` with a zero shift, chosen so the modifier can't be shifted out. `gpu_align_abs_neg_act_on_the_sign_bit` covers `neg` and `abs` on src1 of both align ops. **Tested** - AMD, run by oni-swr ([comment](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7162357878), thanks) at the exact head `30457b2`, as-is: Radeon RX 7800 XT (RDNA3, driver 32.0.31035.1003), Windows 11, debug, DXC 1.9.0.5512. `gpu_shift_add_abs_neg_act_on_the_sign_bit` and `gpu_align_abs_neg_act_on_the_sign_bit` pass; `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1243 passed, 2 failed, 46 ignored. The 2 failures are not this PR's: `fuzz_validate_and_gpu_1` fails the same way on `main` `1a0bbe3` there, and `gpu_image_get_resinfo_past_last_level` comes from this head's base, which predates `main`'s fix `ea088a5`. - At `30457b21` (rebased onto `main` `426a5a74`, the first `main` with green CI after `5478c4a7`, whose two failing tests main fixed in `0d13b071`), RTX 3070 (616.56): `gpu_` suite (`--skip gpu_sparse_vram`) 145 passed, 0 failed with `XCL_DIRECT_DXIL=0` and with `=1`. `main` `426a5a74` gives 143 passed on both. - On an RTX 3070 (Ampere, driver 616.56), Windows 11, debug, on `main` `5ce558f`: - new tests: `main` fails both on both paths (21 for `0x80000015`; 0 for 1). This branch passes them with `XCL_DIRECT_DXIL=0` and `1`. - `gpu_` tests (`--skip gpu_sparse_vram`): 134 passed with `XCL_DIRECT_DXIL=0`; with `1`, 133 passed and 1 failed, `gpu_image_get_resinfo_1d_array`, which also fails on `main` (#2046 fixes it). - `dxil::` units: 136 passed. **Regression run** Pair for the current head `30457b2` against `main` `1a0bbe3`, run by thehollowedone ([comment](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7162938843), thanks): RTX 3080 Ti (621.35), stock `scripts/smoke.ps1`, clean release builds, 60 s offline. Pasted unedited. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1638 (PresentX 1638) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14333 MB ``` ``` xcl-smoke v1 commit: 30457b210086c924df4be115feaded0128cfcc2e gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1634 (PresentX 1634) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14269 MB ``` Earlier: The earlier pair, [comment](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7158686620), was for `7a62a79`, before the rebase onto `main` `5478c4a7`.. A second pair, by ThiagoAlexsander on an RTX 5080 ([comment](https://github.com/xcl-dev/xcl/issues/1607#issuecomment-7162807523), thanks): `main` `426a5a7` 1529 frames shown, this head `30457b2` 1641, 0 crashes and 0 device removals on both. **Not tested** - Titles. On AMD, only the runs above. **AI use** - AI-assisted (Claude Code, Claude Opus 5.5): wrote the change, the tests and this description, and ran the tests above. Synthetic tests only; no game files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
JJAutoCompare commented 2026-11-25 03:05:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T02:32:24Z.


Tested

I ran the two checked-in VOP3 sign-bit fixtures on clean PR head 7a62a796287b06882663220725482da58a124188. I rechecked the PR after the run and confirmed it was open at that SHA.

Windows 11 Enterprise Evaluation (build 26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 (driver 32.0.101.9175), Rust and Cargo 1.100.0 (x86_64-pc-windows-msvc), and DXC/DXIL 1.9.2609.5. The Cargo test profile was unoptimized with debug info disabled.

$env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target'
$env:CARGO_BUILD_JOBS = '2'
$env:CARGO_INCREMENTAL = '0'
$env:CARGO_PROFILE_DEV_DEBUG = '0'
$env:CARGO_PROFILE_TEST_DEBUG = '0'
$env:TEMP = 'L:/XclTooling/pr2058'
$env:TMP = $env:TEMP
$env:XCL_ADAPTER = 'A770'
$env:XCL_DXC_DIR = "$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64"
cargo test -p xcl --lib --no-run --message-format=json

# Executable reported by Cargo. The Arc lock covered only test execution.
$testExe = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    foreach ($backend in '0', '1') {
        $env:XCL_DIRECT_DXIL = $backend
        & $testExe --exact gpu::recomp::tests::gpu_shift_add_abs_neg_act_on_the_sign_bit --nocapture --test-threads=1
        & $testExe --exact gpu::recomp::tests::gpu_align_abs_neg_act_on_the_sign_bit --nocapture --test-threads=1
    }
}
  • HLSL → DXC (XCL_DIRECT_DXIL=0) ran both fixtures. 2 passed, 0 failed, 0 ignored, 0 skipped.
  • Direct DXIL (XCL_DIRECT_DXIL=1) ran both fixtures. 2 passed, 0 failed, 0 ignored, 0 skipped.
  • On both backends, the lane 0 readback matched all five 32-bit fixture assertions. The shift-add results were 0x80000015 for v_lshl_add_u32 with NEG and 0x00000004 for v_add_lshl_u32 with ABS. The align results were 0x00000001 for v_alignbit_b32 with NEG, 0x00000080 for v_alignbyte_b32 with NEG, and 0x00000000 for v_alignbit_b32 with ABS.

Not tested

Other modifier and operand combinations, other GPUs, a main baseline, the full workspace suite, and retail-title smoke runs.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the tests, checked the exact PR head and fixture assertions, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7150854497 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7150854497). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T02:32:24Z. --- **Tested** I ran the two checked-in VOP3 sign-bit fixtures on clean PR head `7a62a796287b06882663220725482da58a124188`. I rechecked the PR after the run and confirmed it was open at that SHA. Windows 11 Enterprise Evaluation (build 26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 (driver 32.0.101.9175), Rust and Cargo 1.100.0 (`x86_64-pc-windows-msvc`), and DXC/DXIL 1.9.2609.5. The Cargo test profile was unoptimized with debug info disabled. ```powershell $env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target' $env:CARGO_BUILD_JOBS = '2' $env:CARGO_INCREMENTAL = '0' $env:CARGO_PROFILE_DEV_DEBUG = '0' $env:CARGO_PROFILE_TEST_DEBUG = '0' $env:TEMP = 'L:/XclTooling/pr2058' $env:TMP = $env:TEMP $env:XCL_ADAPTER = 'A770' $env:XCL_DXC_DIR = "$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64" cargo test -p xcl --lib --no-run --message-format=json # Executable reported by Cargo. The Arc lock covered only test execution. $testExe = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { foreach ($backend in '0', '1') { $env:XCL_DIRECT_DXIL = $backend & $testExe --exact gpu::recomp::tests::gpu_shift_add_abs_neg_act_on_the_sign_bit --nocapture --test-threads=1 & $testExe --exact gpu::recomp::tests::gpu_align_abs_neg_act_on_the_sign_bit --nocapture --test-threads=1 } } ``` - HLSL → DXC (`XCL_DIRECT_DXIL=0`) ran both fixtures. **2 passed, 0 failed, 0 ignored, 0 skipped.** - Direct DXIL (`XCL_DIRECT_DXIL=1`) ran both fixtures. **2 passed, 0 failed, 0 ignored, 0 skipped.** - On both backends, the lane 0 readback matched all five 32-bit fixture assertions. The shift-add results were `0x80000015` for `v_lshl_add_u32` with NEG and `0x00000004` for `v_add_lshl_u32` with ABS. The align results were `0x00000001` for `v_alignbit_b32` with NEG, `0x00000080` for `v_alignbyte_b32` with NEG, and `0x00000000` for `v_alignbit_b32` with ABS. **Not tested** Other modifier and operand combinations, other GPUs, a `main` baseline, the full workspace suite, and retail-title smoke runs. **AI use** T3 Code / Codex (`gpt-6.2-sol`) ran the tests, checked the exact PR head and fixture assertions, and wrote this report.
JoaoPauluu commented 2026-11-25 04:10:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-25T03:14:13Z.


A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, a different compiler from a native-Windows run: this PR's 2 new tests pass.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 7a62a79 as it is (merge base with main 5ce558f), no uncommitted changes. The lib test binary runs under Wine, one test per process.
    • gpu_align_abs_neg_act_on_the_sign_bit: ok, not skipped
    • gpu_shift_add_abs_neg_act_on_the_sign_bit: ok, not skipped

Not tested

  • the whole suite on this head, a retail title, native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7151722042 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7151722042). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-25T03:14:13Z. --- A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, a different compiler from a native-Windows run: this PR's 2 new tests pass. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `7a62a79` as it is (merge base with `main` `5ce558f`), no uncommitted changes. The lib test binary runs under Wine, one test per process. - `gpu_align_abs_neg_act_on_the_sign_bit`: ok, not skipped - `gpu_shift_add_abs_neg_act_on_the_sign_bit`: ok, not skipped **Not tested** - the whole suite on this head, a retail title, native Windows, AMD. **AI use** - Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
DavidM1911 commented 2026-11-25 05:08:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T04:55:09Z.


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:7153282167 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7153282167). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T04:55:09Z. --- 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!
Toons29 commented 2026-11-25 10:10:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T09:42:10Z.


Regression run of 7a62a796 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 568e7db7, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: 7a62a796287b06882663220725482da58a124188
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1637 (PresentX 1637)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB

Against the limits in CONTRIBUTING.md: 105 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

<!-- greyfinch-sync:ivall/xcl:comment:7158686620 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7158686620). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T09:42:10Z. --- Regression run of `7a62a796` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `568e7db7`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1566 (PresentX 1566) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14592 MB ``` ``` xcl-smoke v1 commit: 7a62a796287b06882663220725482da58a124188 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1637 (PresentX 1637) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14592 MB ``` Against the limits in CONTRIBUTING.md: 105 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; a script posted this right after the run, with both blocks exactly as printed.
raylitebull commented 2026-11-25 11:09:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:47:04Z.


7a62a79 now conflicts in crates/xcl/src/gpu/recomp/tests.rs after #2054 merged on main.

Please rebase onto main; once rebased, an AMD synthetic GPU test run on the VOP3 sign-bit tests will also be needed alongside NVIDIA/Arc coverage.

<!-- greyfinch-sync:ivall/xcl:comment:7160168596 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7160168596). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:47:04Z. --- `7a62a79` now conflicts in `crates/xcl/src/gpu/recomp/tests.rs` after #2054 merged on `main`. Please rebase onto `main`; once rebased, an AMD synthetic GPU test run on the VOP3 sign-bit tests will also be needed alongside NVIDIA/Arc coverage.
oni-swr commented 2026-11-25 13:05:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T12:25:40Z.


AMD synthetic GPU run of 30457b210086c924df4be115feaded0128cfcc2e (exact PR head, tested as-is, not merged onto main; the diff touches the recompiler and its tests only). Synthetic Cargo tests only: no retail title, no smoke.ps1.

Tested

  • AMD Radeon RX 7800 XT (RDNA3, driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 Pro 26200, rustc 1.100.0 (2026-11-09), debug build, DXC 1.9.0.5512. Clean target dir; Compiling xcl v0.1.0 came from the PR checkout.
  • cargo build --workspace, then:
    • cargo test -p xcl --lib gpu_shift_add_abs_neg -- --nocapture: gpu_shift_add_abs_neg_act_on_the_sign_bit ... ok (1 passed, 0 failed, 0 ignored).
    • cargo test -p xcl --lib gpu_align_abs_neg -- --nocapture: gpu_align_abs_neg_act_on_the_sign_bit ... ok (1 passed, 0 failed, 0 ignored).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1243 passed, 2 failed, 46 ignored, 7 distinct SKIPPED lines. These are not coverage: f16/f32 per-lane form refused (6, wave32 and wave64) and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • The 2 failures are not in this PR's area:
    • gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1. It fails the same way on main 1a0bbe3 on this machine.
    • gpu::recomp::tests::gpu_image_get_resinfo_past_last_level. This head does not contain main's commit ea088a5 ("image_get_resinfo past the last level gives 0 sizes on AMD too"), so it is probably fixed by rebasing. I did not run the merged tree.

Not tested

  • Retail title / scripts/smoke.ps1 regression run, NVIDIA, Intel, Wine/vkd3d.
  • The PR merged with current main.

AI use
Claude Code, Claude Sonnet 5.5 ran the tests, checked the diff, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7162357878 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7162357878). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T12:25:40Z. --- AMD synthetic GPU run of `30457b210086c924df4be115feaded0128cfcc2e` (exact PR head, tested as-is, not merged onto `main`; the diff touches the recompiler and its tests only). Synthetic Cargo tests only: no retail title, no `smoke.ps1`. **Tested** - AMD Radeon RX 7800 XT (RDNA3, driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 Pro 26200, rustc 1.100.0 (2026-11-09), debug build, DXC 1.9.0.5512. Clean target dir; `Compiling xcl v0.1.0` came from the PR checkout. - `cargo build --workspace`, then: - `cargo test -p xcl --lib gpu_shift_add_abs_neg -- --nocapture`: `gpu_shift_add_abs_neg_act_on_the_sign_bit ... ok` (1 passed, 0 failed, 0 ignored). - `cargo test -p xcl --lib gpu_align_abs_neg -- --nocapture`: `gpu_align_abs_neg_act_on_the_sign_bit ... ok` (1 passed, 0 failed, 0 ignored). - `cargo test --workspace --no-fail-fast -- --test-threads=4`: **1243 passed, 2 failed, 46 ignored**, 7 distinct `SKIPPED` lines. These are not coverage: f16/f32 per-lane form refused (6, wave32 and wave64) and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - The 2 failures are not in this PR's area: - `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`. It fails the same way on `main` `1a0bbe3` on this machine. - `gpu::recomp::tests::gpu_image_get_resinfo_past_last_level`. This head does not contain `main`'s commit ea088a5 ("image_get_resinfo past the last level gives 0 sizes on AMD too"), so it is probably fixed by rebasing. I did not run the merged tree. **Not tested** - Retail title / `scripts/smoke.ps1` regression run, NVIDIA, Intel, Wine/vkd3d. - The PR merged with current `main`. **AI use** Claude Code, Claude Sonnet 5.5 ran the tests, checked the diff, and wrote this report.
thehollowedone commented 2026-11-25 13:05:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T12:50:50Z.


Here is the requested scripts/smoke.ps1 pair from clean release builds of main 1a0bbe3 and PR head 30457b2.

RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. The 60 s offline runs used separate copies of the same starting profile and DXIL seed, no input, PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1638 (PresentX 1638)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14333 MB
xcl-smoke v1
commit: 30457b210086c924df4be115feaded0128cfcc2e
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14269 MB

On the exact head, cargo test --offline --locked -p xcl --lib abs_neg_act_on_the_sign_bit -- --nocapture --test-threads=1 reported 2 passed, 0 failed, 0 ignored, and no runtime skip notices in each of XCL_DIRECT_DXIL=0 and =1. Both the shift-add and align fixtures ran on the GPU in each mode.

The smoke pair covers startup. AMD hardware, Wine, and world load were outside this test.

AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7162938843 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7162938843). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T12:50:50Z. --- Here is the requested `scripts/smoke.ps1` pair from clean release builds of [main 1a0bbe3](https://github.com/xcl-dev/xcl/commit/1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6) and [PR head 30457b2](https://github.com/xcl-dev/xcl/commit/30457b210086c924df4be115feaded0128cfcc2e). RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. The 60 s offline runs used separate copies of the same starting profile and DXIL seed, no input, PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1638 (PresentX 1638) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14333 MB ``` ``` xcl-smoke v1 commit: 30457b210086c924df4be115feaded0128cfcc2e gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1634 (PresentX 1634) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14269 MB ``` On the exact head, `cargo test --offline --locked -p xcl --lib abs_neg_act_on_the_sign_bit -- --nocapture --test-threads=1` reported 2 passed, 0 failed, 0 ignored, and no runtime skip notices in each of `XCL_DIRECT_DXIL=0` and `=1`. Both the shift-add and align fixtures ran on the GPU in each mode. The smoke pair covers startup. AMD hardware, Wine, and world load were outside this test. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.
DavidM1911 commented 2026-11-26 08:04:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T07:13:55Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7185235602 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7185235602). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T07:13:55Z. --- 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
throny commented 2026-11-28 16:54:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T16:54:48Z.


merge-check claim
head: 30457b2100

<!-- greyfinch-sync:ivall/xcl:comment:7242609370 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7242609370). Originally posted by [throny](https://github.com/throny) on 2026-11-28T16:54:48Z. --- merge-check claim head: 30457b210086c924df4be115feaded0128cfcc2e
throny commented 2026-11-28 17:10:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T17:10:41Z.


merge-check
base: db3921dc
head: 30457b2100
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2147 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at db3921dc: 2145 passed, 0 failed, 48 ignored.
review: no blocking finding; all hunks read. main applies no source modifiers on these four instructions; the change is the same in the HLSL and the direct-DXIL path. It does not overlap #802 (different match arms; the two apply together). That the hardware applies the modifiers here rests on the author's cited measurements, which I could not check. Minor: it repeats the modifier loop instead of sharing a helper with #802.
performance: none unless a modifier is set. It changes a translator source: every tester re-translates all shaders once.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7242814163 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7242814163). Originally posted by [throny](https://github.com/throny) on 2026-11-28T17:10:41Z. --- merge-check base: db3921dc head: 30457b210086c924df4be115feaded0128cfcc2e merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2147 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at db3921dc: 2145 passed, 0 failed, 48 ignored. review: no blocking finding; all hunks read. main applies no source modifiers on these four instructions; the change is the same in the HLSL and the direct-DXIL path. It does not overlap #802 (different match arms; the two apply together). That the hardware applies the modifiers here rests on the author's cited measurements, which I could not check. Minor: it repeats the modifier loop instead of sharing a helper with #802. performance: none unless a modifier is set. It changes a translator source: every tester re-translates all shaders once. verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
relativespace2K commented 2026-11-30 02:08:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T02:08:48Z.


merge-check
base: 53e85fb1
head: 30457b2100
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2790 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in --test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its two GPU tests passed here (they are not among the SKIPPED lines, so they really ran on the RX 6800 XT). 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.
review: no blocking finding; three files, every hunk read. Both translators get the same rule and in the same order: each of src0/src1/src2 has abs clear bit 31 before neg flips it, and only for the four ops whose modifiers RDNA2 applies to the sign bit (v_lshl_add_u32, v_add_lshl_u32, v_alignbit_b32, v_alignbyte_b32); nothing else in the 3-source family changes. The shift amount stays masked with & 31u after the modifiers, so an abs on src1 of a shift cannot turn into a different shift count, and v_alignbyte's (c & 3) * 8 is computed after its own modifiers in both paths, which is what the reference notes say. The two GPU tests pin concrete values for neg and abs on src1 and src2, so they fail without the change; the byte case pins the top byte of 0x80ffffff as 0x80. Not a duplicate: the tests-only PRs (#1057, #1206, #445, #1576) cover these ops without implementing the modifiers, and #2641 (already in main) only simplified the alignbit helper.
performance: three extra integer ops per translated instruction of these four kinds, at translation time only; no run-time cost.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7266745259 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2058#issuecomment-7266745259). Originally posted by [relativespace2K](https://github.com/relativespace2K) on 2026-11-30T02:08:48Z. --- merge-check base: 53e85fb1 head: 30457b210086c924df4be115feaded0128cfcc2e merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2790 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in `--test gpu_two_pass_cache_e2e`, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its two GPU tests passed here (they are not among the SKIPPED lines, so they really ran on the RX 6800 XT). 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused. review: no blocking finding; three files, every hunk read. Both translators get the same rule and in the same order: each of src0/src1/src2 has `abs` clear bit 31 before `neg` flips it, and only for the four ops whose modifiers RDNA2 applies to the sign bit (`v_lshl_add_u32`, `v_add_lshl_u32`, `v_alignbit_b32`, `v_alignbyte_b32`); nothing else in the 3-source family changes. The shift amount stays masked with `& 31u` after the modifiers, so an `abs` on src1 of a shift cannot turn into a different shift count, and `v_alignbyte`'s `(c & 3) * 8` is computed after its own modifiers in both paths, which is what the reference notes say. The two GPU tests pin concrete values for `neg` and `abs` on src1 and src2, so they fail without the change; the byte case pins the top byte of `0x80ffffff` as `0x80`. Not a duplicate: the tests-only PRs (#1057, #1206, #445, #1576) cover these ops without implementing the modifiers, and #2641 (already in main) only simplified the `alignbit` helper. performance: three extra integer ops per translated instruction of these four kinds, at translation time only; no run-time cost. verdict: safe to merge hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
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!2048
No description provided.