{"record":{"id":"9d72ef0d005fa946","repo":"stride3d/stride","slug":"can-t-find-method-group-info-for-context-names-function","errorCode":null,"errorMessage":"Can't find method group info for {context.Names[function.ResultId]}","messagePattern":"Can't find method group info for (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Compilers/SDSL/ShaderMixer.cs","lineNumber":1081,"sourceCode":"                    }\n\n                    if ((selectedMethod.Flags & FunctionFlagsMask.Abstract) != 0)\n                        throw new InvalidOperationException($\"Trying to call an abstract method {selectedMethod.Shader.ShaderName}.{methodGroupEntry.Name}\");\n                    functionId = selectedMethod.MethodId;\n\n                    memberAccesses.Add(memberAccess.ResultId, functionId);\n                }\n                else\n                {\n                    throw new InvalidOperationException($\"Member {memberAccess.Member} not found\");\n                }\n\n                SetOpNop(i.Data.Memory.Span);\n            }\n            else if (i.Data.Op == Op.OpFunction && (OpFunction)i is { } function && temp[index + 1].Op == Op.OpFunctionMetadataSDSL && (OpFunctionMetadataSDSL)temp[index + 1] is { } functionInfo)\n            {\n                if (!mixinNode.MethodGroups.TryGetValue(function.ResultId, out var methodGroupEntry))\n                    throw new InvalidOperationException($\"Can't find method group info for {context.Names[function.ResultId]}\");\n            }\n            else if (i.Data.Op == Op.OpFunctionEnd)\n            {\n                memberAccesses.Clear();\n            }\n\n            SpirvBuilder.RemapIds(memberAccesses, ref i.Data);\n        }\n    }\n\n\n    static void SetOpNop(Span<int> words)\n    {\n        words[0] = words.Length << 16;\n        words[1..].Clear();\n    }\n\n    public static void OffsetIds(OpData inst, int offset)","sourceCodeStart":1063,"sourceCodeEnd":1099,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Compilers/SDSL/ShaderMixer.cs#L1063-L1099","documentation":"When the mixer encounters an OpFunction immediately followed by OpFunctionMetadataSDSL, the function being defined must already have a method group registered under its result id in the mixin node. A missing entry means the function definition has no method-group metadata — an inconsistency between the function-definition pass and earlier method-group registration.","triggerScenarios":"ShaderMixer constructor sees Op.OpFunction whose next op is OpFunctionMetadataSDSL; mixinNode.MethodGroups does not contain function.ResultId.","commonSituations":"Stale or hand-edited compiled shader bytecode missing metadata registration; the function was defined in a shader not properly registered into this mixin node; a mixing-pass ordering bug or cache mismatch between metadata and method groups.","solutions":["Recompile/rebuild the shaders so method-group registration and function metadata are consistent.","Ensure the shader defining the function is properly composed into this mixin node.","Check that the function was declared (not just defined) so its method group gets registered.","If reproducible on fresh sources, report as a likely mixer bug with the SDSL sources attached."],"exampleFix":"// before: function defined without prior declaration/metadata in the mixin\nvoid UndeclaredFn() { ... }\n// after: declare it so the method group is registered\nvoid UndeclaredFn(); // declaration registers the method group\nvoid UndeclaredFn() { ... }","handlingStrategy":"try-catch","validationCode":"// Every OpFunction with metadata must have a registered method group in the mixin\nif (!mixinNode.MethodGroups.ContainsKey(functionResultId))\n    throw new InvalidOperationException($\"Function '{name}' defined without method-group registration; rebuild shaders\");","typeGuard":null,"tryCatchPattern":"try { var mixed = mixer.Process(...); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Can't find method group info\"))\n{\n    log.Error(ex, \"Function definition lacks method-group metadata; rebuild shader caches, and report a mixer bug if reproducible from clean sources\");\n    throw;\n}","preventionTips":["Rebuild shader caches whenever SDSL sources or the Stride version change.","Declare functions before/alongside definitions so method groups are registered.","Avoid hand-editing intermediate compiled shader data.","If it reproduces on clean sources, file a bug with the SDSL files and composition setup."],"tags":["shader","sdsl","method-group","internal-state"],"backgroundTag":"internal-invariant-violation","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"}