Shaders: test the VOP3 modifiers of v_cvt_f16_f32 and v_cvt_f32_f16, and drop their unreachable arms #231
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/231"
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 DexNom/VIctory. Originally posted by murillojndem on 2026-11-29T21:00:08Z.
Upstream's fc0c736 (Marvisak/VIctory#2159) fixed
v_cvt_f16_f32andv_cvt_f32_f16dropping their VOP3 modifiers: the VALU lowering had arms foropsel == 0that read the source withoutabsandnegand wrote the result withoutclampandomod. This repository has the same two arms inemit/lower.rs, but they are not reached:valu_ophands both conversions tovalu16first, which applies their modifiers and op_sel, and returns. So the bug does not show here. A change of that order would bring it back unnoticed, since no test ran these conversions.Change:
low_half, which another lowering uses, stays). Lowered shaders are unchanged, since the arms were not reached.emit::valu_testsrun the VOP3 forms on the hardware adapter and on WARP:v_cvt_f32_f16_applies_vop3_source_modifiers_to_the_half_it_widens: six f16 values, with another f16 in the high half, under no modifier, neg, abs, abs and neg, and neg with clamp; and op_sel picking the high half, with neg.v_cvt_f16_f32_applies_omod_and_clamp_before_narrowing_and_keeps_the_high_half: six values with and without clamp, omod mul:2 before clamp, and a NaN (a NaN without clamp, 0 with it), each keeping the destination's high half.Clamp is checked as a median of the value, 0 and 1: NaN and -0 give +0, which is what the RX 7900 XT returned for -0 with clamp.
Tests:
victory-shader --lib: 239 passed, 2 failed, 4 ignored on the RX 7900 XT and WARP with one test thread. The two failures,emit::rect::tests::rectangles_are_drawn_wholeandemit::rect::tests::the_rectangle_stage_is_a_geometry_shader, fail on main too.-D warnings, with and without--all-features, andcargo xtask policypass.Generated with Claude Code
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.