Skip to content

shader: lower binary16 VOP3 three-way minimum, maximum and median - #3564

Merged
tedin7 merged 5 commits into
R0Y00:mainfrom
lambirou:shader/f16-minmax3
Nov 30, 2026
Merged

tedin7 merged 5 commits into
R0Y00:mainfrom
lambirou:shader/f16-minmax3

Conversation

@lambirou

@lambirou lambirou commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Part of the VOP3 f16 slice. Stacked on #3562; rebase after it lands.

This adds v_min3_f16, v_max3_f16 and v_med3_f16 (three VOP3 rows). The result is one of the three inputs, selected by the same sign-magnitude order as the direct compute path; the median is max(min(a,b), min(max(a,b),c)). Clamp: a negative result becomes 0 and a result above 15360 becomes 15360. Sources must be statically finite; op_sel high halves, neg/abs, omod, subword, DPP and permuted encodings stay refused.

Tests

  • pixel_aot_f16_minmax3_hardware and pixel_aot_f16_minmax3_warp pass; the whole pixel_aot_f16_ group passes 22/22.
  • Two med3 programs (plain and clamp) plus the min3/max3 cases; seven mutations report pixel_mismatch: min/max swapped, sign order inverted, key order inverted, clamp dropped, high-half source read, med3 replaced by min3, med3 replaced by max3.
  • form_coverage_check.py passes and records exactly the three new forms; expected full table after the stack: 1,559/1,968 gfx1013 and 1,550/1,863 gfx1030.

Limits

The high half of the destination is not observed. High-half op_sel and neg/abs are refused although the direct compute path admits them. Runtime sources and NaN/infinity sources remain out of scope.

The branch includes #3542/#3549/#3556/#3557/#3562; those commits drop out once the stack lands.

AI-assisted.

@lambirou lambirou changed the title shader: lower binary16 VOP3 three-way minimum and maximum shader: lower binary16 VOP3 three-way minimum, maximum and median Nov 30, 2026
@tedin7
tedin7 merged commit f0a10b1 into R0Y00:main Nov 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants