{"record":{"id":"db143abc02e2e18e","repo":"stride3d/stride","slug":"unsupported-integer-type-width-intinstruction-width-signed","errorCode":null,"errorMessage":"Unsupported integer type: width={intInstruction.Width}, signed={intInstruction.Signedness == 1}","messagePattern":"Unsupported integer type: width=(.+?), signed=(.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/Shader.cs","lineNumber":171,"sourceCode":"\n                RegisterType(floatInstruction.ResultId, floatInstruction.Width switch\n                {\n                    16 => ScalarType.Half,\n                    32 => ScalarType.Float,\n                    64 => ScalarType.Double,\n                    _ => throw new InvalidOperationException(),\n                });\n            }\n            else if (instruction.Op == Op.OpTypeInt)\n            {\n                OpTypeInt intInstruction = instruction;\n                RegisterType(intInstruction.ResultId, (intInstruction.Width, intInstruction.Signedness == 1) switch\n                {\n                    (32, true) => ScalarType.Int,\n                    (32, false) => ScalarType.UInt,\n                    (64, true) => ScalarType.Int64,\n                    (64, false) => ScalarType.UInt64,\n                    _ => throw new NotSupportedException($\"Unsupported integer type: width={intInstruction.Width}, signed={intInstruction.Signedness == 1}\"),\n                });\n            }\n            else if (instruction.Op == Op.OpTypeBool)\n            {\n                OpTypeBool boolInstruction = instruction;\n                RegisterType(boolInstruction.ResultId, ScalarType.Boolean);\n            }\n            else if (instruction.Op == Op.OpTypePointer && (OpTypePointer)instruction is { } pointerInstruction)\n            {\n                var innerType = context.ReverseTypes[pointerInstruction.Type];\n                RegisterType(pointerInstruction.ResultId, new PointerType(innerType, pointerInstruction.StorageClass));\n            }\n            else if (instruction.Op == Op.OpTypeVoid && (OpTypeVoid)instruction is { } voidInstruction)\n            {\n                RegisterType(voidInstruction.ResultId, ScalarType.Void);\n            }\n            else if (instruction.Op == Op.OpTypeVector && (OpTypeVector)instruction is { } vectorInstruction)\n            {","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/AST/Shader.cs#L153-L189","documentation":"Thrown in ProcessNameAndTypes when translating an OpTypeInt SPIR-V instruction whose bit width / signedness combination is not one of the four supported integer types (32-bit or 64-bit, signed or unsigned). The SPIR-V module contains an integer type the SDSL type system cannot represent.","triggerScenarios":"Processing an imported/generated SPIR-V module containing OpTypeInt with Width 8, 16, or any value other than 32/64 (e.g. 8-bit or 16-bit integers from external SPIR-V, or Signedness values other than 0/1 producing odd width data).","commonSituations":"Importing SPIR-V produced by other toolchains using 8/16-bit integer types (e.g. with shaderInt8/shaderInt16 features enabled); hand-authored or third-party SPIR-V binaries; interface-mismatch when mixing SPIR-V modules from different generators.","solutions":["Regenerate/normalize the SPIR-V to use 32-bit (or 64-bit) integers only","Avoid enabling 8/16-bit integer features in the producing compiler for code crossing this boundary","Extend the mapping in ProcessNameAndTypes if narrow integer support is required"],"exampleFix":"// before\n%int8 = OpTypeInt 8 0 // unsupported width\n// after\n%int = OpTypeInt 32 0","handlingStrategy":"validation","validationCode":"if (intInstruction.Width is not (32 or 64))\n    throw new NotSupportedException($\"Only 32/64-bit integers supported, got {intInstruction.Width}\");","typeGuard":"bool IsSupportedInt(uint width) => width is 32 or 64;","tryCatchPattern":"try { ProcessNameAndTypes(...); }\ncatch (NotSupportedException ex) { log.Error($\"SPIR-V integer type unsupported: {ex.Message}\"); throw; }","preventionTips":["Produce SPIR-V with 32-bit integers only","Disable shaderInt8/shaderInt16 features in producing compilers","Validate imported SPIR-V modules before processing"],"tags":["spirv","integer-types","shader-import"],"backgroundTag":"unsupported-dtype","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}