Shaders: lower v_mad_u32_u16, v_mad_i32_i16, and v_lerp_u8 #1688
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!1688
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1688"
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?
@Calvix2k on GitHub · 2026-11-24 20:46 UTC · original
Calvix2k:codex/shader-mad16-lerp-1068→main· +153 −0 · 1 files · 2 commits · openImplements #1068.
Ports the verified branch from @kilvynsilveira-tech's fork (commit 5319a34 by Kilvy Nog), applied unchanged onto
ffe310e; the commit keeps its original author.Summary
Lower::integerrefused three RDNA2 integer VALU instructions:v_mad_u32_u16andv_mad_i32_i16(16x16 → 32 multiply-add), includingopsellow/high 16-bit selection forsrc0andsrc1.v_lerp_u8: the packed 4x8-bit rounded average,(a[i] + b[i] + (c[i] & 1)) >> 1, withsrc2supplying the rounding bits.Synthetic unit test
mad_32_16_and_lerp_u8_lower_and_validatecovers all three, including theopselhigh halves, and validates the emitted DXIL withdxil.dll.Validation
cargo test -p victory-shader --locked -- --test-threads=1 --skip emit::valu_tests --skip emit::waterfall_tests— passed (103 tests, 1 ignored).cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings— passed.cargo xtask policy— passed (154 files).dxil.dllvalidation: passed.@Calvix2k on GitHub · 2026-11-24 22:15 UTC · original
Rebased onto
70564ae; only the test module conflicted (upstream added the packed-half parameter test). Both tests are kept. mad_32_16_and_lerp_u8_lower_and_validate passes and cargo check -p victory-shader --tests is clean.@upipibi on GitHub · 2026-11-24 22:52 UTC · original
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
c7242f1(onmain70564ae).mad_32_16_and_lerp_u8_lower_and_validatepasses on the hardware adapter.AI-assisted (Claude Code). Synthetic tests only.
@Marvisak on GitHub · 2026-11-25 03:33 UTC · original · edited 2026-11-25 22:24 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/lower.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@StExpeditus on GitHub · 2026-11-25 09:04 UTC · original
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
37be962.cargo test --workspace --locked --no-fail-fast-> 697 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.@Calvix2k on GitHub · 2026-11-25 16:39 UTC · original
Thanks — the same five NVIDIA heap-cap failures as on
main, and nothing from this PR. Noted on the record.@catminou4 on GitHub · 2026-11-24 21:40 UTC · original · approved these changes
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 97 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows; macOS covers lowering/structure unit tests.v_mad_u32_u16/v_mad_i32_i16/v_lerp_u8 lowered; mad_32_16_and_lerp_u8_lower_and_validate checks the DXIL container hash against the reference.
@Calvix2k on GitHub · 2026-11-26 13:53 UTC · original
Rebased. Dropped our duplicate
validatehelper (upstream added the same one in the same place) and kept upstream'sds_bpermutetest plus ours.37be962370to8c6ff387e5div:2of a result in the lowest binade: +0, or a zero of its sign? #3171View 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.