Summary
Add a runtime test (via slang-test) that exercises the abort intrinsic shipped in #11542, executing on a Vulkan device that supports the new VK_KHR_shader_abort API.
Requested by @jkwak-work in #11528 (comment).
Background
The feature currently has compile-/emit-side coverage, but no runtime test that actually runs an abort-using shader on a GPU and validates its behaviour. This issue tracks adding that runtime test.
What the test should do
- Compile a Slang shader that calls
abort(...) (with a format string + arguments) for a Vulkan/SPIR-V target.
- Run it on a Vulkan device using the new
VK_KHR_shader_abort API path, with the shaderAbort feature enabled (VkPhysicalDeviceShaderAbortFeaturesKHR) and the AbortKHR SPIR-V capability declared.
- Validate that the abort actually fires and that the abort message round-trips correctly (e.g. the format string + args reach the host).
Runtime-validation constraint (carried from triage)
Per the Vulkan proposal, abort ceases all further processing in the invocation and causes other invocations to terminate, which triggers device loss. Observing/validating the abort — in particular retrieving the abort message — requires VK_KHR_device_fault (vkGetDeviceFaultDebugInfoKHR() with a chained VkDeviceFaultShaderAbortMessageInfoKHR). Without VK_KHR_device_fault, the abort still causes device loss but the message cannot be retrieved.
Implications for this test:
- It needs a real GPU + Vulkan driver that supports both
VK_KHR_shader_abort (with the shaderAbort feature) and VK_KHR_device_fault.
- It is therefore not validatable in the current CI (no GPU; and the two extensions may not be available on available runners).
- The test should be gated on device-feature/extension detection at runtime and skipped where unsupported, and likely needs a dedicated GPU runner (or manual/local execution) until such infra exists. Expect it to run as a GPU-only / opt-in test rather than part of the default CI matrix.
Scope
Runtime slang-test coverage for abort only. The separate emit-side OpExtension token note (Gap C) stays flagged on #11528 and is out of scope here.
🤖 Generated by an automated Slang coworker — may be inaccurate. A human maintainer should verify.
Summary
Add a runtime test (via
slang-test) that exercises theabortintrinsic shipped in #11542, executing on a Vulkan device that supports the newVK_KHR_shader_abortAPI.Requested by @jkwak-work in #11528 (comment).
Background
VK_KHR_shader_abort(closed/completed).void abort<each T>(NativeString format, expand each T args)(overloading the existing SM4abort()), lowered tokIROp_Abort, emitted asOpAbortKHR(SPIR-V) /abortEXT(GLSL).The feature currently has compile-/emit-side coverage, but no runtime test that actually runs an
abort-using shader on a GPU and validates its behaviour. This issue tracks adding that runtime test.What the test should do
abort(...)(with a format string + arguments) for a Vulkan/SPIR-V target.VK_KHR_shader_abortAPI path, with theshaderAbortfeature enabled (VkPhysicalDeviceShaderAbortFeaturesKHR) and theAbortKHRSPIR-V capability declared.Runtime-validation constraint (carried from triage)
Per the Vulkan proposal,
abortceases all further processing in the invocation and causes other invocations to terminate, which triggers device loss. Observing/validating the abort — in particular retrieving the abort message — requiresVK_KHR_device_fault(vkGetDeviceFaultDebugInfoKHR()with a chainedVkDeviceFaultShaderAbortMessageInfoKHR). WithoutVK_KHR_device_fault, the abort still causes device loss but the message cannot be retrieved.Implications for this test:
VK_KHR_shader_abort(with theshaderAbortfeature) andVK_KHR_device_fault.Scope
Runtime
slang-testcoverage forabortonly. The separate emit-sideOpExtensiontoken note (Gap C) stays flagged on #11528 and is out of scope here.🤖 Generated by an automated Slang coworker — may be inaccurate. A human maintainer should verify.