Fix compute shader signed overflow and paired LDS writes #1088
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!1088
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1088"
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?
@THE-PRO-GAME on GitHub · 2026-11-24 15:38 UTC · original
THE-PRO-GAME:compute-shader-improvements→main· +205 −19 · 2 files · 2 commits · openChanges
S_ADD_I32,S_SUB_I32, orS_ADDK_I32. The lowering now derives signed overflow from the operand and result sign bits while preserving the wrapping 32-bit result. This enables shaders whose translation depended on these SCC values. Lowering · AMD RDNA 2 ISA §12.1 · AMD RDNA 2 ISA §12.2DS_WRITE2andDS_WRITE2ST64forms wroteDATA1overDATA0when their offsets matched. Equal offsets now emit one write withDATA0. Distinct offsets still write both operands. This prevents affected shaders from reading the wrong shared-memory value after an equal-offset write. Lowering · AMD RDNA 2 ISA §10.4.3Verification
cargo test --workspace --lockedreported 349 passes and zero failures. With--all-features, it reported 353 passes and zero failures. Three ignored synthetic benchmarks also passed when run separately. Three reference-data tests and the Xbox SDK differential tests were unavailable.cargo clippy --workspace --all-targets --locked -- -D warningspassed with default and all features. The optional workspace formatting check flagged pre-existing differences outside the changed hunks.spirv-val --target-env vulkan1.3for all 12 modules. VIctory emits DXIL for D3D12. Numerical verification ran on WARP. Microsoft DXC · dxil-spirv revision · Khronos SPIRV-Tools revisionScope and disclosure
OpenAI Codex was used to investigate, implement, and test these changes using public documentation and synthetic shaders. In-game impact has not been verified. RTX 3060 execution was unavailable on the test host, and game performance was not measured.
Existing work on other SCC instructions, atomics, LDS bounds and barriers, and wave64 remains separate. SCC #168 · Atomics #164 · LDS and barriers #292 · RTX 3060 #1001
@ghost on GitHub · 2026-11-24 16:14 UTC · original
Ran on RDNA2 hardware through vkd3d-proton on a Steam Deck (not native Windows): AMD Van Gogh, RADV 26.1.99, SteamOS 3.8.28, Proton 11.0-3 (wine-11.0) with its vkd3d-proton 212991fc. Windows MSVC test binary (rustc 1.100.0) built from head
59ab6b7on mainffe310e. Your numerical checks ran on WARP, so this adds RDNA2 hardware.scalar_add_i32_scc_controls_branch,scalar_sub_i32_scc_controls_branch,scalar_addk_i32_scc_controls_branchand the fourpaired_lds_write2*tests (b32/b64, st64, 64 lanes) pass.stub_pipeline_is_created, fails on main on this host too (likely vkd3d-proton accepting the zero DXIL digest the test expects refused; environment, not this PR).Not tested: native Windows AMD drivers; WARP (this setup has none, so the WARP leg ran on RADV too); whether the new test fails without the fix on this host.
AI-assisted (Claude Code, Claude Opus 5.5); no game data.
@Zipettte on GitHub · 2026-11-24 16:29 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
59ab6b7:cargo test -p victory-shaderpasses, 127 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@Marvisak on GitHub · 2026-11-25 00:34 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.