Shaders: lower s_sext_i32_i8 and s_sext_i32_i16 in pure 32-bit DXIL #2077
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!2077
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2077"
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-25 04:24 UTC · original
geiyiliyabumo:feat/shader-s-sext→main· +83 −0 · 2 files · 1 commits · openSummary
s_sext_i32_i8(opcode0x19) ands_sext_i32_i16(opcode0x1a) incrates/victory-shader/src/emit/lower.rsusing pure 32-bit DXIL (shl+ashrby 24/16), without enablingInt64/WIDE_OPSand while preservingSCC.crates/victory-shader/src/emit/valu_tests.rscovering 10 boundary input vectors across both instructions with bothSCC = 0andSCC = 1, verifying single-dword operand/result widths and thatInt64is not set.Verification
cargo xtask policy: passedcargo clippy -p victory-shader --tests -- -D warnings: passedcargo test -p victory-shader --lib s_sext_i32with Microsoftdxil.dll: 2/2 passed on AMD Radeon RX 9060 XT (RDNA4) and Microsoft Basic Render Driver (WARP)@jeremygold02 on GitHub · 2026-11-25 04:33 UTC · original
Triage verdict — Keep the focused sign extension and reconcile #120’s overlap (
b92ae69)Evidence
mainstill lacks. Current patch · #120 patchChecks and limits
Next step
This verification was AI-assisted.
@upipibi on GitHub · 2026-11-25 04:41 UTC · original
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
b92ae69.victory-shader: 246 passed, 3 failed, 3 ignored; the news_sext_i32_has_single_dword_operands_and_preserves_scc_in_irands_sext_i32_lowers_without_int64_and_preserves_scc_on_gpupass. The 3 failures are #1744's NVIDIA failures onmain. Same asmainon this hardware. Not run: a title.AI-assisted (Claude Code).
@sinan-cmyk on GitHub · 2026-11-25 09:14 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
b92ae691ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 10:29 UTC · original
Automated triage for the maintainers.
This lowers
s_sext_i32_i8ands_sext_i32_i16inLower::sop(crates/victory-shader/src/emit/lower.rs) asshlfollowed byashrby 24 or 16. That matches the GFX10 ISA: the low byte or halfword is sign-extended and SCC is not written. Main already decodes both opcodes (0x19 and 0x1a ingfx10/opcodes.rs) but did not lower them. The new tests check operand widths and SCC flow in the IR, that the shader does not use the Int64 feature, and boundary values on the GPU and WARP. CI passes.This overlaps two arms of #120, which needs a rebase and only checks that lowering succeeds. If this merges first, #120 should drop those two arms. One retail census in the comments found no change in validated counts, so the title's benefit is not yet shown.
Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 01:42 UTC · original
Code review and RTX 5090 + WARP + DXIL verification at head
b92ae69133a0merged cleanly ontomain(63bcca43c6a0;emit/lower.rs=520,887B,3,401B under the 512 KiB cap):crates/victory-shader/src/emit/lower.rs:3995-4000):Shl(a, 24/16)followed byAShr(..., 24/16)cleanly masks dirty upper bits and sign-extends low 8/16-bit values without touchingSCCor requiringInt64.dxil.dll10.0.26100.0,VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy(default +--features diagnostics): 0 warningss_sext_i32(2/2),emit::lower::tests(33/33), andemit::semantics_tests(34/34 on both RTX 5090 and WARP, 1 ignored) all passed.LGTM.
View 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.