Repository navigation
docs/design.md, rdna2spirv: NVIDIA splits a binary64 Fma only when it folds an all-constant one - #8750
docs/design.md, rdna2spirv: NVIDIA splits a binary64 Fma only when it folds an all-constant one#8750DeSunShine wants to merge 2 commits into
Conversation
… folds an all-constant one Correcting ItsNotRexed#6635's wording. On an RTX 4090 (621.24) the split 0 of the fma(a, a, c) probe comes from the driver folding an all-constant GLSL Fma while compiling the pipeline: cs_div_fmas_f64's operands are literals. The same values read at run time from user SGPRs (VKC_SGPRS) give the fused 2^-60, as ItsNotRexed#4536 saw on an RTX 4070. --fma khr is still what makes both single-rounded. Wording only in design.md's floating-point row, cs_div_fmas_f64.asm's header, Gen.emit_fma64's docstring, the runner's split note and test_fma_khr_f64's docstring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Grimkeh
left a comment
There was a problem hiding this comment.
Independent Linux CPU review (93740940)
What changed: NVIDIA splits a binary64 Fma only when it folds an all-constant one; design.md + rdna2spirv + semantic fixture.
Checked: test_fma_khr_f64 5 OK (1 skipped). Full GPU path not run here.
Looks coherent; no game files.
|
Reproduced on Ampere: NVIDIA GeForce RTX 3070, driver 621.01, Windows 11, llvm-mc 23.1.6, at
How: So it's the driver folding the all-constant |
|
Tested on Blackwell: NVIDIA GeForce RTX 5060 Laptop GPU, driver 621.24, Windows 11, llvm-mc 23.1.6 (conda-forge), at
How: So on Blackwell with the same 621.24 driver as the 4090, folding the all-constant |
Hardware verification (gfx1030)Head
No regressions. AI-assisted run (Claude Code). |
|
Tested
Not checked: the other half of the sentence, that the same values as run-time operands are fused on NVIDIA. No fixture in this PR feeds them at run time, so this run says nothing about it. No game files. AI-assisted (Claude Code). |
…GPUs Review of ItsNotRexed#8750: the fused half of the claim had no fixture. The new cs_div_fmas_f64_rt reads the same a and c from s4..s7 (VKC_SGPRS), so the driver cannot fold the Fma; it is fused under the default GLSL Fma on the RTX 4090 here. design.md now names the measured GPUs: the all-constant Fma is split on the RTX 4090, RTX 3070 and Quadro RTX 4000 (Turing, Linux) and fused on an RTX 5060 Laptop (Blackwell). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @Joaco9020, @DeerSilver, @TG0000, @comtek21516. Pushed
RTX 4090 at |
|
Tested Tested
Built the Vulkan harness from the PR head and ran the synthetic fixtures with AI-assisted verification. |
|
Tested d1bb78b (CPU side only) on Windows 11 Pro 10.0.26300, Python 3.15.2: no regression. Merged onto main 867d922, AI-assisted (Claude Code). No game files. |
|
Independent Vulkan check on RTX 4070 Ti, Windows 11, NVIDIA 621.24. I built the literal and the new SGPR-input fixture from
This matches the RTX 4090 across all four cases. Shader fixtures are synthetic. AI-assisted. |
Claimed in the coordination issue as: new DOCS item, #8683 (comment)
Depends on: none. Corrects my own wording from #6635.
What and why
#6635 said that NVIDIA's driver rounds a binary64
GLSL.std.450 Fmatwice, based oncs_div_fmas_f64on an RTX 4090. @iurysf then found in #4536 that an RTX 4070 splits only an all-constantFmaand fuses one with run-time operands. I checked the 4090 the same way and got the same result:v_div_fmas_f64VCC=0, a = 1 + 2^-30, c = -(1 + 2^-29)--fma glsl--fma khrcs_div_fmas_f64(operands are literals)0x0 0x0(split)0x0 0x3c300000VKC_SGPRS(; rsrc2: 0x8090)0x0 0x3c300000(fused)0x0 0x3c300000So the split comes from the driver folding the constant
Fmawhile compiling the pipeline.--fma khrstill gives a single rounding in both cases, and nothing in the translator changes. This PR only fixes the claim where it is written:docs/design.mdfloating-point row;cs_div_fmas_f64.asm's header, which now says the test exercises the folded case;Gen.emit_fma64's docstring;test_fma_khr_f64.py's docstring.Tested
RTX 4090 (621.24), Windows 11, current main: the four rows above (both modes, both shapes).
tests/semantic/test_fma_khr_f64.py,tests/test_run_gpu_tests.py,tests/test_design_contract_rows.pyandtests/test_docs_repo_paths.pygive 74 passed. (tests/test_shader_checks.pyhas the 15 failures that main already has, #7122.)AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (n/a: wording of an existing row)