mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #1112] rdna2spirv: the binary64 VALU ops take clamp and nothing else from their omod (SHADER-F64-OMODS-CARRY) #1147
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1147
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1112
Author: @klikso
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:carry/shader-f64-omods📝 Commits (4)
8f498berdna2spirv: the f64 VALU ops keep only clamp, not their omod74b275adocs+translator: say only clamp applies, as the reviewer asked4a678d0test_f64_round: cover the omod on the three rounding ops the existing case leaves open1a3a65etest_f64_round: a subnormal's result takes clamp and no omod📊 Changes
11 files changed (+116 additions, -71 deletions)
View changed files
📝
docs/design.md(+3 -3)📝
runtime/test/shaders/check.py(+1 -1)📝
runtime/test/shaders/cs_f64_add.asm(+2 -1)📝
runtime/test/shaders/ps_f64_mods.asm(+7 -4)📝
scripts/run_gpu_tests.py(+2 -2)📝
tests/semantic/test_f64_round.py(+27 -3)📝
tests/semantic/test_valu_add_f64.py(+10 -8)📝
tests/test_f64_diff.py(+8 -3)📝
tests/test_f64_output_modifiers.py(+21 -22)📝
tests/test_f64_transcendentals.py(+13 -15)📝
tools/rdna2spirv.py(+22 -9)📄 Description
Claimed in the coordination issue as: SHADER-F64-OMODS-CARRY
What and why
This carries #475 by @fiestorra onto current
main: its three commits (9948f1f2f,e3a5bea41,e983b38f6), cherry-picked in order with their author kept and no change of mine. #475 was verified by @Len1k (tests guard the change) and by @moffington on an RTX 3060, reproduced by the author on a Radeon 780M (gfx1036), and then closed by its author on 24 November when he left the project.mainstill models the omods, and no open pull request carries the change.The binary64 VALU ops (
v_add_f64,v_rcp_f64,v_rsq_f64,v_sqrt_f64,v_trunc_f64,v_ceil_f64,v_rndne_f64,v_floor_f64) can namemul:2,mul:4ordiv:2in their omod field. The author measured on gfx1036 hardware that those omods do nothing for these ops in the mode the translator assumes (binary64 denormals kept); onlyclampapplies. The translator now passes only the clamp part of the modifier list for these ops, and the fixtures, tests and thedocs/design.mdrows say so.@fiestorra: this is your work. If you want it back, say so and I will close this.
Tested
Windows 11 26200.9974, Python 3.13.14 (pytest 9.2.0),
llvm-mc23.1.6 (conda-forge, AMDGPU target), SPIRV-Tools v2026.4. Runtime test programs built frommain3aa975421with MSVC 19.44; this change does not touchruntime/srcor the shims.The five changed test files, run against
main's translator and against this branch's:maintranslatortests/semantic/test_f64_round.pytests/semantic/test_valu_add_f64.pytests/test_f64_diff.pytests/test_f64_output_modifiers.pytests/test_f64_transcendentals.pyrun_gpu_tests.py --filter f64, each tree judged by its owncheck.py, native and withLEONIDA_W64_EMULATE=1(the two modes give the same words):maincs_f64_add(high word of themul:2result)0x40040000(2.5)0x3ff40000(1.25)ps_f64_modsps_f64_round,cs_div_fmas_f64,cs_div_fmas_f64_rtThe
cs_f64_addpair is the one @moffington reported on the RTX 3060 (1.25 with the change, 2.5 on the merge base). Note what this does and does not show: an NVIDIA device runs the translated SPIR-V, so it confirms the translator emits what the new rule says; the rule itself rests on the author's gfx1036 measurement.python -I scripts/check_no_game_data.pyon the eleven changed files: no hits.git diff --check: clean.python -I tests/test_text_write_line_endings.py: pass.GPUs tested: NVIDIA GeForce RTX 3060 Ti (Ampere), driver 621.14, Vulkan 1.4.357, Windows 11 26200
AI-assisted: yes (Claude Code; run and measured on the machine above)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed: the commits update the three f64 rows there, confirmed by the author's GPU measurement on gfx1036.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.