Recompiler: apply ABS and NEG input modifiers in v_pack_b32_f16 #1207
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1207
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1207/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@b3IKK on GitHub · 2026-11-24 13:14 UTC · original
b3IKK:recomp/v-pack-b32-f16-abs-neg→main· +39 −3 · 2 files · 1 commits · closed without mergingv_pack_b32_f16supports VOP3ABSandNEGinput modifiers on bothSRC0andSRC1(operating on bit 15 of each selected 16-bit half before packing,ABSbeforeNEG). The emitter appliedOP_SELbut ignoredm.abs[0..2]andm.neg[0..2].This applies bitwise
ABS(& 0x7FFFu) andNEG(^ 0x8000u) to each selected half when set, leaving unmodified instructions unchanged.What is in it
crates/xcl/src/gpu/recomp/emit.rs: applym.abs[0..2]andm.neg[0..2]inv_pack_b32_f16.crates/xcl/src/gpu/recomp/tests.rs: add GPU testgpu_pack_b32_f16_abs_and_negcoveringNEG,ABS,ABS + NEG,OP_SEL, and NaN payload preservation across wave32 and split wave64 (verified failing before the fix).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib gpu_pack_b32_f16_abs_and_neg: 1 passed, 0 failed across wave32 and split wave64 (failed on the GPU before the fix)Regression run
main:
PR:
Not tested
AI use
emit.rs, wrote the fix and GPU test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@DavidM1911 on GitHub · 2026-11-24 13:16 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11.
cargo test -p xcl --lib pack_b32_f16: 1 passed, 0 failed —gpu_pack_b32_f16_abs_and_negcovers the ABS/NEG input modifiers on real hardware.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@bjarngard on GitHub · 2026-11-24 13:47 UTC · original
Test report for head
a1b0edf(AMD, native wave64)Tested
XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPEDXCL_REQUIRE_GPU=wave64:gpu_pack_b32_f16_abs_and_negpassedNot tested: retail titles, RDNA3/RDNA4.
AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
@JoaoPauluu on GitHub · 2026-11-24 13:57 UTC · original
A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.
Tested
x86_64-pc-windows-gnu.a1b0edfas it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).gpu::recomp::tests::gpu_pack_b32_f16_abs_and_neg: ok, no SKIPPED.Not tested
AI use
@b3IKK on GitHub · 2026-11-24 23:45 UTC · original
Closing as a duplicate of #1720, which is this account's later PR for the same change (#1607, group D49). #1720 now fixes the direct DXIL translator as well and tests both paths. AI use: OpenCode, Claude Fable 5.2.
Pull request closed