docs/design.md: name the GPU fixtures of six atomics rows (DOC-GPU-VERIFIED-ATOMICS) #413
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!413
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/413/head"
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?
@milk4sale on GitHub · 2026-11-24 04:49 UTC · original
milk4sale:docs/gpu-verified-atomics→main· +6 −6 · 1 files · 3 commits · merged 2026-11-25 01:48 UTCClaimed in the coordination issue as: DOC-GPU-VERIFIED-ATOMICS (#14)
Depends on: #186, #65 - conflicts only; nothing here builds on them. #186 edits the
ds_wrxchg_rtn_b64row, which sits between two rows changed here, and #65 inserts its Flat memory row right after the 8/16-bit global row. Both resolve by keeping both sides.What and why
Six contract rows in
docs/design.mdended with "Not GPU-verified.", but GPU fixtures onmainalready run them throughscripts/run_gpu_tests.pyandruntime/test/shaders/check.py, and no row named its fixture. Each row now names its fixture, says which forms and cases it compares and on which GPUs it passed, and keeps a Not GPU-verified: list of what is still unchecked. Docs only: six lines of one file.cs_global_mem_extglobal_store_shortat byte 3 (both dwords),global_load_sbyte_d16_hids_cmpst_f32,global_/buffer_atomic_fcmpswapcs_w32_fcmpswapds_cmpst_rtn_f32−0/+0 match and NaN no-match,ds_cmpst_f32no-match,buffer_atomic_fcmpswap−0/+0 match withglcand a one-ulp no-match withoutglobal_atomic_fcmpswap, theds_cmpst_f32match, a NaN in the buffer form, bounds, inactive lanes, contentionds_mskor_b32/_rtn_b32cs_lds_atomics_extoffset:, the 32-lane caseds_{inc,dec,rsub}_u32,ds_{min,max}_f32cs_lds_atomics_ext,cs_lds_xchg64_extds_inc_rtn_u32wrap,ds_dec_u32from 0,ds_rsub_u32wrap (low byte of each),ds_min_f32with a qNaN,ds_max_rtn_f32−0/+0 (as an XOR)offset:, inactive lanes, contentionds_wrxchg2_rtn_b32cs_w32_new_opsdata1in LDSdata0,st64, one dword twice, aliasingds_and/or/xor_b64cs_lds_atomics_ext,cs_lds_xchg64_extds_xor_rtn_b64,ds_and_b64,ds_or_rtn_b64(the element only)ds_and_rtn_b64,ds_or_b64,ds_xor_b64,offset:, aliasing, contentionThe coverage comes from the fixture bodies, not only their headers. Three things the headers don't say:
cs_w32_new_opsoverwrites the second VGPR ofds_wrxchg2_rtn_b32'svdstwith a read before storing it.cs_w32_fcmpswap's NaNbuffer_atomic_fcmpswapcase stores only the returned word, which is the NaN whether or not it matched.cs_lds_xchg64_extnever storesds_or_rtn_b64's returned pair, and judgesds_max_rtn_f32as the word left XOR the returned word.Row 279 also gets back the opening
**of "Hardware-measured natively ongfx1100", lost in6b5fc7fc8, so GitHub no longer prints a stray**there. That row had two "Not GPU-verified" clauses (a later merge added the second); the first goes.Left out or affected:
buffer_atomic_{and,or,xor,swap}_x2: #191 and #174 rewrite those rows.cs_global_mem_extalso covers parts of them (global_atomic_add/cmpswap,global_atomic_or_x2,buffer_atomic_xor_x2), so they can take the same kind of note once those land.cs_w32_late_ext,ds_mskor) and #171 (cs_w32_pk_rel_ext,ds_or/xor_b64) add fixtures for two of these rows without editing them; the rows can name those fixtures once they merge.Tested
On
mainece4ba5b3plus this commit (since rebased ond2cd6c0d9, whose ten new commits change only runtime C++ tests, not the translator, the fixtures ordocs/design.md), CachyOS (kernel 7.3.3), llvm-mc 23.1.4, SPIRV-Tools v2026.4, GCC 16.2.1, implicit Vulkan layers off (VK_LOADER_LAYERS_DISABLE=~implicit~).scripts/run_gpu_tests.py --filter <fixture>for each of the five fixtures, withLEONIDA_VK_DEVICEchoosing the GPU (checked againstvk_compute_test'sdevice:line):LEONIDA_W64_EMULATE=1With
LEONIDA_W64_EMULATE=1the translator writes byte-identical SPIR-V for all five (one active lane, no cross-lane operation), so the emulated runs repeat the native test. That is why the rows name only the GPUs.Also:
tests/test_docs_links.py,tests/test_docs_design_rows.pyandtests/test_design_contract_rows.pypass;scripts/check_no_game_data.py docs/design.mdis clean. The translator suite andctestwere not run, since no code changed.GPUs tested: AMD Radeon 610M (gfx1036), RADV Mesa 26.2.6, CachyOS Linux; NVIDIA GeForce RTX 4070 Ti, 620.70.06, CachyOS Linux.
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No new rule: this names existing fixtures.)🤖 Generated with Claude Code
Six contract rows ended with "Not GPU-verified" although fixtures on main already run them through scripts/run_gpu_tests.py and check.py: cs_lds_atomics_ext, cs_lds_xchg64_ext, cs_global_mem_ext, cs_w32_fcmpswap and cs_w32_new_ops. Each row now names its fixture, the forms and cases it compares, the GPUs it passed on (Radeon 610M, RADV Mesa 26.2.6; RTX 4070 Ti, 620.70.06), and what stays unchecked. Rows: 8/16-bit global stores and d16 loads, ds_cmpst_f32 / fcmpswap, ds_mskor, ds_{inc,dec,rsub}_u32 / ds_{min,max}_f32, ds_wrxchg2_rtn_b32, ds_and/or/xor_b64. Row 279 also gets back the opening ** of its "Hardware-measured natively on gfx1100" note. Left out: Global atomics (32-bit) and buffer_atomic_{and,or,xor,swap}_x2, which open pull requests #191 and #174 rewrite. Co-Authored-By: Claude Opus 5.5 <[email protected]>@PierreEbele on GitHub · 2026-11-24 20:55 UTC · original
Reviewed
cf3951e: docs-only; all five cited fixtures exist on main and matchrun_gpu_tests.py/check.py, and five of the six rows are accurate. One fix: thebuffer_atomic_fcmpswapNaN clause describes the pre-a672a598fixture (which the84347bbb6610M/4070 Ti runs executed), whereascs_w32_fcmpswap.asmoncf3951eandmainnow reads back byte0x48intov6(buffer_load_dword v6, overwriting theglcreturn) soout[7] = 0x7FC00000verifies the word stays NaN rather than returning it. Please update that clause to match the current fixture — and if moving "whether a NaN matches inbuffer_atomic_fcmpswap" out ofNot GPU-verified, either reruncs_w32_fcmpswapon those GPUs or cite post-a672a598runs onmain(GraniteRidge-9950X3D/RTX4080/RTX3060Ti). Sandbox: all six rows' semantic tests plustest_fcmpswap_fixture.pypass on both trees (2spirv-valskips);check_no_game_data.pyclean. AI-assisted review.@milk4sale on GitHub · 2026-11-24 22:04 UTC · original
@PierreEbele Thanks, you're right. My runs on the 610M and the 4070 Ti were at
84347bbb6, beforea672a598, soout[7]was still theglcreturn, and the clause described that older fixture.Fixed in
457bad106, a follow-up on top ofcf3951e. The clause now matches the current fixture: with a NaN in memory and as CMP,buffer_atomic_fcmpswapleaves the NaN in memory. That case is credited to the RTX 4070 Ti only. "Whether a NaN matches" leaves the Not GPU-verified list, and the value returned for a NaN joins it, since the read-back now overwrites that return.Rerun of
cs_w32_fcmpswapatmain6261ca916(which hasa672a598):LEONIDA_VK_DEVICE=4070, matched againstvk_compute_test'sdevice:linescripts/run_gpu_tests.py --filter cs_w32_fcmpswap0 1065353216 2143289344 1065353216 2147483648 1077936128 1065353216 2143289344LEONIDA_W64_EMULATE=1out[7]=0x7FC00000: DATA (1.0) was not stored. I didn't rerun the 610M, so the row names only the 4070 Ti for this case. The other five rows are unchanged.tests/test_docs_links.py,tests/test_docs_design_rows.pyandtests/test_design_contract_rows.pypass, andscripts/check_no_game_data.py docs/design.mdis clean.AI-assisted (Claude Code).
@PierreEbele on GitHub · 2026-11-24 22:34 UTC · original
Rechecked
457bad10: thebuffer_atomic_fcmpswapNaN clause indocs/design.mdnow matches the fixture as it is on main (runtime/test/shaders/cs_w32_fcmpswap.asm:11-12:out[7]is the memory word read back after the atomic, expected0x7FC00000, so DATA is not stored), and moving the returned-value case to Not GPU-verified fits since the read-back overwrites that return. My earlier finding is resolved. In a sandbox on this head:tests/test_docs_links.py,tests/test_docs_design_rows.pyandtests/test_design_contract_rows.pypass,scripts/check_no_game_data.py docs/design.mdis clean, andgit merge-treeinto current main is clean. No GPU here, so the 4070 Ti words are taken from your run. AI-assisted review.Recommendation: Merge
@milk4sale on GitHub · 2026-11-25 02:55 UTC · original
Local stand-in for this pull request's CI, which has been queued here since 22:31 UTC (about 580 runs waiting).
Tested:
4581d0ad3merged withmainb4b7756e8(2026-11-25 01:13 UTC), in one tree together with #1087, #1089, #1090, #1114, next tomainalone. The trees came fromgit merge-tree, and nothing was pushed. Each job used the workflow's own selection fromci.ymlandruntime.yml.main+ the five pull requestsmainalonechecksteps: compileall,make_game.py --helpstdlib-tests-linux(every standalone file, run to the end)translator-tests(pytest files)viewer-testssemantic-testslinux-gpu-tools: ctestlinux-gpu-tools:run_gpu_tests.py, plain,LEONIDA_W64_EMULATE=1 --filter cs_,LEONIDA_BARY_FALLBACK=1no-game-data:scripts/check_no_game_data.pyon this pull request's filesDocs only: the
tests/test_docs_*.pyloop and the design.md row tests pass.The two pytest failures are
main's:tests/test_translate.pyon the text-only fixturecs_dpp_cmp.asm(test_gpu_samples_translate_and_validate,test_wave64_emulate_uses_no_subgroup_ops). With #1375 applied, both pass.Not covered: the Windows and macOS jobs.
Setup: Linux (CachyOS), Python 3.14.10 (CI uses 3.12), llvm-mc 23.1.4 (CI uses 19), Node 26.13.1. GPU suite on lavapipe from Mesa 26.2.6 with
GALLIUM_OVERRIDE_CPU_CAPS=avx, the code path of CI's runners, which lack AVX-512; and on an RTX 4070 Ti, NVIDIA 620.70.06.AI-assisted (Claude Code).