Skip to content

kyty: AMDVLK crashes in vkCreateComputePipelines on 3D/PRT tiler shaders with vector OpSpecConstantOp Select #341

Backlog

Description

@birdmarty

Summary

On AMD's Windows Vulkan driver (amdvlk64.dll), TileManager::CreatePipeline crashes with an access violation (0xc0000005 at amdvlk64.dll+0x22240ac) inside vkCreateComputePipelines when specializing the 64 KB 3D or PRT tiler compute shaders (gpu_tiler_standard64_3d.comp, gpu_tiler_prt.comp, gpu_tiler_prt_3d.comp).

Reproduction

  • In a title: Lies of P (PPSA10621 01.012.000) crashes immediately when entering the 3D title menu (on top of 6af9ec8 + fix(kyty): place mesh per-primitive built-ins in a Block struct #328).
  • Standalone: Calling vkCreateComputePipelines on GPU_TILER_STANDARD64_3D_SPV, GPU_TILER_PRT_SPV, or GPU_TILER_PRT_3D_SPV with VkSpecializationInfo (ELEMENT_BYTES in {1, 2, 4, 8, 16}, TILE in {0, 1}) segfaults inside amdvlk64.dll with 0xc0000005.

Root cause

In three tiler shader sources:

  • core/kyty/graphics/host_gpu/shaders/gpu_tiler_prt.comp
  • core/kyty/graphics/host_gpu/shaders/gpu_tiler_prt_3d.comp
  • core/kyty/graphics/host_gpu/shaders/gpu_tiler_standard64_3d.inc

the 4-component shift vector uvec4 s is computed with a chained ternary expression on the ELEMENT_BYTES specialization constant (ELEMENT_BYTES == 1 ? uvec4(...) : ...).

When compiled with glslang -V --target-env vulkan1.3 -Os, those chained vector ternaries lower to OpSpecConstantOp %v4uint Select .... Although valid SPIR-V (passes spirv-val), AMDVLK's shader compiler crashes when lowering vector-typed OpSpecConstantOp Select during specialization.

An audit of all embedded shaders under core/kyty/graphics/host_gpu/shaders/ shows no other shader emits vector OpSpecConstantOp Select (all other ELEMENT_BYTES ternaries are scalar uint, and standard64_3d_extent() in gpu_tiler_standard64_3d.inc already uses if (ELEMENT_BYTES == ...) branches).

Proposed fix

Replace the chained vector ternaries in gpu_tiler_prt.comp, gpu_tiler_prt_3d.comp, and gpu_tiler_standard64_3d.inc with if / else if / else statements, and add a regression test that:

  1. Validates all 13 embedded tiler SPIR-V modules with spirv-val and rejects vector OpSpecConstantOp Select.
  2. Compiles all 90 specialized tiler compute pipelines on Vulkan and verifies GPU Tile and Detile output for Standard64KB3D, Prt64KB, and Prt64KB3D across all five element sizes (1, 2, 4, 8, 16 bytes) bit-for-bit against CPU TileGetBlockOffset.

Environment

  • OS: Windows 11 Pro (build 26300)
  • CPU: Intel Core i9-9900K
  • GPU: AMD Radeon RX 6800
  • Driver: AMD proprietary driver 26.11.2 (AMDVLK 2.0.353, Vulkan 1.4.315)
  • Base commit: 6af9ec8

AI-assisted: yes (Antigravity).

Activity

  1. github-actions commented on Nov 26, 2026

    @github-actions

    Thanks for isolating this to the tiler shaders. Please open a single fix(kyty): … PR against AnyKyty with the shader changes, regenerated embedded SPIR-V, and title-independent regression coverage. The key verification is a before-and-after run on the affected Windows AMD driver: show that the regenerated shaders no longer emit vector OpSpecConstantOp Select, that the specialized pipelines build, and that tile and detile output matches the CPU reference bit-for-bit. Include the results in the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions