{"record":{"id":"35b29fd44e667719","repo":"wasmerio/wasmer","slug":"unhandled-internal-variant","errorCode":null,"errorMessage":"Unhandled internal variant","messagePattern":"Unhandled internal variant","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"lib/compiler-llvm/src/translator/code.rs","lineNumber":4080,"sourceCode":"                let ((v1, i1), (v2, i2)) = self.state.pop2_extra()?;\n                let (v1, _) = self.v128_into_i32x4(v1, i1)?;\n                let (v2, _) = self.v128_into_i32x4(v2, i2)?;\n                let res = err!(self.builder.build_int_add(v1, v2, \"\"));\n                let res = err!(\n                    self.builder\n                        .build_bit_cast(res, self.intrinsics.i128_ty, \"\")\n                );\n                self.state.push1(res);\n            }\n            Operator::I32x4ExtAddPairwiseI16x8S | Operator::I32x4ExtAddPairwiseI16x8U => {\n                let extend_op = match op {\n                    Operator::I32x4ExtAddPairwiseI16x8S => {\n                        |s: &Self, v| s.builder.build_int_s_extend(v, s.intrinsics.i32x4_ty, \"\")\n                    }\n                    Operator::I32x4ExtAddPairwiseI16x8U => {\n                        |s: &Self, v| s.builder.build_int_z_extend(v, s.intrinsics.i32x4_ty, \"\")\n                    }\n                    _ => unreachable!(\"Unhandled internal variant\"),\n                };\n                let (v, i) = self.state.pop1_extra()?;\n                let (v, _) = self.v128_into_i16x8(v, i)?;\n\n                let left = err!(self.builder.build_shuffle_vector(\n                    v,\n                    v.get_type().get_undef(),\n                    VectorType::const_vector(&[\n                        self.intrinsics.i32_consts[0],\n                        self.intrinsics.i32_consts[2],\n                        self.intrinsics.i32_consts[4],\n                        self.intrinsics.i32_consts[6],\n                    ]),\n                    \"\",\n                ));\n                let left = err!(extend_op(self, left));\n                let right = err!(self.builder.build_shuffle_vector(\n                    v,","sourceCodeStart":4062,"sourceCodeEnd":4098,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/compiler-llvm/src/translator/code.rs#L4062-L4098","documentation":"In the LLVM backend's translator, the i32x4.extadd_pairwise_i16x8 implementation uses a match over operators to pick a sign/zero extension closure; any other operator reaching this match is an internal invariant violation, so it panics with \"Unhandled internal variant\". This means the dispatcher passed an operator the SIMD helper was never written to receive.","triggerScenarios":"Compiling a WASM module containing i32x4.extadd_pairwise_i16x8_s/u SIMD instructions (via translate_operator -> translate_integer_arithmetic_operator) with the LLVM compiler, when an internal refactor lets an unexpected Operator variant fall through.","commonSituations":"Running modules using the SIMD extended-pairwise-add proposal on the LLVM backend; usually a backend bug after code changes rather than a user mistake.","solutions":["Retry compilation with a different backend (Cranelift or singlepass) if available.","Check your wasmer version for known LLVM-backend SIMD bugs and upgrade.","Avoid or polyfill the extadd_pairwise SIMD instructions if stuck on an affected version.","Report a bug with the failing module; the unreachable! marks a translator invariant break."],"exampleFix":"// before\nwasmer compile module.wasm --llvm\n// after\nwasmer compile module.wasm --cranelift  // workaround for LLVM SIMD translator bug","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Compilation aborts via panic; isolate compilation in a worker process\nlet out = std::process::Command::new(\"wasmer\").args([\"compile\", \"--cranelift\", \"module.wasm\"]).status();","preventionTips":["Pin a wasmer version with passing LLVM SIMD tests before deploying.","Prefer the Cranelift backend for modules using extadd_pairwise/extmul SIMD instructions.","Add CI coverage compiling SIMD-heavy modules with the LLVM backend.","Keep module source simple/polyfilled where SIMD intrinsics are not required."],"tags":["llvm-backend","wasm-compiler","simd","panic","unreachable"],"backgroundTag":"unhandled-operator-variant","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}