dxil/shader: integer gather4_l/_o, native FP16 v_med3_f16, pure SLOT_MEMORY_VAS, and sound is_nan/bitcast folding #182
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ReTerryDavis--ReVIctory!182
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-181"
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?
@Zalthor on GitHub · 2026-12-05 21:36 UTC · original
Zalthor:shader/gather4-fp16-med3-and-dxil-folds→main· +552 −50 · 9 files · 1 commits · draftSummary
Targets high-cost instructions across hot shaders while avoiding overlap with upstream PRs (#162
SLOT_STRIDES/VIEW_SIZESpure reads and #169SLOT_MEMORYpage-directory pure reads) and rebased onto merged #96:image_gather4_l/image_gather4_l_o(crates/victory-shader/src/emit/lower/image_buf.rs):[-64, 65536]pre-clampedFpToSi+ shared integer bounds andIMax/IMin.v_med3_f16(crates/victory-shader/src/emit/lower/operands.rs,valu.rs,emit/mod.rs):is_nan_f16,f16_bits_to_f32, andmed3_f16to emit native FP16med3(plus two-constant clampmin/maxlowering underrdna::MED3) whennative_f16_on()is enabled, and honorslower::TEST_NATIVE_FP16inemit::native_fp16()for unit tests.SLOT_MEMORY_VASDescriptor Loads (crates/victory-shader/src/emit/lower/intersect.rs):SLOT_MEMORY_VASloads inpure_readsfor cross-block / cross-UAV-write CSE (complementary to #162 and #169).is_nan_f32&Bitcast(Select)Folding (crates/victory-dxil/src/bitcode/opt.rs,opt_tests.rs):swap_int_pred,half_k(for native FP16 constant-clamp lowering),try_bitcast_value+ generalizedBitcast(Select)folding across mixed constants/bitcasts, and folds 32-bitis_nan_f32checks in either operand order (abs > 0x7F80_0000/0x7F80_0000 < abs/<=) strictly whenbounded_late(src)proves the 32-bit float finite (preservingis_nanguards on data loads,Trunc/ZExt/Shl/LShrinteger patterns, and non-finite math).TRANSLATOR_VERSIONincrates/victory-shader/src/lib.rs.Verification
origin/mainca49e25, post-review):cargo clippy --workspace --all-targets --locked -- -D warningsandcargo clippy --workspace --all-targets --all-features --locked -- -D warningspass (0warnings).--all-features -- --test-threads=1tests pass acrossvictory-dxil(25 passed; 0 failed, includingbitcast_select_mixed_const_folds,is_nan_f32_folds_for_finite_med3,is_nan_f32_preserved_for_nonfinite, andis_nan_f16_preserved_for_data_loads_and_nonfinite),victory-shader(271 passed; 0 failed; 2 ignored; 55 filtered out+5 passed; 0 failedrunnable non-SM-6.6valu_tests/intersect_tests, includingf16_bits_to_f32_decodes_special_and_subnormal_values,native_fp16_med3_lowers_and_validateswithrdna::MED3clamp size check, andimage_gather4_l_o_lowers_and_validates; the remaining SM 6.6 tests require a newer D3D12 runtime than Win10 LTSC inbox), andxtask(9 passed; 0 failed).lower/mod.rsfinite_readsduring review, RX 9070 XT RDNA 4 Wave64):25,889 / 25,889shaders emitted & validated bydxil.dll(0errors);3,950 / 3,950used PSOs warmed cleanly.25,888shaders):-1,354,407ops (-1.67%).C6_OPT_GPUTIMEvsC5_OPT_GPUTIME(builtin:cruise,VICTORY_FSR_FRAMEGEN=0real frames only):[compute 34fb51b8a0312e82]0.780 -> 0.620 ms(-20.5%),[compute 5cf00dc39042edaf]0.217 -> 0.173 ms(-20.3%),[compute 764ca63daec9c616]14.8 -> 12.9 us/dispatch(-12.7%).dxil/shader: integer gather4_l/_o, native FP16 v_med3_f16, legacy-mul finite_reads, and is_nan/bitcast foldingto dxil/shader: integer gather4_l/_o, native FP16 v_med3_f16, pure SLOT_MEMORY_VAS, and sound is_nan/bitcast folding3962d6f564to85eb2953ecView 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.