{"record":{"id":"617a86827c84a632","repo":"stride3d/stride","slug":"call-failed-result","errorCode":null,"errorMessage":"{call} failed: {result}","messagePattern":"(.+?) failed: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Tests/FrameRenderer.Vulkan.cs","lineNumber":60,"sourceCode":"    private VkDescriptorPool descriptorPool;\n    private VkDescriptorSet descriptorSet;\n    private VkPipelineLayout pipelineLayout;\n\n    // Everything created during a test, destroyed in PresentAndFinish\n    private readonly List<VkBuffer> buffers = [];\n    private readonly List<VkBufferView> bufferViews = [];\n    private readonly List<VkImage> images = [];\n    private readonly List<VkImageView> imageViews = [];\n    private readonly List<VkSampler> samplers = [];\n    private readonly List<VkDeviceMemory> memories = [];\n    private readonly List<VkPipeline> pipelines = [];\n    private readonly List<VkRenderPass> renderPasses = [];\n    private readonly List<VkFramebuffer> framebuffers = [];\n\n    private static void Check(VkResult result, [CallerArgumentExpression(nameof(result))] string call = null)\n    {\n        if (result != VkResult.Success)\n            throw new InvalidOperationException($\"{call} failed: {result}\");\n    }\n\n    private static bool? available;\n\n    /// <summary>\n    /// Whether a usable Vulkan 1.2+ device exists (loader present, instance and device selection succeed).\n    /// </summary>\n    public static bool CheckAvailable()\n    {\n        if (available == null)\n        {\n            try\n            {\n                EnsureSharedContext();\n                available = true;\n            }\n            catch\n            {","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Tests/FrameRenderer.Vulkan.cs#L42-L78","documentation":"Check() is the test helper that maps Vulkan API return codes to exceptions in the FrameRenderer.Vulkan test harness. Any vk* call returning something other than VkResult.Success is wrapped in an InvalidOperationException including the call expression and the VkResult. It is a generic gateway error — the actual cause is the specific Vulkan function that failed.","triggerScenarios":"Any Vulkan call routed through Check failing: instance/device creation, vkEnumeratePhysicalDevices, buffer creation etc., returning errors like VK_ERROR_INITIALIZATION_FAILED, VK_ERROR_OUT_OF_HOST_MEMORY, or IncompatibleDriver.","commonSituations":"Running tests on machines without a Vulkan loader/runtime; missing or incompatible GPU drivers; CI containers with no GPU or ICD files; requesting device features/versions the driver lacks.","solutions":["Install/repair a Vulkan runtime and vendor ICD (vulkaninfo should list a device)","Set VK_ICD_FILENAMES/VK_LOADER_DEBUG to diagnose loader failures","Enable the harness's software-rendering path (Lavapipe) when no GPU is available","Read the VkResult in the message and look up the specific Vulkan error code"],"exampleFix":"// before\nCheck(api.vkCreateInstance(&ci, null, out instance));\n// after\nvar result = api.vkCreateInstance(&ci, null, out instance);\nif (result != VkResult.Success)\n    Console.WriteLine($\"vkCreateInstance failed: {result}; loader debug: {Environment.GetEnvironmentVariable(\"VK_LOADER_DEBUG\")}\");\nCheck(result);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    Check(api.vkCreateInstance(&ci, null, out instance));\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"failed:\"))\n{\n    logger.LogError(ex, \"Vulkan call failed; VK_LOADER_DEBUG={Dbg}\", Environment.GetEnvironmentVariable(\"VK_LOADER_DEBUG\"));\n    throw;\n}","preventionTips":["Run `vulkaninfo --summary` before starting Vulkan-dependent tests","Set VK_LOADER_DEBUG=error for diagnosability in CI","Guard the whole Vulkan path behind a cheap availability probe","Log VkResult codes with the failing call expression"],"tags":["vulkan","native-interop","testing"],"backgroundTag":"api-error-response","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}