tests: the LDS GPU fixtures order plain and atomic accesses (TEST-LDS-FIXTURE-ORDER) #1352
Closed
leonida/mandy
klikso wants to merge 0 commits from
test/lds-fixture-order into main
pull from: test/lds-fixture-order
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!1352
Loading…
Reference in a new issue
No description provided.
Delete branch "test/lds-fixture-order"
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 closed
This pull request cannot be reopened because the branch was deleted.
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
Tested dcc36c527 on NVIDIA GeForce RTX 4060 (Ada), driver 617.42, Windows 11 Pro build 26200, native Windows: pass for the fixtures this host can run.
Built at this head with
scripts\build_runtime.ps1(MSVC 19.44, Ninja, RelWithDebInfo, Vulkan SDK 1.4.363.0). No llvm-mc here, sorun_gpu_tests.py --disasm-dir tests/semantic/fixtures/disasmwithLEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1, native and withLEONIDA_W64_EMULATE=1. That subset has four of the seven fixtures (cs_w32_fcmpswap,cs_w32_lds_wide,cs_w32_misc_ext,cs_w32_new_ops); the threecs_lds_*ones were not run.cs_pk_mul_lo_const(VUID-RuntimeSpirv-PhysicalStorageBuffer64-11819, #481) in both modes, and 16 wave64 fixtures with 6 errors each underLEONIDA_W64_EMULATE=1only (the sink-word race #1110 clears).AI-assisted (Claude Code ran the build and tests). No game files.
Rebased onto
main3f81d46ac; the head moved fromdcc36c527toffb9ff07e. #1309 landed thecs_w32_lds_widechange onmainin the meantime, so the rebase tookmain's version of that fixture and this pull request now covers the six atomic fixtures only (9 files instead of 11). The barriers in those six are unchanged.Measured again on the new head, RTX 3060 Ti, test programs built from
3f81d46ac: each of the six prints 1RaceOnLoadStoreVsAtomiconmainand 0 on the branch, natively and withLEONIDA_W64_EMULATE=1, with the same eight words. A validated run of the whole suite goes from 7 fixtures with an error to 1 (cs_pk_mul_lo_const, #481) in both modes. The description has the tables. Thanks @Gefik23 for the RTX 4060 run on the earlier head. AI-assisted (Claude Code).Tested
ffb9ff07emerged ontomain57ba40bd6(merges cleanly here), native Windows 11 Pro 26H2 (build 26300), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 RelWithDebInfo + Ninja, llvm-mc 21.1.8 (scripts/build_llvm_mc.ps1), so all six fixtures ran, including the threecs_lds_*ones the earlier RTX 4060 run had no listing for.With
LEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1, one fixture per run:mainLEONIDA_W64_EMULATE=1Whole suite without validation: 209/263 passed, 53 skipped on both
mainand the branch; the one failure,cs_imgatomic_ext, is the same onmain.AI-assisted testing (non-developer tester).
Native Windows 11 + NVIDIA GeForce RTX 3090 GPU Verification (
PASS)Verified commit
ffb9ff07e2merged ontomain(a9e247cd69) on Windows 11 (10.0.26200, MSVC19.44.35228, Python3.12.10,llvm-mcgfx1030) with physical NVIDIA GeForce RTX 3090 (driver610.88, subgroup32..32, Vulkan1.4+VK_LAYER_KHRONOS_validation1.4.363.1):.asmfixtures and 3 semantic.sdisassembly fixtures: everyds_write*->ds_*atomic (ds_mskor*,ds_xor_rtn_b64,ds_and_b64,ds_add_rtn_f32,ds_inc_rtn_u32/ds_rsub_u32,ds_cmpst*,ds_wrxchg*,ds_or_rtn_b64,ds_min_f32/ds_max_rtn_f32) ->ds_read*hazard now carriess_waitcnt lgkmcnt(0)+s_barrierso multi-subgroup execution cannot race plain LDS stores/loads against LDS atomics.build.py->6/6 translated, 6 pass spirv-val,vk_compute_test <spv> 1 dumpwithLEONIDA_VK_VALIDATION=1):cs_lds_atomics_ext:1 groups x 64: 0 mismatches,0validation errors ([0xf0f11234, 0xab34cd78, 0x12345678, 0xf0f00f0f, 0xa5a55a5a, 0x00aa00aa, 0x7fb00000, 0xfe090700]).cs_lds_b64_cmpst:1 groups x 64: 0 mismatches,0validation errors ([0x11110001, 0x22220002, 0x33330003, 0x44440004, 0xcccc000c, 0x44440004, 0xbbbb000b, 0x3579badc]).cs_lds_xchg64_ext:1 groups x 64: 0 mismatches,0validation errors ([0x11110003, 0x33333333, 0xf00ff000, 0x04030201, 0x40302010, 0x70500705, 0x3fc00000, 0x80000000]).cs_w32_fcmpswap:1 groups x 64: 0 mismatches,0validation errors ([0x0, 0x3f800000, 0x7fc00000, 0x3f800000, 0x80000000, 0x40400000, 0x3f800000, 0x7fc00000]).cs_w32_misc_ext:1 groups x 64: 0 mismatches,0validation errors ([0x0fff0fff, 0xe2c4a688, 0x0007ffff, 0x7fff8000, 0xfffe0002, 0xffff0005, 0x00000509, 0xcafef00d]).cs_w32_new_ops:1 groups x 64: 0 mismatches,0validation errors ([0x55, 0x8001, 0xc0000000, 0x80014000, 0x4000ffff, 0x77, 0x99, 0x1234]).401/401tests/semantic/test_*lds*.pyOK(42.7s) andpython -I scripts/check_no_game_data.pyclean (0issues).AI-assisted.
Verified by OreoFR
48bae6cad+ PR headffb9ff07e(tested as a merge)python -m unittest discover -s tests/semantic -p test_fcmpswap_fixture.pyand-p test_misc_ext_fixture.py; runtime buildscripts/run_gpu_tests.py), not run here: the GPU was busy with another jobgta6rt.exebuilds and links;dumpbin /dependentsshows the same DLLs as main, no network DLL)5825b02ff)AI-assisted (Claude Code, Claude Opus 5.5).
LGTM. Adding
s_barrierbetween plain LDS writes/reads and LDS atomics across the six LDS fixtures (and matching semantic disasms) cleanly fixes the synchronization ordering without regressions. Clean-room verified,MERGEABLE, and independently verified on NVIDIA hardware and semantic tests. Holding merge until a fresh green CI pass completes on currentmain.(AI-assisted review.)
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.