Repository navigation
Conversation
…e old value AAtoms handed operations 3 and 4 to EmitAtomicOp, which has no case for them (the constant 0, no access). AAtomsCas gave every compare-and-swap CAST.SPIN's 1 / 0; nvdisasm names three forms by bit 87, and a plain CAS (bit 87 clear) gives the old value. CAST and CAST.SPIN keep 1 / 0. New SharedAtomics tests in test_dmsh_ampere_alu.py (three fail on main). A GPU cross-check of 400 shared accesses as one-thread compute shaders with the production options: 84 mismatches (INC, DEC, CAS) to none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fpedrolucas95
pushed a commit
to fpedrolucas95/nxnative
that referenced
this pull request
Nov 6, 2026
…are-and-swap loop; ATOMS.CAS gives the old value
fpedrolucas95
pushed a commit
to fpedrolucas95/nxnative
that referenced
this pull request
Nov 6, 2026
…, seedds#1410, seedds#1411, seedds#1412, seedds#1413, seedds#1414, seedds#1329 on top of main's translator fixes): chain c9cf9613657e Publishes Ryujinx.Graphics.Shader, Ryujinx.Common, Spv.Generator and dmsh_xlate (osx-arm64, framework-dependent, the universal launcher kept) from the merged source; the PRs' own binaries were built without this tree's translator changes (float atomic adds, F2IP, the growing raw pool table). The lock and dmsh_chain.h are written again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
seedds
added a commit
that referenced
this pull request
Nov 7, 2026
…s the old value: shared-memory counters move as on Ampere (chain 1ddb83a9817a, PR #1413) AAtoms handed operations 3 and 4 (CUDA's atomicInc / atomicDec) to EmitAtomicOp, which has no case for them: it logged "Invalid atomic operation" and gave the constant 0, with no access to shared memory. They are now the compare-and-swap loop ATOMG's INC / DEC already are on main (INC: old >= b ? 0 : old + 1; DEC: old == 0 || old > b ? b : old - 1), Rd the old value. AAtomsCas gave every compare-and-swap CAST.SPIN's 1 / 0; nvdisasm names the forms by bit 87: clear is CAS (atomicCAS, Rd the old value), set is CAST, with bit 88 CAST.SPIN, which keep 1 / 0, so Fire Emblem Fortune's Weave's retry loop is unchanged. Checked: test_dmsh_ampere_alu SharedAtomics (3 tests, all fail on the translator before) and the 21 translator test files (test_dmsh_pairs' two NameErrors as before), test_nsp_chain, test_xlate_anycpu, test_docs. The author's GPU cross-check: 400 LDS / STS / ATOMS / ATOMS.CAS from the corpus as one-thread compute shaders, 84 mismatches on main (all INC, DEC and CAS) to none, the same on encodings from CUDA sm_80 / sm_75 binaries. No game is known to depend on it. Regression: one Ocarina of Time run on the chain that ends this batch. Co-authored-by: Copak731 <224629733+Copak731@users.noreply.github.com>
Owner
|
Landed as 1a410e6 with you as co-author (SharedAtomics fails before, passes after; main already had ATOMG's INC / DEC). Thank you. |
Aznracer
pushed a commit
to Aznracer/Mighty-Green-Kokiri-Kid
that referenced
this pull request
Nov 8, 2026
…s the old value: shared-memory counters move as on Ampere (chain 1ddb83a9817a, PR seedds#1413)
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
…s the old value: shared-memory counters move as on Ampere (chain 1ddb83a9817a, PR seedds#1413) AAtoms handed operations 3 and 4 (CUDA's atomicInc / atomicDec) to EmitAtomicOp, which has no case for them: it logged "Invalid atomic operation" and gave the constant 0, with no access to shared memory. They are now the compare-and-swap loop ATOMG's INC / DEC already are on main (INC: old >= b ? 0 : old + 1; DEC: old == 0 || old > b ? b : old - 1), Rd the old value. AAtomsCas gave every compare-and-swap CAST.SPIN's 1 / 0; nvdisasm names the forms by bit 87: clear is CAS (atomicCAS, Rd the old value), set is CAST, with bit 88 CAST.SPIN, which keep 1 / 0, so Fire Emblem Fortune's Weave's retry loop is unchanged. Checked: test_dmsh_ampere_alu SharedAtomics (3 tests, all fail on the translator before) and the 21 translator test files (test_dmsh_pairs' two NameErrors as before), test_nsp_chain, test_xlate_anycpu, test_docs. The author's GPU cross-check: 400 LDS / STS / ATOMS / ATOMS.CAS from the corpus as one-thread compute shaders, 84 mismatches on main (all INC, DEC and CAS) to none, the same on encodings from CUDA sm_80 / sm_75 binaries. No game is known to depend on it. Regression: one Ocarina of Time run on the chain that ends this batch. Co-authored-by: Copak731 <224629733+Copak731@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
AAtomshands them toEmitAtomicOp, which has no case for them; it logs "Invalid atomic operation" and gives the constant 0, with no access to shared memory. They are now a compare-and-swap loop (INC:old >= b ? 0 : old + 1; DEC:old == 0 || old > b ? b : old - 1), Rd the old value.AAtomsCasgave every compare-and-swap CAST.SPIN's 1 / 0. nvdisasm names the forms by bit 87: clear is CAS (CUDA's atomicCAS, PTXatom.cas: Rd the old value); set is CAST, and CAST.SPIN with bit 88 too. CAST and CAST.SPIN keep 1 / 0, so Fire Emblem Fortune's Weave's retry loop is unchanged.Reference entry:
docs/reference/shaders.md, "ATOMS.INC / ATOMS.DEC, and ATOMS.CAS's result".Checked
DMSH_TEST_XLATE=<translator> python3 dm/gfx/tests/test_dmsh_ampere_alu.py, newSharedAtomics(3, all fail onmain). Alltest_dmsh_*.pypass.LDC.64 c[0][0x10]thenLDG.E/STG.E; only the 16-byte block the access touches is set and compared), production options, MSL 2.3: 84 mismatches onmain, all INC, DEC and CAS, to none; the same on encodings from real compiled code (CUDA sm_80 / sm_75 binaries). Everything else (LDS of every size, STS, ADD / MIN / MAX / AND / OR / XOR / EXCH) already matched.Docs
docs/reference/shaders.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)🤖 Generated with Claude Code