Repository navigation
rdna2spirv: v_min_f64 and v_max_f64 as a bit-exact selection - #3917
Closed
evilclanker9000 wants to merge 1 commit into
Closed
evilclanker9000 wants to merge 1 commit into
evilclanker9000 wants to merge 1 commit into
Conversation
One source's 64 bits, chosen with integer ops: a NaN operand gives the other one, two NaNs give src0, -0 < +0, subnormals by value; clamp applies, the omod is ignored. 28 words measured natively on gfx1036 (IEEE off). GPU fixture cs_w32_f64_minmax, semantic test test_f64_minmax.py, design.md row. AI-assisted.
Contributor
|
This overlaps #1976 by @IAmNotSiob. In 855870a that PR added I ran this PR's and #3896's tests with #1976's translator. Its NaN selection and omod disagree with your gfx1036 words. The case-by-case table is in my comment there. AI-assisted (Devin). |
Contributor
Author
|
Closing: duplicate of #1976 (open earlier); measurements posted there. AI-assisted. |
Contributor
|
Tested
No game files. AI-assisted (Claude Code). |
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-MINMAX, #3796 (comment)
What and why
v_min_f64andv_max_f64raisedUnsupported. Both are valid gfx1013 forms, found in the same sweep of every gfx1013 opcode form as #3896. No open PR or claim covers them.Change (
tools/rdna2spirv.py,Gen.minmax_f64,Gen.f64_words). The result is one source's 64 bits, selected with integer ops only, so the driver's f64 NaN and denormal handling never enters:clampapplies. The omod is ignored, as on hardware while f64 denormals are kept (see rdna2spirv: v_mul_f64 and v_fma_f64 #3896).Measured natively on RDNA2 gfx1036 (Radeon iGPU of a Ryzen 9 9950X3D, driver 26.10.1,
tools/hw_oracleraw wave32 kernels, v0-v15 / s4-s15): 28 words, all reproduced by the translator. The set covers:mul:2,clamp, abs/neg, and the inline constant 0.5.The measurements use MODE.IEEE off, the MODE inferred for the game. With IEEE on, the only difference is a signalling NaN operand: the hardware returns it quieted instead of returning the other operand. That case is documented and not modelled.
New contract row in
docs/design.md.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_minmax:0 1074266112 0 2147483648 1 0 1 2146435072runtime/test/shaders/cs_w32_f64_minmax.asm. It covers a quiet NaN, -0/+0, a subnormal with an ignoredmul:2, and two NaNs giving src0. The words are derived in its header. Registered incheck.py,run_gpu_tests.pyandregen_fixtures.py.tests/semantic/test_f64_minmax.pychecks the 28 measured words throughtests/spirv_interp.py, a plain-Python reference of the rule against the same words, and the fixture words throughspirv_mini_interp.mainthe test errors withUnsupported: v_min_f64/v_max_f64.... 1 2146959360. Reverted.python -m unittest discover -s tests/semantic,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.