Repository navigation
Shaders: skip f32 flushes in widened f16 comparisons - #3738
Open
andrewpozdnakov7-jpg wants to merge 1 commit into
Open
andrewpozdnakov7-jpg wants to merge 1 commit into
andrewpozdnakov7-jpg wants to merge 1 commit into
Conversation
Contributor
Author
|
Windows CI passed on The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add AI-assisted with OpenAI Codex. |
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.
The f32 comparisons used to implement unpacked f16 min, max and median can take their widened inputs directly. The smallest nonzero f16 magnitude is 2⁻²⁴, which is normal in f32. Widening and applying abs/neg cannot produce an f32 subnormal. The comparisons still use the existing signed-zero handling, and results still narrow through the existing f16 path. Microsoft's f16-to-f32 conversion documentation.
v_min_f16v_min3_f16orv_max3_f16v_med3_f16On Microsoft WARP 1.0.22 with Agility 1.620.2, the five encodings tested together returned the same 851,968 output words on both revisions. The generated inputs exercise every 16-bit pattern, both source and destination halves, abs/neg, clamp, and preservation of the other destination half. The existing f16 model and signed-zero regression passed. Strict all-feature shader Clippy and the asset policy passed.
#3733 addresses three-way f32 comparisons. #3365 handles output denormals according to MODE. This change removes f32 checks from comparisons whose source values were widened from f16. Game performance was unmeasured.
Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>if folding the change into another commit.AI-assisted with OpenAI Codex.