Shaders: lower RDNA2 LDS integer atomics #1281

Open
github-bot wants to merge 4 commits from github-bot/gh-1281 into main AGit
Owner

@⁠spk-c on GitHub · 2026-11-26 10:10 UTC · original
spk-c:submit/rdna2-lds-integer-atomics → main · +300 −4 · 3 files · 4 commits · open

AI-assisted change.

Summary

Lower ds_inc_u32, ds_dec_u32, ds_rsub_u32 and ds_mskor_b32, including their returning forms. INC and DEC use DATA0 as an unsigned limit. Reverse subtraction wraps modulo 2^32, and masked OR clears DATA0 bits before OR-ing in DATA1. The returning forms deliver the old value observed by the successful compare-exchange.

The synthetic reference cases cover unsigned boundaries, operand order, result and return values, and contention. AMD RDNA2 ISA, section 12.13.

Validation

  • Passed on this branch: shader Clippy with all targets and warnings denied, asset policy, and three synthetic lowering tests.
  • Four SM 6.6 value tests were explicitly ignored in the run on this branch: INC/DEC limits and returns, contended INC/DEC returns, reversed subtraction, and masked OR. The corresponding tests ran successfully on hardware on the audited fork with a verified app-local Agility SDK. That result is separate from validation on this PR head.

Update against upstream 06702fe

Merged upstream without rewriting history. Kept the upstream dispatch-spread regression and the seven existing LDS integer tests. Moved the integer compare-exchange helper into emit/lds_integer.rs so lower.rs stays below the existing 512 KiB asset-policy limit (522,453 bytes); no policy changes. Removed an unreachable add_f32 match alternative; existing floating-point lowering is unchanged.

Exact head c19964c29d0e0a3a8ead26c640fd9d692e70942d passed local Windows Rust 1.98.1 workspace Cargo Check, strict Clippy (ordinary and all-features), the three synthetic integer lowering tests, and asset policy (221 files). Total elapsed 12.95 seconds. The four SM 6.6 integer value tests are still ignored by default on this submission. A broader LDS-related run before the module extraction hit the existing float-atomic test's no SM 6.6 device available failure with the Windows 10 inbox runtime. No new hardware result or performance claim. AI-assisted.

Current upstream integration (52ac4ec)

Merged current upstream without rewriting history. New head 74e3ac145dfb333c2b4c37aa4dd924e0c8a9ddaa. Preserved the upstream halves and dispatch_threads modules alongside lds_integer. Clean local Windows workspace check and Clippy (all targets/all features, warnings denied), three focused INC/DEC, RSUB and MSKOR lowering regressions, and diff check passed. The four SM 6.6 value tests were not rerun. Full asset policy remains blocked by upstream's existing oversized source files (#1357); no policy bypass. AI-assisted.

**@⁠spk-c** on GitHub · 2026-11-26 10:10 UTC · [original](https://github.com/fxceless/victory-fork/pull/1281) `spk-c:submit/rdna2-lds-integer-atomics` → `main` · +300 −4 · 3 files · 4 commits · open AI-assisted change. ## Summary Lower `ds_inc_u32`, `ds_dec_u32`, `ds_rsub_u32` and `ds_mskor_b32`, including their returning forms. INC and DEC use DATA0 as an unsigned limit. Reverse subtraction wraps modulo 2^32, and masked OR clears DATA0 bits before OR-ing in DATA1. The returning forms deliver the old value observed by the successful compare-exchange. The synthetic reference cases cover unsigned boundaries, operand order, result and return values, and contention. [AMD RDNA2 ISA, section 12.13](https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/rdna2-shader-instruction-set-architecture.pdf). ## Validation - Passed on this branch: shader Clippy with all targets and warnings denied, asset policy, and three synthetic lowering tests. - Four SM 6.6 value tests were explicitly ignored in the run on this branch: INC/DEC limits and returns, contended INC/DEC returns, reversed subtraction, and masked OR. The corresponding tests ran successfully on hardware on the audited fork with a verified app-local Agility SDK. That result is separate from validation on this PR head. ## Update against upstream `06702fe` Merged upstream without rewriting history. Kept the upstream dispatch-spread regression and the seven existing LDS integer tests. Moved the integer compare-exchange helper into `emit/lds_integer.rs` so `lower.rs` stays below the existing 512 KiB asset-policy limit (522,453 bytes); no policy changes. Removed an unreachable `add_f32` match alternative; existing floating-point lowering is unchanged. Exact head `c19964c29d0e0a3a8ead26c640fd9d692e70942d` passed local Windows Rust 1.98.1 workspace Cargo Check, strict Clippy (ordinary and all-features), the three synthetic integer lowering tests, and asset policy (221 files). Total elapsed 12.95 seconds. The four SM 6.6 integer value tests are still ignored by default on this submission. A broader LDS-related run before the module extraction hit the existing float-atomic test's `no SM 6.6 device available` failure with the Windows 10 inbox runtime. No new hardware result or performance claim. AI-assisted. ## Current upstream integration (52ac4ec) Merged current upstream without rewriting history. New head `74e3ac145dfb333c2b4c37aa4dd924e0c8a9ddaa`. Preserved the upstream halves and dispatch_threads modules alongside lds_integer. Clean local Windows workspace check and Clippy (all targets/all features, warnings denied), three focused INC/DEC, RSUB and MSKOR lowering regressions, and diff check passed. The four SM 6.6 value tests were not rerun. Full asset policy remains blocked by upstream's existing oversized source files (#1357); no policy bypass. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:19:46 +00:00
AI-assisted: retain halves, dispatch_threads and lds_integer modules. Workspace checks and three focused lowering regressions passed.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1281/head:github-bot/gh-1281'
git switch 'github-bot/gh-1281'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1281'
git switch 'github-bot/gh-1281'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1281'
git switch 'github-bot/gh-1281'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1281'
git switch 'main'
git merge --squash 'github-bot/gh-1281'
git switch 'main'
git merge --ff-only 'github-bot/gh-1281'
git switch 'main'
git merge 'github-bot/gh-1281'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.