Skip to content

Shaders: lower RDNA2 LDS integer atomics - #1281

Closed
spk-c wants to merge 4 commits into
fxceless:mainfrom
spk-c:submit/rdna2-lds-integer-atomics
Closed

spk-c wants to merge 4 commits into
fxceless:mainfrom
spk-c:submit/rdna2-lds-integer-atomics

Conversation

@spk-c

@spk-c spk-c commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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.

AI-assisted: retain halves, dispatch_threads and lds_integer modules. Workspace checks and three focused lowering regressions passed.
@spk-c spk-c closed this by deleting the head repository Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant