Repository navigation
Conversation
One rounding of the exact product (and sum) to binary64, clamp applied, the VOP3 omod dropped: on gfx1036 it is ignored while f64 denormals are kept, the MODE the translator assumes. A MODE.FP_ROUND write makes both Unsupported (no toward-zero product). GPU fixture cs_w32_f64_mul_fma, semantic test test_f64_mul_fma.py, design.md row. AI-assisted.
This was referenced Nov 22, 2026
Vonsek
marked this pull request as ready for review
November 22, 2026 22:34
Contributor
Author
|
Closing: duplicate of #1976 (open earlier); measurements posted there. AI-assisted. |
Contributor
|
Tested
No game files. AI-assisted (Claude Code). |
Contributor
|
Closed as a duplicate of #1976, so this is only for whoever lands that one: the content checks out (
AI-assisted review, no game files, no GPU. |
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-F64-MUL-FMA, #3796 (comment)
What and why
v_mul_f64andv_fma_f64raisedUnsupported. Both are valid gfx1013 forms. They turned up in a sweep that translated every gfx1013 opcode form onmain; this one was not claimed and not in an open PR. #3230 only touches null sources of the f64 opsmainalready has.Change (
tools/rdna2spirv.py, the f64 VALU branch):OpFMuland GLSL.std.450Fmaon%double. Source modifiers work as forv_add_f64.clampapplies.Unsupportedthere.Measured on RDNA2 gfx1036 (Radeon iGPU of a Ryzen 9 9950X3D, driver 26.10.1,
tools/hw_oracleraw wave32 kernels, v0-v15 / s4-s15). The table runs with the assembler's default MODE:v_mul_f641.5 × -20xc008000000000000(-3)v_fma_f64(1+2^-30)^2 - (1+2^-29)0x3c30000000000000(2^-60; rounding the product first gives 0)v_mul_f64(1+2^-52)^20x3ff0000000000002v_mul_f642^-1022 × 0.50x0008000000000000(subnormal kept; 0 withdenorm_mode_16_64 = 0)v_mul_f641.5 × 1.5mul:2v_add_f641.5 + 1.5mul:2New contract row in
docs/design.md.Finding, not fixed here: the existing
v_add_f64applies its omod. Under the same MODE assumption, the hardware ignores it (last row of the table). This is the binary64 counterpart of #1970 (f16, SHADER-297). I'll post it as a finding rather than changev_add_f64here.Tested
Windows 11, LLVM
llvm-mc(-mcpu=gfx1013),VK_LOADER_LAYERS_DISABLE=~implicit~, one GPU at a time,python -I scripts/run_gpu_tests.py --filter cs_w32_f64_mul_fma:0 3221749760 0 1009778688 2 1072693248 0 1073872896runtime/test/shaders/cs_w32_f64_mul_fma.asmcovers -3, the fused 2^-60, 1+2^-51, and omod ignored. The words are derived by hand in its header. It is registered incheck.py,run_gpu_tests.pyandregen_fixtures.py.tests/semantic/test_f64_mul_fma.pyruns throughtests/spirv_interp.py, which rounds the exact binary64 product andFmaonce. It covers nine cases, among them the subnormal, clamp and omod cases. It also includes a plain-Python reference and the refusal under a MODE.FP_ROUND write.main, the test errors withUnsupported: v_mul_f64/v_fma_f64.v_fma_f64as a rounded product plus an add. The test fails, and the Radeon run fails with the fused word at 0 (0 3221749760 0 0 ...). I reverted it.python -m unittest discover -s tests/semantic(no new failures: the 7 failures and 3 errors it reports fail the same way onmainaa2988cc, intest_loop_ballot_barrier(emulate),test_vcmp16_opsel(spirv-val),test_cmp_class_f64(TEST-853) andtest_mutations(v_mul_legacy_f32anchor)),python tests/semantic/regen_fixtures.py --check(clean),python -I tests/test_shader_checks.py, andpytest tests/test_docs_design_rows.py tests/test_run_gpu_tests.py.AI-assisted.
Checklist
docs/design.md, with how it was confirmed.