diff --git a/avm-transpiler/src/opcodes.rs b/avm-transpiler/src/opcodes.rs index e20a993702f7..1de1f7803c89 100644 --- a/avm-transpiler/src/opcodes.rs +++ b/avm-transpiler/src/opcodes.rs @@ -51,7 +51,6 @@ pub enum AvmOpcode { SET_FF, MOV_8, MOV_16, - CMOV, // World state SLOAD, SSTORE, @@ -144,7 +143,6 @@ impl AvmOpcode { AvmOpcode::SET_FF => "SET_FF", AvmOpcode::MOV_8 => "MOV_8", AvmOpcode::MOV_16 => "MOV_16", - AvmOpcode::CMOV => "CMOV", // World State AvmOpcode::SLOAD => "SLOAD", // Public Storage diff --git a/avm-transpiler/src/transpile.rs b/avm-transpiler/src/transpile.rs index 877a5b8f3d5d..ff77d03017d6 100644 --- a/avm-transpiler/src/transpile.rs +++ b/avm-transpiler/src/transpile.rs @@ -249,19 +249,6 @@ pub fn brillig_to_avm( destination.to_usize() as u32, )); } - BrilligOpcode::ConditionalMov { source_a, source_b, condition, destination } => { - avm_instrs.push(AvmInstruction { - opcode: AvmOpcode::CMOV, - indirect: Some(AvmOperand::U8 { value: ALL_DIRECT }), - operands: vec![ - AvmOperand::U32 { value: source_a.to_usize() as u32 }, - AvmOperand::U32 { value: source_b.to_usize() as u32 }, - AvmOperand::U32 { value: condition.to_usize() as u32 }, - AvmOperand::U32 { value: destination.to_usize() as u32 }, - ], - ..Default::default() - }); - } BrilligOpcode::Load { destination, source_pointer } => { avm_instrs.push(generate_mov_instruction( Some(AvmOperand::U8 { value: ZEROTH_OPERAND_INDIRECT }), diff --git a/barretenberg/cpp/pil/avm/main.pil b/barretenberg/cpp/pil/avm/main.pil index 29840e932b50..0b70bee3f2ba 100644 --- a/barretenberg/cpp/pil/avm/main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -120,7 +120,6 @@ namespace main(256); //===== MEMORY OPCODES ========================================================== pol commit sel_op_set; pol commit sel_op_mov; - pol commit sel_op_cmov; //===== TABLE SUBOP-TR ======================================================== // Boolean selectors for (sub-)operations. Only one operation is activated at @@ -160,7 +159,7 @@ namespace main(256); // A helper witness being the inverse of some value // to show a non-zero equality pol commit inv; - pol commit id_zero; // Boolean telling whether id is zero (cmov opcode) + pol commit id_zero; // Boolean telling whether id is zero (jmp opcode) //===== MEMORY MODEL ======================================================== // ind_addr_a -> (gets resolved to) @@ -285,7 +284,6 @@ namespace main(256); // Might be removed if derived from opcode based on a lookup of constants sel_op_set * (1 - sel_op_set) = 0; sel_op_mov * (1 - sel_op_mov) = 0; - sel_op_cmov * (1 - sel_op_cmov) = 0; op_err * (1 - op_err) = 0; tag_err * (1 - tag_err) = 0; // Potential optimization (boolean constraint derivation from equivalence check to mem)? @@ -424,7 +422,7 @@ namespace main(256); pol SEL_ALL_BINARY = sel_op_and + sel_op_or + sel_op_xor; pol SEL_ALL_GADGET = sel_op_radix_le + sel_op_sha256 + sel_op_poseidon2 + sel_op_keccak + sel_op_pedersen + sel_op_ecadd + sel_op_pedersen_commit + sel_op_msm; - pol SEL_ALL_MEMORY = sel_op_cmov + sel_op_mov + sel_op_set; + pol SEL_ALL_MEMORY = sel_op_mov + sel_op_set; pol OPCODE_SELECTORS = sel_op_fdiv + sel_op_calldata_copy + sel_op_get_contract_instance + SEL_ALL_ALU + SEL_ALL_BINARY + SEL_ALL_MEMORY + SEL_ALL_GADGET + KERNEL_INPUT_SELECTORS + KERNEL_OUTPUT_SELECTORS + SEL_ALL_LEFTGAS @@ -457,35 +455,32 @@ namespace main(256); //====== MEMORY OPCODES CONSTRAINTS ========================================= // TODO: consolidate with zero division error handling - // TODO: Ensure that operation decompostion will ensure mutual exclusivity of sel_op_cmov and sel_op_jumpi - // When sel_op_cmov or sel_op_jumpi == 1, we need id == 0 <==> id_zero == 0 + // When sel_op_jumpi == 1, we need id == 0 <==> id_zero == 0 // This can be achieved with the 2 following relations. // inv is an extra witness to show that we can invert id, i.e., inv = id^(-1) // If id == 0, we have to set inv = 1 to satisfy the second relation, // because id_zero == 1 from the first relation. - #[CMOV_CONDITION_RES_1] - (sel_op_cmov + sel_op_jumpi) * (id * inv - 1 + id_zero) = 0; - #[CMOV_CONDITION_RES_2] - (sel_op_cmov + sel_op_jumpi) * id_zero * (1 - inv) = 0; + #[JMP_CONDITION_RES_1] + sel_op_jumpi * (id * inv - 1 + id_zero) = 0; + #[JMP_CONDITION_RES_2] + sel_op_jumpi * id_zero * (1 - inv) = 0; // Boolean selectors telling whether we move ia to ic or ib to ic. // Boolean constraints and mutual exclusivity are derived from their - // respective definitions based on sel_op_mov, sel_op_cmov, and id_zero. + // respective definitions based on sel_op_mov, and id_zero. pol commit sel_mov_ia_to_ic; pol commit sel_mov_ib_to_ic; // For MOV, we copy ia to ic. - // For CMOV, we copy ia to ic if id is NOT zero, otherwise we copy ib to ic. - sel_mov_ia_to_ic = sel_op_mov + sel_op_cmov * (1 - id_zero); - sel_mov_ib_to_ic = sel_op_cmov * id_zero; + sel_mov_ia_to_ic = sel_op_mov * (1 - id_zero); #[MOV_SAME_VALUE_A] sel_mov_ia_to_ic * (ia - ic) = 0; // Ensure that the correct value is moved/copied. #[MOV_SAME_VALUE_B] sel_mov_ib_to_ic * (ib - ic) = 0; // Ensure that the correct value is moved/copied. #[MOV_MAIN_SAME_TAG] - (sel_op_mov + sel_op_cmov) * (r_in_tag - w_in_tag) = 0; + sel_op_mov * (r_in_tag - w_in_tag) = 0; // Predicate to activate the copy of intermediate registers to ALU table. If tag_err == 1, // the operation is not copied to the ALU table. @@ -580,16 +575,16 @@ namespace main(256); slice.sel_start {slice.clk, slice.space_id, slice.col_offset, slice.cnt, slice.addr, slice.sel_cd_cpy, slice.sel_return}; #[PERM_MAIN_MEM_A] - sel_mem_op_a {clk, space_id, mem_addr_a, ia, rwa, r_in_tag, w_in_tag, sel_mov_ia_to_ic, sel_op_cmov} + sel_mem_op_a {clk, space_id, mem_addr_a, ia, rwa, r_in_tag, w_in_tag, sel_mov_ia_to_ic} is mem.sel_op_a {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw - , mem.r_in_tag, mem.w_in_tag, mem.sel_mov_ia_to_ic, mem.sel_op_cmov}; + , mem.r_in_tag, mem.w_in_tag, mem.sel_mov_ia_to_ic}; #[PERM_MAIN_MEM_B] - sel_mem_op_b {clk, space_id, mem_addr_b, ib, rwb, r_in_tag, w_in_tag, sel_mov_ib_to_ic, sel_op_cmov} + sel_mem_op_b {clk, space_id, mem_addr_b, ib, rwb, r_in_tag, w_in_tag, sel_mov_ib_to_ic} is mem.sel_op_b {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw - , mem.r_in_tag, mem.w_in_tag, mem.sel_mov_ib_to_ic, mem.sel_op_cmov}; + , mem.r_in_tag, mem.w_in_tag, mem.sel_mov_ib_to_ic}; #[PERM_MAIN_MEM_C] sel_mem_op_c {clk, space_id, mem_addr_c, ic, rwc, r_in_tag, w_in_tag} @@ -597,10 +592,10 @@ namespace main(256); mem.sel_op_c {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw, mem.r_in_tag, mem.w_in_tag}; #[PERM_MAIN_MEM_D] - sel_mem_op_d {clk, space_id, mem_addr_d, id, rwd, r_in_tag, w_in_tag, sel_op_cmov} + sel_mem_op_d {clk, space_id, mem_addr_d, id, rwd, r_in_tag, w_in_tag} is mem.sel_op_d {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw - , mem.r_in_tag, mem.w_in_tag, mem.sel_op_cmov}; + , mem.r_in_tag, mem.w_in_tag}; #[PERM_MAIN_MEM_IND_ADDR_A] sel_resolve_ind_addr_a {clk, space_id, ind_addr_a, mem_addr_a} diff --git a/barretenberg/cpp/pil/avm/mem.pil b/barretenberg/cpp/pil/avm/mem.pil index e4b07c9c0f81..ddf89ea9884d 100644 --- a/barretenberg/cpp/pil/avm/mem.pil +++ b/barretenberg/cpp/pil/avm/mem.pil @@ -20,7 +20,7 @@ namespace mem(256); pol commit r_in_tag; // Instruction memory tag ("foreign key" pointing to main.r_in_tag) pol commit w_in_tag; // Instruction memory tag ("foreign key" pointing to main.w_in_tag) pol commit skip_check_tag; // A boolean value which relaxes the consistency check in memory - // trace between tag and r_in_tag. Required for CMOV opcode. + // trace between tag and r_in_tag. Required for JMPI opcode. // Indicator of the intermediate register pertaining to the memory operation (foreign key to main.sel_mem_op_XXX) pol commit sel_op_a; @@ -56,11 +56,10 @@ namespace mem(256); // Selector for calldata_copy/return memory operations triggered from memory slice gadget. pol commit sel_op_slice; - // Selectors related to MOV/CMOV opcodes (copied from main trace for loading operation on intermediated register ia/ib) + // Selectors related to MOV opcodes (copied from main trace for loading operation on intermediated register ia/ib) // Boolean constraint is performed in main trace. pol commit sel_mov_ia_to_ic; pol commit sel_mov_ib_to_ic; - pol commit sel_op_cmov; // Error columns pol commit tag_err; // Boolean (1 if r_in_tag != tag is detected) @@ -91,7 +90,7 @@ namespace mem(256); sel_mem = SEL_DIRECT_MEM_OP_A + SEL_DIRECT_MEM_OP_B + SEL_DIRECT_MEM_OP_C + SEL_DIRECT_MEM_OP_D + sel_resolve_ind_addr_a + sel_resolve_ind_addr_b + sel_resolve_ind_addr_c + sel_resolve_ind_addr_d + sel_op_slice; - + // Maximum one memory operation enabled per row sel_mem * (sel_mem - 1) = 0; // TODO: might be infered by the main trace @@ -145,11 +144,11 @@ namespace mem(256); // Optimization: We removed the term (1 - main.sel_first) #[MEM_LAST_ACCESS_DELIMITER] (1 - lastAccess) * (glob_addr' - glob_addr) = 0; - + // We need: lastAccess == 1 ==> glob_addr' > glob_addr // The above implies: glob_addr' == glob_addr ==> lastAccess == 0 // This condition does not apply on the last row. - + // In addition, we need glob_addr' == glob_addr ==> tsp' > tsp // For all rows pertaining to the memory trace (sel_mem == 1) except the last one, // i.e., when sel_rng_chk == 1, we compute the difference: @@ -166,11 +165,11 @@ namespace mem(256); // This condition does not apply on the last row. // Note: in barretenberg, a shifted polynomial will be 0 on the last row (shift is not cyclic) // Note2: in barretenberg, if a poynomial is shifted, its non-shifted equivalent must be 0 on the first row - + // Optimization: We removed the term (1 - main.sel_first) and (1 - last) #[MEM_READ_WRITE_VAL_CONSISTENCY] (1 - lastAccess) * (1 - rw') * (val' - val) = 0; - + // lastAccess == 0 && rw' == 0 ==> tag == tag' // Optimization: We removed the term (1 - main.sel_first) and (1 - last) #[MEM_READ_WRITE_TAG_CONSISTENCY] @@ -183,9 +182,9 @@ namespace mem(256); lastAccess * (1 - rw') * val' = 0; // TODO: Verfiy that skip_check_tag cannot be enabled maliciously by the prover. - // Skip check tag enabled for some MOV/CMOV opcodes and RETURN opcode (sel_op_slice) + // Skip check tag enabled for some MOV opcodes and RETURN opcode (sel_op_slice) #[SKIP_CHECK_TAG] - skip_check_tag = sel_op_cmov * (sel_op_d + sel_op_a * (1-sel_mov_ia_to_ic) + sel_op_b * (1-sel_mov_ib_to_ic)) + sel_op_slice; + skip_check_tag = sel_op_slice; // Memory tag consistency check for load operations, i.e., rw == 0. // We want to prove that r_in_tag == tag <==> tag_err == 0 @@ -200,7 +199,7 @@ namespace mem(256); // instead of (r_in_tag - tag)^(-1) as this allows to store zero by default (i.e., when tag_err == 0). // The new column one_min_inv is set to 1 - (r_in_tag - tag)^(-1) when tag_err == 1 // but must be set to 0 when tags are matching and tag_err = 0 - // Relaxation: This relation is relaxed when skip_check_tag is enabled or for + // Relaxation: This relation is relaxed when skip_check_tag is enabled or for // uninitialized memory, i.e. tag == 0. #[MEM_IN_TAG_CONSISTENCY_1] tag * (1 - skip_check_tag) * (1 - rw) * ((r_in_tag - tag) * (1 - one_min_inv) - tag_err) = 0; @@ -251,7 +250,7 @@ namespace mem(256); sel_op_poseidon_write_c * (r_in_tag - constants.MEM_TAG_FF) = 0; // Only write elements of type FF sel_op_poseidon_write_d * (r_in_tag - constants.MEM_TAG_FF) = 0; // Only write elements of type FF - //====== MOV/CMOV Opcode Tag Constraint ===================================== + //====== MOV Opcode Tag Constraint ===================================== // The following constraint ensures that the r_in_tag is set to tag for // the load operation pertaining to Ia resp. Ib. // The permutation check #[PERM_MAIN_MEM_A/B] guarantees that the r_in_tag diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp index 68e3f2c1dbce..af82fc926108 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp @@ -239,7 +239,6 @@ AvmCircuitBuilder::ProverPolynomials AvmCircuitBuilder::compute_polynomials() co polys.main_sel_op_calldata_copy.set_if_valid_index(i, rows[i].main_sel_op_calldata_copy); polys.main_sel_op_cast.set_if_valid_index(i, rows[i].main_sel_op_cast); polys.main_sel_op_chain_id.set_if_valid_index(i, rows[i].main_sel_op_chain_id); - polys.main_sel_op_cmov.set_if_valid_index(i, rows[i].main_sel_op_cmov); polys.main_sel_op_dagasleft.set_if_valid_index(i, rows[i].main_sel_op_dagasleft); polys.main_sel_op_div.set_if_valid_index(i, rows[i].main_sel_op_div); polys.main_sel_op_ecadd.set_if_valid_index(i, rows[i].main_sel_op_ecadd); @@ -323,7 +322,6 @@ AvmCircuitBuilder::ProverPolynomials AvmCircuitBuilder::compute_polynomials() co polys.mem_sel_op_a.set_if_valid_index(i, rows[i].mem_sel_op_a); polys.mem_sel_op_b.set_if_valid_index(i, rows[i].mem_sel_op_b); polys.mem_sel_op_c.set_if_valid_index(i, rows[i].mem_sel_op_c); - polys.mem_sel_op_cmov.set_if_valid_index(i, rows[i].mem_sel_op_cmov); polys.mem_sel_op_d.set_if_valid_index(i, rows[i].mem_sel_op_d); polys.mem_sel_op_poseidon_read_a.set_if_valid_index(i, rows[i].mem_sel_op_poseidon_read_a); polys.mem_sel_op_poseidon_read_b.set_if_valid_index(i, rows[i].mem_sel_op_poseidon_read_b); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp index b3f12a3b761a..676f16380d56 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp @@ -192,566 +192,564 @@ AvmFlavor::AllConstRefValues::AllConstRefValues( , main_sel_op_calldata_copy(il[184]) , main_sel_op_cast(il[185]) , main_sel_op_chain_id(il[186]) - , main_sel_op_cmov(il[187]) - , main_sel_op_dagasleft(il[188]) - , main_sel_op_div(il[189]) - , main_sel_op_ecadd(il[190]) - , main_sel_op_emit_l2_to_l1_msg(il[191]) - , main_sel_op_emit_note_hash(il[192]) - , main_sel_op_emit_nullifier(il[193]) - , main_sel_op_emit_unencrypted_log(il[194]) - , main_sel_op_eq(il[195]) - , main_sel_op_external_call(il[196]) - , main_sel_op_external_return(il[197]) - , main_sel_op_external_revert(il[198]) - , main_sel_op_fdiv(il[199]) - , main_sel_op_fee_per_da_gas(il[200]) - , main_sel_op_fee_per_l2_gas(il[201]) - , main_sel_op_function_selector(il[202]) - , main_sel_op_get_contract_instance(il[203]) - , main_sel_op_internal_call(il[204]) - , main_sel_op_internal_return(il[205]) - , main_sel_op_is_static_call(il[206]) - , main_sel_op_jump(il[207]) - , main_sel_op_jumpi(il[208]) - , main_sel_op_keccak(il[209]) - , main_sel_op_l1_to_l2_msg_exists(il[210]) - , main_sel_op_l2gasleft(il[211]) - , main_sel_op_lt(il[212]) - , main_sel_op_lte(il[213]) - , main_sel_op_mov(il[214]) - , main_sel_op_msm(il[215]) - , main_sel_op_mul(il[216]) - , main_sel_op_not(il[217]) - , main_sel_op_note_hash_exists(il[218]) - , main_sel_op_nullifier_exists(il[219]) - , main_sel_op_or(il[220]) - , main_sel_op_pedersen(il[221]) - , main_sel_op_pedersen_commit(il[222]) - , main_sel_op_poseidon2(il[223]) - , main_sel_op_radix_le(il[224]) - , main_sel_op_sender(il[225]) - , main_sel_op_set(il[226]) - , main_sel_op_sha256(il[227]) - , main_sel_op_shl(il[228]) - , main_sel_op_shr(il[229]) - , main_sel_op_sload(il[230]) - , main_sel_op_sstore(il[231]) - , main_sel_op_static_call(il[232]) - , main_sel_op_storage_address(il[233]) - , main_sel_op_sub(il[234]) - , main_sel_op_timestamp(il[235]) - , main_sel_op_transaction_fee(il[236]) - , main_sel_op_version(il[237]) - , main_sel_op_xor(il[238]) - , main_sel_q_kernel_lookup(il[239]) - , main_sel_q_kernel_output_lookup(il[240]) - , main_sel_resolve_ind_addr_a(il[241]) - , main_sel_resolve_ind_addr_b(il[242]) - , main_sel_resolve_ind_addr_c(il[243]) - , main_sel_resolve_ind_addr_d(il[244]) - , main_sel_returndata(il[245]) - , main_sel_rng_16(il[246]) - , main_sel_rng_8(il[247]) - , main_sel_slice_gadget(il[248]) - , main_side_effect_counter(il[249]) - , main_sload_write_offset(il[250]) - , main_space_id(il[251]) - , main_sstore_write_offset(il[252]) - , main_tag_err(il[253]) - , main_w_in_tag(il[254]) - , mem_addr(il[255]) - , mem_clk(il[256]) - , mem_diff(il[257]) - , mem_glob_addr(il[258]) - , mem_last(il[259]) - , mem_lastAccess(il[260]) - , mem_one_min_inv(il[261]) - , mem_r_in_tag(il[262]) - , mem_rw(il[263]) - , mem_sel_mem(il[264]) - , mem_sel_mov_ia_to_ic(il[265]) - , mem_sel_mov_ib_to_ic(il[266]) - , mem_sel_op_a(il[267]) - , mem_sel_op_b(il[268]) - , mem_sel_op_c(il[269]) - , mem_sel_op_cmov(il[270]) - , mem_sel_op_d(il[271]) - , mem_sel_op_poseidon_read_a(il[272]) - , mem_sel_op_poseidon_read_b(il[273]) - , mem_sel_op_poseidon_read_c(il[274]) - , mem_sel_op_poseidon_read_d(il[275]) - , mem_sel_op_poseidon_write_a(il[276]) - , mem_sel_op_poseidon_write_b(il[277]) - , mem_sel_op_poseidon_write_c(il[278]) - , mem_sel_op_poseidon_write_d(il[279]) - , mem_sel_op_slice(il[280]) - , mem_sel_resolve_ind_addr_a(il[281]) - , mem_sel_resolve_ind_addr_b(il[282]) - , mem_sel_resolve_ind_addr_c(il[283]) - , mem_sel_resolve_ind_addr_d(il[284]) - , mem_sel_rng_chk(il[285]) - , mem_skip_check_tag(il[286]) - , mem_space_id(il[287]) - , mem_tag(il[288]) - , mem_tag_err(il[289]) - , mem_tsp(il[290]) - , mem_val(il[291]) - , mem_w_in_tag(il[292]) - , pedersen_clk(il[293]) - , pedersen_input(il[294]) - , pedersen_output(il[295]) - , pedersen_sel_pedersen(il[296]) - , poseidon2_B_10_0(il[297]) - , poseidon2_B_10_1(il[298]) - , poseidon2_B_10_2(il[299]) - , poseidon2_B_10_3(il[300]) - , poseidon2_B_11_0(il[301]) - , poseidon2_B_11_1(il[302]) - , poseidon2_B_11_2(il[303]) - , poseidon2_B_11_3(il[304]) - , poseidon2_B_12_0(il[305]) - , poseidon2_B_12_1(il[306]) - , poseidon2_B_12_2(il[307]) - , poseidon2_B_12_3(il[308]) - , poseidon2_B_13_0(il[309]) - , poseidon2_B_13_1(il[310]) - , poseidon2_B_13_2(il[311]) - , poseidon2_B_13_3(il[312]) - , poseidon2_B_14_0(il[313]) - , poseidon2_B_14_1(il[314]) - , poseidon2_B_14_2(il[315]) - , poseidon2_B_14_3(il[316]) - , poseidon2_B_15_0(il[317]) - , poseidon2_B_15_1(il[318]) - , poseidon2_B_15_2(il[319]) - , poseidon2_B_15_3(il[320]) - , poseidon2_B_16_0(il[321]) - , poseidon2_B_16_1(il[322]) - , poseidon2_B_16_2(il[323]) - , poseidon2_B_16_3(il[324]) - , poseidon2_B_17_0(il[325]) - , poseidon2_B_17_1(il[326]) - , poseidon2_B_17_2(il[327]) - , poseidon2_B_17_3(il[328]) - , poseidon2_B_18_0(il[329]) - , poseidon2_B_18_1(il[330]) - , poseidon2_B_18_2(il[331]) - , poseidon2_B_18_3(il[332]) - , poseidon2_B_19_0(il[333]) - , poseidon2_B_19_1(il[334]) - , poseidon2_B_19_2(il[335]) - , poseidon2_B_19_3(il[336]) - , poseidon2_B_20_0(il[337]) - , poseidon2_B_20_1(il[338]) - , poseidon2_B_20_2(il[339]) - , poseidon2_B_20_3(il[340]) - , poseidon2_B_21_0(il[341]) - , poseidon2_B_21_1(il[342]) - , poseidon2_B_21_2(il[343]) - , poseidon2_B_21_3(il[344]) - , poseidon2_B_22_0(il[345]) - , poseidon2_B_22_1(il[346]) - , poseidon2_B_22_2(il[347]) - , poseidon2_B_22_3(il[348]) - , poseidon2_B_23_0(il[349]) - , poseidon2_B_23_1(il[350]) - , poseidon2_B_23_2(il[351]) - , poseidon2_B_23_3(il[352]) - , poseidon2_B_24_0(il[353]) - , poseidon2_B_24_1(il[354]) - , poseidon2_B_24_2(il[355]) - , poseidon2_B_24_3(il[356]) - , poseidon2_B_25_0(il[357]) - , poseidon2_B_25_1(il[358]) - , poseidon2_B_25_2(il[359]) - , poseidon2_B_25_3(il[360]) - , poseidon2_B_26_0(il[361]) - , poseidon2_B_26_1(il[362]) - , poseidon2_B_26_2(il[363]) - , poseidon2_B_26_3(il[364]) - , poseidon2_B_27_0(il[365]) - , poseidon2_B_27_1(il[366]) - , poseidon2_B_27_2(il[367]) - , poseidon2_B_27_3(il[368]) - , poseidon2_B_28_0(il[369]) - , poseidon2_B_28_1(il[370]) - , poseidon2_B_28_2(il[371]) - , poseidon2_B_28_3(il[372]) - , poseidon2_B_29_0(il[373]) - , poseidon2_B_29_1(il[374]) - , poseidon2_B_29_2(il[375]) - , poseidon2_B_29_3(il[376]) - , poseidon2_B_30_0(il[377]) - , poseidon2_B_30_1(il[378]) - , poseidon2_B_30_2(il[379]) - , poseidon2_B_30_3(il[380]) - , poseidon2_B_31_0(il[381]) - , poseidon2_B_31_1(il[382]) - , poseidon2_B_31_2(il[383]) - , poseidon2_B_31_3(il[384]) - , poseidon2_B_32_0(il[385]) - , poseidon2_B_32_1(il[386]) - , poseidon2_B_32_2(il[387]) - , poseidon2_B_32_3(il[388]) - , poseidon2_B_33_0(il[389]) - , poseidon2_B_33_1(il[390]) - , poseidon2_B_33_2(il[391]) - , poseidon2_B_33_3(il[392]) - , poseidon2_B_34_0(il[393]) - , poseidon2_B_34_1(il[394]) - , poseidon2_B_34_2(il[395]) - , poseidon2_B_34_3(il[396]) - , poseidon2_B_35_0(il[397]) - , poseidon2_B_35_1(il[398]) - , poseidon2_B_35_2(il[399]) - , poseidon2_B_35_3(il[400]) - , poseidon2_B_36_0(il[401]) - , poseidon2_B_36_1(il[402]) - , poseidon2_B_36_2(il[403]) - , poseidon2_B_36_3(il[404]) - , poseidon2_B_37_0(il[405]) - , poseidon2_B_37_1(il[406]) - , poseidon2_B_37_2(il[407]) - , poseidon2_B_37_3(il[408]) - , poseidon2_B_38_0(il[409]) - , poseidon2_B_38_1(il[410]) - , poseidon2_B_38_2(il[411]) - , poseidon2_B_38_3(il[412]) - , poseidon2_B_39_0(il[413]) - , poseidon2_B_39_1(il[414]) - , poseidon2_B_39_2(il[415]) - , poseidon2_B_39_3(il[416]) - , poseidon2_B_40_0(il[417]) - , poseidon2_B_40_1(il[418]) - , poseidon2_B_40_2(il[419]) - , poseidon2_B_40_3(il[420]) - , poseidon2_B_41_0(il[421]) - , poseidon2_B_41_1(il[422]) - , poseidon2_B_41_2(il[423]) - , poseidon2_B_41_3(il[424]) - , poseidon2_B_42_0(il[425]) - , poseidon2_B_42_1(il[426]) - , poseidon2_B_42_2(il[427]) - , poseidon2_B_42_3(il[428]) - , poseidon2_B_43_0(il[429]) - , poseidon2_B_43_1(il[430]) - , poseidon2_B_43_2(il[431]) - , poseidon2_B_43_3(il[432]) - , poseidon2_B_44_0(il[433]) - , poseidon2_B_44_1(il[434]) - , poseidon2_B_44_2(il[435]) - , poseidon2_B_44_3(il[436]) - , poseidon2_B_45_0(il[437]) - , poseidon2_B_45_1(il[438]) - , poseidon2_B_45_2(il[439]) - , poseidon2_B_45_3(il[440]) - , poseidon2_B_46_0(il[441]) - , poseidon2_B_46_1(il[442]) - , poseidon2_B_46_2(il[443]) - , poseidon2_B_46_3(il[444]) - , poseidon2_B_47_0(il[445]) - , poseidon2_B_47_1(il[446]) - , poseidon2_B_47_2(il[447]) - , poseidon2_B_47_3(il[448]) - , poseidon2_B_48_0(il[449]) - , poseidon2_B_48_1(il[450]) - , poseidon2_B_48_2(il[451]) - , poseidon2_B_48_3(il[452]) - , poseidon2_B_49_0(il[453]) - , poseidon2_B_49_1(il[454]) - , poseidon2_B_49_2(il[455]) - , poseidon2_B_49_3(il[456]) - , poseidon2_B_4_0(il[457]) - , poseidon2_B_4_1(il[458]) - , poseidon2_B_4_2(il[459]) - , poseidon2_B_4_3(il[460]) - , poseidon2_B_50_0(il[461]) - , poseidon2_B_50_1(il[462]) - , poseidon2_B_50_2(il[463]) - , poseidon2_B_50_3(il[464]) - , poseidon2_B_51_0(il[465]) - , poseidon2_B_51_1(il[466]) - , poseidon2_B_51_2(il[467]) - , poseidon2_B_51_3(il[468]) - , poseidon2_B_52_0(il[469]) - , poseidon2_B_52_1(il[470]) - , poseidon2_B_52_2(il[471]) - , poseidon2_B_52_3(il[472]) - , poseidon2_B_53_0(il[473]) - , poseidon2_B_53_1(il[474]) - , poseidon2_B_53_2(il[475]) - , poseidon2_B_53_3(il[476]) - , poseidon2_B_54_0(il[477]) - , poseidon2_B_54_1(il[478]) - , poseidon2_B_54_2(il[479]) - , poseidon2_B_54_3(il[480]) - , poseidon2_B_55_0(il[481]) - , poseidon2_B_55_1(il[482]) - , poseidon2_B_55_2(il[483]) - , poseidon2_B_55_3(il[484]) - , poseidon2_B_56_0(il[485]) - , poseidon2_B_56_1(il[486]) - , poseidon2_B_56_2(il[487]) - , poseidon2_B_56_3(il[488]) - , poseidon2_B_57_0(il[489]) - , poseidon2_B_57_1(il[490]) - , poseidon2_B_57_2(il[491]) - , poseidon2_B_57_3(il[492]) - , poseidon2_B_58_0(il[493]) - , poseidon2_B_58_1(il[494]) - , poseidon2_B_58_2(il[495]) - , poseidon2_B_58_3(il[496]) - , poseidon2_B_59_0(il[497]) - , poseidon2_B_59_1(il[498]) - , poseidon2_B_59_2(il[499]) - , poseidon2_B_59_3(il[500]) - , poseidon2_B_5_0(il[501]) - , poseidon2_B_5_1(il[502]) - , poseidon2_B_5_2(il[503]) - , poseidon2_B_5_3(il[504]) - , poseidon2_B_6_0(il[505]) - , poseidon2_B_6_1(il[506]) - , poseidon2_B_6_2(il[507]) - , poseidon2_B_6_3(il[508]) - , poseidon2_B_7_0(il[509]) - , poseidon2_B_7_1(il[510]) - , poseidon2_B_7_2(il[511]) - , poseidon2_B_7_3(il[512]) - , poseidon2_B_8_0(il[513]) - , poseidon2_B_8_1(il[514]) - , poseidon2_B_8_2(il[515]) - , poseidon2_B_8_3(il[516]) - , poseidon2_B_9_0(il[517]) - , poseidon2_B_9_1(il[518]) - , poseidon2_B_9_2(il[519]) - , poseidon2_B_9_3(il[520]) - , poseidon2_EXT_LAYER_4(il[521]) - , poseidon2_EXT_LAYER_5(il[522]) - , poseidon2_EXT_LAYER_6(il[523]) - , poseidon2_EXT_LAYER_7(il[524]) - , poseidon2_T_0_4(il[525]) - , poseidon2_T_0_5(il[526]) - , poseidon2_T_0_6(il[527]) - , poseidon2_T_0_7(il[528]) - , poseidon2_T_1_4(il[529]) - , poseidon2_T_1_5(il[530]) - , poseidon2_T_1_6(il[531]) - , poseidon2_T_1_7(il[532]) - , poseidon2_T_2_4(il[533]) - , poseidon2_T_2_5(il[534]) - , poseidon2_T_2_6(il[535]) - , poseidon2_T_2_7(il[536]) - , poseidon2_T_3_4(il[537]) - , poseidon2_T_3_5(il[538]) - , poseidon2_T_3_6(il[539]) - , poseidon2_T_3_7(il[540]) - , poseidon2_T_60_4(il[541]) - , poseidon2_T_60_5(il[542]) - , poseidon2_T_60_6(il[543]) - , poseidon2_T_60_7(il[544]) - , poseidon2_T_61_4(il[545]) - , poseidon2_T_61_5(il[546]) - , poseidon2_T_61_6(il[547]) - , poseidon2_T_61_7(il[548]) - , poseidon2_T_62_4(il[549]) - , poseidon2_T_62_5(il[550]) - , poseidon2_T_62_6(il[551]) - , poseidon2_T_62_7(il[552]) - , poseidon2_T_63_4(il[553]) - , poseidon2_T_63_5(il[554]) - , poseidon2_T_63_6(il[555]) - , poseidon2_T_63_7(il[556]) - , poseidon2_a_0(il[557]) - , poseidon2_a_1(il[558]) - , poseidon2_a_2(il[559]) - , poseidon2_a_3(il[560]) - , poseidon2_b_0(il[561]) - , poseidon2_b_1(il[562]) - , poseidon2_b_2(il[563]) - , poseidon2_b_3(il[564]) - , poseidon2_clk(il[565]) - , poseidon2_input_addr(il[566]) - , poseidon2_mem_addr_read_a(il[567]) - , poseidon2_mem_addr_read_b(il[568]) - , poseidon2_mem_addr_read_c(il[569]) - , poseidon2_mem_addr_read_d(il[570]) - , poseidon2_mem_addr_write_a(il[571]) - , poseidon2_mem_addr_write_b(il[572]) - , poseidon2_mem_addr_write_c(il[573]) - , poseidon2_mem_addr_write_d(il[574]) - , poseidon2_output_addr(il[575]) - , poseidon2_sel_poseidon_perm(il[576]) - , range_check_alu_rng_chk(il[577]) - , range_check_clk(il[578]) - , range_check_cmp_hi_bits_rng_chk(il[579]) - , range_check_cmp_lo_bits_rng_chk(il[580]) - , range_check_dyn_diff(il[581]) - , range_check_dyn_rng_chk_bits(il[582]) - , range_check_dyn_rng_chk_pow_2(il[583]) - , range_check_gas_da_rng_chk(il[584]) - , range_check_gas_l2_rng_chk(il[585]) - , range_check_is_lte_u112(il[586]) - , range_check_is_lte_u128(il[587]) - , range_check_is_lte_u16(il[588]) - , range_check_is_lte_u32(il[589]) - , range_check_is_lte_u48(il[590]) - , range_check_is_lte_u64(il[591]) - , range_check_is_lte_u80(il[592]) - , range_check_is_lte_u96(il[593]) - , range_check_mem_rng_chk(il[594]) - , range_check_rng_chk_bits(il[595]) - , range_check_sel_lookup_0(il[596]) - , range_check_sel_lookup_1(il[597]) - , range_check_sel_lookup_2(il[598]) - , range_check_sel_lookup_3(il[599]) - , range_check_sel_lookup_4(il[600]) - , range_check_sel_lookup_5(il[601]) - , range_check_sel_lookup_6(il[602]) - , range_check_sel_rng_chk(il[603]) - , range_check_u16_r0(il[604]) - , range_check_u16_r1(il[605]) - , range_check_u16_r2(il[606]) - , range_check_u16_r3(il[607]) - , range_check_u16_r4(il[608]) - , range_check_u16_r5(il[609]) - , range_check_u16_r6(il[610]) - , range_check_u16_r7(il[611]) - , range_check_value(il[612]) - , sha256_clk(il[613]) - , sha256_input(il[614]) - , sha256_output(il[615]) - , sha256_sel_sha256_compression(il[616]) - , sha256_state(il[617]) - , slice_addr(il[618]) - , slice_clk(il[619]) - , slice_cnt(il[620]) - , slice_col_offset(il[621]) - , slice_one_min_inv(il[622]) - , slice_sel_cd_cpy(il[623]) - , slice_sel_mem_active(il[624]) - , slice_sel_return(il[625]) - , slice_sel_start(il[626]) - , slice_space_id(il[627]) - , slice_val(il[628]) - , lookup_rng_chk_pow_2_counts(il[629]) - , lookup_rng_chk_diff_counts(il[630]) - , lookup_rng_chk_0_counts(il[631]) - , lookup_rng_chk_1_counts(il[632]) - , lookup_rng_chk_2_counts(il[633]) - , lookup_rng_chk_3_counts(il[634]) - , lookup_rng_chk_4_counts(il[635]) - , lookup_rng_chk_5_counts(il[636]) - , lookup_rng_chk_6_counts(il[637]) - , lookup_rng_chk_7_counts(il[638]) - , lookup_pow_2_0_counts(il[639]) - , lookup_pow_2_1_counts(il[640]) - , lookup_byte_lengths_counts(il[641]) - , lookup_byte_operations_counts(il[642]) - , lookup_opcode_gas_counts(il[643]) - , kernel_output_lookup_counts(il[644]) - , lookup_into_kernel_counts(il[645]) - , lookup_cd_value_counts(il[646]) - , lookup_ret_value_counts(il[647]) - , incl_main_tag_err_counts(il[648]) - , incl_mem_tag_err_counts(il[649]) - , perm_rng_mem_inv(il[650]) - , perm_rng_cmp_lo_inv(il[651]) - , perm_rng_cmp_hi_inv(il[652]) - , perm_rng_alu_inv(il[653]) - , perm_cmp_alu_inv(il[654]) - , perm_rng_gas_l2_inv(il[655]) - , perm_rng_gas_da_inv(il[656]) - , perm_pos_mem_read_a_inv(il[657]) - , perm_pos_mem_read_b_inv(il[658]) - , perm_pos_mem_read_c_inv(il[659]) - , perm_pos_mem_read_d_inv(il[660]) - , perm_pos_mem_write_a_inv(il[661]) - , perm_pos_mem_write_b_inv(il[662]) - , perm_pos_mem_write_c_inv(il[663]) - , perm_pos_mem_write_d_inv(il[664]) - , perm_slice_mem_inv(il[665]) - , perm_main_alu_inv(il[666]) - , perm_main_bin_inv(il[667]) - , perm_main_conv_inv(il[668]) - , perm_main_pos2_perm_inv(il[669]) - , perm_main_pedersen_inv(il[670]) - , perm_main_slice_inv(il[671]) - , perm_main_mem_a_inv(il[672]) - , perm_main_mem_b_inv(il[673]) - , perm_main_mem_c_inv(il[674]) - , perm_main_mem_d_inv(il[675]) - , perm_main_mem_ind_addr_a_inv(il[676]) - , perm_main_mem_ind_addr_b_inv(il[677]) - , perm_main_mem_ind_addr_c_inv(il[678]) - , perm_main_mem_ind_addr_d_inv(il[679]) - , lookup_rng_chk_pow_2_inv(il[680]) - , lookup_rng_chk_diff_inv(il[681]) - , lookup_rng_chk_0_inv(il[682]) - , lookup_rng_chk_1_inv(il[683]) - , lookup_rng_chk_2_inv(il[684]) - , lookup_rng_chk_3_inv(il[685]) - , lookup_rng_chk_4_inv(il[686]) - , lookup_rng_chk_5_inv(il[687]) - , lookup_rng_chk_6_inv(il[688]) - , lookup_rng_chk_7_inv(il[689]) - , lookup_pow_2_0_inv(il[690]) - , lookup_pow_2_1_inv(il[691]) - , lookup_byte_lengths_inv(il[692]) - , lookup_byte_operations_inv(il[693]) - , lookup_opcode_gas_inv(il[694]) - , kernel_output_lookup_inv(il[695]) - , lookup_into_kernel_inv(il[696]) - , lookup_cd_value_inv(il[697]) - , lookup_ret_value_inv(il[698]) - , incl_main_tag_err_inv(il[699]) - , incl_mem_tag_err_inv(il[700]) - , binary_acc_ia_shift(il[701]) - , binary_acc_ib_shift(il[702]) - , binary_acc_ic_shift(il[703]) - , binary_mem_tag_ctr_shift(il[704]) - , binary_op_id_shift(il[705]) - , cmp_a_hi_shift(il[706]) - , cmp_a_lo_shift(il[707]) - , cmp_b_hi_shift(il[708]) - , cmp_b_lo_shift(il[709]) - , cmp_cmp_rng_ctr_shift(il[710]) - , cmp_op_gt_shift(il[711]) - , cmp_p_sub_a_hi_shift(il[712]) - , cmp_p_sub_a_lo_shift(il[713]) - , cmp_p_sub_b_hi_shift(il[714]) - , cmp_p_sub_b_lo_shift(il[715]) - , cmp_sel_rng_chk_shift(il[716]) - , main_da_gas_remaining_shift(il[717]) - , main_emit_l2_to_l1_msg_write_offset_shift(il[718]) - , main_emit_note_hash_write_offset_shift(il[719]) - , main_emit_nullifier_write_offset_shift(il[720]) - , main_emit_unencrypted_log_write_offset_shift(il[721]) - , main_internal_return_ptr_shift(il[722]) - , main_l1_to_l2_msg_exists_write_offset_shift(il[723]) - , main_l2_gas_remaining_shift(il[724]) - , main_note_hash_exist_write_offset_shift(il[725]) - , main_nullifier_exists_write_offset_shift(il[726]) - , main_nullifier_non_exists_write_offset_shift(il[727]) - , main_pc_shift(il[728]) - , main_sel_execution_row_shift(il[729]) - , main_sload_write_offset_shift(il[730]) - , main_sstore_write_offset_shift(il[731]) - , mem_glob_addr_shift(il[732]) - , mem_rw_shift(il[733]) - , mem_sel_mem_shift(il[734]) - , mem_tag_shift(il[735]) - , mem_tsp_shift(il[736]) - , mem_val_shift(il[737]) - , slice_addr_shift(il[738]) - , slice_clk_shift(il[739]) - , slice_cnt_shift(il[740]) - , slice_col_offset_shift(il[741]) - , slice_sel_cd_cpy_shift(il[742]) - , slice_sel_mem_active_shift(il[743]) - , slice_sel_return_shift(il[744]) - , slice_sel_start_shift(il[745]) - , slice_space_id_shift(il[746]) + , main_sel_op_dagasleft(il[187]) + , main_sel_op_div(il[188]) + , main_sel_op_ecadd(il[189]) + , main_sel_op_emit_l2_to_l1_msg(il[190]) + , main_sel_op_emit_note_hash(il[191]) + , main_sel_op_emit_nullifier(il[192]) + , main_sel_op_emit_unencrypted_log(il[193]) + , main_sel_op_eq(il[194]) + , main_sel_op_external_call(il[195]) + , main_sel_op_external_return(il[196]) + , main_sel_op_external_revert(il[197]) + , main_sel_op_fdiv(il[198]) + , main_sel_op_fee_per_da_gas(il[199]) + , main_sel_op_fee_per_l2_gas(il[200]) + , main_sel_op_function_selector(il[201]) + , main_sel_op_get_contract_instance(il[202]) + , main_sel_op_internal_call(il[203]) + , main_sel_op_internal_return(il[204]) + , main_sel_op_is_static_call(il[205]) + , main_sel_op_jump(il[206]) + , main_sel_op_jumpi(il[207]) + , main_sel_op_keccak(il[208]) + , main_sel_op_l1_to_l2_msg_exists(il[209]) + , main_sel_op_l2gasleft(il[210]) + , main_sel_op_lt(il[211]) + , main_sel_op_lte(il[212]) + , main_sel_op_mov(il[213]) + , main_sel_op_msm(il[214]) + , main_sel_op_mul(il[215]) + , main_sel_op_not(il[216]) + , main_sel_op_note_hash_exists(il[217]) + , main_sel_op_nullifier_exists(il[218]) + , main_sel_op_or(il[219]) + , main_sel_op_pedersen(il[220]) + , main_sel_op_pedersen_commit(il[221]) + , main_sel_op_poseidon2(il[222]) + , main_sel_op_radix_le(il[223]) + , main_sel_op_sender(il[224]) + , main_sel_op_set(il[225]) + , main_sel_op_sha256(il[226]) + , main_sel_op_shl(il[227]) + , main_sel_op_shr(il[228]) + , main_sel_op_sload(il[229]) + , main_sel_op_sstore(il[230]) + , main_sel_op_static_call(il[231]) + , main_sel_op_storage_address(il[232]) + , main_sel_op_sub(il[233]) + , main_sel_op_timestamp(il[234]) + , main_sel_op_transaction_fee(il[235]) + , main_sel_op_version(il[236]) + , main_sel_op_xor(il[237]) + , main_sel_q_kernel_lookup(il[238]) + , main_sel_q_kernel_output_lookup(il[239]) + , main_sel_resolve_ind_addr_a(il[240]) + , main_sel_resolve_ind_addr_b(il[241]) + , main_sel_resolve_ind_addr_c(il[242]) + , main_sel_resolve_ind_addr_d(il[243]) + , main_sel_returndata(il[244]) + , main_sel_rng_16(il[245]) + , main_sel_rng_8(il[246]) + , main_sel_slice_gadget(il[247]) + , main_side_effect_counter(il[248]) + , main_sload_write_offset(il[249]) + , main_space_id(il[250]) + , main_sstore_write_offset(il[251]) + , main_tag_err(il[252]) + , main_w_in_tag(il[253]) + , mem_addr(il[254]) + , mem_clk(il[255]) + , mem_diff(il[256]) + , mem_glob_addr(il[257]) + , mem_last(il[258]) + , mem_lastAccess(il[259]) + , mem_one_min_inv(il[260]) + , mem_r_in_tag(il[261]) + , mem_rw(il[262]) + , mem_sel_mem(il[263]) + , mem_sel_mov_ia_to_ic(il[264]) + , mem_sel_mov_ib_to_ic(il[265]) + , mem_sel_op_a(il[266]) + , mem_sel_op_b(il[267]) + , mem_sel_op_c(il[268]) + , mem_sel_op_d(il[269]) + , mem_sel_op_poseidon_read_a(il[270]) + , mem_sel_op_poseidon_read_b(il[271]) + , mem_sel_op_poseidon_read_c(il[272]) + , mem_sel_op_poseidon_read_d(il[273]) + , mem_sel_op_poseidon_write_a(il[274]) + , mem_sel_op_poseidon_write_b(il[275]) + , mem_sel_op_poseidon_write_c(il[276]) + , mem_sel_op_poseidon_write_d(il[277]) + , mem_sel_op_slice(il[278]) + , mem_sel_resolve_ind_addr_a(il[279]) + , mem_sel_resolve_ind_addr_b(il[280]) + , mem_sel_resolve_ind_addr_c(il[281]) + , mem_sel_resolve_ind_addr_d(il[282]) + , mem_sel_rng_chk(il[283]) + , mem_skip_check_tag(il[284]) + , mem_space_id(il[285]) + , mem_tag(il[286]) + , mem_tag_err(il[287]) + , mem_tsp(il[288]) + , mem_val(il[289]) + , mem_w_in_tag(il[290]) + , pedersen_clk(il[291]) + , pedersen_input(il[292]) + , pedersen_output(il[293]) + , pedersen_sel_pedersen(il[294]) + , poseidon2_B_10_0(il[295]) + , poseidon2_B_10_1(il[296]) + , poseidon2_B_10_2(il[297]) + , poseidon2_B_10_3(il[298]) + , poseidon2_B_11_0(il[299]) + , poseidon2_B_11_1(il[300]) + , poseidon2_B_11_2(il[301]) + , poseidon2_B_11_3(il[302]) + , poseidon2_B_12_0(il[303]) + , poseidon2_B_12_1(il[304]) + , poseidon2_B_12_2(il[305]) + , poseidon2_B_12_3(il[306]) + , poseidon2_B_13_0(il[307]) + , poseidon2_B_13_1(il[308]) + , poseidon2_B_13_2(il[309]) + , poseidon2_B_13_3(il[310]) + , poseidon2_B_14_0(il[311]) + , poseidon2_B_14_1(il[312]) + , poseidon2_B_14_2(il[313]) + , poseidon2_B_14_3(il[314]) + , poseidon2_B_15_0(il[315]) + , poseidon2_B_15_1(il[316]) + , poseidon2_B_15_2(il[317]) + , poseidon2_B_15_3(il[318]) + , poseidon2_B_16_0(il[319]) + , poseidon2_B_16_1(il[320]) + , poseidon2_B_16_2(il[321]) + , poseidon2_B_16_3(il[322]) + , poseidon2_B_17_0(il[323]) + , poseidon2_B_17_1(il[324]) + , poseidon2_B_17_2(il[325]) + , poseidon2_B_17_3(il[326]) + , poseidon2_B_18_0(il[327]) + , poseidon2_B_18_1(il[328]) + , poseidon2_B_18_2(il[329]) + , poseidon2_B_18_3(il[330]) + , poseidon2_B_19_0(il[331]) + , poseidon2_B_19_1(il[332]) + , poseidon2_B_19_2(il[333]) + , poseidon2_B_19_3(il[334]) + , poseidon2_B_20_0(il[335]) + , poseidon2_B_20_1(il[336]) + , poseidon2_B_20_2(il[337]) + , poseidon2_B_20_3(il[338]) + , poseidon2_B_21_0(il[339]) + , poseidon2_B_21_1(il[340]) + , poseidon2_B_21_2(il[341]) + , poseidon2_B_21_3(il[342]) + , poseidon2_B_22_0(il[343]) + , poseidon2_B_22_1(il[344]) + , poseidon2_B_22_2(il[345]) + , poseidon2_B_22_3(il[346]) + , poseidon2_B_23_0(il[347]) + , poseidon2_B_23_1(il[348]) + , poseidon2_B_23_2(il[349]) + , poseidon2_B_23_3(il[350]) + , poseidon2_B_24_0(il[351]) + , poseidon2_B_24_1(il[352]) + , poseidon2_B_24_2(il[353]) + , poseidon2_B_24_3(il[354]) + , poseidon2_B_25_0(il[355]) + , poseidon2_B_25_1(il[356]) + , poseidon2_B_25_2(il[357]) + , poseidon2_B_25_3(il[358]) + , poseidon2_B_26_0(il[359]) + , poseidon2_B_26_1(il[360]) + , poseidon2_B_26_2(il[361]) + , poseidon2_B_26_3(il[362]) + , poseidon2_B_27_0(il[363]) + , poseidon2_B_27_1(il[364]) + , poseidon2_B_27_2(il[365]) + , poseidon2_B_27_3(il[366]) + , poseidon2_B_28_0(il[367]) + , poseidon2_B_28_1(il[368]) + , poseidon2_B_28_2(il[369]) + , poseidon2_B_28_3(il[370]) + , poseidon2_B_29_0(il[371]) + , poseidon2_B_29_1(il[372]) + , poseidon2_B_29_2(il[373]) + , poseidon2_B_29_3(il[374]) + , poseidon2_B_30_0(il[375]) + , poseidon2_B_30_1(il[376]) + , poseidon2_B_30_2(il[377]) + , poseidon2_B_30_3(il[378]) + , poseidon2_B_31_0(il[379]) + , poseidon2_B_31_1(il[380]) + , poseidon2_B_31_2(il[381]) + , poseidon2_B_31_3(il[382]) + , poseidon2_B_32_0(il[383]) + , poseidon2_B_32_1(il[384]) + , poseidon2_B_32_2(il[385]) + , poseidon2_B_32_3(il[386]) + , poseidon2_B_33_0(il[387]) + , poseidon2_B_33_1(il[388]) + , poseidon2_B_33_2(il[389]) + , poseidon2_B_33_3(il[390]) + , poseidon2_B_34_0(il[391]) + , poseidon2_B_34_1(il[392]) + , poseidon2_B_34_2(il[393]) + , poseidon2_B_34_3(il[394]) + , poseidon2_B_35_0(il[395]) + , poseidon2_B_35_1(il[396]) + , poseidon2_B_35_2(il[397]) + , poseidon2_B_35_3(il[398]) + , poseidon2_B_36_0(il[399]) + , poseidon2_B_36_1(il[400]) + , poseidon2_B_36_2(il[401]) + , poseidon2_B_36_3(il[402]) + , poseidon2_B_37_0(il[403]) + , poseidon2_B_37_1(il[404]) + , poseidon2_B_37_2(il[405]) + , poseidon2_B_37_3(il[406]) + , poseidon2_B_38_0(il[407]) + , poseidon2_B_38_1(il[408]) + , poseidon2_B_38_2(il[409]) + , poseidon2_B_38_3(il[410]) + , poseidon2_B_39_0(il[411]) + , poseidon2_B_39_1(il[412]) + , poseidon2_B_39_2(il[413]) + , poseidon2_B_39_3(il[414]) + , poseidon2_B_40_0(il[415]) + , poseidon2_B_40_1(il[416]) + , poseidon2_B_40_2(il[417]) + , poseidon2_B_40_3(il[418]) + , poseidon2_B_41_0(il[419]) + , poseidon2_B_41_1(il[420]) + , poseidon2_B_41_2(il[421]) + , poseidon2_B_41_3(il[422]) + , poseidon2_B_42_0(il[423]) + , poseidon2_B_42_1(il[424]) + , poseidon2_B_42_2(il[425]) + , poseidon2_B_42_3(il[426]) + , poseidon2_B_43_0(il[427]) + , poseidon2_B_43_1(il[428]) + , poseidon2_B_43_2(il[429]) + , poseidon2_B_43_3(il[430]) + , poseidon2_B_44_0(il[431]) + , poseidon2_B_44_1(il[432]) + , poseidon2_B_44_2(il[433]) + , poseidon2_B_44_3(il[434]) + , poseidon2_B_45_0(il[435]) + , poseidon2_B_45_1(il[436]) + , poseidon2_B_45_2(il[437]) + , poseidon2_B_45_3(il[438]) + , poseidon2_B_46_0(il[439]) + , poseidon2_B_46_1(il[440]) + , poseidon2_B_46_2(il[441]) + , poseidon2_B_46_3(il[442]) + , poseidon2_B_47_0(il[443]) + , poseidon2_B_47_1(il[444]) + , poseidon2_B_47_2(il[445]) + , poseidon2_B_47_3(il[446]) + , poseidon2_B_48_0(il[447]) + , poseidon2_B_48_1(il[448]) + , poseidon2_B_48_2(il[449]) + , poseidon2_B_48_3(il[450]) + , poseidon2_B_49_0(il[451]) + , poseidon2_B_49_1(il[452]) + , poseidon2_B_49_2(il[453]) + , poseidon2_B_49_3(il[454]) + , poseidon2_B_4_0(il[455]) + , poseidon2_B_4_1(il[456]) + , poseidon2_B_4_2(il[457]) + , poseidon2_B_4_3(il[458]) + , poseidon2_B_50_0(il[459]) + , poseidon2_B_50_1(il[460]) + , poseidon2_B_50_2(il[461]) + , poseidon2_B_50_3(il[462]) + , poseidon2_B_51_0(il[463]) + , poseidon2_B_51_1(il[464]) + , poseidon2_B_51_2(il[465]) + , poseidon2_B_51_3(il[466]) + , poseidon2_B_52_0(il[467]) + , poseidon2_B_52_1(il[468]) + , poseidon2_B_52_2(il[469]) + , poseidon2_B_52_3(il[470]) + , poseidon2_B_53_0(il[471]) + , poseidon2_B_53_1(il[472]) + , poseidon2_B_53_2(il[473]) + , poseidon2_B_53_3(il[474]) + , poseidon2_B_54_0(il[475]) + , poseidon2_B_54_1(il[476]) + , poseidon2_B_54_2(il[477]) + , poseidon2_B_54_3(il[478]) + , poseidon2_B_55_0(il[479]) + , poseidon2_B_55_1(il[480]) + , poseidon2_B_55_2(il[481]) + , poseidon2_B_55_3(il[482]) + , poseidon2_B_56_0(il[483]) + , poseidon2_B_56_1(il[484]) + , poseidon2_B_56_2(il[485]) + , poseidon2_B_56_3(il[486]) + , poseidon2_B_57_0(il[487]) + , poseidon2_B_57_1(il[488]) + , poseidon2_B_57_2(il[489]) + , poseidon2_B_57_3(il[490]) + , poseidon2_B_58_0(il[491]) + , poseidon2_B_58_1(il[492]) + , poseidon2_B_58_2(il[493]) + , poseidon2_B_58_3(il[494]) + , poseidon2_B_59_0(il[495]) + , poseidon2_B_59_1(il[496]) + , poseidon2_B_59_2(il[497]) + , poseidon2_B_59_3(il[498]) + , poseidon2_B_5_0(il[499]) + , poseidon2_B_5_1(il[500]) + , poseidon2_B_5_2(il[501]) + , poseidon2_B_5_3(il[502]) + , poseidon2_B_6_0(il[503]) + , poseidon2_B_6_1(il[504]) + , poseidon2_B_6_2(il[505]) + , poseidon2_B_6_3(il[506]) + , poseidon2_B_7_0(il[507]) + , poseidon2_B_7_1(il[508]) + , poseidon2_B_7_2(il[509]) + , poseidon2_B_7_3(il[510]) + , poseidon2_B_8_0(il[511]) + , poseidon2_B_8_1(il[512]) + , poseidon2_B_8_2(il[513]) + , poseidon2_B_8_3(il[514]) + , poseidon2_B_9_0(il[515]) + , poseidon2_B_9_1(il[516]) + , poseidon2_B_9_2(il[517]) + , poseidon2_B_9_3(il[518]) + , poseidon2_EXT_LAYER_4(il[519]) + , poseidon2_EXT_LAYER_5(il[520]) + , poseidon2_EXT_LAYER_6(il[521]) + , poseidon2_EXT_LAYER_7(il[522]) + , poseidon2_T_0_4(il[523]) + , poseidon2_T_0_5(il[524]) + , poseidon2_T_0_6(il[525]) + , poseidon2_T_0_7(il[526]) + , poseidon2_T_1_4(il[527]) + , poseidon2_T_1_5(il[528]) + , poseidon2_T_1_6(il[529]) + , poseidon2_T_1_7(il[530]) + , poseidon2_T_2_4(il[531]) + , poseidon2_T_2_5(il[532]) + , poseidon2_T_2_6(il[533]) + , poseidon2_T_2_7(il[534]) + , poseidon2_T_3_4(il[535]) + , poseidon2_T_3_5(il[536]) + , poseidon2_T_3_6(il[537]) + , poseidon2_T_3_7(il[538]) + , poseidon2_T_60_4(il[539]) + , poseidon2_T_60_5(il[540]) + , poseidon2_T_60_6(il[541]) + , poseidon2_T_60_7(il[542]) + , poseidon2_T_61_4(il[543]) + , poseidon2_T_61_5(il[544]) + , poseidon2_T_61_6(il[545]) + , poseidon2_T_61_7(il[546]) + , poseidon2_T_62_4(il[547]) + , poseidon2_T_62_5(il[548]) + , poseidon2_T_62_6(il[549]) + , poseidon2_T_62_7(il[550]) + , poseidon2_T_63_4(il[551]) + , poseidon2_T_63_5(il[552]) + , poseidon2_T_63_6(il[553]) + , poseidon2_T_63_7(il[554]) + , poseidon2_a_0(il[555]) + , poseidon2_a_1(il[556]) + , poseidon2_a_2(il[557]) + , poseidon2_a_3(il[558]) + , poseidon2_b_0(il[559]) + , poseidon2_b_1(il[560]) + , poseidon2_b_2(il[561]) + , poseidon2_b_3(il[562]) + , poseidon2_clk(il[563]) + , poseidon2_input_addr(il[564]) + , poseidon2_mem_addr_read_a(il[565]) + , poseidon2_mem_addr_read_b(il[566]) + , poseidon2_mem_addr_read_c(il[567]) + , poseidon2_mem_addr_read_d(il[568]) + , poseidon2_mem_addr_write_a(il[569]) + , poseidon2_mem_addr_write_b(il[570]) + , poseidon2_mem_addr_write_c(il[571]) + , poseidon2_mem_addr_write_d(il[572]) + , poseidon2_output_addr(il[573]) + , poseidon2_sel_poseidon_perm(il[574]) + , range_check_alu_rng_chk(il[575]) + , range_check_clk(il[576]) + , range_check_cmp_hi_bits_rng_chk(il[577]) + , range_check_cmp_lo_bits_rng_chk(il[578]) + , range_check_dyn_diff(il[579]) + , range_check_dyn_rng_chk_bits(il[580]) + , range_check_dyn_rng_chk_pow_2(il[581]) + , range_check_gas_da_rng_chk(il[582]) + , range_check_gas_l2_rng_chk(il[583]) + , range_check_is_lte_u112(il[584]) + , range_check_is_lte_u128(il[585]) + , range_check_is_lte_u16(il[586]) + , range_check_is_lte_u32(il[587]) + , range_check_is_lte_u48(il[588]) + , range_check_is_lte_u64(il[589]) + , range_check_is_lte_u80(il[590]) + , range_check_is_lte_u96(il[591]) + , range_check_mem_rng_chk(il[592]) + , range_check_rng_chk_bits(il[593]) + , range_check_sel_lookup_0(il[594]) + , range_check_sel_lookup_1(il[595]) + , range_check_sel_lookup_2(il[596]) + , range_check_sel_lookup_3(il[597]) + , range_check_sel_lookup_4(il[598]) + , range_check_sel_lookup_5(il[599]) + , range_check_sel_lookup_6(il[600]) + , range_check_sel_rng_chk(il[601]) + , range_check_u16_r0(il[602]) + , range_check_u16_r1(il[603]) + , range_check_u16_r2(il[604]) + , range_check_u16_r3(il[605]) + , range_check_u16_r4(il[606]) + , range_check_u16_r5(il[607]) + , range_check_u16_r6(il[608]) + , range_check_u16_r7(il[609]) + , range_check_value(il[610]) + , sha256_clk(il[611]) + , sha256_input(il[612]) + , sha256_output(il[613]) + , sha256_sel_sha256_compression(il[614]) + , sha256_state(il[615]) + , slice_addr(il[616]) + , slice_clk(il[617]) + , slice_cnt(il[618]) + , slice_col_offset(il[619]) + , slice_one_min_inv(il[620]) + , slice_sel_cd_cpy(il[621]) + , slice_sel_mem_active(il[622]) + , slice_sel_return(il[623]) + , slice_sel_start(il[624]) + , slice_space_id(il[625]) + , slice_val(il[626]) + , lookup_rng_chk_pow_2_counts(il[627]) + , lookup_rng_chk_diff_counts(il[628]) + , lookup_rng_chk_0_counts(il[629]) + , lookup_rng_chk_1_counts(il[630]) + , lookup_rng_chk_2_counts(il[631]) + , lookup_rng_chk_3_counts(il[632]) + , lookup_rng_chk_4_counts(il[633]) + , lookup_rng_chk_5_counts(il[634]) + , lookup_rng_chk_6_counts(il[635]) + , lookup_rng_chk_7_counts(il[636]) + , lookup_pow_2_0_counts(il[637]) + , lookup_pow_2_1_counts(il[638]) + , lookup_byte_lengths_counts(il[639]) + , lookup_byte_operations_counts(il[640]) + , lookup_opcode_gas_counts(il[641]) + , kernel_output_lookup_counts(il[642]) + , lookup_into_kernel_counts(il[643]) + , lookup_cd_value_counts(il[644]) + , lookup_ret_value_counts(il[645]) + , incl_main_tag_err_counts(il[646]) + , incl_mem_tag_err_counts(il[647]) + , perm_rng_mem_inv(il[648]) + , perm_rng_cmp_lo_inv(il[649]) + , perm_rng_cmp_hi_inv(il[650]) + , perm_rng_alu_inv(il[651]) + , perm_cmp_alu_inv(il[652]) + , perm_rng_gas_l2_inv(il[653]) + , perm_rng_gas_da_inv(il[654]) + , perm_pos_mem_read_a_inv(il[655]) + , perm_pos_mem_read_b_inv(il[656]) + , perm_pos_mem_read_c_inv(il[657]) + , perm_pos_mem_read_d_inv(il[658]) + , perm_pos_mem_write_a_inv(il[659]) + , perm_pos_mem_write_b_inv(il[660]) + , perm_pos_mem_write_c_inv(il[661]) + , perm_pos_mem_write_d_inv(il[662]) + , perm_slice_mem_inv(il[663]) + , perm_main_alu_inv(il[664]) + , perm_main_bin_inv(il[665]) + , perm_main_conv_inv(il[666]) + , perm_main_pos2_perm_inv(il[667]) + , perm_main_pedersen_inv(il[668]) + , perm_main_slice_inv(il[669]) + , perm_main_mem_a_inv(il[670]) + , perm_main_mem_b_inv(il[671]) + , perm_main_mem_c_inv(il[672]) + , perm_main_mem_d_inv(il[673]) + , perm_main_mem_ind_addr_a_inv(il[674]) + , perm_main_mem_ind_addr_b_inv(il[675]) + , perm_main_mem_ind_addr_c_inv(il[676]) + , perm_main_mem_ind_addr_d_inv(il[677]) + , lookup_rng_chk_pow_2_inv(il[678]) + , lookup_rng_chk_diff_inv(il[679]) + , lookup_rng_chk_0_inv(il[680]) + , lookup_rng_chk_1_inv(il[681]) + , lookup_rng_chk_2_inv(il[682]) + , lookup_rng_chk_3_inv(il[683]) + , lookup_rng_chk_4_inv(il[684]) + , lookup_rng_chk_5_inv(il[685]) + , lookup_rng_chk_6_inv(il[686]) + , lookup_rng_chk_7_inv(il[687]) + , lookup_pow_2_0_inv(il[688]) + , lookup_pow_2_1_inv(il[689]) + , lookup_byte_lengths_inv(il[690]) + , lookup_byte_operations_inv(il[691]) + , lookup_opcode_gas_inv(il[692]) + , kernel_output_lookup_inv(il[693]) + , lookup_into_kernel_inv(il[694]) + , lookup_cd_value_inv(il[695]) + , lookup_ret_value_inv(il[696]) + , incl_main_tag_err_inv(il[697]) + , incl_mem_tag_err_inv(il[698]) + , binary_acc_ia_shift(il[699]) + , binary_acc_ib_shift(il[700]) + , binary_acc_ic_shift(il[701]) + , binary_mem_tag_ctr_shift(il[702]) + , binary_op_id_shift(il[703]) + , cmp_a_hi_shift(il[704]) + , cmp_a_lo_shift(il[705]) + , cmp_b_hi_shift(il[706]) + , cmp_b_lo_shift(il[707]) + , cmp_cmp_rng_ctr_shift(il[708]) + , cmp_op_gt_shift(il[709]) + , cmp_p_sub_a_hi_shift(il[710]) + , cmp_p_sub_a_lo_shift(il[711]) + , cmp_p_sub_b_hi_shift(il[712]) + , cmp_p_sub_b_lo_shift(il[713]) + , cmp_sel_rng_chk_shift(il[714]) + , main_da_gas_remaining_shift(il[715]) + , main_emit_l2_to_l1_msg_write_offset_shift(il[716]) + , main_emit_note_hash_write_offset_shift(il[717]) + , main_emit_nullifier_write_offset_shift(il[718]) + , main_emit_unencrypted_log_write_offset_shift(il[719]) + , main_internal_return_ptr_shift(il[720]) + , main_l1_to_l2_msg_exists_write_offset_shift(il[721]) + , main_l2_gas_remaining_shift(il[722]) + , main_note_hash_exist_write_offset_shift(il[723]) + , main_nullifier_exists_write_offset_shift(il[724]) + , main_nullifier_non_exists_write_offset_shift(il[725]) + , main_pc_shift(il[726]) + , main_sel_execution_row_shift(il[727]) + , main_sload_write_offset_shift(il[728]) + , main_sstore_write_offset_shift(il[729]) + , mem_glob_addr_shift(il[730]) + , mem_rw_shift(il[731]) + , mem_sel_mem_shift(il[732]) + , mem_tag_shift(il[733]) + , mem_tsp_shift(il[734]) + , mem_val_shift(il[735]) + , slice_addr_shift(il[736]) + , slice_clk_shift(il[737]) + , slice_cnt_shift(il[738]) + , slice_col_offset_shift(il[739]) + , slice_sel_cd_cpy_shift(il[740]) + , slice_sel_mem_active_shift(il[741]) + , slice_sel_return_shift(il[742]) + , slice_sel_start_shift(il[743]) + , slice_space_id_shift(il[744]) {} AvmFlavor::ProverPolynomials::ProverPolynomials(ProvingKey& proving_key) @@ -955,7 +953,6 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id main_sel_op_calldata_copy[row_idx], main_sel_op_cast[row_idx], main_sel_op_chain_id[row_idx], - main_sel_op_cmov[row_idx], main_sel_op_dagasleft[row_idx], main_sel_op_div[row_idx], main_sel_op_ecadd[row_idx], @@ -1038,7 +1035,6 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id mem_sel_op_a[row_idx], mem_sel_op_b[row_idx], mem_sel_op_c[row_idx], - mem_sel_op_cmov[row_idx], mem_sel_op_d[row_idx], mem_sel_op_poseidon_read_a[row_idx], mem_sel_op_poseidon_read_b[row_idx], @@ -1706,7 +1702,6 @@ AvmFlavor::CommitmentLabels::CommitmentLabels() Base::main_sel_op_calldata_copy = "MAIN_SEL_OP_CALLDATA_COPY"; Base::main_sel_op_cast = "MAIN_SEL_OP_CAST"; Base::main_sel_op_chain_id = "MAIN_SEL_OP_CHAIN_ID"; - Base::main_sel_op_cmov = "MAIN_SEL_OP_CMOV"; Base::main_sel_op_dagasleft = "MAIN_SEL_OP_DAGASLEFT"; Base::main_sel_op_div = "MAIN_SEL_OP_DIV"; Base::main_sel_op_ecadd = "MAIN_SEL_OP_ECADD"; @@ -1789,7 +1784,6 @@ AvmFlavor::CommitmentLabels::CommitmentLabels() Base::mem_sel_op_a = "MEM_SEL_OP_A"; Base::mem_sel_op_b = "MEM_SEL_OP_B"; Base::mem_sel_op_c = "MEM_SEL_OP_C"; - Base::mem_sel_op_cmov = "MEM_SEL_OP_CMOV"; Base::mem_sel_op_d = "MEM_SEL_OP_D"; Base::mem_sel_op_poseidon_read_a = "MEM_SEL_OP_POSEIDON_READ_A"; Base::mem_sel_op_poseidon_read_b = "MEM_SEL_OP_POSEIDON_READ_B"; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp index 3108b4bfee7b..ed5e72bc4822 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp @@ -90,7 +90,7 @@ template using tuple_cat_t = decltype(std::tuple_cat(std:: // The entities that will be used in the flavor. // clang-format off #define PRECOMPUTED_ENTITIES byte_lookup_sel_bin, byte_lookup_table_byte_lengths, byte_lookup_table_in_tags, byte_lookup_table_input_a, byte_lookup_table_input_b, byte_lookup_table_op_id, byte_lookup_table_output, gas_base_da_gas_fixed_table, gas_base_l2_gas_fixed_table, gas_dyn_da_gas_fixed_table, gas_dyn_l2_gas_fixed_table, gas_sel_gas_cost, main_clk, main_sel_first, main_zeroes, powers_power_of_2 -#define WIRE_ENTITIES main_kernel_inputs, main_kernel_value_out, main_kernel_side_effect_out, main_kernel_metadata_out, main_calldata, main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, alu_b_lo, alu_b_pow, alu_c_hi, alu_c_lo, alu_cf, alu_clk, alu_cmp_gadget_gt, alu_cmp_gadget_input_a, alu_cmp_gadget_input_b, alu_cmp_gadget_result, alu_cmp_gadget_sel, alu_ff_tag, alu_ia, alu_ib, alu_ic, alu_in_tag, alu_max_bits_sub_b_bits, alu_max_bits_sub_b_pow, alu_op_add, alu_op_cast, alu_op_div, alu_op_eq, alu_op_lt, alu_op_lte, alu_op_mul, alu_op_not, alu_op_shl, alu_op_shr, alu_op_sub, alu_partial_prod_hi, alu_partial_prod_lo, alu_range_check_input_value, alu_range_check_num_bits, alu_range_check_sel, alu_remainder, alu_sel_alu, alu_sel_cmp, alu_sel_shift_which, alu_u128_tag, alu_u16_tag, alu_u1_tag, alu_u32_tag, alu_u64_tag, alu_u8_tag, alu_zero_shift, binary_acc_ia, binary_acc_ib, binary_acc_ic, binary_clk, binary_ia_bytes, binary_ib_bytes, binary_ic_bytes, binary_in_tag, binary_mem_tag_ctr, binary_mem_tag_ctr_inv, binary_op_id, binary_sel_bin, binary_start, cmp_a_hi, cmp_a_lo, cmp_b_hi, cmp_b_lo, cmp_borrow, cmp_clk, cmp_cmp_rng_ctr, cmp_input_a, cmp_input_b, cmp_op_eq, cmp_op_eq_diff_inv, cmp_op_gt, cmp_p_a_borrow, cmp_p_b_borrow, cmp_p_sub_a_hi, cmp_p_sub_a_lo, cmp_p_sub_b_hi, cmp_p_sub_b_lo, cmp_range_chk_clk, cmp_res_hi, cmp_res_lo, cmp_result, cmp_sel_cmp, cmp_sel_rng_chk, cmp_shift_sel, conversion_clk, conversion_input, conversion_num_limbs, conversion_output_bits, conversion_radix, conversion_sel_to_radix_le, keccakf1600_clk, keccakf1600_input, keccakf1600_output, keccakf1600_sel_keccakf1600, main_abs_da_rem_gas, main_abs_l2_rem_gas, main_alu_in_tag, main_base_da_gas_op_cost, main_base_l2_gas_op_cost, main_bin_op_id, main_call_ptr, main_da_gas_remaining, main_da_out_of_gas, main_dyn_da_gas_op_cost, main_dyn_gas_multiplier, main_dyn_l2_gas_op_cost, main_emit_l2_to_l1_msg_write_offset, main_emit_note_hash_write_offset, main_emit_nullifier_write_offset, main_emit_unencrypted_log_write_offset, main_ia, main_ib, main_ic, main_id, main_id_zero, main_ind_addr_a, main_ind_addr_b, main_ind_addr_c, main_ind_addr_d, main_internal_return_ptr, main_inv, main_is_fake_row, main_is_gas_accounted, main_kernel_in_offset, main_kernel_out_offset, main_l1_to_l2_msg_exists_write_offset, main_l2_gas_remaining, main_l2_out_of_gas, main_mem_addr_a, main_mem_addr_b, main_mem_addr_c, main_mem_addr_d, main_note_hash_exist_write_offset, main_nullifier_exists_write_offset, main_nullifier_non_exists_write_offset, main_op_err, main_opcode_val, main_pc, main_r_in_tag, main_rwa, main_rwb, main_rwc, main_rwd, main_sel_alu, main_sel_bin, main_sel_calldata, main_sel_execution_row, main_sel_kernel_inputs, main_sel_kernel_out, main_sel_last, main_sel_mem_op_a, main_sel_mem_op_b, main_sel_mem_op_c, main_sel_mem_op_d, main_sel_mov_ia_to_ic, main_sel_mov_ib_to_ic, main_sel_op_add, main_sel_op_address, main_sel_op_and, main_sel_op_block_number, main_sel_op_calldata_copy, main_sel_op_cast, main_sel_op_chain_id, main_sel_op_cmov, main_sel_op_dagasleft, main_sel_op_div, main_sel_op_ecadd, main_sel_op_emit_l2_to_l1_msg, main_sel_op_emit_note_hash, main_sel_op_emit_nullifier, main_sel_op_emit_unencrypted_log, main_sel_op_eq, main_sel_op_external_call, main_sel_op_external_return, main_sel_op_external_revert, main_sel_op_fdiv, main_sel_op_fee_per_da_gas, main_sel_op_fee_per_l2_gas, main_sel_op_function_selector, main_sel_op_get_contract_instance, main_sel_op_internal_call, main_sel_op_internal_return, main_sel_op_is_static_call, main_sel_op_jump, main_sel_op_jumpi, main_sel_op_keccak, main_sel_op_l1_to_l2_msg_exists, main_sel_op_l2gasleft, main_sel_op_lt, main_sel_op_lte, main_sel_op_mov, main_sel_op_msm, main_sel_op_mul, main_sel_op_not, main_sel_op_note_hash_exists, main_sel_op_nullifier_exists, main_sel_op_or, main_sel_op_pedersen, main_sel_op_pedersen_commit, main_sel_op_poseidon2, main_sel_op_radix_le, main_sel_op_sender, main_sel_op_set, main_sel_op_sha256, main_sel_op_shl, main_sel_op_shr, main_sel_op_sload, main_sel_op_sstore, main_sel_op_static_call, main_sel_op_storage_address, main_sel_op_sub, main_sel_op_timestamp, main_sel_op_transaction_fee, main_sel_op_version, main_sel_op_xor, main_sel_q_kernel_lookup, main_sel_q_kernel_output_lookup, main_sel_resolve_ind_addr_a, main_sel_resolve_ind_addr_b, main_sel_resolve_ind_addr_c, main_sel_resolve_ind_addr_d, main_sel_returndata, main_sel_rng_16, main_sel_rng_8, main_sel_slice_gadget, main_side_effect_counter, main_sload_write_offset, main_space_id, main_sstore_write_offset, main_tag_err, main_w_in_tag, mem_addr, mem_clk, mem_diff, mem_glob_addr, mem_last, mem_lastAccess, mem_one_min_inv, mem_r_in_tag, mem_rw, mem_sel_mem, mem_sel_mov_ia_to_ic, mem_sel_mov_ib_to_ic, mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, mem_sel_op_cmov, mem_sel_op_d, mem_sel_op_poseidon_read_a, mem_sel_op_poseidon_read_b, mem_sel_op_poseidon_read_c, mem_sel_op_poseidon_read_d, mem_sel_op_poseidon_write_a, mem_sel_op_poseidon_write_b, mem_sel_op_poseidon_write_c, mem_sel_op_poseidon_write_d, mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, mem_sel_resolve_ind_addr_d, mem_sel_rng_chk, mem_skip_check_tag, mem_space_id, mem_tag, mem_tag_err, mem_tsp, mem_val, mem_w_in_tag, pedersen_clk, pedersen_input, pedersen_output, pedersen_sel_pedersen, poseidon2_B_10_0, poseidon2_B_10_1, poseidon2_B_10_2, poseidon2_B_10_3, poseidon2_B_11_0, poseidon2_B_11_1, poseidon2_B_11_2, poseidon2_B_11_3, poseidon2_B_12_0, poseidon2_B_12_1, poseidon2_B_12_2, poseidon2_B_12_3, poseidon2_B_13_0, poseidon2_B_13_1, poseidon2_B_13_2, poseidon2_B_13_3, poseidon2_B_14_0, poseidon2_B_14_1, poseidon2_B_14_2, poseidon2_B_14_3, poseidon2_B_15_0, poseidon2_B_15_1, poseidon2_B_15_2, poseidon2_B_15_3, poseidon2_B_16_0, poseidon2_B_16_1, poseidon2_B_16_2, poseidon2_B_16_3, poseidon2_B_17_0, poseidon2_B_17_1, poseidon2_B_17_2, poseidon2_B_17_3, poseidon2_B_18_0, poseidon2_B_18_1, poseidon2_B_18_2, poseidon2_B_18_3, poseidon2_B_19_0, poseidon2_B_19_1, poseidon2_B_19_2, poseidon2_B_19_3, poseidon2_B_20_0, poseidon2_B_20_1, poseidon2_B_20_2, poseidon2_B_20_3, poseidon2_B_21_0, poseidon2_B_21_1, poseidon2_B_21_2, poseidon2_B_21_3, poseidon2_B_22_0, poseidon2_B_22_1, poseidon2_B_22_2, poseidon2_B_22_3, poseidon2_B_23_0, poseidon2_B_23_1, poseidon2_B_23_2, poseidon2_B_23_3, poseidon2_B_24_0, poseidon2_B_24_1, poseidon2_B_24_2, poseidon2_B_24_3, poseidon2_B_25_0, poseidon2_B_25_1, poseidon2_B_25_2, poseidon2_B_25_3, poseidon2_B_26_0, poseidon2_B_26_1, poseidon2_B_26_2, poseidon2_B_26_3, poseidon2_B_27_0, poseidon2_B_27_1, poseidon2_B_27_2, poseidon2_B_27_3, poseidon2_B_28_0, poseidon2_B_28_1, poseidon2_B_28_2, poseidon2_B_28_3, poseidon2_B_29_0, poseidon2_B_29_1, poseidon2_B_29_2, poseidon2_B_29_3, poseidon2_B_30_0, poseidon2_B_30_1, poseidon2_B_30_2, poseidon2_B_30_3, poseidon2_B_31_0, poseidon2_B_31_1, poseidon2_B_31_2, poseidon2_B_31_3, poseidon2_B_32_0, poseidon2_B_32_1, poseidon2_B_32_2, poseidon2_B_32_3, poseidon2_B_33_0, poseidon2_B_33_1, poseidon2_B_33_2, poseidon2_B_33_3, poseidon2_B_34_0, poseidon2_B_34_1, poseidon2_B_34_2, poseidon2_B_34_3, poseidon2_B_35_0, poseidon2_B_35_1, poseidon2_B_35_2, poseidon2_B_35_3, poseidon2_B_36_0, poseidon2_B_36_1, poseidon2_B_36_2, poseidon2_B_36_3, poseidon2_B_37_0, poseidon2_B_37_1, poseidon2_B_37_2, poseidon2_B_37_3, poseidon2_B_38_0, poseidon2_B_38_1, poseidon2_B_38_2, poseidon2_B_38_3, poseidon2_B_39_0, poseidon2_B_39_1, poseidon2_B_39_2, poseidon2_B_39_3, poseidon2_B_40_0, poseidon2_B_40_1, poseidon2_B_40_2, poseidon2_B_40_3, poseidon2_B_41_0, poseidon2_B_41_1, poseidon2_B_41_2, poseidon2_B_41_3, poseidon2_B_42_0, poseidon2_B_42_1, poseidon2_B_42_2, poseidon2_B_42_3, poseidon2_B_43_0, poseidon2_B_43_1, poseidon2_B_43_2, poseidon2_B_43_3, poseidon2_B_44_0, poseidon2_B_44_1, poseidon2_B_44_2, poseidon2_B_44_3, poseidon2_B_45_0, poseidon2_B_45_1, poseidon2_B_45_2, poseidon2_B_45_3, poseidon2_B_46_0, poseidon2_B_46_1, poseidon2_B_46_2, poseidon2_B_46_3, poseidon2_B_47_0, poseidon2_B_47_1, poseidon2_B_47_2, poseidon2_B_47_3, poseidon2_B_48_0, poseidon2_B_48_1, poseidon2_B_48_2, poseidon2_B_48_3, poseidon2_B_49_0, poseidon2_B_49_1, poseidon2_B_49_2, poseidon2_B_49_3, poseidon2_B_4_0, poseidon2_B_4_1, poseidon2_B_4_2, poseidon2_B_4_3, poseidon2_B_50_0, poseidon2_B_50_1, poseidon2_B_50_2, poseidon2_B_50_3, poseidon2_B_51_0, poseidon2_B_51_1, poseidon2_B_51_2, poseidon2_B_51_3, poseidon2_B_52_0, poseidon2_B_52_1, poseidon2_B_52_2, poseidon2_B_52_3, poseidon2_B_53_0, poseidon2_B_53_1, poseidon2_B_53_2, poseidon2_B_53_3, poseidon2_B_54_0, poseidon2_B_54_1, poseidon2_B_54_2, poseidon2_B_54_3, poseidon2_B_55_0, poseidon2_B_55_1, poseidon2_B_55_2, poseidon2_B_55_3, poseidon2_B_56_0, poseidon2_B_56_1, poseidon2_B_56_2, poseidon2_B_56_3, poseidon2_B_57_0, poseidon2_B_57_1, poseidon2_B_57_2, poseidon2_B_57_3, poseidon2_B_58_0, poseidon2_B_58_1, poseidon2_B_58_2, poseidon2_B_58_3, poseidon2_B_59_0, poseidon2_B_59_1, poseidon2_B_59_2, poseidon2_B_59_3, poseidon2_B_5_0, poseidon2_B_5_1, poseidon2_B_5_2, poseidon2_B_5_3, poseidon2_B_6_0, poseidon2_B_6_1, poseidon2_B_6_2, poseidon2_B_6_3, poseidon2_B_7_0, poseidon2_B_7_1, poseidon2_B_7_2, poseidon2_B_7_3, poseidon2_B_8_0, poseidon2_B_8_1, poseidon2_B_8_2, poseidon2_B_8_3, poseidon2_B_9_0, poseidon2_B_9_1, poseidon2_B_9_2, poseidon2_B_9_3, poseidon2_EXT_LAYER_4, poseidon2_EXT_LAYER_5, poseidon2_EXT_LAYER_6, poseidon2_EXT_LAYER_7, poseidon2_T_0_4, poseidon2_T_0_5, poseidon2_T_0_6, poseidon2_T_0_7, poseidon2_T_1_4, poseidon2_T_1_5, poseidon2_T_1_6, poseidon2_T_1_7, poseidon2_T_2_4, poseidon2_T_2_5, poseidon2_T_2_6, poseidon2_T_2_7, poseidon2_T_3_4, poseidon2_T_3_5, poseidon2_T_3_6, poseidon2_T_3_7, poseidon2_T_60_4, poseidon2_T_60_5, poseidon2_T_60_6, poseidon2_T_60_7, poseidon2_T_61_4, poseidon2_T_61_5, poseidon2_T_61_6, poseidon2_T_61_7, poseidon2_T_62_4, poseidon2_T_62_5, poseidon2_T_62_6, poseidon2_T_62_7, poseidon2_T_63_4, poseidon2_T_63_5, poseidon2_T_63_6, poseidon2_T_63_7, poseidon2_a_0, poseidon2_a_1, poseidon2_a_2, poseidon2_a_3, poseidon2_b_0, poseidon2_b_1, poseidon2_b_2, poseidon2_b_3, poseidon2_clk, poseidon2_input_addr, poseidon2_mem_addr_read_a, poseidon2_mem_addr_read_b, poseidon2_mem_addr_read_c, poseidon2_mem_addr_read_d, poseidon2_mem_addr_write_a, poseidon2_mem_addr_write_b, poseidon2_mem_addr_write_c, poseidon2_mem_addr_write_d, poseidon2_output_addr, poseidon2_sel_poseidon_perm, range_check_alu_rng_chk, range_check_clk, range_check_cmp_hi_bits_rng_chk, range_check_cmp_lo_bits_rng_chk, range_check_dyn_diff, range_check_dyn_rng_chk_bits, range_check_dyn_rng_chk_pow_2, range_check_gas_da_rng_chk, range_check_gas_l2_rng_chk, range_check_is_lte_u112, range_check_is_lte_u128, range_check_is_lte_u16, range_check_is_lte_u32, range_check_is_lte_u48, range_check_is_lte_u64, range_check_is_lte_u80, range_check_is_lte_u96, range_check_mem_rng_chk, range_check_rng_chk_bits, range_check_sel_lookup_0, range_check_sel_lookup_1, range_check_sel_lookup_2, range_check_sel_lookup_3, range_check_sel_lookup_4, range_check_sel_lookup_5, range_check_sel_lookup_6, range_check_sel_rng_chk, range_check_u16_r0, range_check_u16_r1, range_check_u16_r2, range_check_u16_r3, range_check_u16_r4, range_check_u16_r5, range_check_u16_r6, range_check_u16_r7, range_check_value, sha256_clk, sha256_input, sha256_output, sha256_sel_sha256_compression, sha256_state, slice_addr, slice_clk, slice_cnt, slice_col_offset, slice_one_min_inv, slice_sel_cd_cpy, slice_sel_mem_active, slice_sel_return, slice_sel_start, slice_space_id, slice_val, lookup_rng_chk_pow_2_counts, lookup_rng_chk_diff_counts, lookup_rng_chk_0_counts, lookup_rng_chk_1_counts, lookup_rng_chk_2_counts, lookup_rng_chk_3_counts, lookup_rng_chk_4_counts, lookup_rng_chk_5_counts, lookup_rng_chk_6_counts, lookup_rng_chk_7_counts, lookup_pow_2_0_counts, lookup_pow_2_1_counts, lookup_byte_lengths_counts, lookup_byte_operations_counts, lookup_opcode_gas_counts, kernel_output_lookup_counts, lookup_into_kernel_counts, lookup_cd_value_counts, lookup_ret_value_counts, incl_main_tag_err_counts, incl_mem_tag_err_counts +#define WIRE_ENTITIES main_kernel_inputs, main_kernel_value_out, main_kernel_side_effect_out, main_kernel_metadata_out, main_calldata, main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, alu_b_lo, alu_b_pow, alu_c_hi, alu_c_lo, alu_cf, alu_clk, alu_cmp_gadget_gt, alu_cmp_gadget_input_a, alu_cmp_gadget_input_b, alu_cmp_gadget_result, alu_cmp_gadget_sel, alu_ff_tag, alu_ia, alu_ib, alu_ic, alu_in_tag, alu_max_bits_sub_b_bits, alu_max_bits_sub_b_pow, alu_op_add, alu_op_cast, alu_op_div, alu_op_eq, alu_op_lt, alu_op_lte, alu_op_mul, alu_op_not, alu_op_shl, alu_op_shr, alu_op_sub, alu_partial_prod_hi, alu_partial_prod_lo, alu_range_check_input_value, alu_range_check_num_bits, alu_range_check_sel, alu_remainder, alu_sel_alu, alu_sel_cmp, alu_sel_shift_which, alu_u128_tag, alu_u16_tag, alu_u1_tag, alu_u32_tag, alu_u64_tag, alu_u8_tag, alu_zero_shift, binary_acc_ia, binary_acc_ib, binary_acc_ic, binary_clk, binary_ia_bytes, binary_ib_bytes, binary_ic_bytes, binary_in_tag, binary_mem_tag_ctr, binary_mem_tag_ctr_inv, binary_op_id, binary_sel_bin, binary_start, cmp_a_hi, cmp_a_lo, cmp_b_hi, cmp_b_lo, cmp_borrow, cmp_clk, cmp_cmp_rng_ctr, cmp_input_a, cmp_input_b, cmp_op_eq, cmp_op_eq_diff_inv, cmp_op_gt, cmp_p_a_borrow, cmp_p_b_borrow, cmp_p_sub_a_hi, cmp_p_sub_a_lo, cmp_p_sub_b_hi, cmp_p_sub_b_lo, cmp_range_chk_clk, cmp_res_hi, cmp_res_lo, cmp_result, cmp_sel_cmp, cmp_sel_rng_chk, cmp_shift_sel, conversion_clk, conversion_input, conversion_num_limbs, conversion_output_bits, conversion_radix, conversion_sel_to_radix_le, keccakf1600_clk, keccakf1600_input, keccakf1600_output, keccakf1600_sel_keccakf1600, main_abs_da_rem_gas, main_abs_l2_rem_gas, main_alu_in_tag, main_base_da_gas_op_cost, main_base_l2_gas_op_cost, main_bin_op_id, main_call_ptr, main_da_gas_remaining, main_da_out_of_gas, main_dyn_da_gas_op_cost, main_dyn_gas_multiplier, main_dyn_l2_gas_op_cost, main_emit_l2_to_l1_msg_write_offset, main_emit_note_hash_write_offset, main_emit_nullifier_write_offset, main_emit_unencrypted_log_write_offset, main_ia, main_ib, main_ic, main_id, main_id_zero, main_ind_addr_a, main_ind_addr_b, main_ind_addr_c, main_ind_addr_d, main_internal_return_ptr, main_inv, main_is_fake_row, main_is_gas_accounted, main_kernel_in_offset, main_kernel_out_offset, main_l1_to_l2_msg_exists_write_offset, main_l2_gas_remaining, main_l2_out_of_gas, main_mem_addr_a, main_mem_addr_b, main_mem_addr_c, main_mem_addr_d, main_note_hash_exist_write_offset, main_nullifier_exists_write_offset, main_nullifier_non_exists_write_offset, main_op_err, main_opcode_val, main_pc, main_r_in_tag, main_rwa, main_rwb, main_rwc, main_rwd, main_sel_alu, main_sel_bin, main_sel_calldata, main_sel_execution_row, main_sel_kernel_inputs, main_sel_kernel_out, main_sel_last, main_sel_mem_op_a, main_sel_mem_op_b, main_sel_mem_op_c, main_sel_mem_op_d, main_sel_mov_ia_to_ic, main_sel_mov_ib_to_ic, main_sel_op_add, main_sel_op_address, main_sel_op_and, main_sel_op_block_number, main_sel_op_calldata_copy, main_sel_op_cast, main_sel_op_chain_id, main_sel_op_dagasleft, main_sel_op_div, main_sel_op_ecadd, main_sel_op_emit_l2_to_l1_msg, main_sel_op_emit_note_hash, main_sel_op_emit_nullifier, main_sel_op_emit_unencrypted_log, main_sel_op_eq, main_sel_op_external_call, main_sel_op_external_return, main_sel_op_external_revert, main_sel_op_fdiv, main_sel_op_fee_per_da_gas, main_sel_op_fee_per_l2_gas, main_sel_op_function_selector, main_sel_op_get_contract_instance, main_sel_op_internal_call, main_sel_op_internal_return, main_sel_op_is_static_call, main_sel_op_jump, main_sel_op_jumpi, main_sel_op_keccak, main_sel_op_l1_to_l2_msg_exists, main_sel_op_l2gasleft, main_sel_op_lt, main_sel_op_lte, main_sel_op_mov, main_sel_op_msm, main_sel_op_mul, main_sel_op_not, main_sel_op_note_hash_exists, main_sel_op_nullifier_exists, main_sel_op_or, main_sel_op_pedersen, main_sel_op_pedersen_commit, main_sel_op_poseidon2, main_sel_op_radix_le, main_sel_op_sender, main_sel_op_set, main_sel_op_sha256, main_sel_op_shl, main_sel_op_shr, main_sel_op_sload, main_sel_op_sstore, main_sel_op_static_call, main_sel_op_storage_address, main_sel_op_sub, main_sel_op_timestamp, main_sel_op_transaction_fee, main_sel_op_version, main_sel_op_xor, main_sel_q_kernel_lookup, main_sel_q_kernel_output_lookup, main_sel_resolve_ind_addr_a, main_sel_resolve_ind_addr_b, main_sel_resolve_ind_addr_c, main_sel_resolve_ind_addr_d, main_sel_returndata, main_sel_rng_16, main_sel_rng_8, main_sel_slice_gadget, main_side_effect_counter, main_sload_write_offset, main_space_id, main_sstore_write_offset, main_tag_err, main_w_in_tag, mem_addr, mem_clk, mem_diff, mem_glob_addr, mem_last, mem_lastAccess, mem_one_min_inv, mem_r_in_tag, mem_rw, mem_sel_mem, mem_sel_mov_ia_to_ic, mem_sel_mov_ib_to_ic, mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, mem_sel_op_d, mem_sel_op_poseidon_read_a, mem_sel_op_poseidon_read_b, mem_sel_op_poseidon_read_c, mem_sel_op_poseidon_read_d, mem_sel_op_poseidon_write_a, mem_sel_op_poseidon_write_b, mem_sel_op_poseidon_write_c, mem_sel_op_poseidon_write_d, mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, mem_sel_resolve_ind_addr_d, mem_sel_rng_chk, mem_skip_check_tag, mem_space_id, mem_tag, mem_tag_err, mem_tsp, mem_val, mem_w_in_tag, pedersen_clk, pedersen_input, pedersen_output, pedersen_sel_pedersen, poseidon2_B_10_0, poseidon2_B_10_1, poseidon2_B_10_2, poseidon2_B_10_3, poseidon2_B_11_0, poseidon2_B_11_1, poseidon2_B_11_2, poseidon2_B_11_3, poseidon2_B_12_0, poseidon2_B_12_1, poseidon2_B_12_2, poseidon2_B_12_3, poseidon2_B_13_0, poseidon2_B_13_1, poseidon2_B_13_2, poseidon2_B_13_3, poseidon2_B_14_0, poseidon2_B_14_1, poseidon2_B_14_2, poseidon2_B_14_3, poseidon2_B_15_0, poseidon2_B_15_1, poseidon2_B_15_2, poseidon2_B_15_3, poseidon2_B_16_0, poseidon2_B_16_1, poseidon2_B_16_2, poseidon2_B_16_3, poseidon2_B_17_0, poseidon2_B_17_1, poseidon2_B_17_2, poseidon2_B_17_3, poseidon2_B_18_0, poseidon2_B_18_1, poseidon2_B_18_2, poseidon2_B_18_3, poseidon2_B_19_0, poseidon2_B_19_1, poseidon2_B_19_2, poseidon2_B_19_3, poseidon2_B_20_0, poseidon2_B_20_1, poseidon2_B_20_2, poseidon2_B_20_3, poseidon2_B_21_0, poseidon2_B_21_1, poseidon2_B_21_2, poseidon2_B_21_3, poseidon2_B_22_0, poseidon2_B_22_1, poseidon2_B_22_2, poseidon2_B_22_3, poseidon2_B_23_0, poseidon2_B_23_1, poseidon2_B_23_2, poseidon2_B_23_3, poseidon2_B_24_0, poseidon2_B_24_1, poseidon2_B_24_2, poseidon2_B_24_3, poseidon2_B_25_0, poseidon2_B_25_1, poseidon2_B_25_2, poseidon2_B_25_3, poseidon2_B_26_0, poseidon2_B_26_1, poseidon2_B_26_2, poseidon2_B_26_3, poseidon2_B_27_0, poseidon2_B_27_1, poseidon2_B_27_2, poseidon2_B_27_3, poseidon2_B_28_0, poseidon2_B_28_1, poseidon2_B_28_2, poseidon2_B_28_3, poseidon2_B_29_0, poseidon2_B_29_1, poseidon2_B_29_2, poseidon2_B_29_3, poseidon2_B_30_0, poseidon2_B_30_1, poseidon2_B_30_2, poseidon2_B_30_3, poseidon2_B_31_0, poseidon2_B_31_1, poseidon2_B_31_2, poseidon2_B_31_3, poseidon2_B_32_0, poseidon2_B_32_1, poseidon2_B_32_2, poseidon2_B_32_3, poseidon2_B_33_0, poseidon2_B_33_1, poseidon2_B_33_2, poseidon2_B_33_3, poseidon2_B_34_0, poseidon2_B_34_1, poseidon2_B_34_2, poseidon2_B_34_3, poseidon2_B_35_0, poseidon2_B_35_1, poseidon2_B_35_2, poseidon2_B_35_3, poseidon2_B_36_0, poseidon2_B_36_1, poseidon2_B_36_2, poseidon2_B_36_3, poseidon2_B_37_0, poseidon2_B_37_1, poseidon2_B_37_2, poseidon2_B_37_3, poseidon2_B_38_0, poseidon2_B_38_1, poseidon2_B_38_2, poseidon2_B_38_3, poseidon2_B_39_0, poseidon2_B_39_1, poseidon2_B_39_2, poseidon2_B_39_3, poseidon2_B_40_0, poseidon2_B_40_1, poseidon2_B_40_2, poseidon2_B_40_3, poseidon2_B_41_0, poseidon2_B_41_1, poseidon2_B_41_2, poseidon2_B_41_3, poseidon2_B_42_0, poseidon2_B_42_1, poseidon2_B_42_2, poseidon2_B_42_3, poseidon2_B_43_0, poseidon2_B_43_1, poseidon2_B_43_2, poseidon2_B_43_3, poseidon2_B_44_0, poseidon2_B_44_1, poseidon2_B_44_2, poseidon2_B_44_3, poseidon2_B_45_0, poseidon2_B_45_1, poseidon2_B_45_2, poseidon2_B_45_3, poseidon2_B_46_0, poseidon2_B_46_1, poseidon2_B_46_2, poseidon2_B_46_3, poseidon2_B_47_0, poseidon2_B_47_1, poseidon2_B_47_2, poseidon2_B_47_3, poseidon2_B_48_0, poseidon2_B_48_1, poseidon2_B_48_2, poseidon2_B_48_3, poseidon2_B_49_0, poseidon2_B_49_1, poseidon2_B_49_2, poseidon2_B_49_3, poseidon2_B_4_0, poseidon2_B_4_1, poseidon2_B_4_2, poseidon2_B_4_3, poseidon2_B_50_0, poseidon2_B_50_1, poseidon2_B_50_2, poseidon2_B_50_3, poseidon2_B_51_0, poseidon2_B_51_1, poseidon2_B_51_2, poseidon2_B_51_3, poseidon2_B_52_0, poseidon2_B_52_1, poseidon2_B_52_2, poseidon2_B_52_3, poseidon2_B_53_0, poseidon2_B_53_1, poseidon2_B_53_2, poseidon2_B_53_3, poseidon2_B_54_0, poseidon2_B_54_1, poseidon2_B_54_2, poseidon2_B_54_3, poseidon2_B_55_0, poseidon2_B_55_1, poseidon2_B_55_2, poseidon2_B_55_3, poseidon2_B_56_0, poseidon2_B_56_1, poseidon2_B_56_2, poseidon2_B_56_3, poseidon2_B_57_0, poseidon2_B_57_1, poseidon2_B_57_2, poseidon2_B_57_3, poseidon2_B_58_0, poseidon2_B_58_1, poseidon2_B_58_2, poseidon2_B_58_3, poseidon2_B_59_0, poseidon2_B_59_1, poseidon2_B_59_2, poseidon2_B_59_3, poseidon2_B_5_0, poseidon2_B_5_1, poseidon2_B_5_2, poseidon2_B_5_3, poseidon2_B_6_0, poseidon2_B_6_1, poseidon2_B_6_2, poseidon2_B_6_3, poseidon2_B_7_0, poseidon2_B_7_1, poseidon2_B_7_2, poseidon2_B_7_3, poseidon2_B_8_0, poseidon2_B_8_1, poseidon2_B_8_2, poseidon2_B_8_3, poseidon2_B_9_0, poseidon2_B_9_1, poseidon2_B_9_2, poseidon2_B_9_3, poseidon2_EXT_LAYER_4, poseidon2_EXT_LAYER_5, poseidon2_EXT_LAYER_6, poseidon2_EXT_LAYER_7, poseidon2_T_0_4, poseidon2_T_0_5, poseidon2_T_0_6, poseidon2_T_0_7, poseidon2_T_1_4, poseidon2_T_1_5, poseidon2_T_1_6, poseidon2_T_1_7, poseidon2_T_2_4, poseidon2_T_2_5, poseidon2_T_2_6, poseidon2_T_2_7, poseidon2_T_3_4, poseidon2_T_3_5, poseidon2_T_3_6, poseidon2_T_3_7, poseidon2_T_60_4, poseidon2_T_60_5, poseidon2_T_60_6, poseidon2_T_60_7, poseidon2_T_61_4, poseidon2_T_61_5, poseidon2_T_61_6, poseidon2_T_61_7, poseidon2_T_62_4, poseidon2_T_62_5, poseidon2_T_62_6, poseidon2_T_62_7, poseidon2_T_63_4, poseidon2_T_63_5, poseidon2_T_63_6, poseidon2_T_63_7, poseidon2_a_0, poseidon2_a_1, poseidon2_a_2, poseidon2_a_3, poseidon2_b_0, poseidon2_b_1, poseidon2_b_2, poseidon2_b_3, poseidon2_clk, poseidon2_input_addr, poseidon2_mem_addr_read_a, poseidon2_mem_addr_read_b, poseidon2_mem_addr_read_c, poseidon2_mem_addr_read_d, poseidon2_mem_addr_write_a, poseidon2_mem_addr_write_b, poseidon2_mem_addr_write_c, poseidon2_mem_addr_write_d, poseidon2_output_addr, poseidon2_sel_poseidon_perm, range_check_alu_rng_chk, range_check_clk, range_check_cmp_hi_bits_rng_chk, range_check_cmp_lo_bits_rng_chk, range_check_dyn_diff, range_check_dyn_rng_chk_bits, range_check_dyn_rng_chk_pow_2, range_check_gas_da_rng_chk, range_check_gas_l2_rng_chk, range_check_is_lte_u112, range_check_is_lte_u128, range_check_is_lte_u16, range_check_is_lte_u32, range_check_is_lte_u48, range_check_is_lte_u64, range_check_is_lte_u80, range_check_is_lte_u96, range_check_mem_rng_chk, range_check_rng_chk_bits, range_check_sel_lookup_0, range_check_sel_lookup_1, range_check_sel_lookup_2, range_check_sel_lookup_3, range_check_sel_lookup_4, range_check_sel_lookup_5, range_check_sel_lookup_6, range_check_sel_rng_chk, range_check_u16_r0, range_check_u16_r1, range_check_u16_r2, range_check_u16_r3, range_check_u16_r4, range_check_u16_r5, range_check_u16_r6, range_check_u16_r7, range_check_value, sha256_clk, sha256_input, sha256_output, sha256_sel_sha256_compression, sha256_state, slice_addr, slice_clk, slice_cnt, slice_col_offset, slice_one_min_inv, slice_sel_cd_cpy, slice_sel_mem_active, slice_sel_return, slice_sel_start, slice_space_id, slice_val, lookup_rng_chk_pow_2_counts, lookup_rng_chk_diff_counts, lookup_rng_chk_0_counts, lookup_rng_chk_1_counts, lookup_rng_chk_2_counts, lookup_rng_chk_3_counts, lookup_rng_chk_4_counts, lookup_rng_chk_5_counts, lookup_rng_chk_6_counts, lookup_rng_chk_7_counts, lookup_pow_2_0_counts, lookup_pow_2_1_counts, lookup_byte_lengths_counts, lookup_byte_operations_counts, lookup_opcode_gas_counts, kernel_output_lookup_counts, lookup_into_kernel_counts, lookup_cd_value_counts, lookup_ret_value_counts, incl_main_tag_err_counts, incl_mem_tag_err_counts #define DERIVED_WITNESS_ENTITIES perm_rng_mem_inv, perm_rng_cmp_lo_inv, perm_rng_cmp_hi_inv, perm_rng_alu_inv, perm_cmp_alu_inv, perm_rng_gas_l2_inv, perm_rng_gas_da_inv, perm_pos_mem_read_a_inv, perm_pos_mem_read_b_inv, perm_pos_mem_read_c_inv, perm_pos_mem_read_d_inv, perm_pos_mem_write_a_inv, perm_pos_mem_write_b_inv, perm_pos_mem_write_c_inv, perm_pos_mem_write_d_inv, perm_slice_mem_inv, perm_main_alu_inv, perm_main_bin_inv, perm_main_conv_inv, perm_main_pos2_perm_inv, perm_main_pedersen_inv, perm_main_slice_inv, perm_main_mem_a_inv, perm_main_mem_b_inv, perm_main_mem_c_inv, perm_main_mem_d_inv, perm_main_mem_ind_addr_a_inv, perm_main_mem_ind_addr_b_inv, perm_main_mem_ind_addr_c_inv, perm_main_mem_ind_addr_d_inv, lookup_rng_chk_pow_2_inv, lookup_rng_chk_diff_inv, lookup_rng_chk_0_inv, lookup_rng_chk_1_inv, lookup_rng_chk_2_inv, lookup_rng_chk_3_inv, lookup_rng_chk_4_inv, lookup_rng_chk_5_inv, lookup_rng_chk_6_inv, lookup_rng_chk_7_inv, lookup_pow_2_0_inv, lookup_pow_2_1_inv, lookup_byte_lengths_inv, lookup_byte_operations_inv, lookup_opcode_gas_inv, kernel_output_lookup_inv, lookup_into_kernel_inv, lookup_cd_value_inv, lookup_ret_value_inv, incl_main_tag_err_inv, incl_mem_tag_err_inv #define SHIFTED_ENTITIES binary_acc_ia_shift, binary_acc_ib_shift, binary_acc_ic_shift, binary_mem_tag_ctr_shift, binary_op_id_shift, cmp_a_hi_shift, cmp_a_lo_shift, cmp_b_hi_shift, cmp_b_lo_shift, cmp_cmp_rng_ctr_shift, cmp_op_gt_shift, cmp_p_sub_a_hi_shift, cmp_p_sub_a_lo_shift, cmp_p_sub_b_hi_shift, cmp_p_sub_b_lo_shift, cmp_sel_rng_chk_shift, main_da_gas_remaining_shift, main_emit_l2_to_l1_msg_write_offset_shift, main_emit_note_hash_write_offset_shift, main_emit_nullifier_write_offset_shift, main_emit_unencrypted_log_write_offset_shift, main_internal_return_ptr_shift, main_l1_to_l2_msg_exists_write_offset_shift, main_l2_gas_remaining_shift, main_note_hash_exist_write_offset_shift, main_nullifier_exists_write_offset_shift, main_nullifier_non_exists_write_offset_shift, main_pc_shift, main_sel_execution_row_shift, main_sload_write_offset_shift, main_sstore_write_offset_shift, mem_glob_addr_shift, mem_rw_shift, mem_sel_mem_shift, mem_tag_shift, mem_tsp_shift, mem_val_shift, slice_addr_shift, slice_clk_shift, slice_cnt_shift, slice_col_offset_shift, slice_sel_cd_cpy_shift, slice_sel_mem_active_shift, slice_sel_return_shift, slice_sel_start_shift, slice_space_id_shift #define TO_BE_SHIFTED(e) e.binary_acc_ia, e.binary_acc_ib, e.binary_acc_ic, e.binary_mem_tag_ctr, e.binary_op_id, e.cmp_a_hi, e.cmp_a_lo, e.cmp_b_hi, e.cmp_b_lo, e.cmp_cmp_rng_ctr, e.cmp_op_gt, e.cmp_p_sub_a_hi, e.cmp_p_sub_a_lo, e.cmp_p_sub_b_hi, e.cmp_p_sub_b_lo, e.cmp_sel_rng_chk, e.main_da_gas_remaining, e.main_emit_l2_to_l1_msg_write_offset, e.main_emit_note_hash_write_offset, e.main_emit_nullifier_write_offset, e.main_emit_unencrypted_log_write_offset, e.main_internal_return_ptr, e.main_l1_to_l2_msg_exists_write_offset, e.main_l2_gas_remaining, e.main_note_hash_exist_write_offset, e.main_nullifier_exists_write_offset, e.main_nullifier_non_exists_write_offset, e.main_pc, e.main_sel_execution_row, e.main_sload_write_offset, e.main_sstore_write_offset, e.mem_glob_addr, e.mem_rw, e.mem_sel_mem, e.mem_tag, e.mem_tsp, e.mem_val, e.slice_addr, e.slice_clk, e.slice_cnt, e.slice_col_offset, e.slice_sel_cd_cpy, e.slice_sel_mem_active, e.slice_sel_return, e.slice_sel_start, e.slice_space_id @@ -119,12 +119,12 @@ class AvmFlavor { static constexpr bool HasZK = false; static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 16; - static constexpr size_t NUM_WITNESS_ENTITIES = 685; + static constexpr size_t NUM_WITNESS_ENTITIES = 683; static constexpr size_t NUM_SHIFTED_ENTITIES = 46; static constexpr size_t NUM_WIRES = NUM_WITNESS_ENTITIES + NUM_PRECOMPUTED_ENTITIES; // We have two copies of the witness entities, so we subtract the number of fixed ones (they have no shift), one for // the unshifted and one for the shifted - static constexpr size_t NUM_ALL_ENTITIES = 747; + static constexpr size_t NUM_ALL_ENTITIES = 745; // The total number of witnesses including shifts and derived entities. static constexpr size_t NUM_ALL_WITNESS_ENTITIES = NUM_WITNESS_ENTITIES + NUM_SHIFTED_ENTITIES; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp index e6d698cc800d..72d5632f2873 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp @@ -206,7 +206,6 @@ template std::vector AvmFullRow::names() "main_sel_op_calldata_copy", "main_sel_op_cast", "main_sel_op_chain_id", - "main_sel_op_cmov", "main_sel_op_dagasleft", "main_sel_op_div", "main_sel_op_ecadd", @@ -289,7 +288,6 @@ template std::vector AvmFullRow::names() "mem_sel_op_a", "mem_sel_op_b", "mem_sel_op_c", - "mem_sel_op_cmov", "mem_sel_op_d", "mem_sel_op_poseidon_read_a", "mem_sel_op_poseidon_read_b", @@ -912,7 +910,6 @@ template RefVector AvmFullRow::as_vector() const main_sel_op_calldata_copy, main_sel_op_cast, main_sel_op_chain_id, - main_sel_op_cmov, main_sel_op_dagasleft, main_sel_op_div, main_sel_op_ecadd, @@ -995,7 +992,6 @@ template RefVector AvmFullRow::as_vector() const mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, - mem_sel_op_cmov, mem_sel_op_d, mem_sel_op_poseidon_read_a, mem_sel_op_poseidon_read_b, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp index cb0656845d01..b8c2db298d4b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp @@ -197,7 +197,6 @@ template struct AvmFullRow { FF main_sel_op_calldata_copy{}; FF main_sel_op_cast{}; FF main_sel_op_chain_id{}; - FF main_sel_op_cmov{}; FF main_sel_op_dagasleft{}; FF main_sel_op_div{}; FF main_sel_op_ecadd{}; @@ -280,7 +279,6 @@ template struct AvmFullRow { FF mem_sel_op_a{}; FF mem_sel_op_b{}; FF mem_sel_op_c{}; - FF mem_sel_op_cmov{}; FF mem_sel_op_d{}; FF mem_sel_op_poseidon_read_a{}; FF mem_sel_op_poseidon_read_b{}; @@ -715,7 +713,7 @@ template struct AvmFullRow { RefVector as_vector() const; static std::vector names(); - static constexpr size_t SIZE = 701; + static constexpr size_t SIZE = 699; }; template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp index a10bb223f4e0..64377d819e53 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp @@ -10,11 +10,11 @@ template class mainImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, 3, 3, 3, 4, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 3, 3, 4, 4, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 2, 2 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, 3, 3, 3, 4, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 3, 3, 4, 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 2, 2 }; template @@ -74,8 +74,7 @@ template class mainImpl { new_term.main_sel_op_ecadd) + new_term.main_sel_op_pedersen_commit) + new_term.main_sel_op_msm); - const auto main_SEL_ALL_MEMORY = - ((new_term.main_sel_op_cmov + new_term.main_sel_op_mov) + new_term.main_sel_op_set); + const auto main_SEL_ALL_MEMORY = (new_term.main_sel_op_mov + new_term.main_sel_op_set); const auto main_OPCODE_SELECTORS = ((((((((((new_term.main_sel_op_fdiv + new_term.main_sel_op_calldata_copy) + new_term.main_sel_op_get_contract_instance) + main_SEL_ALL_ALU) + @@ -453,355 +452,340 @@ template class mainImpl { } { using Accumulator = typename std::tuple_element_t<60, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_cmov * (FF(1) - new_term.main_sel_op_cmov)); + auto tmp = (new_term.main_op_err * (FF(1) - new_term.main_op_err)); tmp *= scaling_factor; std::get<60>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<61, ContainerOverSubrelations>; - auto tmp = (new_term.main_op_err * (FF(1) - new_term.main_op_err)); + auto tmp = (new_term.main_tag_err * (FF(1) - new_term.main_tag_err)); tmp *= scaling_factor; std::get<61>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<62, ContainerOverSubrelations>; - auto tmp = (new_term.main_tag_err * (FF(1) - new_term.main_tag_err)); + auto tmp = (new_term.main_id_zero * (FF(1) - new_term.main_id_zero)); tmp *= scaling_factor; std::get<62>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<63, ContainerOverSubrelations>; - auto tmp = (new_term.main_id_zero * (FF(1) - new_term.main_id_zero)); + auto tmp = (new_term.main_sel_mem_op_a * (FF(1) - new_term.main_sel_mem_op_a)); tmp *= scaling_factor; std::get<63>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<64, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_a * (FF(1) - new_term.main_sel_mem_op_a)); + auto tmp = (new_term.main_sel_mem_op_b * (FF(1) - new_term.main_sel_mem_op_b)); tmp *= scaling_factor; std::get<64>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<65, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_b * (FF(1) - new_term.main_sel_mem_op_b)); + auto tmp = (new_term.main_sel_mem_op_c * (FF(1) - new_term.main_sel_mem_op_c)); tmp *= scaling_factor; std::get<65>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<66, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_c * (FF(1) - new_term.main_sel_mem_op_c)); + auto tmp = (new_term.main_sel_mem_op_d * (FF(1) - new_term.main_sel_mem_op_d)); tmp *= scaling_factor; std::get<66>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<67, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_d * (FF(1) - new_term.main_sel_mem_op_d)); + auto tmp = (new_term.main_rwa * (FF(1) - new_term.main_rwa)); tmp *= scaling_factor; std::get<67>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<68, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwa * (FF(1) - new_term.main_rwa)); + auto tmp = (new_term.main_rwb * (FF(1) - new_term.main_rwb)); tmp *= scaling_factor; std::get<68>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<69, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwb * (FF(1) - new_term.main_rwb)); + auto tmp = (new_term.main_rwc * (FF(1) - new_term.main_rwc)); tmp *= scaling_factor; std::get<69>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<70, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwc * (FF(1) - new_term.main_rwc)); + auto tmp = (new_term.main_rwd * (FF(1) - new_term.main_rwd)); tmp *= scaling_factor; std::get<70>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<71, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwd * (FF(1) - new_term.main_rwd)); + auto tmp = (new_term.main_sel_resolve_ind_addr_a * (FF(1) - new_term.main_sel_resolve_ind_addr_a)); tmp *= scaling_factor; std::get<71>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<72, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_a * (FF(1) - new_term.main_sel_resolve_ind_addr_a)); + auto tmp = (new_term.main_sel_resolve_ind_addr_b * (FF(1) - new_term.main_sel_resolve_ind_addr_b)); tmp *= scaling_factor; std::get<72>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<73, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_b * (FF(1) - new_term.main_sel_resolve_ind_addr_b)); + auto tmp = (new_term.main_sel_resolve_ind_addr_c * (FF(1) - new_term.main_sel_resolve_ind_addr_c)); tmp *= scaling_factor; std::get<73>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<74, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_c * (FF(1) - new_term.main_sel_resolve_ind_addr_c)); + auto tmp = (new_term.main_sel_resolve_ind_addr_d * (FF(1) - new_term.main_sel_resolve_ind_addr_d)); tmp *= scaling_factor; std::get<74>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<75, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_d * (FF(1) - new_term.main_sel_resolve_ind_addr_d)); + auto tmp = (((new_term.main_sel_op_eq + new_term.main_sel_op_lte) + new_term.main_sel_op_lt) * + (new_term.main_w_in_tag - constants_MEM_TAG_U1)); tmp *= scaling_factor; std::get<75>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<76, ContainerOverSubrelations>; - auto tmp = (((new_term.main_sel_op_eq + new_term.main_sel_op_lte) + new_term.main_sel_op_lt) * - (new_term.main_w_in_tag - constants_MEM_TAG_U1)); + auto tmp = ((new_term.main_sel_op_fdiv * (FF(1) - new_term.main_op_err)) * + ((new_term.main_ic * new_term.main_ib) - new_term.main_ia)); tmp *= scaling_factor; std::get<76>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<77, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_fdiv * (FF(1) - new_term.main_op_err)) * - ((new_term.main_ic * new_term.main_ib) - new_term.main_ia)); + auto tmp = ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * + (((new_term.main_ib * new_term.main_inv) - FF(1)) + new_term.main_op_err)); tmp *= scaling_factor; std::get<77>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<78, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * - (((new_term.main_ib * new_term.main_inv) - FF(1)) + new_term.main_op_err)); + auto tmp = (((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * new_term.main_op_err) * + (FF(1) - new_term.main_inv)); tmp *= scaling_factor; std::get<78>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<79, ContainerOverSubrelations>; - auto tmp = (((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * new_term.main_op_err) * - (FF(1) - new_term.main_inv)); + auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_r_in_tag - constants_MEM_TAG_FF)); tmp *= scaling_factor; std::get<79>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<80, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_r_in_tag - constants_MEM_TAG_FF)); + auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_w_in_tag - constants_MEM_TAG_FF)); tmp *= scaling_factor; std::get<80>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<81, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_w_in_tag - constants_MEM_TAG_FF)); + auto tmp = (new_term.main_op_err * ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) - FF(1))); tmp *= scaling_factor; std::get<81>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<82, ContainerOverSubrelations>; - auto tmp = (new_term.main_op_err * ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) - FF(1))); + auto tmp = (new_term.main_sel_op_jump * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<82>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<83, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jump * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_jumpi * + (((FF(1) - new_term.main_id_zero) * (new_term.main_pc_shift - new_term.main_ia)) + + (new_term.main_id_zero * ((new_term.main_pc_shift - new_term.main_pc) - FF(1))))); tmp *= scaling_factor; std::get<83>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<84, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jumpi * - (((FF(1) - new_term.main_id_zero) * (new_term.main_pc_shift - new_term.main_ia)) + - (new_term.main_id_zero * ((new_term.main_pc_shift - new_term.main_pc) - FF(1))))); + auto tmp = (new_term.main_sel_op_internal_call * + (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr + FF(1)))); tmp *= scaling_factor; std::get<84>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<85, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * - (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr + FF(1)))); + auto tmp = + (new_term.main_sel_op_internal_call * (new_term.main_internal_return_ptr - new_term.main_mem_addr_b)); tmp *= scaling_factor; std::get<85>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<86, ContainerOverSubrelations>; - auto tmp = - (new_term.main_sel_op_internal_call * (new_term.main_internal_return_ptr - new_term.main_mem_addr_b)); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<86>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<87, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_internal_call * ((new_term.main_pc + FF(1)) - new_term.main_ib)); tmp *= scaling_factor; std::get<87>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<88, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * ((new_term.main_pc + FF(1)) - new_term.main_ib)); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_rwb - FF(1))); tmp *= scaling_factor; std::get<88>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<89, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_rwb - FF(1))); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_sel_mem_op_b - FF(1))); tmp *= scaling_factor; std::get<89>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<90, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_sel_mem_op_b - FF(1))); + auto tmp = (new_term.main_sel_op_internal_return * + (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr - FF(1)))); tmp *= scaling_factor; std::get<90>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<91, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_internal_return * - (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr - FF(1)))); + ((new_term.main_internal_return_ptr - FF(1)) - new_term.main_mem_addr_a)); tmp *= scaling_factor; std::get<91>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<92, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * - ((new_term.main_internal_return_ptr - FF(1)) - new_term.main_mem_addr_a)); + auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<92>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<93, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_internal_return * new_term.main_rwa); tmp *= scaling_factor; std::get<93>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<94, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * new_term.main_rwa); + auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_sel_mem_op_a - FF(1))); tmp *= scaling_factor; std::get<94>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<95, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_sel_mem_op_a - FF(1))); + auto tmp = ((main_CUR_AND_NEXT_ARE_MAIN * (FF(1) - main_SEL_ALL_CTRL_FLOW)) * + (new_term.main_pc_shift - (new_term.main_pc + FF(1)))); tmp *= scaling_factor; std::get<95>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<96, ContainerOverSubrelations>; auto tmp = ((main_CUR_AND_NEXT_ARE_MAIN * (FF(1) - main_SEL_ALL_CTRL_FLOW)) * - (new_term.main_pc_shift - (new_term.main_pc + FF(1)))); + (new_term.main_internal_return_ptr_shift - new_term.main_internal_return_ptr)); tmp *= scaling_factor; std::get<96>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<97, ContainerOverSubrelations>; - auto tmp = ((main_CUR_AND_NEXT_ARE_MAIN * (FF(1) - main_SEL_ALL_CTRL_FLOW)) * - (new_term.main_internal_return_ptr_shift - new_term.main_internal_return_ptr)); + auto tmp = ((new_term.main_sel_op_internal_call + new_term.main_sel_op_internal_return) * + (new_term.main_space_id - constants_misc_INTERNAL_CALL_SPACE_ID)); tmp *= scaling_factor; std::get<97>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<98, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_internal_call + new_term.main_sel_op_internal_return) * - (new_term.main_space_id - constants_misc_INTERNAL_CALL_SPACE_ID)); + auto tmp = (((FF(1) - new_term.main_sel_op_internal_call) - new_term.main_sel_op_internal_return) * + (new_term.main_call_ptr - new_term.main_space_id)); tmp *= scaling_factor; std::get<98>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<99, ContainerOverSubrelations>; - auto tmp = (((FF(1) - new_term.main_sel_op_internal_call) - new_term.main_sel_op_internal_return) * - (new_term.main_call_ptr - new_term.main_space_id)); + auto tmp = (new_term.main_sel_op_jumpi * + (((new_term.main_id * new_term.main_inv) - FF(1)) + new_term.main_id_zero)); tmp *= scaling_factor; std::get<99>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<100, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_cmov + new_term.main_sel_op_jumpi) * - (((new_term.main_id * new_term.main_inv) - FF(1)) + new_term.main_id_zero)); + auto tmp = ((new_term.main_sel_op_jumpi * new_term.main_id_zero) * (FF(1) - new_term.main_inv)); tmp *= scaling_factor; std::get<100>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<101, ContainerOverSubrelations>; - auto tmp = (((new_term.main_sel_op_cmov + new_term.main_sel_op_jumpi) * new_term.main_id_zero) * - (FF(1) - new_term.main_inv)); + auto tmp = (new_term.main_sel_mov_ia_to_ic - (new_term.main_sel_op_mov * (FF(1) - new_term.main_id_zero))); tmp *= scaling_factor; std::get<101>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<102, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ia_to_ic - - (new_term.main_sel_op_mov + (new_term.main_sel_op_cmov * (FF(1) - new_term.main_id_zero)))); + auto tmp = (new_term.main_sel_mov_ia_to_ic * (new_term.main_ia - new_term.main_ic)); tmp *= scaling_factor; std::get<102>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<103, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ib_to_ic - (new_term.main_sel_op_cmov * new_term.main_id_zero)); + auto tmp = (new_term.main_sel_mov_ib_to_ic * (new_term.main_ib - new_term.main_ic)); tmp *= scaling_factor; std::get<103>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<104, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ia_to_ic * (new_term.main_ia - new_term.main_ic)); + auto tmp = (new_term.main_sel_op_mov * (new_term.main_r_in_tag - new_term.main_w_in_tag)); tmp *= scaling_factor; std::get<104>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<105, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ib_to_ic * (new_term.main_ib - new_term.main_ic)); + auto tmp = (new_term.main_sel_alu - + ((main_SEL_ALL_ALU * (FF(1) - new_term.main_tag_err)) * (FF(1) - new_term.main_op_err))); tmp *= scaling_factor; std::get<105>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<106, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_mov + new_term.main_sel_op_cmov) * - (new_term.main_r_in_tag - new_term.main_w_in_tag)); + auto tmp = (main_SEL_ALU_R_TAG * (new_term.main_alu_in_tag - new_term.main_r_in_tag)); tmp *= scaling_factor; std::get<106>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<107, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_alu - - ((main_SEL_ALL_ALU * (FF(1) - new_term.main_tag_err)) * (FF(1) - new_term.main_op_err))); + auto tmp = (main_SEL_ALU_W_TAG * (new_term.main_alu_in_tag - new_term.main_w_in_tag)); tmp *= scaling_factor; std::get<107>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<108, ContainerOverSubrelations>; - auto tmp = (main_SEL_ALU_R_TAG * (new_term.main_alu_in_tag - new_term.main_r_in_tag)); + auto tmp = (new_term.main_sel_op_l2gasleft * (new_term.main_ia - new_term.main_l2_gas_remaining_shift)); tmp *= scaling_factor; std::get<108>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<109, ContainerOverSubrelations>; - auto tmp = (main_SEL_ALU_W_TAG * (new_term.main_alu_in_tag - new_term.main_w_in_tag)); + auto tmp = (new_term.main_sel_op_dagasleft * (new_term.main_ia - new_term.main_da_gas_remaining_shift)); tmp *= scaling_factor; std::get<109>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<110, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_l2gasleft * (new_term.main_ia - new_term.main_l2_gas_remaining_shift)); - tmp *= scaling_factor; - std::get<110>(evals) += typename Accumulator::View(tmp); - } - { - using Accumulator = typename std::tuple_element_t<111, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_dagasleft * (new_term.main_ia - new_term.main_da_gas_remaining_shift)); - tmp *= scaling_factor; - std::get<111>(evals) += typename Accumulator::View(tmp); - } - { - using Accumulator = typename std::tuple_element_t<112, ContainerOverSubrelations>; auto tmp = ((new_term.main_ib * (FF(1) - new_term.main_tag_err)) * ((new_term.main_sel_op_calldata_copy + new_term.main_sel_op_external_return) - new_term.main_sel_slice_gadget)); tmp *= scaling_factor; - std::get<112>(evals) += typename Accumulator::View(tmp); + std::get<110>(evals) += typename Accumulator::View(tmp); } { - using Accumulator = typename std::tuple_element_t<113, ContainerOverSubrelations>; + using Accumulator = typename std::tuple_element_t<111, ContainerOverSubrelations>; auto tmp = (new_term.main_bin_op_id - (new_term.main_sel_op_or + (FF(2) * new_term.main_sel_op_xor))); tmp *= scaling_factor; - std::get<113>(evals) += typename Accumulator::View(tmp); + std::get<111>(evals) += typename Accumulator::View(tmp); } { - using Accumulator = typename std::tuple_element_t<114, ContainerOverSubrelations>; + using Accumulator = typename std::tuple_element_t<112, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_bin - ((new_term.main_sel_op_and + new_term.main_sel_op_or) + new_term.main_sel_op_xor)); tmp *= scaling_factor; - std::get<114>(evals) += typename Accumulator::View(tmp); + std::get<112>(evals) += typename Accumulator::View(tmp); } } }; @@ -815,53 +799,53 @@ template class main : public Relation> { switch (index) { case 0: return "OPCODE_SELECTORS"; - case 76: + case 75: return "OUTPUT_U1"; - case 77: + case 76: return "SUBOP_FDIV"; - case 78: + case 77: return "SUBOP_FDIV_ZERO_ERR1"; - case 79: + case 78: return "SUBOP_FDIV_ZERO_ERR2"; - case 80: + case 79: return "SUBOP_FDIV_R_IN_TAG_FF"; - case 81: + case 80: return "SUBOP_FDIV_W_IN_TAG_FF"; - case 82: + case 81: return "SUBOP_ERROR_RELEVANT_OP"; - case 83: + case 82: return "PC_JUMP"; - case 84: + case 83: return "PC_JUMPI"; - case 85: + case 84: return "RETURN_POINTER_INCREMENT"; - case 91: + case 90: return "RETURN_POINTER_DECREMENT"; - case 96: + case 95: return "PC_INCREMENT"; - case 97: + case 96: return "INTERNAL_RETURN_POINTER_CONSISTENCY"; - case 98: + case 97: return "SPACE_ID_INTERNAL"; - case 99: + case 98: return "SPACE_ID_STANDARD_OPCODES"; + case 99: + return "JMP_CONDITION_RES_1"; case 100: - return "CMOV_CONDITION_RES_1"; - case 101: - return "CMOV_CONDITION_RES_2"; - case 104: + return "JMP_CONDITION_RES_2"; + case 102: return "MOV_SAME_VALUE_A"; - case 105: + case 103: return "MOV_SAME_VALUE_B"; - case 106: + case 104: return "MOV_MAIN_SAME_TAG"; - case 110: + case 108: return "L2GASLEFT"; - case 111: + case 109: return "DAGASLEFT"; - case 113: + case 111: return "BIN_SEL_1"; - case 114: + case 112: return "BIN_SEL_2"; } return std::to_string(index); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem.hpp index e52feb9a46b2..160a8876b0b2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem.hpp @@ -12,7 +12,7 @@ template class memImpl { static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 4, 3, 4, 3, 3, 2, 3, 3, 4, 4, 4, - 4, 4, 6, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 2, 6, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; template @@ -218,11 +218,7 @@ template class memImpl { } { using Accumulator = typename std::tuple_element_t<27, ContainerOverSubrelations>; - auto tmp = (new_term.mem_skip_check_tag - - ((new_term.mem_sel_op_cmov * - ((new_term.mem_sel_op_d + (new_term.mem_sel_op_a * (FF(1) - new_term.mem_sel_mov_ia_to_ic))) + - (new_term.mem_sel_op_b * (FF(1) - new_term.mem_sel_mov_ib_to_ic)))) + - new_term.mem_sel_op_slice)); + auto tmp = (new_term.mem_skip_check_tag - new_term.mem_sel_op_slice); tmp *= scaling_factor; std::get<27>(evals) += typename Accumulator::View(tmp); } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_a.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_a.hpp index bdfd6252bd15..0554d525236b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_a.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_a.hpp @@ -11,7 +11,7 @@ namespace bb { class perm_main_mem_a_permutation_settings { public: // This constant defines how many columns are bundled together to form each set. - constexpr static size_t COLUMNS_PER_SET = 9; + constexpr static size_t COLUMNS_PER_SET = 8; template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { @@ -32,7 +32,6 @@ class perm_main_mem_a_permutation_settings { in.main_r_in_tag, in.main_w_in_tag, in.main_sel_mov_ia_to_ic, - in.main_sel_op_cmov, in.mem_clk, in.mem_space_id, in.mem_addr, @@ -40,8 +39,7 @@ class perm_main_mem_a_permutation_settings { in.mem_rw, in.mem_r_in_tag, in.mem_w_in_tag, - in.mem_sel_mov_ia_to_ic, - in.mem_sel_op_cmov); + in.mem_sel_mov_ia_to_ic); } template static inline auto get_nonconst_entities(AllEntities& in) @@ -58,7 +56,6 @@ class perm_main_mem_a_permutation_settings { in.main_r_in_tag, in.main_w_in_tag, in.main_sel_mov_ia_to_ic, - in.main_sel_op_cmov, in.mem_clk, in.mem_space_id, in.mem_addr, @@ -66,8 +63,7 @@ class perm_main_mem_a_permutation_settings { in.mem_rw, in.mem_r_in_tag, in.mem_w_in_tag, - in.mem_sel_mov_ia_to_ic, - in.mem_sel_op_cmov); + in.mem_sel_mov_ia_to_ic); } }; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_b.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_b.hpp index e42a86af3921..b2e93f46e7ca 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_b.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_b.hpp @@ -11,7 +11,7 @@ namespace bb { class perm_main_mem_b_permutation_settings { public: // This constant defines how many columns are bundled together to form each set. - constexpr static size_t COLUMNS_PER_SET = 9; + constexpr static size_t COLUMNS_PER_SET = 8; template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { @@ -32,7 +32,6 @@ class perm_main_mem_b_permutation_settings { in.main_r_in_tag, in.main_w_in_tag, in.main_sel_mov_ib_to_ic, - in.main_sel_op_cmov, in.mem_clk, in.mem_space_id, in.mem_addr, @@ -40,8 +39,7 @@ class perm_main_mem_b_permutation_settings { in.mem_rw, in.mem_r_in_tag, in.mem_w_in_tag, - in.mem_sel_mov_ib_to_ic, - in.mem_sel_op_cmov); + in.mem_sel_mov_ib_to_ic); } template static inline auto get_nonconst_entities(AllEntities& in) @@ -58,7 +56,6 @@ class perm_main_mem_b_permutation_settings { in.main_r_in_tag, in.main_w_in_tag, in.main_sel_mov_ib_to_ic, - in.main_sel_op_cmov, in.mem_clk, in.mem_space_id, in.mem_addr, @@ -66,8 +63,7 @@ class perm_main_mem_b_permutation_settings { in.mem_rw, in.mem_r_in_tag, in.mem_w_in_tag, - in.mem_sel_mov_ib_to_ic, - in.mem_sel_op_cmov); + in.mem_sel_mov_ib_to_ic); } }; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_d.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_d.hpp index 7ca9ac219e31..2322e097e461 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_d.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_main_mem_d.hpp @@ -11,7 +11,7 @@ namespace bb { class perm_main_mem_d_permutation_settings { public: // This constant defines how many columns are bundled together to form each set. - constexpr static size_t COLUMNS_PER_SET = 8; + constexpr static size_t COLUMNS_PER_SET = 7; template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { @@ -31,15 +31,13 @@ class perm_main_mem_d_permutation_settings { in.main_rwd, in.main_r_in_tag, in.main_w_in_tag, - in.main_sel_op_cmov, in.mem_clk, in.mem_space_id, in.mem_addr, in.mem_val, in.mem_rw, in.mem_r_in_tag, - in.mem_w_in_tag, - in.mem_sel_op_cmov); + in.mem_w_in_tag); } template static inline auto get_nonconst_entities(AllEntities& in) @@ -55,15 +53,13 @@ class perm_main_mem_d_permutation_settings { in.main_rwd, in.main_r_in_tag, in.main_w_in_tag, - in.main_sel_op_cmov, in.mem_clk, in.mem_space_id, in.mem_addr, in.mem_val, in.mem_rw, in.mem_r_in_tag, - in.mem_w_in_tag, - in.mem_sel_op_cmov); + in.mem_w_in_tag); } }; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp index 921aae8a1566..68e8681d3fed 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp @@ -628,62 +628,6 @@ TEST_F(AvmExecutionTests, movOpcode) validate_trace(std::move(trace), public_inputs); } -// Positive test with CMOV. -TEST_F(AvmExecutionTests, cmovOpcode) -{ - std::string bytecode_hex = to_hex(OpCode::SET_8) + // opcode SET - "00" // Indirect flag - + to_hex(AvmMemoryTag::U8) + - "03" // val 3 - "10" // a_offset 16 - + to_hex(OpCode::SET_8) + // opcode SET - "00" // Indirect flag - + to_hex(AvmMemoryTag::U16) + - "04" // val 4 - "11" // b_offset 17 - + to_hex(OpCode::SET_8) + // opcode SET - "00" // Indirect flag - + to_hex(AvmMemoryTag::U32) + - "05" // val 5 - "20" // cond_offset 32 - + to_hex(OpCode::CMOV) + // opcode CMOV - "00" // Indirect flag - "00000010" // a_offset 16 - "00000011" // b_offset 17 - "00000020" // cond_offset 32 - "00000012" // dst_offset 18 - + to_hex(OpCode::RETURN) + // opcode RETURN - "00" // Indirect flag - "00000000" // ret offset 0 - "00000000"; // ret size 0 - - auto bytecode = hex_to_bytes(bytecode_hex); - auto instructions = Deserialization::parse(bytecode); - - ASSERT_THAT(instructions, SizeIs(5)); - - // CMOV - EXPECT_THAT(instructions.at(3), - AllOf(Field(&Instruction::op_code, OpCode::CMOV), - Field(&Instruction::operands, - ElementsAre(VariantWith(0), - VariantWith(16), - VariantWith(17), - VariantWith(32), - VariantWith(18))))); - - auto trace = gen_trace_from_instr(instructions); - - // Find the first row enabling the CMOV selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_cmov == 1; }); - EXPECT_EQ(row->main_ia, 3); - EXPECT_EQ(row->main_ib, 4); - EXPECT_EQ(row->main_ic, 3); - EXPECT_EQ(row->main_id, 5); - - validate_trace(std::move(trace), public_inputs); -} - // Positive test with indirect MOV. TEST_F(AvmExecutionTests, indMovOpcode) { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp index 631c09d1cd44..83ec24d4b0a8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp @@ -59,19 +59,6 @@ class AvmMemOpcodeTests : public ::testing::Test { trace = trace_builder.finalize(); } - void build_cmov_trace_neg_test(bool mov_a) - { - trace_builder.op_set(0, 1979, 10, AvmMemoryTag::U16); // a - trace_builder.op_set(0, 1980, 11, AvmMemoryTag::U16); // b - trace_builder.op_set(0, mov_a ? 9871 : 0, 20, AvmMemoryTag::U64); // Non-zero/zero condition value (we move a/b) - - trace_builder.op_cmov(0, 10, 11, 20, 12); - trace_builder.op_return(0, 0, 0); - trace = trace_builder.finalize(); - - compute_cmov_indices(0); - } - static std::function gen_matcher(FF clk, uint32_t sub_clk) { return [clk, sub_clk](Row r) { return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + sub_clk; }; @@ -124,44 +111,6 @@ class AvmMemOpcodeTests : public ::testing::Test { compute_index_c(clk, indirect); } - void compute_cmov_indices(uint8_t indirect) - { - // Find the first row enabling the CMOV selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_cmov == FF(1); }); - ASSERT_TRUE(row != trace.end()); - main_row_idx = static_cast(row - trace.begin()); - - auto clk = row->main_clk; - compute_index_a(clk, is_operand_indirect(indirect, 0)); - compute_index_c(clk, is_operand_indirect(indirect, 2)); - - // Find the memory trace position corresponding to the load sub-operation of register ib. - row = std::ranges::find_if(trace.begin(), trace.end(), gen_matcher(clk, AvmMemTraceBuilder::SUB_CLK_LOAD_B)); - ASSERT_TRUE(row != trace.end()); - mem_b_row_idx = static_cast(row - trace.begin()); - - // Find the memory trace position of the indirect load for register ib. - if (is_operand_indirect(indirect, 1)) { - row = std::ranges::find_if( - trace.begin(), trace.end(), gen_matcher(clk, AvmMemTraceBuilder::SUB_CLK_IND_LOAD_B)); - ASSERT_TRUE(row != trace.end()); - mem_ind_b_row_idx = static_cast(row - trace.begin()); - } - - // Find the memory trace position corresponding to the load sub-operation of register id. - row = std::ranges::find_if(trace.begin(), trace.end(), gen_matcher(clk, AvmMemTraceBuilder::SUB_CLK_LOAD_D)); - ASSERT_TRUE(row != trace.end()); - mem_d_row_idx = static_cast(row - trace.begin()); - - // Find the memory trace position of the indirect load for register id. - if (is_operand_indirect(indirect, 3)) { - row = std::ranges::find_if( - trace.begin(), trace.end(), gen_matcher(clk, AvmMemTraceBuilder::SUB_CLK_IND_LOAD_D)); - ASSERT_TRUE(row != trace.end()); - mem_ind_d_row_idx = static_cast(row - trace.begin()); - } - } - void validate_mov_trace(bool indirect, uint128_t const& val, uint32_t src_offset, @@ -235,101 +184,6 @@ class AvmMemOpcodeTests : public ::testing::Test { validate_trace(std::move(trace), public_inputs); } - - void common_cmov_trace_validate(bool indirect, - FF const& a, - FF const& b, - FF const& d, - uint32_t addr_a, - uint32_t addr_b, - uint32_t addr_c, - uint32_t addr_d, - AvmMemoryTag tag_a, - AvmMemoryTag tag_b, - AvmMemoryTag tag_d) - { - bool const mov_a = d != 0; - AvmMemoryTag const mov_tag = mov_a ? tag_a : tag_b; - FF const& mov_val = mov_a ? a : b; - FF const inv = mov_a ? d.invert() : 1; - - EXPECT_THAT(trace.at(main_row_idx), - AllOf(MAIN_ROW_FIELD_EQ(ia, a), - MAIN_ROW_FIELD_EQ(ib, b), - MAIN_ROW_FIELD_EQ(ic, mov_val), - MAIN_ROW_FIELD_EQ(id, d), - MAIN_ROW_FIELD_EQ(sel_mem_op_a, 1), - MAIN_ROW_FIELD_EQ(sel_mem_op_b, 1), - MAIN_ROW_FIELD_EQ(sel_mem_op_c, 1), - MAIN_ROW_FIELD_EQ(sel_mem_op_d, 1), - MAIN_ROW_FIELD_EQ(rwa, 0), - MAIN_ROW_FIELD_EQ(rwb, 0), - MAIN_ROW_FIELD_EQ(rwc, 1), - MAIN_ROW_FIELD_EQ(rwd, 0), - MAIN_ROW_FIELD_EQ(mem_addr_a, addr_a), - MAIN_ROW_FIELD_EQ(mem_addr_b, addr_b), - MAIN_ROW_FIELD_EQ(mem_addr_c, addr_c), - MAIN_ROW_FIELD_EQ(mem_addr_d, addr_d), - MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_a, static_cast(indirect)), - MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_b, static_cast(indirect)), - MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_c, static_cast(indirect)), - MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_d, static_cast(indirect)), - MAIN_ROW_FIELD_EQ(sel_op_cmov, 1), - MAIN_ROW_FIELD_EQ(sel_mov_ia_to_ic, mov_a), - MAIN_ROW_FIELD_EQ(sel_mov_ib_to_ic, !mov_a), - MAIN_ROW_FIELD_EQ(r_in_tag, static_cast(mov_tag)), - MAIN_ROW_FIELD_EQ(w_in_tag, static_cast(mov_tag)), - MAIN_ROW_FIELD_EQ(inv, inv))); - - EXPECT_THAT(trace.at(mem_a_row_idx), - AllOf(MEM_ROW_FIELD_EQ(r_in_tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(w_in_tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(tag, static_cast(tag_a)), - MEM_ROW_FIELD_EQ(sel_mov_ia_to_ic, mov_a), - MEM_ROW_FIELD_EQ(addr, addr_a), - MEM_ROW_FIELD_EQ(val, a), - MEM_ROW_FIELD_EQ(rw, 0), - MEM_ROW_FIELD_EQ(skip_check_tag, mov_a ? 0 : 1), - MEM_ROW_FIELD_EQ(sel_op_a, 1), - MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_a, 0))); - - EXPECT_THAT(trace.at(mem_b_row_idx), - AllOf(MEM_ROW_FIELD_EQ(r_in_tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(w_in_tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(tag, static_cast(tag_b)), - MEM_ROW_FIELD_EQ(tag_err, 0), - MEM_ROW_FIELD_EQ(sel_mov_ib_to_ic, !mov_a), - MEM_ROW_FIELD_EQ(addr, addr_b), - MEM_ROW_FIELD_EQ(val, b), - MEM_ROW_FIELD_EQ(rw, 0), - MEM_ROW_FIELD_EQ(skip_check_tag, mov_a ? 1 : 0), - MEM_ROW_FIELD_EQ(sel_op_b, 1), - MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_b, 0))); - - EXPECT_THAT(trace.at(mem_c_row_idx), - AllOf(MEM_ROW_FIELD_EQ(r_in_tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(w_in_tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(tag_err, 0), - MEM_ROW_FIELD_EQ(addr, addr_c), - MEM_ROW_FIELD_EQ(val, mov_a ? a : b), - MEM_ROW_FIELD_EQ(rw, 1), - MEM_ROW_FIELD_EQ(skip_check_tag, 0), - MEM_ROW_FIELD_EQ(sel_op_c, 1), - MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_c, 0))); - - EXPECT_THAT(trace.at(mem_d_row_idx), - AllOf(MEM_ROW_FIELD_EQ(r_in_tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(w_in_tag, static_cast(mov_tag)), - MEM_ROW_FIELD_EQ(tag, static_cast(tag_d)), - MEM_ROW_FIELD_EQ(tag_err, 0), - MEM_ROW_FIELD_EQ(addr, addr_d), - MEM_ROW_FIELD_EQ(val, d), - MEM_ROW_FIELD_EQ(rw, 0), - MEM_ROW_FIELD_EQ(skip_check_tag, 1), - MEM_ROW_FIELD_EQ(sel_op_d, 1), - MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_d, 0))); - } }; class AvmMemOpcodeNegativeTests : public AvmMemOpcodeTests { @@ -407,115 +261,6 @@ TEST_F(AvmMemOpcodeTests, indirectMovInvalidAddressTag) validate_trace(std::move(trace), public_inputs, {}, {}); } -/****************************************************************************** - * CMOV Opcode - ******************************************************************************/ - -TEST_F(AvmMemOpcodeTests, allDirectCMovA) -{ - trace_builder.op_set(0, 1979, 10, AvmMemoryTag::U16); // a - trace_builder.op_set(0, 1980, 11, AvmMemoryTag::U128); // b - trace_builder.op_set(0, 987162, 20, AvmMemoryTag::U64); // Non-zero condition value (we move a) - trace_builder.op_set(0, 8, 12, AvmMemoryTag::U32); // Target, should be overwritten - - trace_builder.op_cmov(0, 10, 11, 20, 12); - trace_builder.op_return(0, 0, 0); - trace = trace_builder.finalize(); - - compute_cmov_indices(0); - common_cmov_trace_validate( - false, 1979, 1980, 987162, 10, 11, 12, 20, AvmMemoryTag::U16, AvmMemoryTag::U128, AvmMemoryTag::U64); - validate_trace(std::move(trace), public_inputs); -} - -TEST_F(AvmMemOpcodeTests, allDirectCMovB) -{ - trace_builder.op_set(0, 1979, 10, AvmMemoryTag::U8); // a - trace_builder.op_set(0, 1980, 11, AvmMemoryTag::U8); // b - trace_builder.op_set(0, 0, 20, AvmMemoryTag::U64); // Zero condition value (we move b) - trace_builder.op_set(0, 8, 12, AvmMemoryTag::U32); // Target, should be overwritten - - trace_builder.op_cmov(0, 10, 11, 20, 12); - trace_builder.op_return(0, 0, 0); - trace = trace_builder.finalize(); - - compute_cmov_indices(0); - common_cmov_trace_validate( - false, 1979, 1980, 0, 10, 11, 12, 20, AvmMemoryTag::U8, AvmMemoryTag::U8, AvmMemoryTag::U64); - validate_trace(std::move(trace), public_inputs); -} - -TEST_F(AvmMemOpcodeTests, allDirectCMovConditionUninitialized) -{ - trace_builder.op_set(0, 1979, 10, AvmMemoryTag::U8); // a - trace_builder.op_set(0, 1980, 11, AvmMemoryTag::U8); // b - // Address 20 is unitialized and we use it as the condition - // value. It will be therefore zero. (we move b) - - trace_builder.op_cmov(0, 10, 11, 20, 12); - trace_builder.op_return(0, 0, 0); - trace = trace_builder.finalize(); - - compute_cmov_indices(0); - common_cmov_trace_validate( - false, 1979, 1980, 0, 10, 11, 12, 20, AvmMemoryTag::U8, AvmMemoryTag::U8, AvmMemoryTag::U0); - validate_trace(std::move(trace), public_inputs); -} - -TEST_F(AvmMemOpcodeTests, allDirectCMovOverwriteA) -{ - trace_builder.op_set(0, 1979, 10, AvmMemoryTag::U8); // a - trace_builder.op_set(0, 1980, 11, AvmMemoryTag::U8); // b - trace_builder.op_set(0, 0, 20, AvmMemoryTag::U64); // Zero condition value (we move b) - - trace_builder.op_cmov(0, 10, 11, 20, 10); - trace_builder.op_return(0, 0, 0); - trace = trace_builder.finalize(); - - compute_cmov_indices(0); - common_cmov_trace_validate( - false, 1979, 1980, 0, 10, 11, 10, 20, AvmMemoryTag::U8, AvmMemoryTag::U8, AvmMemoryTag::U64); - validate_trace(std::move(trace), public_inputs); -} - -TEST_F(AvmMemOpcodeTests, allIndirectCMovA) -{ - // a b c d - // Val 1979 1980 1979 987162 - // Dir Addr 10 11 12 20 - // Ind Addr 110 111 112 120 - - trace_builder.op_set(0, 10, 110, AvmMemoryTag::U32); - trace_builder.op_set(0, 11, 111, AvmMemoryTag::U32); - trace_builder.op_set(0, 12, 112, AvmMemoryTag::U32); - trace_builder.op_set(0, 20, 120, AvmMemoryTag::U32); - - trace_builder.op_set(0, 1979, 10, AvmMemoryTag::U16); // a - trace_builder.op_set(0, 1980, 11, AvmMemoryTag::U128); // b - trace_builder.op_set(0, 987162, 20, AvmMemoryTag::U64); // Non-zero condition value (we move a) - trace_builder.op_set(0, 8, 12, AvmMemoryTag::U32); // Target, should be overwritten - - trace_builder.op_cmov(15, 110, 111, 120, 112); - trace_builder.op_return(0, 0, 0); - trace = trace_builder.finalize(); - - compute_cmov_indices(15); - common_cmov_trace_validate( - true, 1979, 1980, 987162, 10, 11, 12, 20, AvmMemoryTag::U16, AvmMemoryTag::U128, AvmMemoryTag::U64); - validate_trace(std::move(trace), public_inputs); -} - -TEST_F(AvmMemOpcodeTests, allIndirectCMovAllUnitialized) -{ - trace_builder.op_cmov(15, 10, 11, 20, 10); - trace_builder.op_return(0, 0, 0); - trace = trace_builder.finalize(); - - compute_cmov_indices(15); - common_cmov_trace_validate(true, 0, 0, 0, 0, 0, 0, 0, AvmMemoryTag::U0, AvmMemoryTag::U0, AvmMemoryTag::U0); - validate_trace(std::move(trace), public_inputs); -} - /****************************************************************************** * SET Opcode ******************************************************************************/ @@ -738,63 +483,4 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagMainTraceRead) EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } -/****************************************************************************** - * CMOV Opcode - ******************************************************************************/ -TEST_F(AvmMemOpcodeNegativeTests, cmovBInsteadA) -{ - build_cmov_trace_neg_test(true); - - trace.at(main_row_idx).main_ic = 1980; - EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_A"); -} - -TEST_F(AvmMemOpcodeNegativeTests, cmovAInsteadB) -{ - build_cmov_trace_neg_test(false); - - trace.at(main_row_idx).main_ic = 1979; - EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_B"); -} - -TEST_F(AvmMemOpcodeNegativeTests, cmovAChangeTag) -{ - build_cmov_trace_neg_test(true); - - trace.at(mem_c_row_idx).mem_tag = static_cast(AvmMemoryTag::U32); - trace.at(mem_c_row_idx).mem_w_in_tag = static_cast(AvmMemoryTag::U32); - trace.at(main_row_idx).main_w_in_tag = static_cast(AvmMemoryTag::U32); - - EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_MAIN_SAME_TAG"); -} - -TEST_F(AvmMemOpcodeNegativeTests, cmovASkipCheckAbuse) -{ - build_cmov_trace_neg_test(true); - - trace.at(mem_a_row_idx).mem_skip_check_tag = 1; - - EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SKIP_CHECK_TAG"); -} - -TEST_F(AvmMemOpcodeNegativeTests, cmovASkipCheckAbuseDisableSelMovA) -{ - build_cmov_trace_neg_test(true); - - trace.at(mem_a_row_idx).mem_skip_check_tag = 1; - trace.at(mem_a_row_idx).mem_sel_mov_ia_to_ic = 0; - - EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); -} - -TEST_F(AvmMemOpcodeNegativeTests, cmovBSkipCheckAbuseDisableSelMovB) -{ - build_cmov_trace_neg_test(false); - - trace.at(mem_b_row_idx).mem_skip_check_tag = 1; - trace.at(mem_b_row_idx).mem_sel_mov_ib_to_ic = 0; - - EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); -} - } // namespace tests_avm diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/deserialization.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/deserialization.cpp index aa5d88b707df..8741a6abbdac 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/deserialization.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/deserialization.cpp @@ -98,8 +98,6 @@ const std::unordered_map> OPCODE_WIRE_FORMAT = { OpCode::SET_FF, { OperandType::INDIRECT8, OperandType::TAG, OperandType::FF, OperandType::UINT16 } }, { OpCode::MOV_8, { OperandType::INDIRECT8, OperandType::UINT8, OperandType::UINT8 } }, { OpCode::MOV_16, { OperandType::INDIRECT8, OperandType::UINT16, OperandType::UINT16 } }, - { OpCode::CMOV, - { OperandType::INDIRECT8, OperandType::UINT32, OperandType::UINT32, OperandType::UINT32, OperandType::UINT32 } }, // Side Effects - Public Storage { OpCode::SLOAD, { OperandType::INDIRECT8, OperandType::UINT32, OperandType::UINT32 } }, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp index 4dfd121c0d64..0950d3cfe09d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp @@ -604,13 +604,6 @@ std::vector Execution::gen_trace(std::vector const& instructio std::get(inst.operands.at(1)), std::get(inst.operands.at(2))); break; - case OpCode::CMOV: - trace_builder.op_cmov(std::get(inst.operands.at(0)), - std::get(inst.operands.at(1)), - std::get(inst.operands.at(2)), - std::get(inst.operands.at(3)), - std::get(inst.operands.at(4))); - break; // World State case OpCode::SLOAD: diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/fixed_gas.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/fixed_gas.cpp index edcc3a9976e1..9f37ad46e98d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/fixed_gas.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/fixed_gas.cpp @@ -62,7 +62,6 @@ const std::unordered_map GAS_COST_TABLE = { { OpCode::SET_FF, make_cost(AVM_SET_BASE_L2_GAS, 0, 0, 0) }, { OpCode::MOV_8, make_cost(AVM_MOV_BASE_L2_GAS, 0, 0, 0) }, { OpCode::MOV_16, make_cost(AVM_MOV_BASE_L2_GAS, 0, 0, 0) }, - { OpCode::CMOV, make_cost(AVM_CMOV_BASE_L2_GAS, 0, 0, 0) }, { OpCode::SLOAD, make_cost(AVM_SLOAD_BASE_L2_GAS, 0, 0, 0) }, { OpCode::SSTORE, make_cost(AVM_SSTORE_BASE_L2_GAS, AVM_SSTORE_BASE_DA_GAS, 0, 0) }, { OpCode::NOTEHASHEXISTS, make_cost(AVM_NOTEHASHEXISTS_BASE_L2_GAS, 0, 0, 0) }, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/mem_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/mem_trace.cpp index 2c932af69e5b..03bbb724e84e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/mem_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/mem_trace.cpp @@ -239,75 +239,6 @@ AvmMemTraceBuilder::MemEntry AvmMemTraceBuilder::read_and_load_mov_opcode(uint8_ return mem_entry; } -/** - * @brief Handle a read memory operation specific to CMOV opcode. Load the corresponding - * values to the intermediate register ia, ib, id. Three memory trace entries for - * these load operations are added. They are permissive in the sense that we do not - * enforce tag matching against any instruction tag. In addition, the specific selector - * for CMOV opcode is enabled. - * - * @param space_id Address space identifier - * @param clk Main clock - * @param a_addr Memory address of the first value candidate a. - * @param b_addr Memory address of the second value candidate b. - * @param cond_addr Memory address of the conditional value. - * - * @return Result of the read operation containing the value and the tag of the memory cell - * at the supplied address. - */ -std::array AvmMemTraceBuilder::read_and_load_cmov_opcode( - uint8_t space_id, uint32_t clk, uint32_t a_addr, uint32_t b_addr, uint32_t cond_addr) -{ - auto& mem_space = memory.at(space_id); - MemEntry a_mem_entry = mem_space.contains(a_addr) ? mem_space.at(a_addr) : MemEntry{}; - MemEntry b_mem_entry = mem_space.contains(b_addr) ? mem_space.at(b_addr) : MemEntry{}; - MemEntry cond_mem_entry = mem_space.contains(cond_addr) ? mem_space.at(cond_addr) : MemEntry{}; - - bool mov_b = cond_mem_entry.val == 0; - - AvmMemoryTag r_w_in_tag = mov_b ? b_mem_entry.tag : a_mem_entry.tag; - - mem_trace.emplace_back(MemoryTraceEntry{ - .m_space_id = space_id, - .m_clk = clk, - .m_sub_clk = SUB_CLK_LOAD_A, - .m_addr = a_addr, - .m_val = a_mem_entry.val, - .m_tag = a_mem_entry.tag, - .r_in_tag = r_w_in_tag, - .w_in_tag = r_w_in_tag, - .m_sel_mov_ia_to_ic = !mov_b, - .m_sel_cmov = true, - }); - - mem_trace.emplace_back(MemoryTraceEntry{ - .m_space_id = space_id, - .m_clk = clk, - .m_sub_clk = SUB_CLK_LOAD_B, - .m_addr = b_addr, - .m_val = b_mem_entry.val, - .m_tag = b_mem_entry.tag, - .r_in_tag = r_w_in_tag, - .w_in_tag = r_w_in_tag, - .m_sel_mov_ib_to_ic = mov_b, - .m_sel_cmov = true, - }); - - mem_trace.emplace_back(MemoryTraceEntry{ - .m_space_id = space_id, - .m_clk = clk, - .m_sub_clk = SUB_CLK_LOAD_D, - .m_addr = cond_addr, - .m_val = cond_mem_entry.val, - .m_tag = cond_mem_entry.tag, - .r_in_tag = r_w_in_tag, - .w_in_tag = r_w_in_tag, - .m_sel_cmov = true, - }); - - return { a_mem_entry, b_mem_entry, cond_mem_entry }; -} - /** * @brief Handle a read memory operation specific to JUMPI opcode. Load the conditional * value in the intermediate register id. A memory trace entry for this load operation is added. diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/mem_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/mem_trace.hpp index 70e543757ad9..8ab846c317af 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/mem_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/mem_trace.hpp @@ -41,7 +41,6 @@ class AvmMemTraceBuilder { FF m_one_min_inv{}; bool m_sel_mov_ia_to_ic = false; bool m_sel_mov_ib_to_ic = false; - bool m_sel_cmov = false; bool m_tag_err_count_relevant = false; bool m_sel_op_slice = false; @@ -80,8 +79,6 @@ class AvmMemTraceBuilder { std::vector finalize(); MemEntry read_and_load_mov_opcode(uint8_t space_id, uint32_t clk, uint32_t addr); - std::array read_and_load_cmov_opcode( - uint8_t space_id, uint32_t clk, uint32_t a_addr, uint32_t b_addr, uint32_t cond_addr); MemEntry read_and_load_jumpi_opcode(uint8_t space_id, uint32_t clk, uint32_t cond_addr); MemEntry read_and_load_cast_opcode(uint8_t space_id, uint32_t clk, uint32_t addr, AvmMemoryTag w_in_tag); MemRead read_and_load_from_memory(uint8_t space_id, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/opcode.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/opcode.cpp index 91a6ba60ae3d..724ee32e2cc0 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/opcode.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/opcode.cpp @@ -120,8 +120,6 @@ std::string to_string(OpCode opcode) return "MOV_8"; case OpCode::MOV_16: return "MOV_16"; - case OpCode::CMOV: - return "CMOV"; // World State case OpCode::SLOAD: return "SLOAD"; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/opcode.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/opcode.hpp index 02e881677688..feab28e807a7 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/opcode.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/opcode.hpp @@ -72,7 +72,6 @@ enum class OpCode : uint8_t { SET_FF, MOV_8, MOV_16, - CMOV, // World State SLOAD, // Public Storage diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp index 8c6829c7f4fa..1c27f3b8181e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp @@ -1921,119 +1921,6 @@ void AvmTraceBuilder::op_mov(uint8_t indirect, uint32_t src_offset, uint32_t dst }); } -/** - * @brief Copy value and tag from a memory cell at position src_offset to the - * memory cell at position dst_offset. src_offset is a_offset if the value - * defined by cond_offset is non-zero. Otherwise, src_offset is b_offset. - * - * @param indirect A byte encoding information about indirect/direct memory access. - * @param a_offset Offset of first candidate source memory cell - * @param b_offset Offset of second candidate source memory cell - * @param cond_offset Offset of the condition determining the source offset (a_offset or b_offset) - * @param dst_offset Offset of destination memory cell - */ -void AvmTraceBuilder::op_cmov( - uint8_t indirect, uint32_t a_offset, uint32_t b_offset, uint32_t cond_offset, uint32_t dst_offset) -{ - auto const clk = static_cast(main_trace.size()) + 1; - bool tag_match = true; - uint32_t direct_a_offset = a_offset; - uint32_t direct_b_offset = b_offset; - uint32_t direct_cond_offset = cond_offset; - uint32_t direct_dst_offset = dst_offset; - - bool indirect_a_flag = is_operand_indirect(indirect, 0); - bool indirect_b_flag = is_operand_indirect(indirect, 1); - bool indirect_cond_flag = is_operand_indirect(indirect, 2); - bool indirect_dst_flag = is_operand_indirect(indirect, 3); - - if (indirect_a_flag) { - auto read_ind_a = - mem_trace_builder.indirect_read_and_load_from_memory(call_ptr, clk, IndirectRegister::IND_A, a_offset); - direct_a_offset = uint32_t(read_ind_a.val); - tag_match = tag_match && read_ind_a.tag_match; - } - - if (indirect_b_flag) { - auto read_ind_b = - mem_trace_builder.indirect_read_and_load_from_memory(call_ptr, clk, IndirectRegister::IND_B, b_offset); - direct_b_offset = uint32_t(read_ind_b.val); - tag_match = tag_match && read_ind_b.tag_match; - } - - if (indirect_cond_flag) { - auto read_ind_d = - mem_trace_builder.indirect_read_and_load_from_memory(call_ptr, clk, IndirectRegister::IND_D, cond_offset); - direct_cond_offset = uint32_t(read_ind_d.val); - tag_match = tag_match && read_ind_d.tag_match; - } - - if (indirect_dst_flag) { - auto read_ind_c = - mem_trace_builder.indirect_read_and_load_from_memory(call_ptr, clk, IndirectRegister::IND_C, dst_offset); - direct_dst_offset = uint32_t(read_ind_c.val); - tag_match = tag_match && read_ind_c.tag_match; - } - - // Reading from memory and loading into ia or ib without tag check. We also load the conditional value - // in id without any tag check. - std::array const cmov_res = mem_trace_builder.read_and_load_cmov_opcode( - call_ptr, clk, direct_a_offset, direct_b_offset, direct_cond_offset); - - AvmMemTraceBuilder::MemEntry const& a_mem_entry = cmov_res.at(0); - AvmMemTraceBuilder::MemEntry const& b_mem_entry = cmov_res.at(1); - AvmMemTraceBuilder::MemEntry const& cond_mem_entry = cmov_res.at(2); - - const bool id_zero = cond_mem_entry.val == 0; - - auto const& val = id_zero ? b_mem_entry.val : a_mem_entry.val; - auto const& tag = id_zero ? b_mem_entry.tag : a_mem_entry.tag; - - // Write into memory from intermediate register ic. - mem_trace_builder.write_into_memory(call_ptr, clk, IntermRegister::IC, direct_dst_offset, val, tag, tag); - - FF const inv = !id_zero ? cond_mem_entry.val.invert() : 1; - - // Constrain gas cost - gas_trace_builder.constrain_gas(clk, OpCode::CMOV); - - main_trace.push_back(Row{ - .main_clk = clk, - .main_call_ptr = call_ptr, - .main_ia = a_mem_entry.val, - .main_ib = b_mem_entry.val, - .main_ic = val, - .main_id = cond_mem_entry.val, - .main_id_zero = static_cast(id_zero), - .main_ind_addr_a = indirect_a_flag ? a_offset : 0, - .main_ind_addr_b = indirect_b_flag ? b_offset : 0, - .main_ind_addr_c = indirect_dst_flag ? dst_offset : 0, - .main_ind_addr_d = indirect_cond_flag ? cond_offset : 0, - .main_internal_return_ptr = internal_return_ptr, - .main_inv = inv, - .main_mem_addr_a = direct_a_offset, - .main_mem_addr_b = direct_b_offset, - .main_mem_addr_c = direct_dst_offset, - .main_mem_addr_d = direct_cond_offset, - .main_pc = pc++, - .main_r_in_tag = static_cast(tag), - .main_rwc = 1, - .main_sel_mem_op_a = 1, - .main_sel_mem_op_b = 1, - .main_sel_mem_op_c = 1, - .main_sel_mem_op_d = 1, - .main_sel_mov_ia_to_ic = static_cast(!id_zero), - .main_sel_mov_ib_to_ic = static_cast(id_zero), - .main_sel_op_cmov = 1, - .main_sel_resolve_ind_addr_a = static_cast(indirect_a_flag), - .main_sel_resolve_ind_addr_b = static_cast(indirect_b_flag), - .main_sel_resolve_ind_addr_c = static_cast(indirect_dst_flag), - .main_sel_resolve_ind_addr_d = static_cast(indirect_cond_flag), - .main_tag_err = static_cast(!tag_match), - .main_w_in_tag = static_cast(tag), - }); -} - /************************************************************************************************** * HELPERS FOR WORLD STATE AND ACCRUED SUBSTATE **************************************************************************************************/ @@ -3682,7 +3569,6 @@ std::vector AvmTraceBuilder::finalize() dest.mem_one_min_inv = src.m_one_min_inv; dest.mem_sel_mov_ia_to_ic = FF(static_cast(src.m_sel_mov_ia_to_ic)); dest.mem_sel_mov_ib_to_ic = FF(static_cast(src.m_sel_mov_ib_to_ic)); - dest.mem_sel_op_cmov = FF(static_cast(src.m_sel_cmov)); dest.mem_sel_op_slice = FF(static_cast(src.m_sel_op_slice)); dest.incl_mem_tag_err_counts = FF(static_cast(src.m_tag_err_count_relevant)); @@ -3732,11 +3618,8 @@ std::vector AvmTraceBuilder::finalize() } } - if (src.m_sel_cmov || src.m_sel_op_slice) { - dest.mem_skip_check_tag = - dest.mem_sel_op_cmov * (dest.mem_sel_op_d + dest.mem_sel_op_a * (-dest.mem_sel_mov_ia_to_ic + 1) + - dest.mem_sel_op_b * (-dest.mem_sel_mov_ib_to_ic + 1)) + - dest.mem_sel_op_slice; + if (src.m_sel_op_slice) { + dest.mem_skip_check_tag = dest.mem_sel_op_b * (-dest.mem_sel_mov_ib_to_ic + 1) + dest.mem_sel_op_slice; } if (i + 1 < mem_trace_size) { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp index 5ac2c38b1724..5ec4ae794997 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp @@ -118,7 +118,6 @@ class AvmTraceBuilder { // TODO(8945): skip_gas boolean is temporary and should be removed once all fake rows are removed void op_set(uint8_t indirect, FF val, uint32_t dst_offset, AvmMemoryTag in_tag, bool skip_gas = false); void op_mov(uint8_t indirect, uint32_t src_offset, uint32_t dst_offset); - void op_cmov(uint8_t indirect, uint32_t a_offset, uint32_t b_offset, uint32_t cond_offset, uint32_t dst_offset); // World State void op_sload(uint8_t indirect, uint32_t slot_offset, uint32_t size, uint32_t dest_offset); diff --git a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp index 6ae5af89b350..7c6edcbe3c75 100644 --- a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp @@ -34,7 +34,7 @@ #define PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH 691 #define PUBLIC_CONTEXT_INPUTS_LENGTH 42 #define AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS 66 -#define AVM_PROOF_LENGTH_IN_FIELDS 3832 +#define AVM_PROOF_LENGTH_IN_FIELDS 3822 #define AVM_PUBLIC_COLUMN_MAX_SIZE 1024 #define AVM_PUBLIC_INPUTS_FLATTENED_SIZE 2739 #define MEM_TAG_U1 1 @@ -92,7 +92,6 @@ #define AVM_INTERNALRETURN_BASE_L2_GAS 18 #define AVM_SET_BASE_L2_GAS 18 #define AVM_MOV_BASE_L2_GAS 23 -#define AVM_CMOV_BASE_L2_GAS 34 #define AVM_SLOAD_BASE_L2_GAS 1218 #define AVM_SSTORE_BASE_L2_GAS 2642 #define AVM_NOTEHASHEXISTS_BASE_L2_GAS 986 diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr index 4846842c401e..df4d56124b08 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -325,7 +325,7 @@ global AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS: u32 = 2 + 16 * 4; // `AVM_PROOF_LENGTH_IN_FIELDS` must be updated when AVM circuit changes. // To determine latest value, hover `COMPUTED_AVM_PROOF_LENGTH_IN_FIELDS` // in barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp -global AVM_PROOF_LENGTH_IN_FIELDS: u32 = 3832; +global AVM_PROOF_LENGTH_IN_FIELDS: u32 = 3822; global AVM_PUBLIC_COLUMN_MAX_SIZE : u32 = 1024; global AVM_PUBLIC_INPUTS_FLATTENED_SIZE : u32 = 2 * AVM_PUBLIC_COLUMN_MAX_SIZE + PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH; /** @@ -469,7 +469,6 @@ global AVM_INTERNALCALL_BASE_L2_GAS: u32 = 18; global AVM_INTERNALRETURN_BASE_L2_GAS: u32 = 18; global AVM_SET_BASE_L2_GAS: u32 = 18; global AVM_MOV_BASE_L2_GAS: u32 = 23; -global AVM_CMOV_BASE_L2_GAS: u32 = 34; global AVM_SLOAD_BASE_L2_GAS: u32 = 18 + L2_GAS_PER_PUBLIC_DATA_READ; global AVM_SSTORE_BASE_L2_GAS: u32 = 18 + L2_GAS_PER_PUBLIC_DATA_UPDATE; global AVM_NOTEHASHEXISTS_BASE_L2_GAS: u32 = 26 + L2_GAS_PER_NOTE_HASH_READ_REQUEST; diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs b/noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs index e764c81b023e..288656a39a84 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs @@ -1310,12 +1310,13 @@ impl<'block> BrilligBlock<'block> { self.brillig_context.binary_instruction(zero, num, twos_complement, BrilligBinaryOp::Sub); // absolute_value = result_is_negative ? twos_complement : num - self.brillig_context.conditional_mov_instruction( - absolute_value.address, - result_is_negative.address, - twos_complement.address, - num.address, - ); + self.brillig_context.codegen_branch(result_is_negative.address, |ctx, is_negative| { + if is_negative { + ctx.mov_instruction(absolute_value.address, twos_complement.address); + } else { + ctx.mov_instruction(absolute_value.address, num.address); + } + }); self.brillig_context.deallocate_single_addr(zero); self.brillig_context.deallocate_single_addr(max_positive); diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 14ff856712f3..521c7201aad6 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -211,7 +211,7 @@ export const NESTED_RECURSIVE_PROOF_LENGTH = 463; export const TUBE_PROOF_LENGTH = 463; export const VERIFICATION_KEY_LENGTH_IN_FIELDS = 128; export const AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS = 66; -export const AVM_PROOF_LENGTH_IN_FIELDS = 3832; +export const AVM_PROOF_LENGTH_IN_FIELDS = 3822; export const AVM_PUBLIC_COLUMN_MAX_SIZE = 1024; export const AVM_PUBLIC_INPUTS_FLATTENED_SIZE = 2739; export const MEM_TAG_U1 = 1; @@ -272,7 +272,6 @@ export const AVM_INTERNALCALL_BASE_L2_GAS = 18; export const AVM_INTERNALRETURN_BASE_L2_GAS = 18; export const AVM_SET_BASE_L2_GAS = 18; export const AVM_MOV_BASE_L2_GAS = 23; -export const AVM_CMOV_BASE_L2_GAS = 34; export const AVM_SLOAD_BASE_L2_GAS = 1218; export const AVM_SSTORE_BASE_L2_GAS = 2642; export const AVM_NOTEHASHEXISTS_BASE_L2_GAS = 986; diff --git a/yarn-project/simulator/src/avm/avm_gas.ts b/yarn-project/simulator/src/avm/avm_gas.ts index 3ef1ecc19e14..ea3e955517c4 100644 --- a/yarn-project/simulator/src/avm/avm_gas.ts +++ b/yarn-project/simulator/src/avm/avm_gas.ts @@ -101,7 +101,6 @@ const BASE_GAS_COSTS: Record = { [Opcode.SET_FF]: makeCost(c.AVM_SET_BASE_L2_GAS, 0), [Opcode.MOV_8]: makeCost(c.AVM_MOV_BASE_L2_GAS, 0), [Opcode.MOV_16]: makeCost(c.AVM_MOV_BASE_L2_GAS, 0), - [Opcode.CMOV]: makeCost(c.AVM_CMOV_BASE_L2_GAS, 0), [Opcode.SLOAD]: makeCost(c.AVM_SLOAD_BASE_L2_GAS, 0), [Opcode.SSTORE]: makeCost(c.AVM_SSTORE_BASE_L2_GAS, c.AVM_SSTORE_BASE_DA_GAS), [Opcode.NOTEHASHEXISTS]: makeCost(c.AVM_NOTEHASHEXISTS_BASE_L2_GAS, 0), diff --git a/yarn-project/simulator/src/avm/opcodes/memory.test.ts b/yarn-project/simulator/src/avm/opcodes/memory.test.ts index 29be47112c8b..9820fb849114 100644 --- a/yarn-project/simulator/src/avm/opcodes/memory.test.ts +++ b/yarn-project/simulator/src/avm/opcodes/memory.test.ts @@ -5,7 +5,7 @@ import { Field, TypeTag, Uint8, Uint16, Uint32, Uint64, Uint128 } from '../avm_m import { initContext, initExecutionEnvironment } from '../fixtures/index.js'; import { Opcode } from '../serialization/instruction_serialization.js'; import { Addressing, AddressingMode } from './addressing_mode.js'; -import { CMov, CalldataCopy, Cast, Mov, Set } from './memory.js'; +import { CalldataCopy, Cast, Mov, Set } from './memory.js'; describe('Memory instructions', () => { let context: AvmContext; @@ -364,89 +364,6 @@ describe('Memory instructions', () => { }); }); - describe('CMOV', () => { - it('Should deserialize correctly', () => { - const buf = Buffer.from([ - CMov.opcode, // opcode - 0x01, // indirect - ...Buffer.from('12345678', 'hex'), // aOffset - ...Buffer.from('a2345678', 'hex'), // bOffset - ...Buffer.from('b2345678', 'hex'), // condOffset - ...Buffer.from('3456789a', 'hex'), // dstOffset - ]); - const inst = new CMov( - /*indirect=*/ 0x01, - /*aOffset=*/ 0x12345678, - /*bOffset=*/ 0xa2345678, - /*condOffset=*/ 0xb2345678, - /*dstOffset=*/ 0x3456789a, - ); - - expect(CMov.deserialize(buf)).toEqual(inst); - expect(inst.serialize()).toEqual(buf); - }); - - it('Should move A if COND is true, on different memory cells (integral condition)', async () => { - context.machineState.memory.set(0, new Uint32(123)); // A - context.machineState.memory.set(1, new Uint16(456)); // B - context.machineState.memory.set(2, new Uint8(2)); // Condition - - await new CMov(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*condOffset=*/ 2, /*dstOffset=*/ 3).execute( - context, - ); - - const actual = context.machineState.memory.get(3); - const tag = context.machineState.memory.getTag(3); - expect(actual).toEqual(new Uint32(123)); - expect(tag).toEqual(TypeTag.UINT32); - }); - - it('Should move B if COND is false, on different memory cells (integral condition)', async () => { - context.machineState.memory.set(0, new Uint32(123)); // A - context.machineState.memory.set(1, new Uint16(456)); // B - context.machineState.memory.set(2, new Uint8(0)); // Condition - - await new CMov(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*condOffset=*/ 2, /*dstOffset=*/ 3).execute( - context, - ); - - const actual = context.machineState.memory.get(3); - const tag = context.machineState.memory.getTag(3); - expect(actual).toEqual(new Uint16(456)); - expect(tag).toEqual(TypeTag.UINT16); - }); - - it('Should move A if COND is true, on different memory cells (field condition)', async () => { - context.machineState.memory.set(0, new Uint32(123)); // A - context.machineState.memory.set(1, new Uint16(456)); // B - context.machineState.memory.set(2, new Field(1)); // Condition - - await new CMov(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*condOffset=*/ 2, /*dstOffset=*/ 3).execute( - context, - ); - - const actual = context.machineState.memory.get(3); - const tag = context.machineState.memory.getTag(3); - expect(actual).toEqual(new Uint32(123)); - expect(tag).toEqual(TypeTag.UINT32); - }); - - it('Should move B if COND is false, on different memory cells (integral condition)', async () => { - context.machineState.memory.set(0, new Uint32(123)); // A - context.machineState.memory.set(1, new Uint16(456)); // B - context.machineState.memory.set(2, new Field(0)); // Condition - - await new CMov(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*condOffset=*/ 2, /*dstOffset=*/ 3).execute( - context, - ); - - const actual = context.machineState.memory.get(3); - const tag = context.machineState.memory.getTag(3); - expect(actual).toEqual(new Uint16(456)); - expect(tag).toEqual(TypeTag.UINT16); - }); - }); - describe('CALLDATACOPY', () => { it('Should (de)serialize correctly', () => { const buf = Buffer.from([ diff --git a/yarn-project/simulator/src/avm/opcodes/memory.ts b/yarn-project/simulator/src/avm/opcodes/memory.ts index 605f97eccf04..7a82db76bcee 100644 --- a/yarn-project/simulator/src/avm/opcodes/memory.ts +++ b/yarn-project/simulator/src/avm/opcodes/memory.ts @@ -76,49 +76,6 @@ export class Set extends Instruction { } } -export class CMov extends Instruction { - static readonly type: string = 'CMOV'; - static readonly opcode: Opcode = Opcode.CMOV; - // Informs (de)serialization. See Instruction.deserialize. - static readonly wireFormat: OperandType[] = [ - OperandType.UINT8, - OperandType.UINT8, - OperandType.UINT32, - OperandType.UINT32, - OperandType.UINT32, - OperandType.UINT32, - ]; - - constructor( - private indirect: number, - private aOffset: number, - private bOffset: number, - private condOffset: number, - private dstOffset: number, - ) { - super(); - } - - public async execute(context: AvmContext): Promise { - const memory = context.machineState.memory.track(this.type); - context.machineState.consumeGas(this.gasCost()); - - const operands = [this.aOffset, this.bOffset, this.condOffset, this.dstOffset]; - const addressing = Addressing.fromWire(this.indirect, operands.length); - const [aOffset, bOffset, condOffset, dstOffset] = addressing.resolve(operands, memory); - - const a = memory.get(aOffset); - const b = memory.get(bOffset); - const cond = memory.get(condOffset); - - // TODO: reconsider toBigInt() here - memory.set(dstOffset, cond.toBigInt() > 0 ? a : b); - - memory.assert({ reads: 3, writes: 1, addressing }); - context.machineState.incrementPc(); - } -} - export class Cast extends Instruction { static readonly type: string = 'CAST'; static readonly opcode = Opcode.CAST_8; diff --git a/yarn-project/simulator/src/avm/serialization/bytecode_serialization.ts b/yarn-project/simulator/src/avm/serialization/bytecode_serialization.ts index 75f656fa1811..879a25279cb2 100644 --- a/yarn-project/simulator/src/avm/serialization/bytecode_serialization.ts +++ b/yarn-project/simulator/src/avm/serialization/bytecode_serialization.ts @@ -1,7 +1,6 @@ import { Add, And, - CMov, Call, CalldataCopy, Cast, @@ -114,7 +113,6 @@ const INSTRUCTION_SET = () => [Opcode.SET_FF, Set.as(Set.wireFormatFF).deserialize], [Opcode.MOV_8, Mov.as(Mov.wireFormat8).deserialize], [Opcode.MOV_16, Mov.as(Mov.wireFormat16).deserialize], - [CMov.opcode, Instruction.deserialize.bind(CMov)], // World State [SLoad.opcode, Instruction.deserialize.bind(SLoad)], // Public Storage diff --git a/yarn-project/simulator/src/avm/serialization/instruction_serialization.ts b/yarn-project/simulator/src/avm/serialization/instruction_serialization.ts index 10c087f313da..949dc4b28190 100644 --- a/yarn-project/simulator/src/avm/serialization/instruction_serialization.ts +++ b/yarn-project/simulator/src/avm/serialization/instruction_serialization.ts @@ -55,7 +55,6 @@ export enum Opcode { SET_FF, MOV_8, MOV_16, - CMOV, // World state SLOAD, SSTORE,