Shaders: allow abs/neg source modifiers on v_cvt_{u16,i16}_f16 #668
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!668
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/668/head"
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?
@DenRakEiw on GitHub · 2026-11-24 06:27 UTC · original
fix/valu16-omod-and-cvt-saturation→main· +92 −3 · 2 files · 1 commits · closed without mergingAllow VOP3
abs/negsource modifiers onv_cvt_u16_f16andv_cvt_i16_f16invalu16_op(crates/victory-shader/src/emit/lower.rs).Motivation
v_cvt_u16_f16andv_cvt_i16_f16already read theirf16operand viahalf_fsrc, which applies VOP3abs/negmodifiers, and already saturate to 16-bit integer bounds onmain(commit2af66ff1). However, the guard right above the integermatchrejectedv.abs != 0 || v.neg != 0for all arms, including these two float-source conversions.Changes
crates/victory-shader/src/emit/lower.rs: exemptv_cvt_u16_f16andv_cvt_i16_f16from thev.abs != 0 || v.neg != 0rejection while keepingv.clamp || v.omod != 0rejected and keeping all integer-source 16-bit ops unchanged.crates/victory-shader/src/emit/valu_tests.rs: addcvt_16bit_int_from_f16_saturates_and_honors_modifierscoveringv_cvt_u16_f16(including|src0|) andv_cvt_i16_f16(including-src0), NaN, infinities, and out-of-range saturation.Verified locally on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
cargo test -p victory-shader --lib cvt_16bit_int_from_f16_saturates_and_honors_modifiers— passed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)AI-assisted (Gemini 4 Neon).
@slint6614-dev on GitHub · 2026-11-24 10:16 UTC · original
AMD hardware check, Windows 11, Adrenalin driver: RX 9070 (RDNA4) and Ryzen 9600X iGPU (RDNA2, gfx1036), each picked as the hardware device of
run_cases(local adapter-selection patch, not part of this PR);cargo test -p victory-shader --release valu_testsat the PR head. Negative control: the PR's non-test files reverted to its merge base, its new tests kept.f16_omod_applies_before_clampandcvt_16bit_int_from_f16_saturates_and_honors_modifierspass on both AMD GPUs.@DenRakEiw on GitHub · 2026-11-24 12:17 UTC · original
Rebased onto latest \main\ (\fe310e): kept upstream's f32-clamped saturation for \cvt{u16,i16}_f16\ while retaining \16\ \.omod\ (before \clamp) and \bs/
eg\ source modifiers on \cvt{u16,i16}_f16. Re-verified with \cargo test -p victory-shader\ (122 passed, 0 failed on Windows 11 / RTX 5090 + WARP), \cargo clippy -p victory-shader --all-targets\ (0 warnings), and \cargo xtask policy. AI-assisted (Gemini 4 Neon).
@Marvisak on GitHub · 2026-11-25 00:33 UTC · original · edited 2026-11-25 22:28 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/valu_tests.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@DenRakEiw on GitHub · 2026-11-25 02:54 UTC · original
Rebased cleanly onto latest
origin/main(940d32f, headaca82f4) resolving the tail conflict incrates/victory-shader/src/emit/valu_tests.rs.Re-verified locally on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
f16_omod_applies_before_clampandv_cvt_u16_i16_f16_*— passed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Ready for review. AI-assisted (Gemini 4 Neon).
@DenRakEiw on GitHub · 2026-11-25 03:46 UTC · original
Addressed the triage feedback:
f16omodchange (until RDNA2 f16 omod denormal behavior is measured on hardware) so this PR is now strictly scoped to allowingabs/negonv_cvt_{u16,i16}_f16.lower.rsdiff to a 4-line guard update (no moved integer match block).cvt_16bit_int_from_f16_saturates_and_honors_modifiers).Re-verified locally on RTX 5090 + WARP,
cargo clippy -p victory-shader --all-targets(0 warnings), andcargo xtask policy(ok).AI-assisted (Gemini 4 Neon).
@DenRakEiw on GitHub · 2026-11-26 00:53 UTC · original
Closing this PR — stepping back from code contributions on this account. Feel free to reuse the approach if helpful.
Pull request closed