Skip to content

gpuav: Allow a runtime coopmat stride in the data race pass - #13104

Merged
spencer-lunarg merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:gpuav-coopmat-runtime-stride
Sep 16, 2026
Merged

spencer-lunarg merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:gpuav-coopmat-runtime-stride

Conversation

@apollo-2006

Copy link
Copy Markdown
Contributor

Fixes #13098.

SharedMemoryDataRacePass treated the Stride operand of coopmat load/store as a constant, so a stride computed at runtime made GetConstantUInt32FromId dereference null and crash vkCreateComputePipelines. SPIR-V only requires MemoryLayout to be a constant; Stride can be any integer.

The stride now goes through the existing constant path when it is a constant. Otherwise the runtime value is passed straight to the instrumentation call, with an OpBitcast (signed 32-bit) or OpUConvert (other widths) to get a uint32, the same way DebugPrintfPass handles integer arguments.

Tests: StoreBarrierCoopMatLoadRuntimeStride and CoopMatStoreBarrierLoadRuntimeStride are copies of the existing coopmat positive tests with a runtime stride. Both crash without this change and pass with it on RADV (RX 9070 XT, Mesa 26.2.2). The rest of *GpuAVSharedMemoryDataRace* is unaffected there (71 passed, 6 skipped, 0 failed).

The Stride operand of OpCooperativeMatrixLoadKHR and
OpCooperativeMatrixStoreKHR can be any integer value, but the shared
memory data race pass passed it to GetConstantUInt32FromId, which
dereferences a null constant when the stride is not a constant. Pipeline
creation then crashed for a coopmat load or store on shared memory with a
runtime stride.

Use the constant path only when the stride is a constant, and otherwise
pass the runtime value to the instrumentation function as a uint32.

Fixes KhronosGroup#13098
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build.

@CLAassistant

CLAassistant commented Sep 15, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@spencer-lunarg spencer-lunarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If CI is happy and @jeffbolznv is happy, this seems reasonable to me

@apollo-2006
apollo-2006 marked this pull request as ready for review September 15, 2026 18:46
@apollo-2006
apollo-2006 requested a review from a team as a code owner September 15, 2026 18:46
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 119586.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24505 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24505 passed.

@spencer-lunarg
spencer-lunarg merged commit f1478c9 into KhronosGroup:main Sep 16, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPU-AV: SharedMemoryDataRacePass segfaults on coopmat load/store into shared memory with a non-constant stride

5 participants