Recompiler: honour OP_SEL[1] for SRC1 in v_cmp_class_f16 #1214
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!1214
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1214"
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:18 UTC · original
b3IKK:recomp/v-cmp-class-f16-opsel1→main· +26 −1 · 2 files · 1 commits · openIn
V_CMP_CLASS_F16(rdna2_spec.rs),SRC1is a 16-bit operand soOP_SEL[1] == 1selects its upper 16-bit half as the class mask. The emitter appliedhalf(0, &ua)toSRC0but passedubunchanged, ignoringOP_SEL[1].This selects
SRC1viahalf(1, &ub).What is in it
crates/xcl/src/gpu/recomp/emit.rs: usehalf(1, &ub)forV_CMP_CLASS_F16SRC1.crates/xcl/src/gpu/recomp/tests.rs: add GPU testgpu_cmp_class_f16_honours_opsel1coveringOP_SEL[1] = 0/1andOP_SEL = 3across 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_cmp_class_f16_honours_opsel1: 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.@DavidM1911 on GitHub · 2026-11-24 13:39 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib recomp: 190 passed, 0 failed, 18 ignored (new GPU checks included).Thanks!
@bjarngard on GitHub · 2026-11-24 13:47 UTC · original
Test report for head
b725489(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_cmp_class_f16_honours_opsel1passedNot 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.
@regiumlepidi on GitHub · 2026-11-25 00:10 UTC · original
RTX 5070 Ti:
b725489merged intomain8e87fc7passes its test on the default path; it still fails withXCL_DIRECT_DXIL=1Tested
XCL_SAMPLE_*cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocapture, one run per cell; PR headb7254898babb4babf1c988ca5ca131e53cd269e5merged locally into8e87fc7b62a87ea589ccb9ea6182f514016cf7db, no conflicts (passed / failed / ignored):XCL_DIRECT_DXIL=1main8e87fc7gpu_cmp_class_f16_honours_opsel1passes. The 4 failures arefuzz_validate_and_gpu_0to_3(#1905, this driver), as onmainXCL_DIRECT_DXIL=1: those 4,offline_compute_pipeline_is_reused_by_a_second_process(fails onmaintoo) andgpu_cmp_class_f16_honours_opsel1:wave32 v_cmp_class_f16 OP_SEL[1]=1 reads high half of SRC1, left(0, 0), right(4294967295, 0). The PR's diff touches onlyrecomp/emit.rsandrecomp/tests.rstests.rschange applied tomain8e87fc7: the new test fails on both paths with the same valuesSKIPPEDlines in each run (18 no wave64, 1 const mask + wave64, 3 per-lane form refused, Developer Mode,d3d12SDKLayers.dll, heap windows, debug layer); none names the new testsNot tested
gpu_waves()runs wave32 only here), release build, any retail title, other GPUs or driversDirect translator patch
gpu_cmp_class_f16_honours_opsel1fails withXCL_DIRECT_DXIL=1because the direct translator has the same bug:dxil/lower_valu.rsshifts the whole 32-bit SRC1 instead of the half OP_SEL[1] picks. The patch below mirrors this PR there. With this PR's commit and the patch onmain8e87fc7, the new tests pass on both paths, andcargo test --workspace --locked --no-fail-fast -- --test-threads=4gives 987 / 4 / 45 (default) and 986 / 5 / 45 (direct); the failures are the same as onmain. Take it into this PR if you like, or say if you would rather it go in a separate PR stacked on this one.Patch (applies with
git applyon this PR merged intomain8e87fc7)AI use
@JJAutoCompare on GitHub · 2026-11-25 07:03 UTC · original
XCL PR #1214 verification
Tested
b7254898babb4babf1c988ca5ca131e53cd269e5before and after testing. The STOR-WINLAB checkout was clean and detached at that SHA.32.0.101.9175, Windows 11 Enterprise Evaluation 25H2 build26200.9974, Rust and Cargo1.100.0onstable-x86_64-pc-windows-msvc, DXC1.9.2609.5(01b62ad47). Unoptimized test profile, two jobs, incremental compilation disabled, dev/test debuginfo disabled.cargo +stable-x86_64-pc-windows-msvc test --locked -j 2 -p xcl --lib --no-run --message-format=json(exit 0). The assigned target wasL:/XclTooling/pr1801-e00963f-t3-3c561aa2/target. BothTEMPandTMPpointed toL:/XclTooling/pr1214/run-b725489-20261125-080053-770/temp.& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { ... }withXCL_ADAPTER=A770,XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64,XCL_DIRECT_DXIL=0, andXCL_SPLIT_WAVE64=0. The fixture compiles translated HLSL tocs_6_6with DXC. Used process-scopedRemoteSigned.1 passed, 0 failed, 0 ignored, 0 explicit GPU skips, 719 filtered out, 0.68 s, exit 0. Both the Cargo artifact and pinned executable had SHA-256
09D9C6BB6C0A04BF0A4A45075C4FF3E19C9599CEBF74CD9D43CD5A95D0952579before waiting and inside the lock. The wrapper confirmed release and exited 0. The target slot is free.Each lane was seeded with
v0=0x0000_3C00(low half +1.0h),v1=0x0100_0000(high-half positive-normal class bit 8, low half zero), andv2=0x3C00_0000(high half +1.0h, low half +0.0h). All three wave32 GPU readback assertions passed.(0xFFFF_FFFF, 0x0000_0000)(0x0000_0000, 0x0000_0000)(0xFFFF_FFFF, 0x0000_0000)The before/after discussion snapshots contained one independent exact-head report for the fixture on AMD and two NVIDIA reports on merges with main. I found no equivalent exact-head A770 report. AMD report · Triage #1607
Not tested
Native wave64, split wave64, direct DXIL (including stacked PR #1980), other adapters, a negative control, the full workspace suite, and retail smoke. The A770 exposes hardware wave sizes 8–32, and the exact-head fixture enters its wave64 branch only when native wave64 is available.
AI use
T3 Code / Codex (gpt-6.2-sol) verified the live head, inspected the fixture, ran the checked-in test, and wrote this report. No source edits, commits, or GitHub writes.
Logs
L:/XclTooling/pr1214/run-b725489-20261125-080053-770/environment.logL:/XclTooling/pr1214/run-b725489-20261125-080053-770/build.logL:/XclTooling/pr1214/run-b725489-20261125-080053-770/build.jsonlL:/XclTooling/pr1214/run-b725489-20261125-080053-770/arc.stdout.logL:/XclTooling/pr1214/run-b725489-20261125-080053-770/arc.stderr.logL:/XclTooling/pr1214/run-b725489-20261125-080053-770/postcheck.logL:/XclTooling/pr1214/run-b725489-20261125-080053-770/pr-before.html,pr-after.html,triage.html@DavidM1911 on GitHub · 2026-11-26 04:05 UTC · original
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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.