Repository navigation
rdna2spirv: flush v_exp_f32 denormal results (SHADER-EXP-F32-DENORM) - #1587
Conversation
|
Tested
AI-assisted; synthetic fixtures only, no game data. |
|
I checked the open question about #1518 on Windows with an RTX 4090 (NVIDIA 616.64). The two descriptor-word changes in that PR resolve the I built the test executables from this PR's Full
Both of this PR's exponential fixtures also matched all 4,096 pixels per draw in each run. These are local synthetic GPU results. AI-assisted verification. |
|
Tested
Does AMD's driver need the flush? As on NVIDIA, no. I read
So on this card One small thing in the harness: |
|
GPU test on an NVIDIA Ada card, for the record: this passes on an RTX 4090.
Only the filtered fixture(s) were run for this PR, not the full suite or ctest; the full-suite baseline for this card on |
|
Hi @exoticLgk, thanks for this pull request. CONTRIBUTING.md asks contributors to claim their work in the coordination issue ("Coordinating who works on what", currently #1608) before opening a pull request: post The claim matters because "it is claimed in the coordination issue by the pull request's author" is the first item on the maintainers' checklist for a mergeable pull request, and because it lets others see that the work is taken before they write it a second time. Could you post the claim in #1608 and add the ID to the pull request description? If you already claimed it in another form, a link to your comment is enough. AI-assisted (Claude Code, Claude Opus 5.5). |
|
#1587 | head The semantic file reproduced the v_exp_f32 denormal regression. On the two available drivers the hardware readbacks already matched the expected words on the baseline. Captured 62 distinct complete SPIR-V module(s) emitted while rerunning test_alu_exp_f32.py on the merged tree. All assembled and passed spirv-val for Vulkan 1.2 with --allow-offset-texture-operand. On each adapter I ran both changed fixtures with the default wave setting and with LEONIDA_W64_EMULATE=1. Both trees matched all 4096 pixels per draw, including 64 runtime-dependent inputs in the second fixture. Windows Vulkan adapters: AMD Radeon(TM) Graphics (26.11.2) and NVIDIA GeForce RTX 5070 Ti (610.74). Additional commands
Base |
|
Merged, thank you @exoticLgk! This translator PR (rdna2spirv: flush v_exp_f32 denormal results (SHADER-EXP-F32-DENORM)) passed its own tests with main merged in during sodove's verification of this batch, so it went in with the batch. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers. |
…irtual runner (CI-MACOS-EXP-DENORM) The fixture from ProjectLeonida#1587 reads 16777214 instead of 16777216 at pixel 0 on the runner's Apple Paravirtual device (MoltenVK 1.4.2), on main's last two macOS runs (46142035955, 46144804679) and on ProjectLeonida#1774's. On an Apple M3 with MoltenVK 1.4.2 it passes, 3 of 3 runs, so the translator is not at fault: list it with ps_ssharp. ci_expected_failures.py still prints a notice if it starts to pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…irtual runner (CI-MACOS-EXP-DENORM) The fixture from ProjectLeonida#1587 reads 16777214 instead of 16777216 at pixel 0 on the runner's Apple Paravirtual device (MoltenVK 1.4.2), on main's last two macOS runs (46142035955, 46144804679) and on ProjectLeonida#1774's. On an Apple M3 with MoltenVK 1.4.2 it passes, 3 of 3 runs, so the translator is not at fault: list it with ps_ssharp. ci_expected_failures.py still prints a notice if it starts to pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coordination
Claimed in the coordination issue as:
SHADER-EXP-F32-DENORMThe claim could not be posted because coordination issue #14 reached GitHub's 2,500-comment limit and no successor was found. Following the precedent in #1544, the claim is recorded here:
Searched existing claims and open PRs before implementation. No directly overlapping contribution was identified.
What and why
The RDNA2 hardware measurements documented in
docs/design.mdestablish thatv_exp_f32flushes denormal results, including when MODE requests denormal preservation.The translator previously emitted GLSL
Exp2without explicitly modelling this behaviour.This PR:
Gen.flush_f32to flush the rawv_exp_f32result before output modifiers.The semantic regression reproduces the following differences:
0x004000000x000000000x002000000x000000000x000000010x00000000Normal results at -125 and -126 remain unchanged.
Tested
c7e82e26e.Both GPU fixtures also pass without the translator change on the tested NVIDIA device. They establish GPU compatibility rather than a hardware-visible regression on this device. The semantic regression distinguishes the corrected implementation from the previous one.
Full GPU runs before the final rebase and addition of the second fixture:
The existing
cs_imgatomic_extfailure was reproduced without this patch on the earlier base and persisted after rebuilding on the updated base. PR #1518 appears relevant to that failure but was not tested here.Output modifier checks
Eight additional semantic probes were performed:
0x000000000x000000000x004000000x000000000x3f8000000x408000000x410000000x3f800000All eight match the intended implementation.
The existing hardware measurements in
docs/design.md, particularly the VOP3 modifier validation, support flushing denormal intermediate results before output modifiers.Post-scaling underflow remains outside this PR's scope because the exact
v_exp_f32boundary behaviour has not been independently established on native RDNA2.The existing
f32_fuzz.pyreference deliberately declines denormal exponential results. Its behaviour is left unchanged.Compatibility with #1231
PR #1231 addresses special results for other f32 transcendental instructions and explicitly leaves denormal handling unchanged.
A temporary local merge was tested:
No additional regression was detected in the combined configuration.
The temporary merge was aborted after testing. No changes from #1231 are included in this PR.
The final branch was checked against upstream main immediately before submission: zero commits behind, one commit ahead, clean working tree and clean
git diff --check.GPUs tested
Limitations
AI-assisted
ChatGPT assisted with investigation, implementation, regression tests, documentation and compatibility analysis. The reported local tests were executed on my machine.
Checklist
docs/design.md.