{"record":{"id":"f3c5a3817520bc6f","repo":"gfx-rs/wgpu","slug":"not-implemented-f3c5a3","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"naga/src/back/spv/block.rs","lineNumber":1167,"sourceCode":"                            } => {\n                                //TODO: why not just rely on `Fadd` for matrices?\n                                self.write_matrix_matrix_column_op(\n                                    block,\n                                    id,\n                                    result_type_id,\n                                    left_id,\n                                    right_id,\n                                    columns,\n                                    rows,\n                                    scalar.width,\n                                    spirv::Op::FAdd,\n                                );\n\n                                self.cached[expr_handle] = id;\n                                return Ok(());\n                            }\n                            crate::TypeInner::CooperativeMatrix { .. } => spirv::Op::FAdd,\n                            _ => unimplemented!(),\n                        },\n                        crate::BinaryOperator::Subtract => match *left_ty_inner {\n                            crate::TypeInner::Scalar(scalar)\n                            | crate::TypeInner::Vector { scalar, .. } => match scalar.kind {\n                                crate::ScalarKind::Float => spirv::Op::FSub,\n                                _ => spirv::Op::ISub,\n                            },\n                            crate::TypeInner::Matrix {\n                                columns,\n                                rows,\n                                scalar,\n                            } => {\n                                self.write_matrix_matrix_column_op(\n                                    block,\n                                    id,\n                                    result_type_id,\n                                    left_id,\n                                    right_id,","sourceCodeStart":1149,"sourceCodeEnd":1185,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/naga/src/back/spv/block.rs#L1149-L1185","documentation":"A `unimplemented!()` panic in naga's SPIR-V backend (`cache_expression_value`, called from `write_block`) while selecting the SPIR-V opcode for a binary Add. Scalar and vector operands select FAdd/ISub-style ops per scalar kind, and `CooperativeMatrix` selects `OpFAdd`, but any other operand type (e.g. matrices or unexpected type inners) falls into `_ => unimplemented!()`. It indicates the SPIR-V writer lacks an opcode mapping for the addition's operand type.","triggerScenarios":"Evaluating an addition expression whose left operand type is neither scalar, vector, nor CooperativeMatrix — e.g. a matrix add or an unexpected type inner reaching the SPIR-V block writer.","commonSituations":"Shaders using additions on types the SPIR-V writer doesn't map (such as matrix arithmetic on some paths); internal IR lowered in ways that produce non-scalar/vector adds; testing cooperative matrix or novel type support.","solutions":["Rewrite the shader so additions operate on scalars/vectors (decompose matrix adds into component-wise vector ops).","Lower the addition before SPIR-V emission (e.g. via naga's lowering passes) so the expression reaches the backend in a supported form.","Upgrade naga or file an upstream issue with the failing WGSL module to get the opcode mapping added."],"exampleFix":"// before: matrix + matrix add reaching SPIR-V writer unhandled\nlet m = a + b;\n// after: component-wise via vectors/loops\nfor (var i = 0u; i < 4u; i++) { m[i] = a[i] + b[i]; }","handlingStrategy":"validation","validationCode":"fn add_operands_supported(left_ty: &naga::TypeInner) -> bool {\n    matches!(left_ty,\n        naga::TypeInner::Scalar(_) | naga::TypeInner::Vector { .. } |\n        naga::TypeInner::CooperativeMatrix { .. })\n}","typeGuard":"fn is_scalar_or_vector(t: &naga::TypeInner) -> bool {\n    matches!(t, naga::TypeInner::Scalar(_) | naga::TypeInner::Vector { .. })\n}","tryCatchPattern":"let result = std::panic::catch_unwind(|| spv::write_pipeline(...)).map_err(|_| TranslateError::UnsupportedBinaryOp);","preventionTips":["Only add scalars, vectors, or cooperative matrices in SPIR-V-targeted shaders","Decompose composite adds into component-wise operations","Validate expression operand types against backend opcode coverage before emission"],"tags":["naga","spirv","binary-operator","unimplemented","panic"],"backgroundTag":"unimplemented-backend-feature","analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}