Skip to content

gpuav: Use Pointer type size for coopmat stride - #13276

Merged
spencer-lunarg merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:gpuav-coopmat-align-units
Oct 1, 2026
Merged

spencer-lunarg merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:gpuav-coopmat-align-units

Conversation

@apollo-2006

Copy link
Copy Markdown
Contributor

Ran into this on RADV. Per SPV_KHR_cooperative_matrix Issue 8, coopmat Stride and element index are in units of the pointed-to type, but GPU-AV was using the matrix component size in both the 08986 alignment check and the 06936 bounds check.

That's what was breaking two tests on RADV:

  • NegativeGpuAVDescriptorClassGeneralBufferCoopMat.ElementSize got a false 08986 (uint8 matrix at uvec4[] element 33 is byte 528, not 33).
  • .Load's shader is actually misaligned, and the wrong units were hiding it.

While in there, I noticed GetLastByte's runtime-stride path was overwriting sum_id and dropping the access chain offset, so I fixed that too.

Now Stride and the element index use the pointee size, and everything else still uses the component size. Untyped pointers keep the old behavior.

I updated Load, DynamicStride, and DynamicElement to match, and added PositiveGpuAVShaderSanitizer.CoopMatAlignedVectorElement. On RADV, the full *GpuAV* run only changes those two tests plus the new one. I haven't looked at vec3 arrays (ArrayStride 16 vs size 12) yet.

@apollo-2006
apollo-2006 requested a review from a team as a code owner September 30, 2026 16:48
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

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

Stride and the element index of OpCooperativeMatrixLoadKHR and
OpCooperativeMatrixStoreKHR are in units of the type Pointer points
to, not the matrix component type. GPU-AV used the component size in
the 08986 alignment check and the 06936 bounds check, so a uint8
matrix loaded from a uvec4 array reported a false 08986, and a uint32
matrix loaded from a uint8 array hid real misalignment.
@spencer-lunarg
spencer-lunarg force-pushed the gpuav-coopmat-align-units branch from fc1b91e to 8764b12 Compare October 1, 2026 16:19
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

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

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 139710.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24759 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24759 passed.

@spencer-lunarg
spencer-lunarg merged commit 394ccee into KhronosGroup:main Oct 1, 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.

3 participants