Shaders: skip f32 flushes in widened f16 comparisons #3738
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3738"
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?
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T13:29:20Z.
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 <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T13:32:39Z.
Windows CI passed on
6a4a505, including the workspace tests and both Clippy configurations. The same 851,968 output words also matched with #3365's f16 output-MODE changes. Combined result.The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.