Repository navigation
Recompiler: cube sc / tc negate by the sign bit on both backends - #2348
Victorbriez wants to merge 1 commit into
Conversation
1a116f0 to
a5b3149
Compare
|
Tested: current PR head merged onto current The new test goes red on this lane, but only on the
Not tested: retail titles (no title data on this lane, counts only). AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
Both backends negated with `fsub -0.0, x`: the HLSL helpers through `-x`, the direct lowering through `fneg`. With no denormal option a driver may flush a denormal there. NVIDIA does on the HLSL path (v_cubetc_f32 returned ±0 for a denormal source on an RTX 3070), and RADV under vkd3d-proton does on the direct path (reported on xcl-dev#2348). Both now flip the sign bit, as the direct backend's directed-rounding path already does for source modifiers (`fsrc_bits`). The VALU fuzzer of xcl-dev#2169 found 58 of 256 cases differing between the backends on NVIDIA; with this change it finds none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a5b3149 to
eda3db7
Compare
|
Thanks, you are right, and the description was wrong about the direct backend: its eda3db7 (on AI use: Claude Code (Claude Opus 5.5) checked the report against the code, wrote the change and this reply; I checked it before posting. |
Both backends negated the sources of
v_cubesc_f32/v_cubetc_f32withfsub -0.0, x: the HLSL helpers through-x, the direct lowering throughfneg. A driver may flush a denormal there: NVIDIA does on the HLSL path, sov_cubetc_f32returned ±0 for a denormal source; RADV under vkd3d-proton does on the direct path (reported below). Both now flip the sign bit. Fixes #2347.What is in it
neg_bitshelper in the HLSL prelude, used bycube_scandcube_tc(crates/xcl/src/gpu/recomp/emit.rs); anfneg_bitshelper used bycubein the direct lowering (crates/xcl/src/gpu/dxil/prelude.rs); and the GPU testgpu_cube_coordinates_negate_denormals_by_signon both backends (crates/xcl/src/gpu/recomp/tests.rs)Tested
main50a9fde), no uncommitted changesmain(hlsl lane 0: tc0x80000000, want0x80000001) and passes with the fix on both backendscargo test --workspace --no-fail-fast -- --test-threads=4:main50a9fde 1288 passed, 1 failed, 46 ignored; this PR 1289 passed, 1 failed, 46 ignored (the new test). The one failure is the same on both,a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfrom Recompiler: a bridged mask write in the split form meets no barrier #2074, and is not touched hereV_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32, Recompiler: the per-lane form takes f16 converts and products from #1426 #2182); 1 × no heap windows; 1 × Developer Mode off (0x887A002D); 1 × no xgameruntime.dllvalu_fuzz_backends_agree(its file added locally, not part of this PR):main1 instruction differs (V_CUBETC_F32, 58 of 256); this PR 0 differ, 333 of 341 compared (on eda3db7)Regression run
scripts/smoke.ps1onmainand on this head, I will add both blocks here. Until then this stays a draft.Not tested
AI use
🤖 Generated with Claude Code