Repository navigation
docs/testing.md: Known problems row for ps_imgatomic on MoltenVK 1.4.2 (DOC-IMGATOMIC-MVK) - #860
Merged
Merged
Conversation
abnalstlll-byte
approved these changes
Nov 24, 2026
abnalstlll-byte
left a comment
Contributor
There was a problem hiding this comment.
Audited and verified. Documents ps_imgatomic flake on macOS with MoltenVK 1.4.2 in docs/testing.md's Known problems table, isolating it to Metal texture atomic lowering rather than translator broadcast issues, and confirms test expectations must not be weakened. Clean-room compliant. Approved.
abnalstlll-byte
approved these changes
Nov 24, 2026
abnalstlll-byte
left a comment
Contributor
There was a problem hiding this comment.
Clean-Room Audit & Documentation Review — PR #860 (docs/testing.md MoltenVK 1.4.2 ps_imgatomic)
Thorough and empirical documentation of driver-level atomic behavior on Apple Silicon.
Technical Verification
- Measured Behavior & Analysis:
- Accurately details why
ps_imgatomicexhibits non-deterministic read-modify-write races on MoltenVK 1.4.2 (Metalatomic_fetch_max/atomic_fetch_minlowering across fragment threadgroups). - Confirms that KosmicKrisp / Mesa passes 10/10, establishing that the issue stems strictly from MoltenVK's Metal translation layer rather than our SPIR-V output.
- Crucially recommends preserving the strict assertions in the test suite without weakening bounds.
- Accurately details why
- Clean-Room Compliance:
- Empirical hardware testing notes only; 0 proprietary assets or game data.
Verdict: APPROVED
…2 (DOC-IMGATOMIC-MVK) The test fails in about two of three runs on Apple GPUs with MoltenVK 1.4.2 (ProjectLeonida#543) and had no row. The row records what the Apple M5 adds to the M5 Pro report: - MoltenVK lowers the four atomics to Metal's texture atomics, so the module is not turned into a read-modify-write on the way; - a wrong umax or umin texel always holds the max or min of only some of its own 64 pixels, as a lost update between two groups of fragment threads leaves it; - it is neither the first-lane broadcast of the descriptor index (54 of 60 runs fail with the index used directly) nor the readback (42 of 60 fail with the copies in a submission of their own). Documentation only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
hugo0024
force-pushed
the
doc-imgatomic-mvk
branch
from
November 24, 2026 16:02
01b4069 to
513129b
Compare
3 of 4 tasks
Collaborator
|
Merged, thanks! Docs only; the docs tests pass with it merged onto
AI-assisted (Claude Code, Claude Opus 5.5). |
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.
Claimed in the coordination issue as: DOC-IMGATOMIC-MVK (claim)
What and why
ps_imgatomicfails in about two of three runs on Apple GPUs with MoltenVK 1.4.2 (#543). All three Apple records list it (#552, #564, #785), and the Known problems table ofdocs/testing.mdhad no row for it. This adds the row, with what a second Apple chip narrows down. One line indocs/testing.md; no test, translator or CI change. It does not close #543.Measured on an Apple M5 at
maind0da7dade(vk_bindless_test.cppandps_imgatomic.asmare unchanged since),vs_idsandps_imgatomicbuilt bybuild.py, single runs ofvk_bindless_test:mainvkQueueWaitIdleMVK_CONFIG_SHADER_DUMP_DIR) callsatomic_fetch_max,atomic_fetch_minandatomic_fetch_orontexture2d<uint, access::read_write>andtexture3d<uint, access::read_write>: Metal's own texture atomics, not a load and a store.desc_lookupbroadcasts the descriptor index from the wave's first running lane. I replaced the fourOpGroupNonUniformShufflewithOpCopyObjectof the lane's own value in the.spvasm, assembled it (the unpatched text reassembles byte-identical) and it fails as often.2D umax, 482D umin, 483D umax, no2D or. Every wrongumaxtexel holds the id of one of its own 64 pixels, the largest of only some of them: the last pixel of the texel's first four rows in 43 cases (all 32 larger ids gone), column 5 of row 5 in 39 (18 gone), column 3 of row 7 in 8 (4 gone).uminmirrors it: the first pixel of the last four rows in 39 of 48.My reading of the last point, not something I measured directly: a group of fragment threads writes its own reduced value over a more extreme one that another group stored in between, so the operation is atomic inside a group and not between two. That would also explain the clean
orimage, since a group that spans a texel's eight columns sets all eight bits itself.Not done: KosmicKrisp was not run on this machine (the row cites #543 for it), and the table "Which known problems the game's shaders reach" gets no row, because the count needs the game's shader corpus.
Tested
tests/test_docs_*.pyandtests/test_i18n_index.py: 13 files pass before and after.scripts/check_no_game_data.py docs/testing.mdpasses.macosjob log of run 45369028696 onmain21625bca8:SKIP ps_imgatomic SKIP (unsupported: the bindless set does not fit this device's descriptor limits).GPUs tested: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1 (26B131)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code