{"record":{"id":"b9aaa166e530c50d","repo":"stride3d/stride","slug":"ex-message-bytecode-stages-0-id-entrypoints","errorCode":null,"errorMessage":"{ex.Message} (bytecode {stages[0].Id} [{entryPoints}])","messagePattern":"(.+?) \\(bytecode (.+?) \\[(.+?)\\]\\)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Graphics/Vulkan/PipelineState.Vulkan.cs","lineNumber":60,"sourceCode":"\n        internal PipelineState(GraphicsDevice graphicsDevice, PipelineStateDescription pipelineStateDescription) : base(graphicsDevice)\n        {\n            Description = pipelineStateDescription.Clone();\n            Recreate();\n        }\n\n        private unsafe void Recreate()\n        {\n            // Note: important to pin this so that stages[x].Name is valid during this whole function\n            try\n            {\n                fixed (void* defaultEntryPointData = defaultEntryPoint) // null if array is empty or null\n                    RecreateInner();\n            }\n            catch (InvalidOperationException ex) when (Description.EffectBytecode?.Stages is { Length: > 0 } stages)\n            {\n                var entryPoints = string.Join(\", \", stages.Select(s => $\"{s.Stage}:{Encoding.UTF8.GetString(s.EntryPoint).TrimEnd('\\0')}\"));\n                throw new InvalidOperationException($\"{ex.Message} (bytecode {stages[0].Id} [{entryPoints}])\", ex);\n            }\n        }\n\n        private unsafe void RecreateInner()\n        {\n            if (Description.RootSignature == null)\n                return;\n\n            CreatePipelineLayout(Description);\n\n            // Create shader stages\n            var stages = CreateShaderStages(Description);\n\n            if (IsCompute)\n            {\n                fixed (VkPipelineShaderStageCreateInfo* fStages = stages)\n                {\n                    var createInfo = new VkComputePipelineCreateInfo","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Graphics/Vulkan/PipelineState.Vulkan.cs#L42-L78","documentation":"When PipelineState.Recreate() fails, this catch block rethrows the underlying InvalidOperationException with added diagnostic context: the effect bytecode's stage id and the list of shader entry points (stage:name pairs). The original exception is preserved as InnerException. It exists to make pipeline (re)creation failures attributable to a specific shader bytecode, which is invaluable when debugging effects that fail only at runtime re-creation (e.g. after device loss).","triggerScenarios":"Any InvalidOperationException thrown inside RecreateInner() during PipelineState creation or OnRecreate (e.g. missing root signature, invalid shader stages, driver rejection) while Description.EffectBytecode has at least one stage.","commonSituations":"Shader compilation/compilation-effect mismatch; pipeline state referencing an effect bytecode whose entry points don't match compiled shaders; device-lost recovery path (OnRecreate) failing after a GPU reset.","solutions":["Inspect the InnerException for the root cause (it contains the original message).","Verify the EffectBytecode's stages and entry point names match the compiled shader sources.","Recompile/reimport the effect (check EffectBytecode generation in the effect compiler) and rebuild assets.","If it occurs after device loss, verify the pipeline can be rebuilt with the same bytecode on the new device."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify bytecode entry points before pipeline creation\nforeach (var stage in bytecode.Stages)\n    if (stage.EntryPoint == null || stage.EntryPoint.Length == 0)\n        throw new InvalidOperationException($\"Stage {stage.Stage} missing entry point\");","typeGuard":"bool HasStages(PipelineStateDescription d) => d.EffectBytecode?.Stages is { Length: > 0 };","tryCatchPattern":"try { pipeline = new PipelineState(device, desc); }\ncatch (InvalidOperationException ex) {\n    log.Error($\"Pipeline creation failed for bytecode {ex.InnerException?.Message}\", ex);\n    // ex.Message includes bytecode id + entry points; ex.InnerException has root cause\n}","preventionTips":["Log EffectBytecode id and entry points at pipeline creation time","Regenerate effect bytecode after shader source changes","Test device-lost/OnRecreate paths so re-creation failures surface in dev","Keep the effect compiler output and runtime bytecode versions in sync"],"tags":["vulkan","pipeline-state","shader-bytecode","recreation"],"backgroundTag":"invalid-state-transition","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}