Repository navigation
Recompiler: legacy FMA zero product adds c; XAsync waits cover the callback - #670
henriazz10 wants to merge 3 commits into
Conversation
gpu_cube_face_sc_tc_ma_and_ties checks V_CUBEID / SC / TC / MA_F32 on every major axis, including ties between components. gpu_legacy_zero_wins_mul_fma_fmac checks that a zero multiplicand wins over inf and NaN in V_MUL / FMA / FMAC_LEGACY_F32, with neg, abs and clamp modifiers, and a fused rounding witness. Assisted-by: Gemini CLI (model not recorded)
With a zero multiplicand the legacy FMA's product is +0.0 and c is still added to it, so c = -0.0 gives +0.0 (LLVM folds fma_legacy(+/-0.0, x, y) to fadd y, 0.0). The fma_legacy helper returned c unchanged, so v_fma_legacy_f32 and v_fmac_legacy_f32 gave -0.0. The add is marked precise so that DXC keeps it. New test gpu_fma_legacy_zero_product_adds_c fails without the change (0x80000000 where +0.0 is expected) on an RTX 5080. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… callback Part of xcl-dev#576 (points 1, 3 and 4). - A queued DoWork item now carries the state of the call that queued it (an Arc passed as the queue context), so a stale item left from an earlier call on a reused XAsyncBlock no longer runs the later call. - XAsyncGetStatus(wait = true) returns only after the completion callback has returned, also when the wait starts after the call completed: a call without a payload stays registered until its callback returns. A wait from inside the callback itself does not deadlock. - XAsyncGetResultSize always writes the size (0 while pending or when there is no payload). Four new tests in xasync.rs, each failing without its part of the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
For the #679 part: the issue's bit-based form, |
|
Smoke blocks for this head, from a machine with the title — you asked for someone to run them. Setup: RTX 3060 Ti 8 GB (wave32), Ryzen 7 9800X3D, 32 GB RAM, driver 32.0.16.1742, Windows 11, release builds, retail title 1.0.2.1, Tests on Regression run Head Both reach the menus at a steady 60 presents / 2 s; the frame-count difference is within run-to-run variance we see between identical builds. Not tested: the XAsync change against a retail title doing real async work beyond the 90 s menu window (the smoke runs stay in the menus); wave64 hardware; the legacy-FMA result on console hardware (as your description notes). AI use: GPT-6.2 Astra (API model selector) in DSH built both revisions, ran the suite and the two smoke runs, and wrote this report; the human contributor reviewed the numbers before posting. |
|
Data for the I put this PR's helper (
Windows 11 Pro 26200, DXC 1.8.2502.11, Rust 1.100.0 MSVC, debug. So the add survives DXC here but AMD's compiler still drops it; on the bits there is nothing for either compiler to fold, which is what @dadnotdaddy suggested. Also, this PR predates #679 (my search missed drafts, sorry for the duplicate issue). If you take the bit form, a Run and report by Claude Code (Claude Opus 5.5). |
|
RDNA4 data for the Tested
So the With only that helper line changed locally to the bit form suggested above,
So the bit form holds on RDNA4 as well as on the RDNA2 iGPU. The other 3 failures in the suite run are the title-texture trio from #718 ( Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
|
Nothing has happened on this PR for 3 days, so it is marked |
|
Overlap: the AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Two fixes and a set of GPU tests, kept as separate commits so each can be reviewed or dropped on its own. Part of #576 (points 1, 3 and 4).
v_fma_legacy_f32/v_fmac_legacy_f32still addcto a +0.0 product, soc = -0.0gives +0.0 (LLVM foldsfma_legacy(±0.0, x, y)tofadd y, 0.0). The recompiler'sfma_legacyhelper returnedcunchanged and gave -0.0.XAsyncBlock;XAsyncGetStatus(wait = true)could return before the completion callback ran;XAsyncGetResultSizedid not always write the size.What is in it
Tests: GPU tests for V_CUBE*_F32 and the legacy mul / fma / fmac:gpu_cube_face_sc_tc_ma_and_tiesandgpu_legacy_zero_wins_mul_fma_fmacingpu/recomp/tests.rs(test only).Recompiler: a zero product in v_fma_legacy_f32 still adds c: the zero-product branch offma_legacyingpu/recomp/emit.rsreturnsprecise c + 0.0f; new testgpu_fma_legacy_zero_product_adds_c(fails without the change:0x80000000where0x00000000is expected).XGameRuntime: XAsync work items carry their call, and waits cover the callback, inhle/xgameruntime/xasync.rs: each queued item carries its call's state (anArcas the queue context); a wait returns only after the completion callback has returned, also when it starts after completion (a call without a payload stays registered until its callback returns), and a wait from inside the callback does not deadlock;XAsyncGetResultSizealways writes the size. Four new tests, each failing without its part of the change.Tested
cargo test --workspace -- --test-threads=4on this branch (47b4989): 697 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Regression run
scripts/smoke.ps1. The second and third commits change the runtime (emit.rs,xasync.rs), so this PR needs someone with a title to add the twoxcl-smokeblocks. It stays a draft until then.Not tested
cwith a zero product is not covered.AI use
fma_legacyfix, the XAsync change and their tests, the commits and this description; ran the tests.fma_legacybehaviour, and reviewed the XAsync change (found the late-wait case fixed here).🤖 Generated with Claude Code