mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:50:52 +01:00
[PR #1352] tests: the LDS GPU fixtures order plain and atomic accesses (TEST-LDS-FIXTURE-ORDER) #1381
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#1381
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/1352
Author: @klikso
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:test/lds-fixture-order📝 Commits (1)
ffb9ff0tests: the LDS GPU fixtures order plain and atomic accesses (TEST-LDS-FIXTURE-ORDER)📊 Changes
9 files changed (+47 additions, -0 deletions)
View changed files
📝
runtime/test/shaders/cs_lds_atomics_ext.asm(+12 -0)📝
runtime/test/shaders/cs_lds_b64_cmpst.asm(+5 -0)📝
runtime/test/shaders/cs_lds_xchg64_ext.asm(+10 -0)📝
runtime/test/shaders/cs_w32_fcmpswap.asm(+6 -0)📝
runtime/test/shaders/cs_w32_misc_ext.asm(+2 -0)📝
runtime/test/shaders/cs_w32_new_ops.asm(+2 -0)📝
tests/semantic/fixtures/disasm/cs_w32_fcmpswap.s(+6 -0)📝
tests/semantic/fixtures/disasm/cs_w32_misc_ext.s(+2 -0)📝
tests/semantic/fixtures/disasm/cs_w32_new_ops.s(+2 -0)📄 Description
Claimed in the coordination issue as: TEST-LDS-FIXTURE-ORDER (claim)
What and why
Six compute fixtures return the expected words but print a shared-memory data race under GPU-assisted validation, so a validated run of
run_gpu_tests.pyis never clean and a real race in the translator would not stand out. They are what is left of the list @natterman12 posted after #382: #412 fixedcs_w32_lds_subdword, #1309 fixedcs_w32_lds_wide, #481 hascs_pk_mul_lo_const. This does the rest the same way, in the fixtures only.cs_lds_atomics_ext,cs_lds_b64_cmpst,cs_lds_xchg64_ext,cs_w32_fcmpswap,cs_w32_misc_extandcs_w32_new_opsalready run on lane 0 alone. They seed a word withds_write, change it with an atomic op and read it back withds_read, and the layer reports the plain access next to the atomic one (RaceOnLoadStoreVsAtomic). Ans_barriernow separates each run of plain LDS accesses (ds_read*,ds_write*) from each run of atomic ones. It goes after thes_waitcnt lgkmcnt(0)that ends the earlier run; one place incs_lds_b64_cmpsthad no wait between a read and the nextds_cmpst_b32and gets one.No instruction that computes a result changes, and neither do the expected words. Where a fixture's words were measured on hardware, the listing measured there differs from this one by those barriers; I have no RDNA2 hardware to run them on again. The three fixtures that have a checked-in listing are regenerated with
tests/semantic/regen_fixtures.py.This pull request first also moved the lane-0 mask in
cs_w32_lds_wide. #1309 landed that onmain, so the rebase dropped it here.Tested
Windows 11 26200.9974, RTX 3060 Ti (driver 621.14, 32-wide subgroups),
main3f81d46ac, test programs built from it with MSVC 19.44,llvm-mc23.1.6, SPIRV-Tools v2026.4,VK_LAYER_KHRONOS_validation1.4.357 loaded throughVK_INSTANCE_LAYERSwithVK_KHRONOS_VALIDATION_GPUAV_ENABLE=1. The branch ismain3f81d46acplus this one commit.Validation errors per fixture, the same natively and with
LEONIDA_W64_EMULATE=1:mains_barrieraddedcs_w32_misc_extRaceOnLoadStoreVsAtomiccs_w32_new_opscs_lds_b64_cmpstcs_w32_fcmpswapcs_lds_xchg64_extcs_lds_atomics_extAll six print the same eight words before and after, in both modes.
Whole suite,
run_gpu_tests.pywith the layer loaded for every test program (284 runs):mainLEONIDA_W64_EMULATE=1The one failure is
cs_imgatomic_ext, in both trees and both modes; onmainit fails without the layer too (#1518 addresses it). The one fixture left with a validation error iscs_pk_mul_lo_const(#481).tests/semantic/regen_fixtures.py --check: clean.4a50cafc7:scripts/run_semantic_tests.py tests/semantic471 files, 6177 tests, 1 file failed,test_image_cube_store_glc(LlvmMcRoundTrip), which failed the same way onmainon this host. Not rerun after the rebase; the change since is the dropped fixture.python -I scripts/check_no_game_data.pyon the 9 changed files: no hits.git diff --check: clean.GPUs tested: NVIDIA GeForce RTX 3060 Ti (Ampere), driver 621.14, Vulkan 1.4.357, Windows 11 26200. @Gefik23 ran the earlier head on an RTX 4060 (comment).
AI-assisted: yes (Claude Code; run and measured on the machine above)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed: n/a (fixtures only, no translator change).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.