Recompiler: apply v_cmp_class_f32 abs/neg bitwise on raw uint bits (#1281) #1340
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!1340
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1340/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?
@GamingChelsea on GitHub · 2026-11-24 14:59 UTC · original
GamingChelsea:fix/v-cmp-class-f32-bitwise-mods→main· +54 −6 · 2 files · 1 commits · closed without mergingFixes #1281.
v_cmp_class_f32previously applied VOP3abs/negmodifiers throughSelf::fsrc(floatabs(asfloat(u))/-asfloat(u)) and passed afloatintofclass(float). Under D3D12 FTZ, floatabs/negflushes f32 subnormals to ±0 and can quiet signaling NaNs, misclassifying subnormal and sNaN class bits.What is in it
crates/xcl/src/gpu/recomp/emit.rs: changefclass(float)tofclass(uint)(matchingfclass16(uint)) and handle"f32"withop == "class"invopc()directly on rawuintbits with bitwiseabs(& 0x7FFFFFFFu) andneg(^ 0x80000000u).crates/xcl/src/gpu/recomp/tests.rs: addgpu_cmp_class_f32_bitwise_modifiers_preserve_denorm_and_snanverifying VOP3abs,neg, and-abson f32 subnormals (0x80000001,0x00000001) and sNaN (0x7F800001).Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2602.17, debug (tests) and release (smoke).cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored.SKIPPEDGPU tests on this adapter (Wave32-only):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64cargo test -p xcl --lib cmp_class -- --test-threads=1 --nocapture: 2 passed, 0 failed, 0 skipped.Regression run
main:
PR head:
Not tested
XCL_SAMPLE_RPF).AI use
fclass(uint)and bitwiseabs/negfix, wrotegpu_cmp_class_f32_bitwise_modifiers_preserve_denorm_and_snan, ran the workspace test suite and smoke regression 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 15:05 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 708 passed, 0 failed, 21 ignored.Thanks!
@futurepro62 on GitHub · 2026-11-24 15:03 UTC · original · edited 2026-11-24 15:06 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
3f96fef(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.gpu_cmp_class_f32_bitwise_modifiers_preserve_denorm_and_snan.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.v_cmp_class_f32.Not tested
AI use
@DarkPanda69 on GitHub · 2026-11-24 15:16 UTC · original
AMD run with 64-lane waves, which this PR lists as not tested (the other reports here are NVIDIA).
Tested: pass, head
3f96fefapplied on its basemain930e8b4, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17.cargo test -p xcl --lib -- gpu::recomp --test-threads=4:gpu_cmp_class_f32_bitwise_modifiers_preserve_denorm_and_snanok, and the wave64 tests the RTX 4070 skipped run here.Not tested: the whole workspace suite;
XCL_SAMPLE_RPF; a title.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@throny on GitHub · 2026-11-24 20:29 UTC · original
Two contributors checked independently and found that this PR makes the same change as #1306 #1309 #1569 (for #1281): #1607, group D1. They suggest keeping #1306. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps.
This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@ivall on GitHub · 2026-11-24 20:42 UTC · original
Closing this as a duplicate: #1306 makes the same change and was opened first (v_cmp_class_f32 applies abs / neg to the sign bit and fclass takes the bits). It stays open and is the one that will be reviewed and merged.
This says nothing about the quality of the code here. I compared the two diffs; the pair was also found by independent checks in #1607. If this PR covers a case #1306 does not, or #1306 is closed without being merged, say so and I'll reopen it. A test that is only here is welcome on #1306.
Thank you for the work.
AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this comment; the decision is the maintainer's.
Pull request closed