diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp index 9387efd4525..fc2faf2d31c 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp @@ -708,80 +708,80 @@ AvmFlavor::AllConstRefValues::AllConstRefValues( , lookup_div_u16_5_inv(il[700]) , lookup_div_u16_6_inv(il[701]) , lookup_div_u16_7_inv(il[702]) - , alu_op_div_shift(il[703]) - , alu_cmp_rng_ctr_shift(il[704]) - , mem_val_shift(il[705]) - , binary_acc_ia_shift(il[706]) - , alu_op_shr_shift(il[707]) - , alu_u16_r2_shift(il[708]) - , alu_sel_rng_chk_shift(il[709]) - , kernel_l1_to_l2_msg_exists_write_offset_shift(il[710]) - , slice_addr_shift(il[711]) - , alu_div_u16_r7_shift(il[712]) - , mem_glob_addr_shift(il[713]) - , slice_space_id_shift(il[714]) - , alu_div_u16_r1_shift(il[715]) - , kernel_note_hash_exist_write_offset_shift(il[716]) - , alu_u16_r4_shift(il[717]) - , mem_sel_mem_shift(il[718]) - , alu_p_sub_a_hi_shift(il[719]) - , kernel_nullifier_exists_write_offset_shift(il[720]) - , alu_div_u16_r3_shift(il[721]) - , alu_op_add_shift(il[722]) - , alu_p_sub_a_lo_shift(il[723]) - , slice_col_offset_shift(il[724]) - , alu_sel_rng_chk_lookup_shift(il[725]) - , binary_op_id_shift(il[726]) - , kernel_sload_write_offset_shift(il[727]) - , alu_div_u16_r2_shift(il[728]) - , kernel_emit_unencrypted_log_write_offset_shift(il[729]) - , alu_b_lo_shift(il[730]) - , mem_tsp_shift(il[731]) - , main_da_gas_remaining_shift(il[732]) - , alu_op_sub_shift(il[733]) - , slice_sel_start_shift(il[734]) - , alu_sel_alu_shift(il[735]) - , kernel_nullifier_non_exists_write_offset_shift(il[736]) - , alu_b_hi_shift(il[737]) - , slice_cnt_shift(il[738]) + , alu_a_hi_shift(il[703]) + , alu_a_lo_shift(il[704]) + , alu_b_hi_shift(il[705]) + , alu_b_lo_shift(il[706]) + , alu_cmp_rng_ctr_shift(il[707]) + , alu_div_u16_r0_shift(il[708]) + , alu_div_u16_r1_shift(il[709]) + , alu_div_u16_r2_shift(il[710]) + , alu_div_u16_r3_shift(il[711]) + , alu_div_u16_r4_shift(il[712]) + , alu_div_u16_r5_shift(il[713]) + , alu_div_u16_r6_shift(il[714]) + , alu_div_u16_r7_shift(il[715]) + , alu_op_add_shift(il[716]) + , alu_op_cast_shift(il[717]) + , alu_op_cast_prev_shift(il[718]) + , alu_op_div_shift(il[719]) + , alu_op_mul_shift(il[720]) + , alu_op_shl_shift(il[721]) + , alu_op_shr_shift(il[722]) + , alu_op_sub_shift(il[723]) + , alu_p_sub_a_hi_shift(il[724]) + , alu_p_sub_a_lo_shift(il[725]) + , alu_p_sub_b_hi_shift(il[726]) + , alu_p_sub_b_lo_shift(il[727]) + , alu_sel_alu_shift(il[728]) + , alu_sel_cmp_shift(il[729]) + , alu_sel_div_rng_chk_shift(il[730]) + , alu_sel_rng_chk_shift(il[731]) + , alu_sel_rng_chk_lookup_shift(il[732]) + , alu_u16_r0_shift(il[733]) + , alu_u16_r1_shift(il[734]) + , alu_u16_r2_shift(il[735]) + , alu_u16_r3_shift(il[736]) + , alu_u16_r4_shift(il[737]) + , alu_u16_r5_shift(il[738]) , alu_u16_r6_shift(il[739]) - , slice_sel_cd_cpy_shift(il[740]) + , alu_u8_r0_shift(il[740]) , alu_u8_r1_shift(il[741]) - , alu_div_u16_r0_shift(il[742]) - , alu_u8_r0_shift(il[743]) - , alu_op_cast_shift(il[744]) - , kernel_emit_l2_to_l1_msg_write_offset_shift(il[745]) - , alu_div_u16_r6_shift(il[746]) - , alu_div_u16_r4_shift(il[747]) - , slice_sel_mem_active_shift(il[748]) - , main_l2_gas_remaining_shift(il[749]) - , alu_op_mul_shift(il[750]) - , alu_u16_r5_shift(il[751]) - , binary_acc_ib_shift(il[752]) - , alu_p_sub_b_hi_shift(il[753]) - , alu_sel_div_rng_chk_shift(il[754]) - , alu_a_lo_shift(il[755]) - , alu_u16_r1_shift(il[756]) - , slice_clk_shift(il[757]) - , mem_tag_shift(il[758]) - , alu_op_cast_prev_shift(il[759]) - , alu_div_u16_r5_shift(il[760]) - , slice_sel_return_shift(il[761]) - , alu_u16_r3_shift(il[762]) - , alu_u16_r0_shift(il[763]) - , binary_mem_tag_ctr_shift(il[764]) - , alu_sel_cmp_shift(il[765]) - , kernel_emit_note_hash_write_offset_shift(il[766]) - , kernel_emit_nullifier_write_offset_shift(il[767]) - , alu_a_hi_shift(il[768]) - , kernel_sstore_write_offset_shift(il[769]) - , alu_op_shl_shift(il[770]) - , mem_rw_shift(il[771]) - , main_pc_shift(il[772]) - , main_internal_return_ptr_shift(il[773]) - , binary_acc_ic_shift(il[774]) - , kernel_side_effect_counter_shift(il[775]) - , alu_p_sub_b_lo_shift(il[776]) + , binary_acc_ia_shift(il[742]) + , binary_acc_ib_shift(il[743]) + , binary_acc_ic_shift(il[744]) + , binary_mem_tag_ctr_shift(il[745]) + , binary_op_id_shift(il[746]) + , kernel_emit_l2_to_l1_msg_write_offset_shift(il[747]) + , kernel_emit_note_hash_write_offset_shift(il[748]) + , kernel_emit_nullifier_write_offset_shift(il[749]) + , kernel_emit_unencrypted_log_write_offset_shift(il[750]) + , kernel_l1_to_l2_msg_exists_write_offset_shift(il[751]) + , kernel_note_hash_exist_write_offset_shift(il[752]) + , kernel_nullifier_exists_write_offset_shift(il[753]) + , kernel_nullifier_non_exists_write_offset_shift(il[754]) + , kernel_side_effect_counter_shift(il[755]) + , kernel_sload_write_offset_shift(il[756]) + , kernel_sstore_write_offset_shift(il[757]) + , main_da_gas_remaining_shift(il[758]) + , main_internal_return_ptr_shift(il[759]) + , main_l2_gas_remaining_shift(il[760]) + , main_pc_shift(il[761]) + , mem_glob_addr_shift(il[762]) + , mem_rw_shift(il[763]) + , mem_sel_mem_shift(il[764]) + , mem_tag_shift(il[765]) + , mem_tsp_shift(il[766]) + , mem_val_shift(il[767]) + , slice_addr_shift(il[768]) + , slice_clk_shift(il[769]) + , slice_cnt_shift(il[770]) + , slice_col_offset_shift(il[771]) + , slice_sel_cd_cpy_shift(il[772]) + , slice_sel_mem_active_shift(il[773]) + , slice_sel_return_shift(il[774]) + , slice_sel_start_shift(il[775]) + , slice_space_id_shift(il[776]) {} AvmFlavor::ProverPolynomials::ProverPolynomials(ProvingKey& proving_key) @@ -1501,80 +1501,80 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id lookup_div_u16_5_inv[row_idx], lookup_div_u16_6_inv[row_idx], lookup_div_u16_7_inv[row_idx], - alu_op_div_shift[row_idx], + alu_a_hi_shift[row_idx], + alu_a_lo_shift[row_idx], + alu_b_hi_shift[row_idx], + alu_b_lo_shift[row_idx], alu_cmp_rng_ctr_shift[row_idx], - mem_val_shift[row_idx], - binary_acc_ia_shift[row_idx], - alu_op_shr_shift[row_idx], - alu_u16_r2_shift[row_idx], - alu_sel_rng_chk_shift[row_idx], - kernel_l1_to_l2_msg_exists_write_offset_shift[row_idx], - slice_addr_shift[row_idx], - alu_div_u16_r7_shift[row_idx], - mem_glob_addr_shift[row_idx], - slice_space_id_shift[row_idx], + alu_div_u16_r0_shift[row_idx], alu_div_u16_r1_shift[row_idx], - kernel_note_hash_exist_write_offset_shift[row_idx], - alu_u16_r4_shift[row_idx], - mem_sel_mem_shift[row_idx], - alu_p_sub_a_hi_shift[row_idx], - kernel_nullifier_exists_write_offset_shift[row_idx], + alu_div_u16_r2_shift[row_idx], alu_div_u16_r3_shift[row_idx], + alu_div_u16_r4_shift[row_idx], + alu_div_u16_r5_shift[row_idx], + alu_div_u16_r6_shift[row_idx], + alu_div_u16_r7_shift[row_idx], alu_op_add_shift[row_idx], - alu_p_sub_a_lo_shift[row_idx], - slice_col_offset_shift[row_idx], - alu_sel_rng_chk_lookup_shift[row_idx], - binary_op_id_shift[row_idx], - kernel_sload_write_offset_shift[row_idx], - alu_div_u16_r2_shift[row_idx], - kernel_emit_unencrypted_log_write_offset_shift[row_idx], - alu_b_lo_shift[row_idx], - mem_tsp_shift[row_idx], - main_da_gas_remaining_shift[row_idx], - alu_op_sub_shift[row_idx], - slice_sel_start_shift[row_idx], - alu_sel_alu_shift[row_idx], - kernel_nullifier_non_exists_write_offset_shift[row_idx], - alu_b_hi_shift[row_idx], - slice_cnt_shift[row_idx], - alu_u16_r6_shift[row_idx], - slice_sel_cd_cpy_shift[row_idx], - alu_u8_r1_shift[row_idx], - alu_div_u16_r0_shift[row_idx], - alu_u8_r0_shift[row_idx], alu_op_cast_shift[row_idx], - kernel_emit_l2_to_l1_msg_write_offset_shift[row_idx], - alu_div_u16_r6_shift[row_idx], - alu_div_u16_r4_shift[row_idx], - slice_sel_mem_active_shift[row_idx], - main_l2_gas_remaining_shift[row_idx], + alu_op_cast_prev_shift[row_idx], + alu_op_div_shift[row_idx], alu_op_mul_shift[row_idx], - alu_u16_r5_shift[row_idx], - binary_acc_ib_shift[row_idx], + alu_op_shl_shift[row_idx], + alu_op_shr_shift[row_idx], + alu_op_sub_shift[row_idx], + alu_p_sub_a_hi_shift[row_idx], + alu_p_sub_a_lo_shift[row_idx], alu_p_sub_b_hi_shift[row_idx], + alu_p_sub_b_lo_shift[row_idx], + alu_sel_alu_shift[row_idx], + alu_sel_cmp_shift[row_idx], alu_sel_div_rng_chk_shift[row_idx], - alu_a_lo_shift[row_idx], + alu_sel_rng_chk_shift[row_idx], + alu_sel_rng_chk_lookup_shift[row_idx], + alu_u16_r0_shift[row_idx], alu_u16_r1_shift[row_idx], - slice_clk_shift[row_idx], - mem_tag_shift[row_idx], - alu_op_cast_prev_shift[row_idx], - alu_div_u16_r5_shift[row_idx], - slice_sel_return_shift[row_idx], + alu_u16_r2_shift[row_idx], alu_u16_r3_shift[row_idx], - alu_u16_r0_shift[row_idx], + alu_u16_r4_shift[row_idx], + alu_u16_r5_shift[row_idx], + alu_u16_r6_shift[row_idx], + alu_u8_r0_shift[row_idx], + alu_u8_r1_shift[row_idx], + binary_acc_ia_shift[row_idx], + binary_acc_ib_shift[row_idx], + binary_acc_ic_shift[row_idx], binary_mem_tag_ctr_shift[row_idx], - alu_sel_cmp_shift[row_idx], + binary_op_id_shift[row_idx], + kernel_emit_l2_to_l1_msg_write_offset_shift[row_idx], kernel_emit_note_hash_write_offset_shift[row_idx], kernel_emit_nullifier_write_offset_shift[row_idx], - alu_a_hi_shift[row_idx], + kernel_emit_unencrypted_log_write_offset_shift[row_idx], + kernel_l1_to_l2_msg_exists_write_offset_shift[row_idx], + kernel_note_hash_exist_write_offset_shift[row_idx], + kernel_nullifier_exists_write_offset_shift[row_idx], + kernel_nullifier_non_exists_write_offset_shift[row_idx], + kernel_side_effect_counter_shift[row_idx], + kernel_sload_write_offset_shift[row_idx], kernel_sstore_write_offset_shift[row_idx], - alu_op_shl_shift[row_idx], - mem_rw_shift[row_idx], - main_pc_shift[row_idx], + main_da_gas_remaining_shift[row_idx], main_internal_return_ptr_shift[row_idx], - binary_acc_ic_shift[row_idx], - kernel_side_effect_counter_shift[row_idx], - alu_p_sub_b_lo_shift[row_idx] }; + main_l2_gas_remaining_shift[row_idx], + main_pc_shift[row_idx], + mem_glob_addr_shift[row_idx], + mem_rw_shift[row_idx], + mem_sel_mem_shift[row_idx], + mem_tag_shift[row_idx], + mem_tsp_shift[row_idx], + mem_val_shift[row_idx], + slice_addr_shift[row_idx], + slice_clk_shift[row_idx], + slice_cnt_shift[row_idx], + slice_col_offset_shift[row_idx], + slice_sel_cd_cpy_shift[row_idx], + slice_sel_mem_active_shift[row_idx], + slice_sel_return_shift[row_idx], + slice_sel_start_shift[row_idx], + slice_space_id_shift[row_idx] }; } AvmFlavor::CommitmentLabels::CommitmentLabels() diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp index 713260306d2..5aa967235c2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp @@ -104,8 +104,8 @@ template using tuple_cat_t = decltype(std::tuple_cat(std:: #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_da_gas_fixed_table, gas_l2_gas_fixed_table, gas_sel_gas_cost, main_clk, main_sel_first, main_zeroes, powers_power_of_2 #define WIRE_ENTITIES kernel_kernel_inputs, kernel_kernel_value_out, kernel_kernel_side_effect_out, kernel_kernel_metadata_out, main_calldata, main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, alu_b_lo, alu_borrow, alu_cf, alu_clk, alu_cmp_rng_ctr, alu_div_u16_r0, alu_div_u16_r1, alu_div_u16_r2, alu_div_u16_r3, alu_div_u16_r4, alu_div_u16_r5, alu_div_u16_r6, alu_div_u16_r7, alu_divisor_hi, alu_divisor_lo, alu_ff_tag, alu_ia, alu_ib, alu_ic, alu_in_tag, alu_op_add, alu_op_cast, alu_op_cast_prev, alu_op_div, alu_op_div_a_lt_b, alu_op_div_std, alu_op_eq, alu_op_eq_diff_inv, alu_op_lt, alu_op_lte, alu_op_mul, alu_op_not, alu_op_shl, alu_op_shr, alu_op_sub, alu_p_a_borrow, alu_p_b_borrow, alu_p_sub_a_hi, alu_p_sub_a_lo, alu_p_sub_b_hi, alu_p_sub_b_lo, alu_partial_prod_hi, alu_partial_prod_lo, alu_quotient_hi, alu_quotient_lo, alu_remainder, alu_res_hi, alu_res_lo, alu_sel_alu, alu_sel_cmp, alu_sel_div_rng_chk, alu_sel_rng_chk, alu_sel_rng_chk_lookup, alu_sel_shift_which, alu_shift_lt_bit_len, alu_t_sub_s_bits, alu_two_pow_s, alu_two_pow_t_sub_s, alu_u128_tag, alu_u16_r0, alu_u16_r1, alu_u16_r10, alu_u16_r11, alu_u16_r12, alu_u16_r13, alu_u16_r14, alu_u16_r2, alu_u16_r3, alu_u16_r4, alu_u16_r5, alu_u16_r6, alu_u16_r7, alu_u16_r8, alu_u16_r9, alu_u16_tag, alu_u32_tag, alu_u64_tag, alu_u8_r0, alu_u8_r1, alu_u8_tag, 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, conversion_clk, conversion_input, conversion_num_limbs, conversion_radix, conversion_sel_to_radix_le, keccakf1600_clk, keccakf1600_input, keccakf1600_output, keccakf1600_sel_keccakf1600, kernel_emit_l2_to_l1_msg_write_offset, kernel_emit_note_hash_write_offset, kernel_emit_nullifier_write_offset, kernel_emit_unencrypted_log_write_offset, kernel_kernel_in_offset, kernel_kernel_out_offset, kernel_l1_to_l2_msg_exists_write_offset, kernel_note_hash_exist_write_offset, kernel_nullifier_exists_write_offset, kernel_nullifier_non_exists_write_offset, kernel_q_public_input_kernel_add_to_table, kernel_q_public_input_kernel_out_add_to_table, kernel_side_effect_counter, kernel_sload_write_offset, kernel_sstore_write_offset, main_abs_da_rem_gas_hi, main_abs_da_rem_gas_lo, main_abs_l2_rem_gas_hi, main_abs_l2_rem_gas_lo, main_alu_in_tag, main_bin_op_id, main_call_ptr, main_da_gas_op_cost, main_da_gas_remaining, main_da_out_of_gas, 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_l2_gas_op_cost, 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_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_gas_accounting_active, 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_coinbase, main_sel_op_dagasleft, main_sel_op_div, 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_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_halt, main_sel_op_internal_call, main_sel_op_internal_return, 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_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_poseidon2, main_sel_op_radix_le, main_sel_op_sender, main_sel_op_sha256, main_sel_op_shl, main_sel_op_shr, main_sel_op_sload, main_sel_op_sstore, 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_space_id, main_tag_err, main_w_in_tag, mem_addr, mem_clk, mem_diff_hi, mem_diff_lo, mem_diff_mid, 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, 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_byte_lengths_counts, lookup_byte_operations_counts, lookup_cd_value_counts, lookup_ret_value_counts, lookup_opcode_gas_counts, range_check_l2_gas_hi_counts, range_check_l2_gas_lo_counts, range_check_da_gas_hi_counts, range_check_da_gas_lo_counts, kernel_output_lookup_counts, lookup_into_kernel_counts, incl_main_tag_err_counts, incl_mem_tag_err_counts, lookup_mem_rng_chk_lo_counts, lookup_mem_rng_chk_mid_counts, lookup_mem_rng_chk_hi_counts, lookup_pow_2_0_counts, lookup_pow_2_1_counts, lookup_u8_0_counts, lookup_u8_1_counts, lookup_u16_0_counts, lookup_u16_1_counts, lookup_u16_2_counts, lookup_u16_3_counts, lookup_u16_4_counts, lookup_u16_5_counts, lookup_u16_6_counts, lookup_u16_7_counts, lookup_u16_8_counts, lookup_u16_9_counts, lookup_u16_10_counts, lookup_u16_11_counts, lookup_u16_12_counts, lookup_u16_13_counts, lookup_u16_14_counts, lookup_div_u16_0_counts, lookup_div_u16_1_counts, lookup_div_u16_2_counts, lookup_div_u16_3_counts, lookup_div_u16_4_counts, lookup_div_u16_5_counts, lookup_div_u16_6_counts, lookup_div_u16_7_counts #define DERIVED_WITNESS_ENTITIES 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_byte_lengths_inv, lookup_byte_operations_inv, lookup_cd_value_inv, lookup_ret_value_inv, lookup_opcode_gas_inv, range_check_l2_gas_hi_inv, range_check_l2_gas_lo_inv, range_check_da_gas_hi_inv, range_check_da_gas_lo_inv, kernel_output_lookup_inv, lookup_into_kernel_inv, incl_main_tag_err_inv, incl_mem_tag_err_inv, lookup_mem_rng_chk_lo_inv, lookup_mem_rng_chk_mid_inv, lookup_mem_rng_chk_hi_inv, lookup_pow_2_0_inv, lookup_pow_2_1_inv, lookup_u8_0_inv, lookup_u8_1_inv, lookup_u16_0_inv, lookup_u16_1_inv, lookup_u16_2_inv, lookup_u16_3_inv, lookup_u16_4_inv, lookup_u16_5_inv, lookup_u16_6_inv, lookup_u16_7_inv, lookup_u16_8_inv, lookup_u16_9_inv, lookup_u16_10_inv, lookup_u16_11_inv, lookup_u16_12_inv, lookup_u16_13_inv, lookup_u16_14_inv, lookup_div_u16_0_inv, lookup_div_u16_1_inv, lookup_div_u16_2_inv, lookup_div_u16_3_inv, lookup_div_u16_4_inv, lookup_div_u16_5_inv, lookup_div_u16_6_inv, lookup_div_u16_7_inv -#define SHIFTED_ENTITIES alu_op_div_shift, alu_cmp_rng_ctr_shift, mem_val_shift, binary_acc_ia_shift, alu_op_shr_shift, alu_u16_r2_shift, alu_sel_rng_chk_shift, kernel_l1_to_l2_msg_exists_write_offset_shift, slice_addr_shift, alu_div_u16_r7_shift, mem_glob_addr_shift, slice_space_id_shift, alu_div_u16_r1_shift, kernel_note_hash_exist_write_offset_shift, alu_u16_r4_shift, mem_sel_mem_shift, alu_p_sub_a_hi_shift, kernel_nullifier_exists_write_offset_shift, alu_div_u16_r3_shift, alu_op_add_shift, alu_p_sub_a_lo_shift, slice_col_offset_shift, alu_sel_rng_chk_lookup_shift, binary_op_id_shift, kernel_sload_write_offset_shift, alu_div_u16_r2_shift, kernel_emit_unencrypted_log_write_offset_shift, alu_b_lo_shift, mem_tsp_shift, main_da_gas_remaining_shift, alu_op_sub_shift, slice_sel_start_shift, alu_sel_alu_shift, kernel_nullifier_non_exists_write_offset_shift, alu_b_hi_shift, slice_cnt_shift, alu_u16_r6_shift, slice_sel_cd_cpy_shift, alu_u8_r1_shift, alu_div_u16_r0_shift, alu_u8_r0_shift, alu_op_cast_shift, kernel_emit_l2_to_l1_msg_write_offset_shift, alu_div_u16_r6_shift, alu_div_u16_r4_shift, slice_sel_mem_active_shift, main_l2_gas_remaining_shift, alu_op_mul_shift, alu_u16_r5_shift, binary_acc_ib_shift, alu_p_sub_b_hi_shift, alu_sel_div_rng_chk_shift, alu_a_lo_shift, alu_u16_r1_shift, slice_clk_shift, mem_tag_shift, alu_op_cast_prev_shift, alu_div_u16_r5_shift, slice_sel_return_shift, alu_u16_r3_shift, alu_u16_r0_shift, binary_mem_tag_ctr_shift, alu_sel_cmp_shift, kernel_emit_note_hash_write_offset_shift, kernel_emit_nullifier_write_offset_shift, alu_a_hi_shift, kernel_sstore_write_offset_shift, alu_op_shl_shift, mem_rw_shift, main_pc_shift, main_internal_return_ptr_shift, binary_acc_ic_shift, kernel_side_effect_counter_shift, alu_p_sub_b_lo_shift -#define TO_BE_SHIFTED(e) e.alu_op_div, e.alu_cmp_rng_ctr, e.mem_val, e.binary_acc_ia, e.alu_op_shr, e.alu_u16_r2, e.alu_sel_rng_chk, e.kernel_l1_to_l2_msg_exists_write_offset, e.slice_addr, e.alu_div_u16_r7, e.mem_glob_addr, e.slice_space_id, e.alu_div_u16_r1, e.kernel_note_hash_exist_write_offset, e.alu_u16_r4, e.mem_sel_mem, e.alu_p_sub_a_hi, e.kernel_nullifier_exists_write_offset, e.alu_div_u16_r3, e.alu_op_add, e.alu_p_sub_a_lo, e.slice_col_offset, e.alu_sel_rng_chk_lookup, e.binary_op_id, e.kernel_sload_write_offset, e.alu_div_u16_r2, e.kernel_emit_unencrypted_log_write_offset, e.alu_b_lo, e.mem_tsp, e.main_da_gas_remaining, e.alu_op_sub, e.slice_sel_start, e.alu_sel_alu, e.kernel_nullifier_non_exists_write_offset, e.alu_b_hi, e.slice_cnt, e.alu_u16_r6, e.slice_sel_cd_cpy, e.alu_u8_r1, e.alu_div_u16_r0, e.alu_u8_r0, e.alu_op_cast, e.kernel_emit_l2_to_l1_msg_write_offset, e.alu_div_u16_r6, e.alu_div_u16_r4, e.slice_sel_mem_active, e.main_l2_gas_remaining, e.alu_op_mul, e.alu_u16_r5, e.binary_acc_ib, e.alu_p_sub_b_hi, e.alu_sel_div_rng_chk, e.alu_a_lo, e.alu_u16_r1, e.slice_clk, e.mem_tag, e.alu_op_cast_prev, e.alu_div_u16_r5, e.slice_sel_return, e.alu_u16_r3, e.alu_u16_r0, e.binary_mem_tag_ctr, e.alu_sel_cmp, e.kernel_emit_note_hash_write_offset, e.kernel_emit_nullifier_write_offset, e.alu_a_hi, e.kernel_sstore_write_offset, e.alu_op_shl, e.mem_rw, e.main_pc, e.main_internal_return_ptr, e.binary_acc_ic, e.kernel_side_effect_counter, e.alu_p_sub_b_lo +#define SHIFTED_ENTITIES alu_a_hi_shift, alu_a_lo_shift, alu_b_hi_shift, alu_b_lo_shift, alu_cmp_rng_ctr_shift, alu_div_u16_r0_shift, alu_div_u16_r1_shift, alu_div_u16_r2_shift, alu_div_u16_r3_shift, alu_div_u16_r4_shift, alu_div_u16_r5_shift, alu_div_u16_r6_shift, alu_div_u16_r7_shift, alu_op_add_shift, alu_op_cast_shift, alu_op_cast_prev_shift, alu_op_div_shift, alu_op_mul_shift, alu_op_shl_shift, alu_op_shr_shift, alu_op_sub_shift, alu_p_sub_a_hi_shift, alu_p_sub_a_lo_shift, alu_p_sub_b_hi_shift, alu_p_sub_b_lo_shift, alu_sel_alu_shift, alu_sel_cmp_shift, alu_sel_div_rng_chk_shift, alu_sel_rng_chk_shift, alu_sel_rng_chk_lookup_shift, alu_u16_r0_shift, alu_u16_r1_shift, alu_u16_r2_shift, alu_u16_r3_shift, alu_u16_r4_shift, alu_u16_r5_shift, alu_u16_r6_shift, alu_u8_r0_shift, alu_u8_r1_shift, binary_acc_ia_shift, binary_acc_ib_shift, binary_acc_ic_shift, binary_mem_tag_ctr_shift, binary_op_id_shift, kernel_emit_l2_to_l1_msg_write_offset_shift, kernel_emit_note_hash_write_offset_shift, kernel_emit_nullifier_write_offset_shift, kernel_emit_unencrypted_log_write_offset_shift, kernel_l1_to_l2_msg_exists_write_offset_shift, kernel_note_hash_exist_write_offset_shift, kernel_nullifier_exists_write_offset_shift, kernel_nullifier_non_exists_write_offset_shift, kernel_side_effect_counter_shift, kernel_sload_write_offset_shift, kernel_sstore_write_offset_shift, main_da_gas_remaining_shift, main_internal_return_ptr_shift, main_l2_gas_remaining_shift, main_pc_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.alu_a_hi, e.alu_a_lo, e.alu_b_hi, e.alu_b_lo, e.alu_cmp_rng_ctr, e.alu_div_u16_r0, e.alu_div_u16_r1, e.alu_div_u16_r2, e.alu_div_u16_r3, e.alu_div_u16_r4, e.alu_div_u16_r5, e.alu_div_u16_r6, e.alu_div_u16_r7, e.alu_op_add, e.alu_op_cast, e.alu_op_cast_prev, e.alu_op_div, e.alu_op_mul, e.alu_op_shl, e.alu_op_shr, e.alu_op_sub, e.alu_p_sub_a_hi, e.alu_p_sub_a_lo, e.alu_p_sub_b_hi, e.alu_p_sub_b_lo, e.alu_sel_alu, e.alu_sel_cmp, e.alu_sel_div_rng_chk, e.alu_sel_rng_chk, e.alu_sel_rng_chk_lookup, e.alu_u16_r0, e.alu_u16_r1, e.alu_u16_r2, e.alu_u16_r3, e.alu_u16_r4, e.alu_u16_r5, e.alu_u16_r6, e.alu_u8_r0, e.alu_u8_r1, e.binary_acc_ia, e.binary_acc_ib, e.binary_acc_ic, e.binary_mem_tag_ctr, e.binary_op_id, e.kernel_emit_l2_to_l1_msg_write_offset, e.kernel_emit_note_hash_write_offset, e.kernel_emit_nullifier_write_offset, e.kernel_emit_unencrypted_log_write_offset, e.kernel_l1_to_l2_msg_exists_write_offset, e.kernel_note_hash_exist_write_offset, e.kernel_nullifier_exists_write_offset, e.kernel_nullifier_non_exists_write_offset, e.kernel_side_effect_counter, e.kernel_sload_write_offset, e.kernel_sstore_write_offset, e.main_da_gas_remaining, e.main_internal_return_ptr, e.main_l2_gas_remaining, e.main_pc, 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 #define ALL_ENTITIES PRECOMPUTED_ENTITIES, WIRE_ENTITIES, DERIVED_WITNESS_ENTITIES, SHIFTED_ENTITIES // clang-format on @@ -138,7 +138,7 @@ class AvmFlavor { // the unshifted and one for the shifted static constexpr size_t NUM_ALL_ENTITIES = 777; // The total number of witnesses including shifts and derived entities. - static constexpr size_t NUM_ALL_WITNESS_ENTITIES = 763; + static constexpr size_t NUM_ALL_WITNESS_ENTITIES = NUM_WITNESS_ENTITIES + NUM_SHIFTED_ENTITIES; using MainRelations = std::tuple< // Relations @@ -418,4 +418,4 @@ class AvmFlavor { }; }; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/bb-pilcom/bb-pil-backend/src/vm_builder.rs b/bb-pilcom/bb-pil-backend/src/vm_builder.rs index 360f28867c7..7cc4fd67c78 100644 --- a/bb-pilcom/bb-pil-backend/src/vm_builder.rs +++ b/bb-pilcom/bb-pil-backend/src/vm_builder.rs @@ -167,16 +167,18 @@ fn get_all_col_names( .map(|(sym, _)| sym.absolute_name.clone()) .map(|n| sanitize_name(&n)) .collect_vec(); - let to_be_shifted = get_shifted_polys( - analyzed - .identities_with_inlined_intermediate_polynomials() - .iter() - .map(|i| i.left.selector.clone().unwrap()) - .collect_vec(), - ) - .iter() - .map(|n| sanitize_name(&n)) - .collect_vec(); + let to_be_shifted = sort_cols( + &get_shifted_polys( + analyzed + .identities_with_inlined_intermediate_polynomials() + .iter() + .map(|i| i.left.selector.clone().unwrap()) + .collect_vec(), + ) + .iter() + .map(|n| sanitize_name(&n)) + .collect_vec(), + ); let shifted = to_be_shifted .iter() .map(|n| format!("{}_shift", n)) diff --git a/bb-pilcom/bb-pil-backend/templates/flavor.hpp.hbs b/bb-pilcom/bb-pil-backend/templates/flavor.hpp.hbs index 02d7f75d2e2..416d7de916f 100644 --- a/bb-pilcom/bb-pil-backend/templates/flavor.hpp.hbs +++ b/bb-pilcom/bb-pil-backend/templates/flavor.hpp.hbs @@ -56,12 +56,17 @@ class {{name}}Flavor { using VerifierCommitmentKey = {{name}}FlavorSettings::VerifierCommitmentKey; using RelationSeparator = {{name}}FlavorSettings::RelationSeparator; + // This flavor would not be used with ZK Sumcheck + static constexpr bool HasZK = false; + static constexpr size_t NUM_PRECOMPUTED_ENTITIES = {{len fixed}}; static constexpr size_t NUM_WITNESS_ENTITIES = {{len witness}}; static constexpr size_t NUM_SHIFTED_ENTITIES = {{len shifted}}; 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 = {{len all_cols_and_shifts}}; + // The total number of witnesses including shifts and derived entities. + static constexpr size_t NUM_ALL_WITNESS_ENTITIES = NUM_WITNESS_ENTITIES + NUM_SHIFTED_ENTITIES; using MainRelations = std::tuple< // Relations @@ -279,4 +284,4 @@ class {{name}}Flavor { }; }; -} // namespace bb \ No newline at end of file +} // namespace bb