Shaders: lower 24-bit mul_hi, saturating 16-bit packs, integer dot pr… #157
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!157
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-157"
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?
@9hvn9yt2vk-netizen on GitHub · 2026-11-24 01:01 UTC · original
9hvn9yt2vk-netizen:valu-packing-dot-ldexp→main· +336 −0 · 3 files · 1 commits · open…oducts and v_ldexp_f32
Ten VALU instructions the translator refused, so any shader using one dropped its draws or dispatches:
Found by lowering every GFX10 ALU opcode alone in a pixel shader whose export depends on it. The formulas were checked against the ISA definitions on random inputs (0 differences; ldexp differs only where a result turns denormal before the last factor, noted as a shortcut).
Tests: packing_dot_and_ldexp_instructions_translate (each one goes through the whole translation; fails without this change), and GPU tests in valu_tests comparing every instruction with its definition on edge values. The GPU tests were type-checked and clippy-clean for x86_64-pc-windows-msvc but not run (no Windows machine here).
@DaviTostes on GitHub · 2026-11-24 01:18 UTC · original
Tested
13d984aon Arch Linux x86_64, rustc 1.98.1: pass.cargo test -p victory-shader: 57 passed, 0 failed (2 test binaries), including the 5 tests this PR adds.victory-gpuE0425.No game data used.
@Sunkiller-qc on GitHub · 2026-11-24 01:29 UTC · original
Overlap note:
v_mul_hi_u32_u24/v_mul_hi_i32_i24are also in #156 (and #162 is stacked on #156), and #163 lowers all ten of these. The rest of this PR (cvt_pk,dot*,ldexp) isn't in #156, so dropping the twomul_hiarms here, or there, would avoid the duplicate match arms.Static review, not built or run.
@Baconzido on GitHub · 2026-11-24 03:51 UTC · original
Ran this PR's tests on Windows, since the description says the GPU tests have not run yet.
Windows 11 (26300), AMD Radeon RX 5700 (RDNA1, driver 26.11.2) and WARP,
dxil.dllfrom SDK 10.0.26100, at this PR's head13d984a:packing_dot_and_ldexp_instructions_translatev_mul_hi_24_bit_productsv_cvt_pk_16_saturates_each_halfv_dot_products_of_packed_fieldsv_ldexp_f32_scales_by_powers_of_twocargo test -p victory-shader: 74 passed, 0 failed.cargo clippy -p victory-shader --all-targetsandcargo fmt -p victory-shader -- --checkare clean.Merged together with #465 (the f16 dot products) on
maind2a4bae: no conflict, 78 passed, clippy clean. Both PRs had added avop3ptest helper tovalu_tests.rs; #465 now names its ownvop3p_mods, so the two compose in either order.AI-assisted (Claude Code ran the builds over SSH and read the logs); every run is on my machine. No game files.
@Marvisak on GitHub · 2026-11-25 00:18 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-shader/src/emit/valu_tests.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
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.