Skip to content

Test inline FP16 multiplicands in VOP3P dot products - #1

Open
MichaelSmithAI wants to merge 14 commits into
Baconzido:shaders/v-dot2-f32-f16from
MichaelSmithAI:fix/dot-half-immediates
Open

MichaelSmithAI wants to merge 14 commits into
Baconzido:shaders/v-dot2-f32-f16from
MichaelSmithAI:fix/dot-half-immediates

Conversation

@MichaelSmithAI

@MichaelSmithAI MichaelSmithAI commented Nov 24, 2026 •

Copy link
Copy Markdown

Add regression coverage for the inline FP16 multiplicands of the VOP3P v_dot2_f32_f16 instruction. The portable test compares emitted DXIL for inline and packed-register operands with normal and swapped half selection. The GPU test checks that an inline 0.5 with packed (2, −4) and accumulator 1 returns 2 with the normal selectors and −1 with the swapped selectors.

The target branch's 7e969e5 keeps inline operands of the accumulating VOP2 form v_dot2c_f32_f16 refused until RDNA2 hardware measurements establish how they fill the two halves. The resolved branch preserves that safeguard and the single clamp. This diff adds tests only.

All nine focused Win64 dot-product tests passed on RTX 4090 under Wine, including the target's accumulating-form refusal, and repository policy passed. Synthetic shaders only. AI assistance was used.

Baconzido and others added 7 commits November 24, 2026 00:44
The two products of f16 halves, exact in f32, summed with the f32 addend (v_dot2c: the destination). VOP3P op_sel/op_sel_hi pick each half, neg_lo/neg_hi negate them and clamp saturates; modifiers not modelled are refused. Tests run each case on the host GPU and WARP.
Marvisak#157 adds a vop3p helper without modifiers to the same file; a distinct name and a place before the file's last test let the two changes merge.
The two products of f16 halves, exact in f32, summed with the f32 addend (v_dot2c: the destination). VOP3P op_sel/op_sel_hi pick each half, neg_lo/neg_hi negate them and clamp saturates; modifiers not modelled are refused. Tests run each case on the host GPU and WARP.
RDNA2 rounds the exact sum of the two f16 products and the f32 addend
once (measured on gfx1036 in Marvisak#465), where summing the products first
rounds twice: (1, 2^-12) . (1, 2^-12) - 1 gives 2^-24 on the hardware
and 0 that way.

The sum is now Boldo and Melquiond's correctly rounded sum of three:
two TwoSums, their errors added with rounding to odd, then one final
rounded add. A zero tail keeps the sign of an all-negative-zero sum,
and an infinite or NaN term gives the plain sum.
@Baconzido
Baconzido force-pushed the shaders/v-dot2-f32-f16 branch from 1d20123 to 2b0d00b Compare November 24, 2026 12:40
swarm and others added 4 commits November 24, 2026 07:44
The two products of f16 halves, exact in f32, summed with the f32 addend (v_dot2c: the destination). VOP3P op_sel/op_sel_hi pick each half, neg_lo/neg_hi negate them and clamp saturates; modifiers not modelled are refused. Tests run each case on the host GPU and WARP.
RDNA2 rounds the exact sum of the two f16 products and the f32 addend
once (measured on gfx1036 in Marvisak#465), where summing the products first
rounds twice: (1, 2^-12) . (1, 2^-12) - 1 gives 2^-24 on the hardware
and 0 that way.

The sum is now Boldo and Melquiond's correctly rounded sum of three:
two TwoSums, their errors added with rounding to odd, then one final
rounded add. A zero tail keeps the sign of an all-negative-zero sum,
and an infinite or NaN term gives the plain sum.
@Baconzido
Baconzido force-pushed the shaders/v-dot2-f32-f16 branch from 2b0d00b to bdced0f Compare November 24, 2026 22:16
@Baconzido
Baconzido force-pushed the shaders/v-dot2-f32-f16 branch from bdced0f to 693468a Compare November 25, 2026 22:31
Baconzido pushed a commit that referenced this pull request Nov 25, 2026
Exercise the descriptor cursor regression on the actual heap capacity
@MichaelSmithAI MichaelSmithAI changed the title Decode inline FP16 multiplicands in both packed dot-product forms Test inline FP16 multiplicands in VOP3P dot products Nov 26, 2026
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