mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:40:52 +01:00
[PR #411] GPU fixtures for global_atomic_csub / buffer_atomic_csub (GPU-ATOMIC-CSUB) #461
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#461
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/411
Author: @milk4sale
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:gpu-test/atomic-csub📝 Commits (6)
b80541eGPU fixture for global_atomic_csub / buffer_atomic_csub, and a "; mcpu:" fixture header40d7d76tests/conftest.py: assemble a fixture for its "; mcpu:" target tooe811439GPU fixture cs_w32_csub_ext: csub inactive lanes and buffer bounds (GPU-ATOMIC-CSUB)7c77cf4Merge origin/main into gpu-test/atomic-csubfd8a042Merge main into gpu-test/atomic-csube95d2c1Merge main into gpu-test/atomic-csub📊 Changes
8 files changed (+354 additions, -30 deletions)
View changed files
📝
docs/design.md(+1 -1)📝
runtime/test/shaders/build.py(+14 -3)📝
runtime/test/shaders/check.py(+8 -3)➕
runtime/test/shaders/cs_global_csub.asm(+138 -0)➕
runtime/test/shaders/cs_w32_csub_ext.asm(+140 -0)📝
scripts/run_gpu_tests.py(+38 -16)📝
tests/conftest.py(+11 -5)📝
tests/test_rdna2_decode.py(+4 -2)📄 Description
GPU-ATOMIC-CSUB (claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121459552)
What and why
The
docs/design.mdrow "global_atomic_csub,buffer_atomic_csub(GFX10.3)" is CPU-checked only onmain(tests/semantic/test_atomic_csub.py) and says that the translation is not GPU-verified.Draft #59 (carried over, Unclaimed) already has a GPU fixture for it,
runtime/test/shaders/cs_global_csub.asm, from old PR 7237 byxelerb-debug. This PR takes that part over on its own:xelerb-debug's two commits, cherry-picked unchanged with their author: thecs_global_csubfixture and the; mcpu:fixture header (build.py,run_gpu_tests.py,tests/test_rdna2_decode.py,tests/conftest.py). The fixture covers both forms:DATAabove, equal to and belowM0xffffffffon0x80000000glcand noglcOne new commit adds
runtime/test/shaders/cs_w32_csub_ext.asm, a wave32 fixture for what that file leaves out:vdst/vdata, and the active lanes get their old values. Each lane ORs1 << laneinto a word, which gives the exact mask. A lane mask copied into a VGPR would read only that lane's bit in the translator (the "Whole-wave masks" row).buffer_atomic_csubgoes through a V# withnum_records8. Offset 4 is in range. Offsets 8 (glc) and 12 (noglc) are out of range: memory is untouched, andvdatais 0 withglcand kept without.Every expected word is derived in the file header from three
docs/design.mdrows:glclane gets 0, and an inactive lane keeps its registerIt is registered in
check.pyandrun_gpu_tests.pythe waycs_w32_fcmpswapis. It is also inWAVE32_LANE_DUMPS, because its masks cover 32 lanes.The csub row now names both fixtures, the GPUs, and the faults each fixture catches.
#59 would then reduce to its
cs_w32_dot_intcommit, on top of this one.cs_w32_csub_extvdstkept its preset0xaaaaaaaa0x777700540x023005c8vdatakept its preset0xaaaaaaaa0x55550012glc: old 30 |Mafter (25) << 160x0019001eglc:vdata0 |Mkept (0x99) << 160x00990000glc:vdatakept (3) |Mkept (0xab) << 160x00ab0003Depends on: none.
Tested
CachyOS (Linux 7.3.3) on this branch (
mainece4ba5b3plus 3 commits), with llvm-mc 23.1.4 and theruntime/buildtest programs, whose sources are the same as this branch's. The device was picked withVK_DRIVER_FILES. Both fixtures were run withrun_gpu_tests.py --filter csuband withbuild.py+check.py:LEONIDA_W64_EMULATE=1I planted translator faults one at a time and reverted each. The results are the same on both GPUs:
cs_global_csubcs_w32_csub_extglcreturnglclane gets itsDATA, not 0Other checks:
python -m unittest discover -s tests/semantic -p test_atomic_csub.py: OK.python -I:test_run_gpu_tests,test_runner_calls_all_tests,test_design_contract_rows,test_docs_links,test_docs_repo_paths,test_text_write_line_endingsandtest_shader_checks.tests/test_rdna2_decode.pywithLLVM_MCset: both csub fixtures pass the llvm-mc parity check. The test then fails oncs_w32_permlane_fi.asm, as it does onmain.conftest.pychange serves. pytest isn't installed here.scripts/check_no_game_data.pyon the changed files: clean.AI-assisted: yes (Claude Code).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.