shader: lower v_frexp_{exp,mant}_{f32,f16} in pure 32-bit DXIL #1659
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!1659
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1659"
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?
@geiyiliyabumo on GitHub · 2026-11-24 20:33 UTC · original
geiyiliyabumo:fix/shader-frexp-f32-f16→main· +290 −24 · 2 files · 1 commits · openSummary
v_frexp_exp_i32_f32(VOP1 0x03f/VOP3 0x1bf),v_frexp_mant_f32(VOP1 0x040/VOP3 0x1c0),v_frexp_mant_f16(VOP1 0x059/VOP3 0x1d9), andv_frexp_exp_i16_f16(VOP1 0x05a/VOP3 0x1da) incrates/victory-shader/src/emit/lower.rs(Lower::frexp).DoublenorInt64feature bits are set inSFI0):FirstbitHi(unaryBits.i32op 33) so DXIL f32 denormal flushing cannot corrupt subnormal inputs.±0.0),±inf, andNaNin the mantissa (and flushes-0.0to+0.0underomodper RDNA2 ISA §6.2.2); returns0for their exponents.abs/negsource modifiers,clamp/omodfloat output modifiers, and SDWA / VOP3op_selhalf selection while preserving the untouched VGPR half on 16-bit writes.Verification
cargo test -p victory-shader --lib: 123 passed, 0 failed, 1 ignored on both AMD Radeon RX 9060 XT (D3D12 hardware) and Microsoft Basic Render Driver (WARP), including 3 new regression tests (v_frexp_f32_decomposes_normals_and_subnormals_and_handles_special_values,v_frexp_f16_decomposes_and_preserves_the_other_destination_half,v_frexp_vop3_applies_float_modifiers— 108 synthetic GPU dispatches per backend, assertingDoubleandInt64SFI0flags are clear).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: pass (154 files).AI-assisted; synthetic tests only, no game files.
@Marvisak on GitHub · 2026-11-25 01:33 UTC · original · edited 2026-11-25 22:25 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
@Headache3318 on GitHub · 2026-11-25 01:36 UTC · original
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
79107fdapplied cleanly onto currentmainccfb029.cargo test -p victory-shader --locked: 96 passed, 0 failed, 1 ignored. All tests pass.cargo clippy -p victory-shader --all-targets -- -D warnings: 2 pre-existing unused-import errors in test code (fail identically on mainccfb029). The PR introduces no new clippy warnings.Not tested: Windows MSVC build, the title itself. AI-assisted.
@geiyiliyabumo on GitHub · 2026-11-25 02:25 UTC · original
Rebased cleanly onto \main\ (\
ccfb029), preserving \main's \tz/denormal-flush \omod\ handling inside \loat_output_modifiers. \cargo test -p victory-shader --locked frexp\ (verified on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll), \cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings, and \cargo xtask policy\ all pass.@geiyiliyabumo on GitHub · 2026-11-25 03:49 UTC · original
Updated per triage feedback: applied \Lower::ftz\ to f32 \_frexp_exp_i32_f32\ / \_frexp_mant_f32\ inputs (preserving signed-zero mantissa and zero exponent for flushed f32 subnormals while keeping f16 subnormal decomposition unchanged) and updated the f32 subnormal tests. Rebased onto \main\ (\
940d32f); verified on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll: \rexp\ (3 passed, 0 failed), \semantics_tests\ (32 passed, 0 failed), \clippy -D warnings, and \xtask policy\ all pass.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.