mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[GH-ISSUE #543] GPU test: ps_imgatomic loses atomic updates intermittently on MoltenVK 1.4.2 (Apple M5 Pro); KosmicKrisp passes #13
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GeorgiyDemo on GitHub (Nov 24, 2026).
Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/543
Re-filed from the old
#9786(listed in #18): that repository went private. Re-verified on this repository'smaind42773d07;runtime/test/vk_bindless_test.cppandruntime/test/shaders/ps_imgatomic.asmare identical to the old tree, so the measurements carry over.What happens.
runtime/test/vk_bindless_testin itsps_imgatomicmode fails intermittently on MoltenVK 1.4.2 on an Apple M5 Pro: 1 to 5 of the 256 checked texels come back wrong, always with fewer updates than expected (lost atomics), while the render-target check stays exact (0 of 4096 pixels). The same SPIR-V and the same binary pass every time through KosmicKrisp (Mesa).Reproduce:
d42773d07. At the oldmainit was 11 pass / 9 fail in 20 runs at two commits (152 commits apart), and earlier sessions on the same machine gave 1/5, 3/10, 4/8, 6/10 and 9/12 failures, so roughly half.Examples printed by the test on a failing run, all consistent with one or a few atomic updates not landing:
What I ruled out:
spirv-disshows fourOpImageTexelPointerwithOpAtomicUMax,OpAtomicUMinandOpAtomicOr.brew reinstall molten-vk) and the runs repeated; the picture is unchanged.MTL_DEBUG_LAYER=1reports no validation errors or hazards, and the intermittent wrong texels remain.In the full suite on the old tree:
run_gpu_tests.py182/244 passed, 60 skipped, 2 failed (cs_fma_fused, the known MoltenVK 1.4.2 row, andps_imgatomic); withLEONIDA_W64_EMULATE=1, 213/244 passed, 30 skipped, 1 failed (cs_fma_fusedonly), sops_imgatomicis a flake and not a translation difference.Question: does
ps_imgatomicreproduce on other Apple GPUs or on MoltenVKmain? If it is MoltenVK-side, the macOS CI job'sEXPECTED_FAILURES(todayps_ssharpandcs_fma_fused) would need this one too, because a suite run reaches it about half the time.AI-assisted run; synthetic fixtures only, no game data.
@GeorgiyDemo commented on GitHub (Nov 24, 2026):
Two extra series on the same machine (
maind42773d07, MoltenVK 1.4.2, 20 runs each, same binary and SPIR-V):MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS=1MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=1So it is not the submission path or the descriptor path: serializing submissions and switching to Metal argument buffers leave the rate where it is. Together with
MTL_DEBUG_LAYER=1reporting nothing and the same module passing 10/10 on KosmicKrisp, that points at the shader-level atomic path in MoltenVK rather than at the test's synchronization.AI-assisted; synthetic fixtures only, no game data.
@hugo0024 commented on GitHub (Nov 24, 2026):
It reproduces on a second Apple chip: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1,
maind0da7dade, 101 of 150 single runs fail. What that run narrowed down, with the numbers in #860: MoltenVK lowers the four atomics to Metal's texture atomics; it fails as often with the descriptor index used directly instead of the first-lane broadcast (54 of 60) and with the image copies in a submission of their own after the draw (42 of 60); and a wrongumaxorumintexel always holds the max or min of only some of its own 64 pixels. AI-assisted; synthetic fixtures only.@EvgHaze commented on GitHub (Nov 25, 2026):
A third Apple chip says this one is not MoltenVK-wide — it does not reproduce on an M3 at all.
0 of 256 texels wrongand0 of 4096 render-target pixels wrongin every runSo the numbers now are: M5 Pro 11 of 20 fail, M5 101 of 150 fail (from the comments above), M3 0 of 30. That is not a random flake that a different machine sometimes shows — it looks bounded by the GPU generation, and if so the useful next step is a boundary rather than another reproduction:
supportsFamily:forMTLGPUFamilyApple*) and whether Metal 4's texture atomics are in use at all, because the lowering named in #860 is the one path that changes between these generations.I can run an M4 check too if one is reachable; on this hardware there is nothing to reproduce, so what I can offer is the negative datapoint, which is what rules out "MoltenVK 1.4.2 loses atomics on every Apple GPU".
AI-assisted. No game data: the fixtures are hand-written and every number above is test output.