buffer_atomic_sub is refused (no DXIL atomic subtraction; 3 compute shaders) #363

Closed
opened 2026-11-27 14:12:44 +00:00 by tiagonogueiraa-bit · 3 comments
tiagonogueiraa-bit commented 2026-11-27 14:12:44 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T14:12:44Z.


A small shape from #4: buffer_atomic_sub is refused by name ("GFX10 code at …: buffer_atomic_sub is not supported"). There are 3 unique compute shaders in a 12,020-shader corpus (Series S, boot to the menus, main 905e7aa): 49b8b58b93edb335, b1454a15c3e09497 and dfc4a2c9e8be67ba.

DXIL's AtomicBinOp has no subtraction. Plan: lower it as an add of 0 - data. Modulo 2^32 that leaves the same dword and returns the same old value. The PR will include a GPU test and a by-output corpus sweep.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6648128574 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/363). Originally posted by [tiagonogueiraa-bit](https://github.com/tiagonogueiraa-bit) on 2026-11-27T14:12:44Z. --- A small shape from #4: `buffer_atomic_sub` is refused by name ("GFX10 code at …: buffer_atomic_sub is not supported"). There are 3 unique compute shaders in a 12,020-shader corpus (Series S, boot to the menus, main `905e7aa`): `49b8b58b93edb335`, `b1454a15c3e09497` and `dfc4a2c9e8be67ba`. DXIL's `AtomicBinOp` has no subtraction. Plan: lower it as an add of `0 - data`. Modulo 2^32 that leaves the same dword and returns the same old value. The PR will include a GPU test and a by-output corpus sweep.
tiagonogueiraa-bit commented 2026-11-27 14:12:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T14:12:46Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7220494360 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/363#issuecomment-7220494360). Originally posted by [tiagonogueiraa-bit](https://github.com/tiagonogueiraa-bit) on 2026-11-27T14:12:46Z. --- /claim
github-actions[bot] commented 2026-11-27 14:12:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T14:12:57Z.


Claimed by @tiagonogueiraa-bit. Open a draft pull request with Refs #363 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7220498185 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/363#issuecomment-7220498185). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T14:12:57Z. --- Claimed by @tiagonogueiraa-bit. Open a draft pull request with `Refs #363` in its description within 24 hours, or the claim expires.
LakshanSivakumar commented 2026-11-28 00:35:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T00:35:29Z.


Thank you. buffer_atomic_sub now lowers as an add of the negated data, in #364 on main. The sweep showed 3 compute shaders gained, no regressions, with a GPU test. I have not tested it in the game. Closing. Please reopen if one of the 3 hashes is still refused on a6a58361.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7231034310 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/363#issuecomment-7231034310). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-28T00:35:29Z. --- Thank you. buffer_atomic_sub now lowers as an add of the negated data, in #364 on main. The sweep showed 3 compute shaders gained, no regressions, with a GPU test. I have not tested it in the game. Closing. Please reopen if one of the 3 hashes is still refused on a6a58361.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS#363
No description provided.