{"record":{"id":"10a523deb3d3fcce","repo":"stride3d/stride","slug":"unable-to-find-compiled-shaders-0-for-mixin-1-with","errorCode":null,"errorMessage":"Unable to find compiled shaders [{0}] for mixin [{1}] with parameters [{2}]","messagePattern":"Unable to find compiled shaders \\[(.+?)\\] for mixin \\[(.+?)\\] with parameters \\[(.+?)\\]","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"sources/shaders/Stride.Shaders.Effects/Compiler/EffectCompilerCache.cs","lineNumber":105,"sourceCode":"            var bytecode = new KeyValuePair<EffectBytecode, EffectBytecodeCacheLoadSource>(null, EffectBytecodeCacheLoadSource.JustCompiled);\n            lock (bytecodes)\n            {\n                // ------------------------------------------------------------------------------------------------------------\n                // 1) Try to load latest bytecode\n                // ------------------------------------------------------------------------------------------------------------\n                ObjectId bytecodeId;\n                if (database.ContentIndexMap.TryGetValue(compiledUrl, out bytecodeId))\n                {\n                    bytecode = LoadEffectBytecode(database, bytecodeId);\n                }\n\n                // On non Windows platform, we are expecting to have the bytecode stored directly\n                if (Compiler is NullEffectCompiler && bytecode.Key == null)\n                {\n                    var stringBuilder = new StringBuilder();\n                    stringBuilder.AppendFormat(\"Unable to find compiled shaders [{0}] for mixin [{1}] with parameters [{2}]\", compiledUrl, mixin, compilerParameters.ToStringPermutationsDetailed());\n                    Log.Error(stringBuilder.ToString());\n                    throw new InvalidOperationException(stringBuilder.ToString());\n                }\n\n                // ------------------------------------------------------------------------------------------------------------\n                // 2) Try to load from database cache\n                // ------------------------------------------------------------------------------------------------------------\n                if (bytecode.Key == null && database.ObjectDatabase.Exists(effectInputHash))\n                {\n                    using (var stream = database.ObjectDatabase.OpenStream(effectInputHash))\n                    {\n                        // We have an existing stream, make sure the shader is compiled\n                        var objectIdBuffer = new byte[ObjectId.HashSize];\n                        if (stream.Read(objectIdBuffer, 0, ObjectId.HashSize) == ObjectId.HashSize)\n                        {\n                            var newBytecodeId = new ObjectId(objectIdBuffer);\n                            bytecode = LoadEffectBytecode(database, newBytecodeId);\n\n                            if (bytecode.Key != null)\n                            {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Effects/Compiler/EffectCompilerCache.cs#L87-L123","documentation":"When compiling via the cache, if the compiler is NullEffectCompiler (runtime platforms where shader compilation is forbidden) and no bytecode was found, the cache logs and throws InvalidOperationException: the precompiled shader was not found for this mixin/parameter combination. It means the deployment is missing compiled effect bytecode for the requested effect permutation.","triggerScenarios":"Requesting an effect at runtime on a platform using NullEffectCompiler, where the effect's bytecode was never compiled at build time — e.g. a new/changed ShaderMixinSource+EffectCompilerParameters permutation absent from the precompiled bundle.","commonSituations":"Changing effect permutations or shader mixins after the last effect-compilation build step; deploying assets without running the EffectCompiler pipeline; calling effects from code that were never referenced at build time.","solutions":["Re-run the shader/effect compilation step (Stride editor effect compile / build) so the new permutation is cached into the bundle.","Ensure the compiled effects database (EffectDescriptors) is deployed with the application and mounted via the file provider.","Avoid dynamic effect permutations at runtime on compilation-restricted platforms; pre-generate all needed ones.","Check the logged compiledUrl/mixin/parameters and make sure that exact permutation is requested at build time too."],"exampleFix":"// before (runtime on console/mobile with NullEffectCompiler)\nvar bytecode = effectSystem.LoadEffect(mixinSource, parameters).WaitFor_result();\n// after: precompile at build time in the editor (Game Studio effect compile), then load the same permutation\nvar bytecode = effectSystem.LoadEffect(mixinSource, sameParametersAsBuild).WaitForResult();","handlingStrategy":"fallback","validationCode":"if (!effectDatabase.ObjectDatabase.Exists(effectInputHash)) throw new InvalidOperationException($\"Effect permutation {effectInputHash} was not precompiled; rerun the build-time effect compile\");","typeGuard":"null","tryCatchPattern":"try { result = compiler.Compile(mixin, parameters, compilerParameters, hash); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"Unable to find compiled shaders\")) { /* fail fast with guidance to re-run build-time effect compilation */ }","preventionTips":["Run the effect-compilation build step after any shader/effect change","Pre-declare all runtime effect permutations","Verify the compiled-effects database is included in deployment","Match runtime EffectCompilerParameters to build-time ones"],"tags":["shaders","cache-miss","deployment","runtime"],"backgroundTag":"resource-not-found","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"}