{"record":{"id":"ae5b1e3598517338","repo":"diem/diem","slug":"vector-bytecode-not-supported-yet","errorCode":null,"errorMessage":"Vector bytecode not supported yet","messagePattern":"Vector bytecode not supported yet","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"language/move-prover/bytecode/src/stackless_bytecode_generator.rs","lineNumber":1065,"sourceCode":"                            .get_struct_id(struct_instantiation.def),\n                        self.get_type_params(struct_instantiation.type_parameters),\n                    ),\n                    vec![],\n                    vec![value_operand_index, signer_operand_index],\n                ));\n            }\n\n            MoveBytecode::Nop => self.code.push(Bytecode::Nop(attr_id)),\n\n            // TODO: implement the translation when the the vector-related bytecode is ready\n            MoveBytecode::VecPack(..)\n            | MoveBytecode::VecLen(_)\n            | MoveBytecode::VecImmBorrow(_)\n            | MoveBytecode::VecMutBorrow(_)\n            | MoveBytecode::VecPushBack(_)\n            | MoveBytecode::VecPopBack(_)\n            | MoveBytecode::VecUnpack(..)\n            | MoveBytecode::VecSwap(_) => unimplemented!(\"Vector bytecode not supported yet\"),\n        }\n    }\n\n    fn translate_value(ty: &Type, value: &MoveValue) -> Constant {\n        match (ty, &value) {\n            (Type::Vector(inner), MoveValue::Vector(vs)) => {\n                let b = vs\n                    .iter()\n                    .map(|v| match Self::translate_value(inner, v) {\n                        Constant::U8(u) => u,\n                        _ => unimplemented!(\"Not yet supported constant vector type: {:?}\", ty),\n                    })\n                    .collect::<Vec<u8>>();\n                Constant::ByteArray(b)\n            }\n            (Type::Primitive(PrimitiveType::Bool), MoveValue::Bool(b)) => Constant::Bool(*b),\n            (Type::Primitive(PrimitiveType::U8), MoveValue::U8(b)) => Constant::U8(*b),\n            (Type::Primitive(PrimitiveType::U64), MoveValue::U64(b)) => Constant::U64(*b),","sourceCodeStart":1047,"sourceCodeEnd":1083,"githubUrl":"https://github.com/diem/diem/blob/fc4714a8ea273b6efe8b13dbce72ea60aad9a16c/language/move-prover/bytecode/src/stackless_bytecode_generator.rs#L1047-L1083","documentation":"generate_bytecode ends with an unimplemented!() arm for all vector bytecodes (VecPack, VecLen, VecImmBorrow, VecMutBorrow, VecPushBack, VecPopBack, VecUnpack, VecSwap). Vector operations in the raw bytecode are expected to have been eliminated earlier by function data generation (vector-inlining pass lowering them to calls to intrinsic model functions), so hitting this arm means the input bytecode still contains raw vector instructions.","triggerScenarios":"Running generate_bytecode on a function whose Move bytecode contains vector instructions (VecPushBack, VecPopBack, VecSwap, VecLen, VecBorrow, VecPack/VecUnpack) that were not lowered by the vector pass.","commonSituations":"Invoking the prover bytecode generator directly on compiled bytecode instead of going through function data generation; using a vector op the prover's inlining pass does not recognize; version mismatch where the vector-elaboration pass is skipped.","solutions":["Generate function data through the standard move_model pipeline so the vector bytecode is lowered to builtin intrinsic calls before this generator runs","Rewrite the Move code to avoid raw vector ops if driving the generator directly","Upgrade/move to a move-prover version where the vector pass handles your bytecode","If writing a transformation, run/replicate the vector-inlining pass (explore.rs / function data generation) before stackless generation"],"exampleFix":"// before: building stackless bytecode directly from compiled module\nlet gen = StacklessBytecodeGenerator::new(&env);\nlet func = gen.generate_function(compiled_function);\n// after: use FunctionData::gen which applies the vector lowering\nenv.add_target_function(&function_env, &compiled_function)?;\nlet func_data = FunctionData::gen(&env, fun_id);","handlingStrategy":"validation","validationCode":"// before generation, ensure no raw vector bytecode remains\nlet has_vec = func.get_code().iter().any(|c| matches!(c,\n    MoveBytecode::VecPack(..) | MoveBytecode::VecLen(_) | MoveBytecode::VecImmBorrow(_)\n    | MoveBytecode::VecMutBorrow(_) | MoveBytecode::VecPushBack(_)\n    | MoveBytecode::VecPopBack(_) | MoveBytecode::VecUnpack(..) | MoveBytecode::VecSwap(_)));\nassert!(!has_vec, \"vector bytecode must be lowered before stackless generation\");","typeGuard":"fn vector_free(code: &[MoveBytecode]) -> bool {\n    !code.iter().any(|c| matches!(c,\n        MoveBytecode::VecPack(..) | MoveBytecode::VecLen(_)\n        | MoveBytecode::VecImmBorrow(_) | MoveBytecode::VecMutBorrow(_)\n        | MoveBytecode::VecPushBack(_) | MoveBytecode::VecPopBack(_)\n        | MoveBytecode::VecUnpack(..) | MoveBytecode::VecSwap(_)))\n}","tryCatchPattern":"match std::panic::catch_unwind(|| generate_bytecode(func)) {\n    Ok(bc) => bc,\n    Err(_) => return Err(\"vector bytecode present; run the vector lowering pass first\".into()),\n}","preventionTips":["Use FunctionData::gen / the standard move_model pipeline instead of calling the generator directly","Avoid vector operations the prover intrinsics don't cover","Keep prover and bytecode format versions aligned","Add a pre-check pass that scans for raw Vec* instructions in CI"],"tags":["move","move-prover","vector","unimplemented","panic"],"backgroundTag":"unimplemented-bytecode-op","analyzedSha":"fc4714a8ea273b6efe8b13dbce72ea60aad9a16c","analyzedAt":"2026-09-04T21:07:05.890Z","contentChangedAt":"2026-09-04T21:07:05.890Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}