Repository navigation
Recompiler: v_cmp_class_f32 takes abs / neg on the sign bit (#1281) - #1306
tiagonogueiraa-bit wants to merge 1 commit into
Conversation
…1281) v_cmp_class_f32 applied its VOP3 abs / neg as float operations and passed a float to fclass. In DXIL, -x is fsub -0.0, x, which quiets an sNaN, and under D3D's fp32 denormal flush it turns a denormal into a zero. So neg on an sNaN classified as a qNaN, and neg on a denormal as a zero. The f16 and f64 paths already work on the bits. The modifiers now clear or flip bit 31 of the raw bits, and fclass takes the uint, as fclass16 does. gpu_cmp_class_f32_modifiers_keep_the_bits checks abs / neg on a negative denormal and on an sNaN. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
GPU run of Tested
main: this PR: Not tested
AI use
|
|
Test report on RTX 5070 Ti under Wine Following up on #1243. I tested the exact PR head Tested
Not tested Native Windows, AMD hardware and retail-title smoke runs. Retail sample environment variables were unset. AI use Codex (GPT-6, exact variant unavailable) cross-built and ran the tests, compared the failure lists and drafted this report. |
|
Thank you, @IvyNotFound and @vitor127wt! I put your runs under Tested and the two Written with Claude Code (Claude Opus 5.5). |
|
Test report on head Tested
Not tested
|
|
Thank you, @ySKELLETONX! That the test can't tell the two apart on AMD is a useful point, so I wrote it into Tested next to the NVIDIA run where it does fail without the change. I'm not pushing an extra HLSL-level check onto this head: that would invalidate the smoke blocks it already has. It would be an easy follow-up if a maintainer wants one. Written with Claude Code (Claude Opus 5.5). |
ivall#1379 Integrate 22 open upstream PRs targeting world rendering, shader correctness, DirectStorage terrain loads, and crash/memory stability: - ivall#1321 (ivall#1307): fall back to pc blocks when structured CFG HLSL grows oversized (eliminates the 148 MB HLSL / 1 GB/s commit explosion from b8b1f49 so XCL_PSO_PRELOAD=1 stays flat at ~5.4 GiB) - ivall#549, ivall#1312: DirectStorage late page-array queue hold (fixes 0x89240009 terrain read failures) and 0-byte memory-source requests - ivall#1365 (ivall#1361): GFX10.30 scratch SADDR 0x7F addresses the immediate offset alone instead of adding v0 - ivall#1368: translated compute PSOs use NodeMask 0 - ivall#1371 (ivall#105): deduplicate packed ISG1 vertex input struct fields - ivall#1375 (ivall#1360): ES s_setpc_b64 ends block before gs_start - ivall#1350, ivall#1351, ivall#1352, ivall#1353, ivall#1349: VS layer/viewport outputs, PS sample index/fixed-point position & SV_Coverage, depth+UAV initial states, console SetPredication - ivall#1305, ivall#1306, ivall#1314, ivall#1319, ivall#1322, ivall#1334, ivall#1339, ivall#1355, ivall#1357, ivall#1379: console_list UMA hold on Release, v_cmp_class_f32 bitwise abs/neg, late_release vram queue wait, root arg clamping, empty BVH / NaN rays, NULL IASetIndexBuffer clearing, MSAA MipLevels=1, VFS lazy-page commits, coherent VirtualFree validation, cpu_writes PAGE_GUARD & stale fence wakeups - README.md: document the integrated PRs, XCL_PSO_PRELOAD=1, and 16 GiB cap Verified on RX 9060 XT / GE-Proton11-14: release build clean, targeted unit tests pass (75 passed, 0 failed), and 80 s run with XCL_PSO_PRELOAD=1 and XCL_MEM_LIMIT=12G stays flat at 5340-5413 MB with 512+ pipelines preloaded (1385 frames, exit 0x0). Assisted-by: Antigravity (Google DeepMind)
…v#1305-xcl-dev#1379 Integrate 22 open upstream PRs targeting world rendering, shader correctness, DirectStorage terrain loads, and crash/memory stability: - xcl-dev#1321 (xcl-dev#1307): fall back to pc blocks when structured CFG HLSL grows oversized (eliminates the 148 MB HLSL / 1 GB/s commit explosion from b8b1f49 so XCL_PSO_PRELOAD=1 stays flat at ~5.4 GiB) - xcl-dev#549, xcl-dev#1312: DirectStorage late page-array queue hold (fixes 0x89240009 terrain read failures) and 0-byte memory-source requests - xcl-dev#1365 (xcl-dev#1361): GFX10.30 scratch SADDR 0x7F addresses the immediate offset alone instead of adding v0 - xcl-dev#1368: translated compute PSOs use NodeMask 0 - xcl-dev#1371 (xcl-dev#105): deduplicate packed ISG1 vertex input struct fields - xcl-dev#1375 (xcl-dev#1360): ES s_setpc_b64 ends block before gs_start - xcl-dev#1350, xcl-dev#1351, xcl-dev#1352, xcl-dev#1353, xcl-dev#1349: VS layer/viewport outputs, PS sample index/fixed-point position & SV_Coverage, depth+UAV initial states, console SetPredication - xcl-dev#1305, xcl-dev#1306, xcl-dev#1314, xcl-dev#1319, xcl-dev#1322, xcl-dev#1334, xcl-dev#1339, xcl-dev#1355, xcl-dev#1357, xcl-dev#1379: console_list UMA hold on Release, v_cmp_class_f32 bitwise abs/neg, late_release vram queue wait, root arg clamping, empty BVH / NaN rays, NULL IASetIndexBuffer clearing, MSAA MipLevels=1, VFS lazy-page commits, coherent VirtualFree validation, cpu_writes PAGE_GUARD & stale fence wakeups - README.md: document the integrated PRs, XCL_PSO_PRELOAD=1, and 16 GiB cap Verified on RX 9060 XT / GE-Proton11-14: release build clean, targeted unit tests pass (75 passed, 0 failed), and 80 s run with XCL_PSO_PRELOAD=1 and XCL_MEM_LIMIT=12G stays flat at 5340-5413 MB with 512+ pipelines preloaded (1385 frames, exit 0x0). Assisted-by: Antigravity (Google DeepMind)
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Thank you @DavidM1911, the merged-with- |
v_cmp_class_f32applied its VOP3 abs / neg as float operations (abs(asfloat(u)),-asfloat(u)) and passed a float tofclass. In DXIL,-xisfsub -0.0, x, which quiets an sNaN, and with D3D's fp32 denormal flush it turns a denormal into a zero. Sonegon an sNaN classified it as a qNaN, andnegon a denormal as a zero. The f16 and f64 paths already work on the bits. Fixes #1281.What is in it
crates/xcl/src/gpu/recomp/emit.rs: invopc,classon f32 clears or flips bit 31 of the raw bits, andfclasstakes theuint, asfclass16does.crates/xcl/src/gpu/recomp/tests.rs:gpu_cmp_class_f32_modifiers_keep_the_bitschecks abs / neg on a negative denormal and on an sNaN.Tested
cargo check -p xcl --lib --tests --target x86_64-pc-windows-msvc, no errors. The C code is stubbed and nothing is linked.mainand from this branch as C++ on one lane, with-xasfsub -0.0, xand the fp32 denormal flush on, to stand in for the GPU.main,neg(-denormal)andneg(sNaN)fail; the twoabscases pass, becausefabsonly touches the sign.5b4069c:cargo test --workspace --no-fail-fast -- --test-threads=4752 passed, 0 failed, 41 ignored, with SKIPPED (no wave64)gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware. The new test fails withemit.rsfrom930e8b4, withwave32 abs(-denormal) matches +denormal. (report)scripts/test.ps1752 passed, 0 failed, 41 ignored, noSKIPPED. On this card the new test also passes without the change: AMD's driver keeps denormals and sNaN throughfabsandfsub -0.0, x. So the test tells the two apart on NVIDIA (above) but not on AMD. (report)main:cargo test -p xcl --lib -- --test-threads=1, all passed, 0 failed, 21 ignored. (report)Regression run
By @IvyNotFound,
scripts/smoke.ps1 -Seconds 60,XCL_PRESS_A_AT=15, RTX 5080, unedited, from the report:main:
PR:
Not tested
fclass64'sdoubleargument (point 3 of the issue). It is left for its own change.AI use
🤖 Generated with Claude Code