From de46916a9750b7e54e48bd2116eb408832a74bcd Mon Sep 17 00:00:00 2001 From: jeanmon Date: Thu, 4 Jul 2024 09:22:15 +0000 Subject: [PATCH 01/12] 7211: PIL relations for calldatacopy slice memory gadget --- .../cpp/pil/avm/gadgets/mem_slice.pil | 38 + barretenberg/cpp/pil/avm/main.pil | 15 +- barretenberg/cpp/pil/avm/mem.pil | 19 +- .../relations/generated/avm/declare_views.hpp | 21 +- .../generated/avm/lookup_cd_value.hpp | 170 ++ .../relations/generated/avm/main.hpp | 544 +++--- .../relations/generated/avm/mem.hpp | 163 +- .../relations/generated/avm/mem_slice.hpp | 104 ++ .../relations/generated/avm/perm_cd_mem.hpp | 101 ++ .../generated/avm/perm_main_cd_copy.hpp | 98 ++ .../vm/generated/avm_circuit_builder.hpp | 450 ++++- .../barretenberg/vm/generated/avm_flavor.hpp | 1465 ++++++++++++++++- .../vm/generated/avm_full_row.cpp | 32 + .../barretenberg/vm/generated/avm_prover.cpp | 123 ++ .../vm/generated/avm_verifier.cpp | 5 + 15 files changed, 3001 insertions(+), 347 deletions(-) create mode 100644 barretenberg/cpp/pil/avm/gadgets/mem_slice.pil create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp diff --git a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil new file mode 100644 index 00000000000..c0ed7ad5c8d --- /dev/null +++ b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil @@ -0,0 +1,38 @@ +include "../main.pil"; + +namespace slice(256); + + pol commit clk; + + pol commit sel_start_cd; // Selector to indicate the start of calldatacopy. Used in permutation with the main trace. + pol commit sel_cd; // Selector for any row involved in a callatacopy operation. + pol commit cnt; // Decreasing counter to track the number of memory operations. + pol commit space_id; // Copied from main trace. + pol commit addr; // Address pertaining to the memory operation. + pol commit val; // Value pertaining to the memory operation. + pol commit cd_offset; // Offset of the calldata element. It is used to get the correct value from calldata. + pol commit one_min_inv; // Helper column to assert zero/non-zero equality of cnt; + + sel_cd * (1 - sel_cd) = 0; + // TODO: might not be required + sel_start_cd * (1 - sel_start_cd) = 0; + + // Show that cnt != 0 <==> sel_cd == 1 + // one_min_inv == 1 - cnt^(-1) if cnt != 0 else == 0 + #[SLICE_CNT_ZERO_TEST1] + cnt * (1 - one_min_inv) - sel_cd = 0; + #[SLICE_CNT_ZERO_TEST2] + (1 - sel_cd) * one_min_inv = 0; + + #[SLICE_CNT_DECREMENT] + sel_cd * (cnt - 1 - cnt') = 0; + #[ADDR_CNT_INCREMENT] + sel_cd * (addr + 1 - addr') = 0; + #[CD_OFFSET_INCREMENT] + sel_cd * (cd_offset + 1 - cd_offset') = 0; + + #[LOOKUP_CD_VALUE] + sel_cd {cd_offset, val} in main.sel_cd {main.clk, main.calldata}; + + #[PERM_CD_MEM] + sel_cd {clk, space_id, addr, val} is mem.sel_op_cd {mem.clk, mem.space_id, mem.addr, mem.val}; diff --git a/barretenberg/cpp/pil/avm/main.pil b/barretenberg/cpp/pil/avm/main.pil index 7858269448b..5f46a54471c 100644 --- a/barretenberg/cpp/pil/avm/main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -11,6 +11,7 @@ include "gadgets/sha256.pil"; include "gadgets/poseidon2.pil"; include "gadgets/keccakf1600.pil"; include "gadgets/pedersen.pil"; +include "gadgets/mem_slice.pil"; namespace main(256); //===== CONSTANT POLYNOMIALS ================================================== @@ -20,6 +21,7 @@ namespace main(256); //===== PUBLIC COLUMNS========================================================= pol public calldata; + pol commit sel_cd; // Selector used for lookup in calldata. TODO: Might be removed or made constant. //===== KERNEL INPUTS ========================================================= // Kernel lookup selector opcodes @@ -139,6 +141,9 @@ namespace main(256); pol commit sel_op_keccak; pol commit sel_op_pedersen; + //===== Memory Slice Gadget Selectors ========================================= + pol commit sel_op_calldata_copy; + //===== Fix Range Checks Selectors============================================= // We re-use the clk column for the lookup values of 8-bit resp. 16-bit range check. pol commit sel_rng_8; // Boolean selector for the 8-bit range check lookup @@ -321,6 +326,8 @@ namespace main(256); sel_op_halt * (1 - sel_op_halt) = 0; sel_op_external_call * (1 - sel_op_external_call) = 0; + sel_op_calldata_copy * (1 - sel_op_calldata_copy) = 0; + // Might be removed if derived from opcode based on a lookup of constants sel_op_mov * ( 1 - sel_op_mov) = 0; sel_op_cmov * ( 1 - sel_op_cmov) = 0; @@ -473,8 +480,9 @@ 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; pol SEL_ALL_MEMORY = sel_op_cmov + sel_op_mov; + pol SEL_ALL_MEM_SLICE = sel_op_calldata_copy; pol OPCODE_SELECTORS = sel_op_fdiv + SEL_ALU_ALL + SEL_ALL_BINARY + SEL_ALL_MEMORY + SEL_ALL_GADGET - + KERNEL_INPUT_SELECTORS + KERNEL_OUTPUT_SELECTORS + SEL_ALL_LEFTGAS; + + KERNEL_INPUT_SELECTORS + KERNEL_OUTPUT_SELECTORS + SEL_ALL_LEFTGAS + SEL_ALL_MEM_SLICE; // TODO: sel_gas_accounting_active is activating gas accounting on a given row. All opcode with selectors // are activated through the relation below. The other opcodes which are implemented purely @@ -723,6 +731,11 @@ namespace main(256); is pedersen.sel_pedersen {pedersen.clk, pedersen.input}; + #[PERM_MAIN_CD_COPY] + sel_op_calldata_copy {ia, ib, mem_addr_c} + is + slice.sel_start_cd {slice.cd_offset, slice.cnt, slice.addr}; + #[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} is diff --git a/barretenberg/cpp/pil/avm/mem.pil b/barretenberg/cpp/pil/avm/mem.pil index 0cb9d7c491a..cded6b54361 100644 --- a/barretenberg/cpp/pil/avm/mem.pil +++ b/barretenberg/cpp/pil/avm/mem.pil @@ -32,6 +32,9 @@ namespace mem(256); pol commit sel_resolve_ind_addr_c; pol commit sel_resolve_ind_addr_d; + // Selector for calldata_copy memory operations triggered from memory slice gadget. + pol commit sel_op_cd; + // Selectors related to MOV/CMOV 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; @@ -57,6 +60,7 @@ namespace mem(256); sel_op_b * (1 - sel_op_b) = 0; sel_op_c * (1 - sel_op_c) = 0; sel_op_d * (1 - sel_op_d) = 0; + sel_op_cd * (1 - sel_op_cd) = 0; sel_resolve_ind_addr_a * (1 - sel_resolve_ind_addr_a) = 0; sel_resolve_ind_addr_b * (1 - sel_resolve_ind_addr_b) = 0; sel_resolve_ind_addr_c * (1 - sel_resolve_ind_addr_c) = 0; @@ -66,8 +70,9 @@ namespace mem(256); // 2) Ensure that tag, r_in_tag, w_in_tag are properly constrained by the main trace and/or bytecode decomposition // Definition of sel_mem - sel_mem = sel_op_a + sel_op_b + sel_op_c + sel_op_d + - sel_resolve_ind_addr_a + sel_resolve_ind_addr_b + sel_resolve_ind_addr_c + sel_resolve_ind_addr_d; + sel_mem = sel_op_a + sel_op_b + sel_op_c + sel_op_d + + sel_resolve_ind_addr_a + sel_resolve_ind_addr_b + sel_resolve_ind_addr_c + sel_resolve_ind_addr_d + + sel_op_cd; // Maximum one memory operation enabled per row sel_mem * (sel_mem - 1) = 0; // TODO: might be infered by the main trace @@ -99,6 +104,11 @@ namespace mem(256); pol SUB_CLK = sel_mem * (sel_resolve_ind_addr_b + sel_op_b + 2 * (sel_resolve_ind_addr_c + sel_op_c) + 3 * (sel_resolve_ind_addr_d + sel_op_d) + 4 * (1 - IND_OP + rw)); // We need the sel_mem factor as the right factor is not zero when all columns are zero. + // Calldata_copy memory slice operations will have a sub_clk value of 8 as rw == 1 which is outside of the range of + // indirect memory operations. This is crucial as a main trace entry for calldata_copy triggers an indirect memory + // load operation for intermediate register c. The write slice memory operations will have the same sub_clk which in + // this particular case is not a problem as all addresses are different. + #[TIMESTAMP] tsp = NUM_SUB_CLK * clk + SUB_CLK; @@ -154,6 +164,7 @@ namespace mem(256); #[MEM_ZERO_INIT] lastAccess * (1 - rw') * val' = 0; + // TODO: Verfiy that skip_check_tag cannot be enabled maliciously by the prover. // Skip check tag #[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)); @@ -207,6 +218,10 @@ namespace mem(256); sel_resolve_ind_addr_c * rw = 0; sel_resolve_ind_addr_d * rw = 0; + //====== CALLDATACOPY specific constraints ================================== + sel_op_cd * (rw - 1) = 0; + sel_op_cd * (w_in_tag - 6) = 0; + //====== MOV/CMOV 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. diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp index f0c272ca4f7..a1fe196f78e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -184,6 +184,7 @@ [[maybe_unused]] auto main_rwd = View(new_term.main_rwd); \ [[maybe_unused]] auto main_sel_alu = View(new_term.main_sel_alu); \ [[maybe_unused]] auto main_sel_bin = View(new_term.main_sel_bin); \ + [[maybe_unused]] auto main_sel_cd = View(new_term.main_sel_cd); \ [[maybe_unused]] auto main_sel_gas_accounting_active = View(new_term.main_sel_gas_accounting_active); \ [[maybe_unused]] auto main_sel_last = View(new_term.main_sel_last); \ [[maybe_unused]] auto main_sel_mem_op_a = View(new_term.main_sel_mem_op_a); \ @@ -197,6 +198,7 @@ [[maybe_unused]] auto main_sel_op_address = View(new_term.main_sel_op_address); \ [[maybe_unused]] auto main_sel_op_and = View(new_term.main_sel_op_and); \ [[maybe_unused]] auto main_sel_op_block_number = View(new_term.main_sel_op_block_number); \ + [[maybe_unused]] auto main_sel_op_calldata_copy = View(new_term.main_sel_op_calldata_copy); \ [[maybe_unused]] auto main_sel_op_cast = View(new_term.main_sel_op_cast); \ [[maybe_unused]] auto main_sel_op_chain_id = View(new_term.main_sel_op_chain_id); \ [[maybe_unused]] auto main_sel_op_cmov = View(new_term.main_sel_op_cmov); \ @@ -273,6 +275,7 @@ [[maybe_unused]] auto mem_sel_op_a = View(new_term.mem_sel_op_a); \ [[maybe_unused]] auto mem_sel_op_b = View(new_term.mem_sel_op_b); \ [[maybe_unused]] auto mem_sel_op_c = View(new_term.mem_sel_op_c); \ + [[maybe_unused]] auto mem_sel_op_cd = View(new_term.mem_sel_op_cd); \ [[maybe_unused]] auto mem_sel_op_cmov = View(new_term.mem_sel_op_cmov); \ [[maybe_unused]] auto mem_sel_op_d = View(new_term.mem_sel_op_d); \ [[maybe_unused]] auto mem_sel_resolve_ind_addr_a = View(new_term.mem_sel_resolve_ind_addr_a); \ @@ -301,11 +304,22 @@ [[maybe_unused]] auto sha256_output = View(new_term.sha256_output); \ [[maybe_unused]] auto sha256_sel_sha256_compression = View(new_term.sha256_sel_sha256_compression); \ [[maybe_unused]] auto sha256_state = View(new_term.sha256_state); \ + [[maybe_unused]] auto slice_addr = View(new_term.slice_addr); \ + [[maybe_unused]] auto slice_cd_offset = View(new_term.slice_cd_offset); \ + [[maybe_unused]] auto slice_clk = View(new_term.slice_clk); \ + [[maybe_unused]] auto slice_cnt = View(new_term.slice_cnt); \ + [[maybe_unused]] auto slice_one_min_inv = View(new_term.slice_one_min_inv); \ + [[maybe_unused]] auto slice_sel_cd = View(new_term.slice_sel_cd); \ + [[maybe_unused]] auto slice_sel_start_cd = View(new_term.slice_sel_start_cd); \ + [[maybe_unused]] auto slice_space_id = View(new_term.slice_space_id); \ + [[maybe_unused]] auto slice_val = View(new_term.slice_val); \ + [[maybe_unused]] auto perm_cd_mem = View(new_term.perm_cd_mem); \ [[maybe_unused]] auto perm_main_alu = View(new_term.perm_main_alu); \ [[maybe_unused]] auto perm_main_bin = View(new_term.perm_main_bin); \ [[maybe_unused]] auto perm_main_conv = View(new_term.perm_main_conv); \ [[maybe_unused]] auto perm_main_pos2_perm = View(new_term.perm_main_pos2_perm); \ [[maybe_unused]] auto perm_main_pedersen = View(new_term.perm_main_pedersen); \ + [[maybe_unused]] auto perm_main_cd_copy = View(new_term.perm_main_cd_copy); \ [[maybe_unused]] auto perm_main_mem_a = View(new_term.perm_main_mem_a); \ [[maybe_unused]] auto perm_main_mem_b = View(new_term.perm_main_mem_b); \ [[maybe_unused]] auto perm_main_mem_c = View(new_term.perm_main_mem_c); \ @@ -316,6 +330,7 @@ [[maybe_unused]] auto perm_main_mem_ind_addr_d = View(new_term.perm_main_mem_ind_addr_d); \ [[maybe_unused]] auto lookup_byte_lengths = View(new_term.lookup_byte_lengths); \ [[maybe_unused]] auto lookup_byte_operations = View(new_term.lookup_byte_operations); \ + [[maybe_unused]] auto lookup_cd_value = View(new_term.lookup_cd_value); \ [[maybe_unused]] auto lookup_opcode_gas = View(new_term.lookup_opcode_gas); \ [[maybe_unused]] auto range_check_l2_gas_hi = View(new_term.range_check_l2_gas_hi); \ [[maybe_unused]] auto range_check_l2_gas_lo = View(new_term.range_check_l2_gas_lo); \ @@ -357,6 +372,7 @@ [[maybe_unused]] auto lookup_div_u16_7 = View(new_term.lookup_div_u16_7); \ [[maybe_unused]] auto lookup_byte_lengths_counts = View(new_term.lookup_byte_lengths_counts); \ [[maybe_unused]] auto lookup_byte_operations_counts = View(new_term.lookup_byte_operations_counts); \ + [[maybe_unused]] auto lookup_cd_value_counts = View(new_term.lookup_cd_value_counts); \ [[maybe_unused]] auto lookup_opcode_gas_counts = View(new_term.lookup_opcode_gas_counts); \ [[maybe_unused]] auto range_check_l2_gas_hi_counts = View(new_term.range_check_l2_gas_hi_counts); \ [[maybe_unused]] auto range_check_l2_gas_lo_counts = View(new_term.range_check_l2_gas_lo_counts); \ @@ -468,4 +484,7 @@ [[maybe_unused]] auto mem_sel_mem_shift = View(new_term.mem_sel_mem_shift); \ [[maybe_unused]] auto mem_tag_shift = View(new_term.mem_tag_shift); \ [[maybe_unused]] auto mem_tsp_shift = View(new_term.mem_tsp_shift); \ - [[maybe_unused]] auto mem_val_shift = View(new_term.mem_val_shift); + [[maybe_unused]] auto mem_val_shift = View(new_term.mem_val_shift); \ + [[maybe_unused]] auto slice_addr_shift = View(new_term.slice_addr_shift); \ + [[maybe_unused]] auto slice_cd_offset_shift = View(new_term.slice_cd_offset_shift); \ + [[maybe_unused]] auto slice_cnt_shift = View(new_term.slice_cnt_shift); diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp new file mode 100644 index 00000000000..176b115f89a --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp @@ -0,0 +1,170 @@ + + +#pragma once + +#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" + +#include +#include + +namespace bb { + +/** + * @brief This class contains an example of how to set LookupSettings classes used by the + * GenericLookupRelationImpl class to specify a scaled lookup + * + * @details To create your own lookup: + * 1) Create a copy of this class and rename it + * 2) Update all the values with the ones needed for your lookup + * 3) Update "DECLARE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS" and "DEFINE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS" to + * include the new settings + * 4) Add the relation with the chosen settings to Relations in the flavor (for example,"` + * using Relations = std::tuple>;)` + * + */ +class lookup_cd_value_lookup_settings { + public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ + static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ + static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ + static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ + static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ + static constexpr size_t LOOKUP_TUPLE_SIZE = 2; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ + static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ + static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + + static constexpr size_t WRITE_TERM_DEGREE = 0; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) + { + return (in.slice_sel_cd == 1 || in.main_sel_cd == 1); + } + + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + + template + static inline auto compute_inverse_exists(const AllEntities& in) + { + using View = typename Accumulator::View; + const auto is_operation = View(in.slice_sel_cd); + const auto is_table_entry = View(in.main_sel_cd); + return (is_operation + is_table_entry - is_operation * is_table_entry); + } + + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + + template static inline auto get_const_entities(const AllEntities& in) + { + + return std::forward_as_tuple(in.lookup_cd_value, + in.lookup_cd_value_counts, + in.slice_sel_cd, + in.main_sel_cd, + in.slice_cd_offset, + in.slice_val, + in.main_clk, + in.main_calldata); + } + + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + + template static inline auto get_nonconst_entities(AllEntities& in) + { + + return std::forward_as_tuple(in.lookup_cd_value, + in.lookup_cd_value_counts, + in.slice_sel_cd, + in.main_sel_cd, + in.slice_cd_offset, + in.slice_val, + in.main_clk, + in.main_calldata); + } +}; + +template using lookup_cd_value_relation = GenericLookupRelation; +template using lookup_cd_value = GenericLookup; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp index bb16f6812c3..b0d5e28835c 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp @@ -69,6 +69,7 @@ template struct MainRow { FF main_sel_op_address{}; FF main_sel_op_and{}; FF main_sel_op_block_number{}; + FF main_sel_op_calldata_copy{}; FF main_sel_op_cast{}; FF main_sel_op_chain_id{}; FF main_sel_op_cmov{}; @@ -139,99 +140,99 @@ inline std::string get_relation_label_main(int index) return "L2_GAS_INACTIVE"; case 5: return "DA_GAS_INACTIVE"; - case 75: - return "OUTPUT_U8"; case 76: - return "SUBOP_FDIV"; + return "OUTPUT_U8"; case 77: - return "SUBOP_FDIV_ZERO_ERR1"; + return "SUBOP_FDIV"; case 78: - return "SUBOP_FDIV_ZERO_ERR2"; + return "SUBOP_FDIV_ZERO_ERR1"; case 79: - return "SUBOP_FDIV_R_IN_TAG_FF"; + return "SUBOP_FDIV_ZERO_ERR2"; case 80: - return "SUBOP_FDIV_W_IN_TAG_FF"; + return "SUBOP_FDIV_R_IN_TAG_FF"; case 81: - return "SUBOP_ERROR_RELEVANT_OP"; + return "SUBOP_FDIV_W_IN_TAG_FF"; case 82: - return "KERNEL_INPUT_ACTIVE_CHECK"; + return "SUBOP_ERROR_RELEVANT_OP"; case 83: - return "KERNEL_OUTPUT_ACTIVE_CHECK"; + return "KERNEL_INPUT_ACTIVE_CHECK"; case 84: - return "PC_JUMP"; + return "KERNEL_OUTPUT_ACTIVE_CHECK"; case 85: - return "PC_JUMPI"; + return "PC_JUMP"; case 86: + return "PC_JUMPI"; + case 87: return "RETURN_POINTER_INCREMENT"; - case 92: + case 93: return "RETURN_POINTER_DECREMENT"; - case 98: - return "PC_INCREMENT"; case 99: - return "INTERNAL_RETURN_POINTER_CONSISTENCY"; + return "PC_INCREMENT"; case 100: - return "SPACE_ID_INTERNAL"; + return "INTERNAL_RETURN_POINTER_CONSISTENCY"; case 101: - return "SPACE_ID_STANDARD_OPCODES"; + return "SPACE_ID_INTERNAL"; case 102: - return "CMOV_CONDITION_RES_1"; + return "SPACE_ID_STANDARD_OPCODES"; case 103: + return "CMOV_CONDITION_RES_1"; + case 104: return "CMOV_CONDITION_RES_2"; - case 106: - return "MOV_SAME_VALUE_A"; case 107: - return "MOV_SAME_VALUE_B"; + return "MOV_SAME_VALUE_A"; case 108: + return "MOV_SAME_VALUE_B"; + case 109: return "MOV_MAIN_SAME_TAG"; - case 112: - return "L2GASLEFT"; case 113: - return "DAGASLEFT"; + return "L2GASLEFT"; case 114: - return "ADDRESS_KERNEL"; + return "DAGASLEFT"; case 115: - return "STORAGE_ADDRESS_KERNEL"; + return "ADDRESS_KERNEL"; case 116: - return "SENDER_KERNEL"; + return "STORAGE_ADDRESS_KERNEL"; case 117: - return "FUNCTION_SELECTOR_KERNEL"; + return "SENDER_KERNEL"; case 118: - return "FEE_TRANSACTION_FEE_KERNEL"; + return "FUNCTION_SELECTOR_KERNEL"; case 119: - return "CHAIN_ID_KERNEL"; + return "FEE_TRANSACTION_FEE_KERNEL"; case 120: - return "VERSION_KERNEL"; + return "CHAIN_ID_KERNEL"; case 121: - return "BLOCK_NUMBER_KERNEL"; + return "VERSION_KERNEL"; case 122: - return "TIMESTAMP_KERNEL"; + return "BLOCK_NUMBER_KERNEL"; case 123: - return "COINBASE_KERNEL"; + return "TIMESTAMP_KERNEL"; case 124: - return "FEE_DA_GAS_KERNEL"; + return "COINBASE_KERNEL"; case 125: - return "FEE_L2_GAS_KERNEL"; + return "FEE_DA_GAS_KERNEL"; case 126: + return "FEE_L2_GAS_KERNEL"; + case 127: return "NOTE_HASH_KERNEL_OUTPUT"; - case 128: + case 129: return "EMIT_NOTE_HASH_KERNEL_OUTPUT"; - case 130: + case 131: return "NULLIFIER_EXISTS_KERNEL_OUTPUT"; - case 133: + case 134: return "EMIT_NULLIFIER_KERNEL_OUTPUT"; - case 135: + case 136: return "L1_TO_L2_MSG_EXISTS_KERNEL_OUTPUT"; - case 137: + case 138: return "EMIT_UNENCRYPTED_LOG_KERNEL_OUTPUT"; - case 139: + case 140: return "EMIT_L2_TO_L1_MSGS_KERNEL_OUTPUT"; - case 141: + case 142: return "SLOAD_KERNEL_OUTPUT"; - case 143: + case 144: return "SSTORE_KERNEL_OUTPUT"; - case 146: - return "BIN_SEL_1"; case 147: + return "BIN_SEL_1"; + case 148: return "BIN_SEL_2"; } return std::to_string(index); @@ -241,11 +242,12 @@ template class mainImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { - 3, 3, 3, 3, 3, 3, 5, 5, 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, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 4, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2 + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { + 3, 3, 3, 3, 3, 3, 5, 5, 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, 3, 3, 4, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2 }; template @@ -671,174 +673,181 @@ template class mainImpl { // Contribution 58 { Avm_DECLARE_VIEWS(58); - auto tmp = (main_sel_op_mov * (-main_sel_op_mov + FF(1))); + auto tmp = (main_sel_op_calldata_copy * (-main_sel_op_calldata_copy + FF(1))); tmp *= scaling_factor; std::get<58>(evals) += tmp; } // Contribution 59 { Avm_DECLARE_VIEWS(59); - auto tmp = (main_sel_op_cmov * (-main_sel_op_cmov + FF(1))); + auto tmp = (main_sel_op_mov * (-main_sel_op_mov + FF(1))); tmp *= scaling_factor; std::get<59>(evals) += tmp; } // Contribution 60 { Avm_DECLARE_VIEWS(60); - auto tmp = (main_op_err * (-main_op_err + FF(1))); + auto tmp = (main_sel_op_cmov * (-main_sel_op_cmov + FF(1))); tmp *= scaling_factor; std::get<60>(evals) += tmp; } // Contribution 61 { Avm_DECLARE_VIEWS(61); - auto tmp = (main_tag_err * (-main_tag_err + FF(1))); + auto tmp = (main_op_err * (-main_op_err + FF(1))); tmp *= scaling_factor; std::get<61>(evals) += tmp; } // Contribution 62 { Avm_DECLARE_VIEWS(62); - auto tmp = (main_id_zero * (-main_id_zero + FF(1))); + auto tmp = (main_tag_err * (-main_tag_err + FF(1))); tmp *= scaling_factor; std::get<62>(evals) += tmp; } // Contribution 63 { Avm_DECLARE_VIEWS(63); - auto tmp = (main_sel_mem_op_a * (-main_sel_mem_op_a + FF(1))); + auto tmp = (main_id_zero * (-main_id_zero + FF(1))); tmp *= scaling_factor; std::get<63>(evals) += tmp; } // Contribution 64 { Avm_DECLARE_VIEWS(64); - auto tmp = (main_sel_mem_op_b * (-main_sel_mem_op_b + FF(1))); + auto tmp = (main_sel_mem_op_a * (-main_sel_mem_op_a + FF(1))); tmp *= scaling_factor; std::get<64>(evals) += tmp; } // Contribution 65 { Avm_DECLARE_VIEWS(65); - auto tmp = (main_sel_mem_op_c * (-main_sel_mem_op_c + FF(1))); + auto tmp = (main_sel_mem_op_b * (-main_sel_mem_op_b + FF(1))); tmp *= scaling_factor; std::get<65>(evals) += tmp; } // Contribution 66 { Avm_DECLARE_VIEWS(66); - auto tmp = (main_sel_mem_op_d * (-main_sel_mem_op_d + FF(1))); + auto tmp = (main_sel_mem_op_c * (-main_sel_mem_op_c + FF(1))); tmp *= scaling_factor; std::get<66>(evals) += tmp; } // Contribution 67 { Avm_DECLARE_VIEWS(67); - auto tmp = (main_rwa * (-main_rwa + FF(1))); + auto tmp = (main_sel_mem_op_d * (-main_sel_mem_op_d + FF(1))); tmp *= scaling_factor; std::get<67>(evals) += tmp; } // Contribution 68 { Avm_DECLARE_VIEWS(68); - auto tmp = (main_rwb * (-main_rwb + FF(1))); + auto tmp = (main_rwa * (-main_rwa + FF(1))); tmp *= scaling_factor; std::get<68>(evals) += tmp; } // Contribution 69 { Avm_DECLARE_VIEWS(69); - auto tmp = (main_rwc * (-main_rwc + FF(1))); + auto tmp = (main_rwb * (-main_rwb + FF(1))); tmp *= scaling_factor; std::get<69>(evals) += tmp; } // Contribution 70 { Avm_DECLARE_VIEWS(70); - auto tmp = (main_rwd * (-main_rwd + FF(1))); + auto tmp = (main_rwc * (-main_rwc + FF(1))); tmp *= scaling_factor; std::get<70>(evals) += tmp; } // Contribution 71 { Avm_DECLARE_VIEWS(71); - auto tmp = (main_sel_resolve_ind_addr_a * (-main_sel_resolve_ind_addr_a + FF(1))); + auto tmp = (main_rwd * (-main_rwd + FF(1))); tmp *= scaling_factor; std::get<71>(evals) += tmp; } // Contribution 72 { Avm_DECLARE_VIEWS(72); - auto tmp = (main_sel_resolve_ind_addr_b * (-main_sel_resolve_ind_addr_b + FF(1))); + auto tmp = (main_sel_resolve_ind_addr_a * (-main_sel_resolve_ind_addr_a + FF(1))); tmp *= scaling_factor; std::get<72>(evals) += tmp; } // Contribution 73 { Avm_DECLARE_VIEWS(73); - auto tmp = (main_sel_resolve_ind_addr_c * (-main_sel_resolve_ind_addr_c + FF(1))); + auto tmp = (main_sel_resolve_ind_addr_b * (-main_sel_resolve_ind_addr_b + FF(1))); tmp *= scaling_factor; std::get<73>(evals) += tmp; } // Contribution 74 { Avm_DECLARE_VIEWS(74); - auto tmp = (main_sel_resolve_ind_addr_d * (-main_sel_resolve_ind_addr_d + FF(1))); + auto tmp = (main_sel_resolve_ind_addr_c * (-main_sel_resolve_ind_addr_c + FF(1))); tmp *= scaling_factor; std::get<74>(evals) += tmp; } // Contribution 75 { Avm_DECLARE_VIEWS(75); - auto tmp = (((main_sel_op_eq + main_sel_op_lte) + main_sel_op_lt) * (main_w_in_tag - FF(1))); + auto tmp = (main_sel_resolve_ind_addr_d * (-main_sel_resolve_ind_addr_d + FF(1))); tmp *= scaling_factor; std::get<75>(evals) += tmp; } // Contribution 76 { Avm_DECLARE_VIEWS(76); - auto tmp = ((main_sel_op_fdiv * (-main_op_err + FF(1))) * ((main_ic * main_ib) - main_ia)); + auto tmp = (((main_sel_op_eq + main_sel_op_lte) + main_sel_op_lt) * (main_w_in_tag - FF(1))); tmp *= scaling_factor; std::get<76>(evals) += tmp; } // Contribution 77 { Avm_DECLARE_VIEWS(77); - auto tmp = ((main_sel_op_fdiv + main_sel_op_div) * (((main_ib * main_inv) - FF(1)) + main_op_err)); + auto tmp = ((main_sel_op_fdiv * (-main_op_err + FF(1))) * ((main_ic * main_ib) - main_ia)); tmp *= scaling_factor; std::get<77>(evals) += tmp; } // Contribution 78 { Avm_DECLARE_VIEWS(78); - auto tmp = (((main_sel_op_fdiv + main_sel_op_div) * main_op_err) * (-main_inv + FF(1))); + auto tmp = ((main_sel_op_fdiv + main_sel_op_div) * (((main_ib * main_inv) - FF(1)) + main_op_err)); tmp *= scaling_factor; std::get<78>(evals) += tmp; } // Contribution 79 { Avm_DECLARE_VIEWS(79); - auto tmp = (main_sel_op_fdiv * (main_r_in_tag - FF(6))); + auto tmp = (((main_sel_op_fdiv + main_sel_op_div) * main_op_err) * (-main_inv + FF(1))); tmp *= scaling_factor; std::get<79>(evals) += tmp; } // Contribution 80 { Avm_DECLARE_VIEWS(80); - auto tmp = (main_sel_op_fdiv * (main_w_in_tag - FF(6))); + auto tmp = (main_sel_op_fdiv * (main_r_in_tag - FF(6))); tmp *= scaling_factor; std::get<80>(evals) += tmp; } // Contribution 81 { Avm_DECLARE_VIEWS(81); - auto tmp = (main_op_err * ((main_sel_op_fdiv + main_sel_op_div) - FF(1))); + auto tmp = (main_sel_op_fdiv * (main_w_in_tag - FF(6))); tmp *= scaling_factor; std::get<81>(evals) += tmp; } // Contribution 82 { Avm_DECLARE_VIEWS(82); + auto tmp = (main_op_err * ((main_sel_op_fdiv + main_sel_op_div) - FF(1))); + tmp *= scaling_factor; + std::get<82>(evals) += tmp; + } + // Contribution 83 + { + Avm_DECLARE_VIEWS(83); auto tmp = ((((((((((((main_sel_op_address + main_sel_op_storage_address) + main_sel_op_sender) + main_sel_op_function_selector) + main_sel_op_transaction_fee) + @@ -851,11 +860,11 @@ template class mainImpl { main_sel_op_fee_per_da_gas) * (-main_sel_q_kernel_lookup + FF(1))); tmp *= scaling_factor; - std::get<82>(evals) += tmp; + std::get<83>(evals) += tmp; } - // Contribution 83 + // Contribution 84 { - Avm_DECLARE_VIEWS(83); + Avm_DECLARE_VIEWS(84); auto tmp = (((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + main_sel_op_emit_nullifier) + @@ -864,151 +873,207 @@ template class mainImpl { main_sel_op_emit_l2_to_l1_msg) * (-main_sel_q_kernel_output_lookup + FF(1))); tmp *= scaling_factor; - std::get<83>(evals) += tmp; - } - // Contribution 84 - { - Avm_DECLARE_VIEWS(84); - auto tmp = (main_sel_op_jump * (main_pc_shift - main_ia)); - tmp *= scaling_factor; std::get<84>(evals) += tmp; } // Contribution 85 { Avm_DECLARE_VIEWS(85); - auto tmp = (main_sel_op_jumpi * (((-main_id_zero + FF(1)) * (main_pc_shift - main_ia)) + - (main_id_zero * ((main_pc_shift - main_pc) - FF(1))))); + auto tmp = (main_sel_op_jump * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<85>(evals) += tmp; } // Contribution 86 { Avm_DECLARE_VIEWS(86); - auto tmp = - (main_sel_op_internal_call * (main_internal_return_ptr_shift - (main_internal_return_ptr + FF(1)))); + auto tmp = (main_sel_op_jumpi * (((-main_id_zero + FF(1)) * (main_pc_shift - main_ia)) + + (main_id_zero * ((main_pc_shift - main_pc) - FF(1))))); tmp *= scaling_factor; std::get<86>(evals) += tmp; } // Contribution 87 { Avm_DECLARE_VIEWS(87); - auto tmp = (main_sel_op_internal_call * (main_internal_return_ptr - main_mem_addr_b)); + auto tmp = + (main_sel_op_internal_call * (main_internal_return_ptr_shift - (main_internal_return_ptr + FF(1)))); tmp *= scaling_factor; std::get<87>(evals) += tmp; } // Contribution 88 { Avm_DECLARE_VIEWS(88); - auto tmp = (main_sel_op_internal_call * (main_pc_shift - main_ia)); + auto tmp = (main_sel_op_internal_call * (main_internal_return_ptr - main_mem_addr_b)); tmp *= scaling_factor; std::get<88>(evals) += tmp; } // Contribution 89 { Avm_DECLARE_VIEWS(89); - auto tmp = (main_sel_op_internal_call * ((main_pc + FF(1)) - main_ib)); + auto tmp = (main_sel_op_internal_call * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<89>(evals) += tmp; } // Contribution 90 { Avm_DECLARE_VIEWS(90); - auto tmp = (main_sel_op_internal_call * (main_rwb - FF(1))); + auto tmp = (main_sel_op_internal_call * ((main_pc + FF(1)) - main_ib)); tmp *= scaling_factor; std::get<90>(evals) += tmp; } // Contribution 91 { Avm_DECLARE_VIEWS(91); - auto tmp = (main_sel_op_internal_call * (main_sel_mem_op_b - FF(1))); + auto tmp = (main_sel_op_internal_call * (main_rwb - FF(1))); tmp *= scaling_factor; std::get<91>(evals) += tmp; } // Contribution 92 { Avm_DECLARE_VIEWS(92); - auto tmp = - (main_sel_op_internal_return * (main_internal_return_ptr_shift - (main_internal_return_ptr - FF(1)))); + auto tmp = (main_sel_op_internal_call * (main_sel_mem_op_b - FF(1))); tmp *= scaling_factor; std::get<92>(evals) += tmp; } // Contribution 93 { Avm_DECLARE_VIEWS(93); - auto tmp = (main_sel_op_internal_return * ((main_internal_return_ptr - FF(1)) - main_mem_addr_a)); + auto tmp = + (main_sel_op_internal_return * (main_internal_return_ptr_shift - (main_internal_return_ptr - FF(1)))); tmp *= scaling_factor; std::get<93>(evals) += tmp; } // Contribution 94 { Avm_DECLARE_VIEWS(94); - auto tmp = (main_sel_op_internal_return * (main_pc_shift - main_ia)); + auto tmp = (main_sel_op_internal_return * ((main_internal_return_ptr - FF(1)) - main_mem_addr_a)); tmp *= scaling_factor; std::get<94>(evals) += tmp; } // Contribution 95 { Avm_DECLARE_VIEWS(95); - auto tmp = (main_sel_op_internal_return * main_rwa); + auto tmp = (main_sel_op_internal_return * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<95>(evals) += tmp; } // Contribution 96 { Avm_DECLARE_VIEWS(96); - auto tmp = (main_sel_op_internal_return * (main_sel_mem_op_a - FF(1))); + auto tmp = (main_sel_op_internal_return * main_rwa); tmp *= scaling_factor; std::get<96>(evals) += tmp; } // Contribution 97 { Avm_DECLARE_VIEWS(97); - auto tmp = - (((((main_sel_gas_accounting_active - - (((((((main_sel_op_fdiv + - ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + - main_sel_op_not) + - main_sel_op_eq) + - main_sel_op_lt) + - main_sel_op_lte) + - main_sel_op_shr) + - main_sel_op_shl) + - main_sel_op_cast)) + - ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)) + - (main_sel_op_cmov + main_sel_op_mov)) + - ((((main_sel_op_radix_le + main_sel_op_sha256) + main_sel_op_poseidon2) + main_sel_op_keccak) + - main_sel_op_pedersen)) + - (((((((((((main_sel_op_address + main_sel_op_storage_address) + main_sel_op_sender) + - main_sel_op_function_selector) + - main_sel_op_transaction_fee) + - main_sel_op_chain_id) + - main_sel_op_version) + - main_sel_op_block_number) + - main_sel_op_coinbase) + - main_sel_op_timestamp) + - main_sel_op_fee_per_l2_gas) + - main_sel_op_fee_per_da_gas)) + - ((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + - main_sel_op_nullifier_exists) + - main_sel_op_emit_nullifier) + - main_sel_op_l1_to_l2_msg_exists) + - main_sel_op_emit_unencrypted_log) + - main_sel_op_emit_l2_to_l1_msg)) + - (main_sel_op_dagasleft + main_sel_op_l2gasleft))) - - (((main_sel_op_jump + main_sel_op_jumpi) + main_sel_op_internal_call) + - main_sel_op_internal_return)) - - main_sel_op_sload) - - main_sel_op_sstore) - - main_sel_mem_op_activate_gas); + auto tmp = (main_sel_op_internal_return * (main_sel_mem_op_a - FF(1))); tmp *= scaling_factor; std::get<97>(evals) += tmp; } // Contribution 98 { Avm_DECLARE_VIEWS(98); + auto tmp = (((((main_sel_gas_accounting_active - + ((((((((main_sel_op_fdiv + + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + + main_sel_op_not) + + main_sel_op_eq) + + main_sel_op_lt) + + main_sel_op_lte) + + main_sel_op_shr) + + main_sel_op_shl) + + main_sel_op_cast)) + + ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)) + + (main_sel_op_cmov + main_sel_op_mov)) + + ((((main_sel_op_radix_le + main_sel_op_sha256) + main_sel_op_poseidon2) + + main_sel_op_keccak) + + main_sel_op_pedersen)) + + (((((((((((main_sel_op_address + main_sel_op_storage_address) + main_sel_op_sender) + + main_sel_op_function_selector) + + main_sel_op_transaction_fee) + + main_sel_op_chain_id) + + main_sel_op_version) + + main_sel_op_block_number) + + main_sel_op_coinbase) + + main_sel_op_timestamp) + + main_sel_op_fee_per_l2_gas) + + main_sel_op_fee_per_da_gas)) + + ((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + + main_sel_op_nullifier_exists) + + main_sel_op_emit_nullifier) + + main_sel_op_l1_to_l2_msg_exists) + + main_sel_op_emit_unencrypted_log) + + main_sel_op_emit_l2_to_l1_msg)) + + (main_sel_op_dagasleft + main_sel_op_l2gasleft)) + + main_sel_op_calldata_copy)) - + (((main_sel_op_jump + main_sel_op_jumpi) + main_sel_op_internal_call) + + main_sel_op_internal_return)) - + main_sel_op_sload) - + main_sel_op_sstore) - + main_sel_mem_op_activate_gas); + tmp *= scaling_factor; + std::get<98>(evals) += tmp; + } + // Contribution 99 + { + Avm_DECLARE_VIEWS(99); auto tmp = ((((-main_sel_first + FF(1)) * (-main_sel_op_halt + FF(1))) * - (((((((main_sel_op_fdiv + + ((((((((main_sel_op_fdiv + + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + + main_sel_op_not) + + main_sel_op_eq) + + main_sel_op_lt) + + main_sel_op_lte) + + main_sel_op_shr) + + main_sel_op_shl) + + main_sel_op_cast)) + + ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)) + + (main_sel_op_cmov + main_sel_op_mov)) + + ((((main_sel_op_radix_le + main_sel_op_sha256) + main_sel_op_poseidon2) + main_sel_op_keccak) + + main_sel_op_pedersen)) + + (((((((((((main_sel_op_address + main_sel_op_storage_address) + main_sel_op_sender) + + main_sel_op_function_selector) + + main_sel_op_transaction_fee) + + main_sel_op_chain_id) + + main_sel_op_version) + + main_sel_op_block_number) + + main_sel_op_coinbase) + + main_sel_op_timestamp) + + main_sel_op_fee_per_l2_gas) + + main_sel_op_fee_per_da_gas)) + + ((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + + main_sel_op_emit_nullifier) + + main_sel_op_l1_to_l2_msg_exists) + + main_sel_op_emit_unencrypted_log) + + main_sel_op_emit_l2_to_l1_msg)) + + (main_sel_op_dagasleft + main_sel_op_l2gasleft)) + + main_sel_op_calldata_copy)) * + (main_pc_shift - (main_pc + FF(1)))); + tmp *= scaling_factor; + std::get<99>(evals) += tmp; + } + // Contribution 100 + { + Avm_DECLARE_VIEWS(100); + auto tmp = + ((-(((main_sel_first + main_sel_op_internal_call) + main_sel_op_internal_return) + main_sel_op_halt) + + FF(1)) * + (main_internal_return_ptr_shift - main_internal_return_ptr)); + tmp *= scaling_factor; + std::get<100>(evals) += tmp; + } + // Contribution 101 + { + Avm_DECLARE_VIEWS(101); + auto tmp = ((main_sel_op_internal_call + main_sel_op_internal_return) * (main_space_id - FF(255))); + tmp *= scaling_factor; + std::get<101>(evals) += tmp; + } + // Contribution 102 + { + Avm_DECLARE_VIEWS(102); + auto tmp = + (((((((((main_sel_op_fdiv + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + main_sel_op_not) + main_sel_op_eq) + @@ -1036,117 +1101,64 @@ template class mainImpl { main_sel_op_l1_to_l2_msg_exists) + main_sel_op_emit_unencrypted_log) + main_sel_op_emit_l2_to_l1_msg)) + - (main_sel_op_dagasleft + main_sel_op_l2gasleft))) * - (main_pc_shift - (main_pc + FF(1)))); - tmp *= scaling_factor; - std::get<98>(evals) += tmp; - } - // Contribution 99 - { - Avm_DECLARE_VIEWS(99); - auto tmp = - ((-(((main_sel_first + main_sel_op_internal_call) + main_sel_op_internal_return) + main_sel_op_halt) + - FF(1)) * - (main_internal_return_ptr_shift - main_internal_return_ptr)); - tmp *= scaling_factor; - std::get<99>(evals) += tmp; - } - // Contribution 100 - { - Avm_DECLARE_VIEWS(100); - auto tmp = ((main_sel_op_internal_call + main_sel_op_internal_return) * (main_space_id - FF(255))); - tmp *= scaling_factor; - std::get<100>(evals) += tmp; - } - // Contribution 101 - { - Avm_DECLARE_VIEWS(101); - auto tmp = - ((((((((main_sel_op_fdiv + - ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + - main_sel_op_not) + - main_sel_op_eq) + - main_sel_op_lt) + - main_sel_op_lte) + - main_sel_op_shr) + - main_sel_op_shl) + - main_sel_op_cast)) + - ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)) + - (main_sel_op_cmov + main_sel_op_mov)) + - ((((main_sel_op_radix_le + main_sel_op_sha256) + main_sel_op_poseidon2) + main_sel_op_keccak) + - main_sel_op_pedersen)) + - (((((((((((main_sel_op_address + main_sel_op_storage_address) + main_sel_op_sender) + - main_sel_op_function_selector) + - main_sel_op_transaction_fee) + - main_sel_op_chain_id) + - main_sel_op_version) + - main_sel_op_block_number) + - main_sel_op_coinbase) + - main_sel_op_timestamp) + - main_sel_op_fee_per_l2_gas) + - main_sel_op_fee_per_da_gas)) + - ((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + - main_sel_op_emit_nullifier) + - main_sel_op_l1_to_l2_msg_exists) + - main_sel_op_emit_unencrypted_log) + - main_sel_op_emit_l2_to_l1_msg)) + - (main_sel_op_dagasleft + main_sel_op_l2gasleft)) * + (main_sel_op_dagasleft + main_sel_op_l2gasleft)) + + main_sel_op_calldata_copy) * (main_call_ptr - main_space_id)); tmp *= scaling_factor; - std::get<101>(evals) += tmp; - } - // Contribution 102 - { - Avm_DECLARE_VIEWS(102); - auto tmp = ((main_sel_op_cmov + main_sel_op_jumpi) * (((main_id * main_inv) - FF(1)) + main_id_zero)); - tmp *= scaling_factor; std::get<102>(evals) += tmp; } // Contribution 103 { Avm_DECLARE_VIEWS(103); - auto tmp = (((main_sel_op_cmov + main_sel_op_jumpi) * main_id_zero) * (-main_inv + FF(1))); + auto tmp = ((main_sel_op_cmov + main_sel_op_jumpi) * (((main_id * main_inv) - FF(1)) + main_id_zero)); tmp *= scaling_factor; std::get<103>(evals) += tmp; } // Contribution 104 { Avm_DECLARE_VIEWS(104); - auto tmp = (main_sel_mov_ia_to_ic - (main_sel_op_mov + (main_sel_op_cmov * (-main_id_zero + FF(1))))); + auto tmp = (((main_sel_op_cmov + main_sel_op_jumpi) * main_id_zero) * (-main_inv + FF(1))); tmp *= scaling_factor; std::get<104>(evals) += tmp; } // Contribution 105 { Avm_DECLARE_VIEWS(105); - auto tmp = (main_sel_mov_ib_to_ic - (main_sel_op_cmov * main_id_zero)); + auto tmp = (main_sel_mov_ia_to_ic - (main_sel_op_mov + (main_sel_op_cmov * (-main_id_zero + FF(1))))); tmp *= scaling_factor; std::get<105>(evals) += tmp; } // Contribution 106 { Avm_DECLARE_VIEWS(106); - auto tmp = (main_sel_mov_ia_to_ic * (main_ia - main_ic)); + auto tmp = (main_sel_mov_ib_to_ic - (main_sel_op_cmov * main_id_zero)); tmp *= scaling_factor; std::get<106>(evals) += tmp; } // Contribution 107 { Avm_DECLARE_VIEWS(107); - auto tmp = (main_sel_mov_ib_to_ic * (main_ib - main_ic)); + auto tmp = (main_sel_mov_ia_to_ic * (main_ia - main_ic)); tmp *= scaling_factor; std::get<107>(evals) += tmp; } // Contribution 108 { Avm_DECLARE_VIEWS(108); - auto tmp = ((main_sel_op_mov + main_sel_op_cmov) * (main_r_in_tag - main_w_in_tag)); + auto tmp = (main_sel_mov_ib_to_ic * (main_ib - main_ic)); tmp *= scaling_factor; std::get<108>(evals) += tmp; } // Contribution 109 { Avm_DECLARE_VIEWS(109); + auto tmp = ((main_sel_op_mov + main_sel_op_cmov) * (main_r_in_tag - main_w_in_tag)); + tmp *= scaling_factor; + std::get<109>(evals) += tmp; + } + // Contribution 110 + { + Avm_DECLARE_VIEWS(110); auto tmp = (main_sel_alu - ((((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + main_sel_op_not) + @@ -1159,11 +1171,11 @@ template class mainImpl { (-main_tag_err + FF(1))) * (-main_op_err + FF(1)))); tmp *= scaling_factor; - std::get<109>(evals) += tmp; + std::get<110>(evals) += tmp; } - // Contribution 110 + // Contribution 111 { - Avm_DECLARE_VIEWS(110); + Avm_DECLARE_VIEWS(111); auto tmp = ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + main_sel_op_not) + main_sel_op_eq) + @@ -1173,258 +1185,258 @@ template class mainImpl { main_sel_op_shl) * (main_alu_in_tag - main_r_in_tag)); tmp *= scaling_factor; - std::get<110>(evals) += tmp; - } - // Contribution 111 - { - Avm_DECLARE_VIEWS(111); - auto tmp = (main_sel_op_cast * (main_alu_in_tag - main_w_in_tag)); - tmp *= scaling_factor; std::get<111>(evals) += tmp; } // Contribution 112 { Avm_DECLARE_VIEWS(112); - auto tmp = (main_sel_op_l2gasleft * (main_ia - main_l2_gas_remaining_shift)); + auto tmp = (main_sel_op_cast * (main_alu_in_tag - main_w_in_tag)); tmp *= scaling_factor; std::get<112>(evals) += tmp; } // Contribution 113 { Avm_DECLARE_VIEWS(113); - auto tmp = (main_sel_op_dagasleft * (main_ia - main_da_gas_remaining_shift)); + auto tmp = (main_sel_op_l2gasleft * (main_ia - main_l2_gas_remaining_shift)); tmp *= scaling_factor; std::get<113>(evals) += tmp; } // Contribution 114 { Avm_DECLARE_VIEWS(114); - auto tmp = (main_sel_op_address * (kernel_kernel_in_offset - FF(1))); + auto tmp = (main_sel_op_dagasleft * (main_ia - main_da_gas_remaining_shift)); tmp *= scaling_factor; std::get<114>(evals) += tmp; } // Contribution 115 { Avm_DECLARE_VIEWS(115); - auto tmp = (main_sel_op_storage_address * (kernel_kernel_in_offset - FF(1))); + auto tmp = (main_sel_op_address * (kernel_kernel_in_offset - FF(1))); tmp *= scaling_factor; std::get<115>(evals) += tmp; } // Contribution 116 { Avm_DECLARE_VIEWS(116); - auto tmp = (main_sel_op_sender * kernel_kernel_in_offset); + auto tmp = (main_sel_op_storage_address * (kernel_kernel_in_offset - FF(1))); tmp *= scaling_factor; std::get<116>(evals) += tmp; } // Contribution 117 { Avm_DECLARE_VIEWS(117); - auto tmp = (main_sel_op_function_selector * (kernel_kernel_in_offset - FF(2))); + auto tmp = (main_sel_op_sender * kernel_kernel_in_offset); tmp *= scaling_factor; std::get<117>(evals) += tmp; } // Contribution 118 { Avm_DECLARE_VIEWS(118); - auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(39))); + auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(40))); tmp *= scaling_factor; std::get<118>(evals) += tmp; } // Contribution 119 { Avm_DECLARE_VIEWS(119); - auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(28))); + auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(29))); tmp *= scaling_factor; std::get<119>(evals) += tmp; } // Contribution 120 { Avm_DECLARE_VIEWS(120); - auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(29))); + auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(30))); tmp *= scaling_factor; std::get<120>(evals) += tmp; } // Contribution 121 { Avm_DECLARE_VIEWS(121); - auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(30))); + auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(31))); tmp *= scaling_factor; std::get<121>(evals) += tmp; } // Contribution 122 { Avm_DECLARE_VIEWS(122); - auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(31))); + auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(32))); tmp *= scaling_factor; std::get<122>(evals) += tmp; } // Contribution 123 { Avm_DECLARE_VIEWS(123); - auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(32))); + auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(33))); tmp *= scaling_factor; std::get<123>(evals) += tmp; } // Contribution 124 { Avm_DECLARE_VIEWS(124); - auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(34))); + auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(35))); tmp *= scaling_factor; std::get<124>(evals) += tmp; } // Contribution 125 { Avm_DECLARE_VIEWS(125); - auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(35))); + auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(36))); tmp *= scaling_factor; std::get<125>(evals) += tmp; } // Contribution 126 { Avm_DECLARE_VIEWS(126); - auto tmp = (main_sel_op_note_hash_exists * - (kernel_kernel_out_offset - (kernel_note_hash_exist_write_offset + FF(0)))); + auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(36))); tmp *= scaling_factor; std::get<126>(evals) += tmp; } // Contribution 127 { Avm_DECLARE_VIEWS(127); - auto tmp = (main_sel_first * kernel_note_hash_exist_write_offset); + auto tmp = (main_sel_op_note_hash_exists * + (kernel_kernel_out_offset - (kernel_note_hash_exist_write_offset + FF(0)))); tmp *= scaling_factor; std::get<127>(evals) += tmp; } // Contribution 128 { Avm_DECLARE_VIEWS(128); - auto tmp = (main_sel_op_emit_note_hash * - (kernel_kernel_out_offset - (kernel_emit_note_hash_write_offset + FF(128)))); + auto tmp = (main_sel_first * kernel_note_hash_exist_write_offset); tmp *= scaling_factor; std::get<128>(evals) += tmp; } // Contribution 129 { Avm_DECLARE_VIEWS(129); - auto tmp = (main_sel_first * kernel_emit_note_hash_write_offset); + auto tmp = (main_sel_op_emit_note_hash * + (kernel_kernel_out_offset - (kernel_emit_note_hash_write_offset + FF(128)))); tmp *= scaling_factor; std::get<129>(evals) += tmp; } // Contribution 130 { Avm_DECLARE_VIEWS(130); - auto tmp = (main_sel_op_nullifier_exists * - (kernel_kernel_out_offset - - ((main_ib * (kernel_nullifier_exists_write_offset + FF(16))) + - ((-main_ib + FF(1)) * (kernel_nullifier_non_exists_write_offset + FF(32)))))); + auto tmp = (main_sel_first * kernel_emit_note_hash_write_offset); tmp *= scaling_factor; std::get<130>(evals) += tmp; } // Contribution 131 { Avm_DECLARE_VIEWS(131); - auto tmp = (main_sel_first * kernel_nullifier_exists_write_offset); + auto tmp = (main_sel_op_nullifier_exists * + (kernel_kernel_out_offset - + ((main_ib * (kernel_nullifier_exists_write_offset + FF(16))) + + ((-main_ib + FF(1)) * (kernel_nullifier_non_exists_write_offset + FF(32)))))); tmp *= scaling_factor; std::get<131>(evals) += tmp; } // Contribution 132 { Avm_DECLARE_VIEWS(132); - auto tmp = (main_sel_first * kernel_nullifier_non_exists_write_offset); + auto tmp = (main_sel_first * kernel_nullifier_exists_write_offset); tmp *= scaling_factor; std::get<132>(evals) += tmp; } // Contribution 133 { Avm_DECLARE_VIEWS(133); - auto tmp = (main_sel_op_emit_nullifier * - (kernel_kernel_out_offset - (kernel_emit_nullifier_write_offset + FF(144)))); + auto tmp = (main_sel_first * kernel_nullifier_non_exists_write_offset); tmp *= scaling_factor; std::get<133>(evals) += tmp; } // Contribution 134 { Avm_DECLARE_VIEWS(134); - auto tmp = (main_sel_first * kernel_emit_nullifier_write_offset); + auto tmp = (main_sel_op_emit_nullifier * + (kernel_kernel_out_offset - (kernel_emit_nullifier_write_offset + FF(144)))); tmp *= scaling_factor; std::get<134>(evals) += tmp; } // Contribution 135 { Avm_DECLARE_VIEWS(135); - auto tmp = (main_sel_op_l1_to_l2_msg_exists * - (kernel_kernel_out_offset - (kernel_l1_to_l2_msg_exists_write_offset + FF(48)))); + auto tmp = (main_sel_first * kernel_emit_nullifier_write_offset); tmp *= scaling_factor; std::get<135>(evals) += tmp; } // Contribution 136 { Avm_DECLARE_VIEWS(136); - auto tmp = (main_sel_first * kernel_l1_to_l2_msg_exists_write_offset); + auto tmp = (main_sel_op_l1_to_l2_msg_exists * + (kernel_kernel_out_offset - (kernel_l1_to_l2_msg_exists_write_offset + FF(48)))); tmp *= scaling_factor; std::get<136>(evals) += tmp; } // Contribution 137 { Avm_DECLARE_VIEWS(137); - auto tmp = (main_sel_op_emit_unencrypted_log * - (kernel_kernel_out_offset - (kernel_emit_unencrypted_log_write_offset + FF(162)))); + auto tmp = (main_sel_first * kernel_l1_to_l2_msg_exists_write_offset); tmp *= scaling_factor; std::get<137>(evals) += tmp; } // Contribution 138 { Avm_DECLARE_VIEWS(138); - auto tmp = (main_sel_first * kernel_emit_unencrypted_log_write_offset); + auto tmp = (main_sel_op_emit_unencrypted_log * + (kernel_kernel_out_offset - (kernel_emit_unencrypted_log_write_offset + FF(162)))); tmp *= scaling_factor; std::get<138>(evals) += tmp; } // Contribution 139 { Avm_DECLARE_VIEWS(139); - auto tmp = (main_sel_op_emit_l2_to_l1_msg * - (kernel_kernel_out_offset - (kernel_emit_l2_to_l1_msg_write_offset + FF(160)))); + auto tmp = (main_sel_first * kernel_emit_unencrypted_log_write_offset); tmp *= scaling_factor; std::get<139>(evals) += tmp; } // Contribution 140 { Avm_DECLARE_VIEWS(140); - auto tmp = (main_sel_first * kernel_emit_l2_to_l1_msg_write_offset); + auto tmp = (main_sel_op_emit_l2_to_l1_msg * + (kernel_kernel_out_offset - (kernel_emit_l2_to_l1_msg_write_offset + FF(160)))); tmp *= scaling_factor; std::get<140>(evals) += tmp; } // Contribution 141 { Avm_DECLARE_VIEWS(141); - auto tmp = (main_sel_op_sload * (kernel_kernel_out_offset - (kernel_sload_write_offset + FF(96)))); + auto tmp = (main_sel_first * kernel_emit_l2_to_l1_msg_write_offset); tmp *= scaling_factor; std::get<141>(evals) += tmp; } // Contribution 142 { Avm_DECLARE_VIEWS(142); - auto tmp = (main_sel_first * kernel_sload_write_offset); + auto tmp = (main_sel_op_sload * (kernel_kernel_out_offset - (kernel_sload_write_offset + FF(96)))); tmp *= scaling_factor; std::get<142>(evals) += tmp; } // Contribution 143 { Avm_DECLARE_VIEWS(143); - auto tmp = (main_sel_op_sstore * (kernel_kernel_out_offset - (kernel_sstore_write_offset + FF(64)))); + auto tmp = (main_sel_first * kernel_sload_write_offset); tmp *= scaling_factor; std::get<143>(evals) += tmp; } // Contribution 144 { Avm_DECLARE_VIEWS(144); - auto tmp = (main_sel_first * kernel_sstore_write_offset); + auto tmp = (main_sel_op_sstore * (kernel_kernel_out_offset - (kernel_sstore_write_offset + FF(64)))); tmp *= scaling_factor; std::get<144>(evals) += tmp; } // Contribution 145 { Avm_DECLARE_VIEWS(145); + auto tmp = (main_sel_first * kernel_sstore_write_offset); + tmp *= scaling_factor; + std::get<145>(evals) += tmp; + } + // Contribution 146 + { + Avm_DECLARE_VIEWS(146); auto tmp = (((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + main_sel_op_emit_nullifier) + @@ -1433,21 +1445,21 @@ template class mainImpl { main_sel_op_emit_l2_to_l1_msg) * (kernel_side_effect_counter_shift - (kernel_side_effect_counter + FF(1)))); tmp *= scaling_factor; - std::get<145>(evals) += tmp; + std::get<146>(evals) += tmp; } - // Contribution 146 + // Contribution 147 { - Avm_DECLARE_VIEWS(146); + Avm_DECLARE_VIEWS(147); auto tmp = (main_bin_op_id - (main_sel_op_or + (main_sel_op_xor * FF(2)))); tmp *= scaling_factor; - std::get<146>(evals) += tmp; + std::get<147>(evals) += tmp; } - // Contribution 147 + // Contribution 148 { - Avm_DECLARE_VIEWS(147); + Avm_DECLARE_VIEWS(148); auto tmp = (main_sel_bin - ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)); tmp *= scaling_factor; - std::get<147>(evals) += tmp; + std::get<148>(evals) += tmp; } } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp index 232d79fe190..4d6142eb31e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp @@ -28,6 +28,7 @@ template struct MemRow { FF mem_sel_op_a{}; FF mem_sel_op_b{}; FF mem_sel_op_c{}; + FF mem_sel_op_cd{}; FF mem_sel_op_cmov{}; FF mem_sel_op_d{}; FF mem_sel_resolve_ind_addr_a{}; @@ -50,39 +51,39 @@ template struct MemRow { inline std::string get_relation_label_mem(int index) { switch (index) { - case 14: - return "MEM_CONTIGUOUS"; case 15: - return "MEM_FIRST_EMPTY"; + return "MEM_CONTIGUOUS"; case 16: + return "MEM_FIRST_EMPTY"; + case 17: return "MEM_LAST"; - case 18: - return "TIMESTAMP"; case 19: - return "GLOBAL_ADDR"; + return "TIMESTAMP"; case 20: - return "LAST_ACCESS_FIRST_ROW"; + return "GLOBAL_ADDR"; case 21: - return "MEM_LAST_ACCESS_DELIMITER"; + return "LAST_ACCESS_FIRST_ROW"; case 22: - return "DIFF_RNG_CHK_DEC"; + return "MEM_LAST_ACCESS_DELIMITER"; case 23: - return "MEM_READ_WRITE_VAL_CONSISTENCY"; + return "DIFF_RNG_CHK_DEC"; case 24: - return "MEM_READ_WRITE_TAG_CONSISTENCY"; + return "MEM_READ_WRITE_VAL_CONSISTENCY"; case 25: - return "MEM_ZERO_INIT"; + return "MEM_READ_WRITE_TAG_CONSISTENCY"; case 26: - return "SKIP_CHECK_TAG"; + return "MEM_ZERO_INIT"; case 27: - return "MEM_IN_TAG_CONSISTENCY_1"; + return "SKIP_CHECK_TAG"; case 28: - return "MEM_IN_TAG_CONSISTENCY_2"; + return "MEM_IN_TAG_CONSISTENCY_1"; case 29: + return "MEM_IN_TAG_CONSISTENCY_2"; + case 30: return "NO_TAG_ERR_WRITE_OR_SKIP"; - case 31: + case 32: return "NO_TAG_ERR_WRITE"; - case 40: + case 43: return "MOV_SAME_TAG"; } return std::to_string(index); @@ -92,9 +93,9 @@ template class memImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, - 4, 3, 4, 3, 4, 3, 3, 3, 4, 4, 4, 4, 4, 6, - 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; + 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, 4, 3, 3, 3, 4, 4, 4, 4, 4, 6, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; template void static accumulate(ContainerOverSubrelations& evals, @@ -161,81 +162,89 @@ template class memImpl { // Contribution 8 { Avm_DECLARE_VIEWS(8); - auto tmp = (mem_sel_resolve_ind_addr_a * (-mem_sel_resolve_ind_addr_a + FF(1))); + auto tmp = (mem_sel_op_cd * (-mem_sel_op_cd + FF(1))); tmp *= scaling_factor; std::get<8>(evals) += tmp; } // Contribution 9 { Avm_DECLARE_VIEWS(9); - auto tmp = (mem_sel_resolve_ind_addr_b * (-mem_sel_resolve_ind_addr_b + FF(1))); + auto tmp = (mem_sel_resolve_ind_addr_a * (-mem_sel_resolve_ind_addr_a + FF(1))); tmp *= scaling_factor; std::get<9>(evals) += tmp; } // Contribution 10 { Avm_DECLARE_VIEWS(10); - auto tmp = (mem_sel_resolve_ind_addr_c * (-mem_sel_resolve_ind_addr_c + FF(1))); + auto tmp = (mem_sel_resolve_ind_addr_b * (-mem_sel_resolve_ind_addr_b + FF(1))); tmp *= scaling_factor; std::get<10>(evals) += tmp; } // Contribution 11 { Avm_DECLARE_VIEWS(11); - auto tmp = (mem_sel_resolve_ind_addr_d * (-mem_sel_resolve_ind_addr_d + FF(1))); + auto tmp = (mem_sel_resolve_ind_addr_c * (-mem_sel_resolve_ind_addr_c + FF(1))); tmp *= scaling_factor; std::get<11>(evals) += tmp; } // Contribution 12 { Avm_DECLARE_VIEWS(12); - auto tmp = - (mem_sel_mem - - (((((((mem_sel_op_a + mem_sel_op_b) + mem_sel_op_c) + mem_sel_op_d) + mem_sel_resolve_ind_addr_a) + - mem_sel_resolve_ind_addr_b) + - mem_sel_resolve_ind_addr_c) + - mem_sel_resolve_ind_addr_d)); + auto tmp = (mem_sel_resolve_ind_addr_d * (-mem_sel_resolve_ind_addr_d + FF(1))); tmp *= scaling_factor; std::get<12>(evals) += tmp; } // Contribution 13 { Avm_DECLARE_VIEWS(13); - auto tmp = (mem_sel_mem * (mem_sel_mem - FF(1))); + auto tmp = + (mem_sel_mem - + ((((((((mem_sel_op_a + mem_sel_op_b) + mem_sel_op_c) + mem_sel_op_d) + 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_op_cd)); tmp *= scaling_factor; std::get<13>(evals) += tmp; } // Contribution 14 { Avm_DECLARE_VIEWS(14); - auto tmp = (((-main_sel_first + FF(1)) * mem_sel_mem_shift) * (-mem_sel_mem + FF(1))); + auto tmp = (mem_sel_mem * (mem_sel_mem - FF(1))); tmp *= scaling_factor; std::get<14>(evals) += tmp; } // Contribution 15 { Avm_DECLARE_VIEWS(15); - auto tmp = (main_sel_first * mem_sel_mem); + auto tmp = (((-main_sel_first + FF(1)) * mem_sel_mem_shift) * (-mem_sel_mem + FF(1))); tmp *= scaling_factor; std::get<15>(evals) += tmp; } // Contribution 16 { Avm_DECLARE_VIEWS(16); - auto tmp = (((-mem_last + FF(1)) * mem_sel_mem) * (-mem_sel_mem_shift + FF(1))); + auto tmp = (main_sel_first * mem_sel_mem); tmp *= scaling_factor; std::get<16>(evals) += tmp; } // Contribution 17 { Avm_DECLARE_VIEWS(17); - auto tmp = (mem_sel_rng_chk - (mem_sel_mem * (-mem_last + FF(1)))); + auto tmp = (((-mem_last + FF(1)) * mem_sel_mem) * (-mem_sel_mem_shift + FF(1))); tmp *= scaling_factor; std::get<17>(evals) += tmp; } // Contribution 18 { Avm_DECLARE_VIEWS(18); + auto tmp = (mem_sel_rng_chk - (mem_sel_mem * (-mem_last + FF(1)))); + tmp *= scaling_factor; + std::get<18>(evals) += tmp; + } + // Contribution 19 + { + Avm_DECLARE_VIEWS(19); auto tmp = (mem_tsp - ((mem_clk * FF(12)) + @@ -249,169 +258,183 @@ template class memImpl { mem_rw) * FF(4)))))); tmp *= scaling_factor; - std::get<18>(evals) += tmp; - } - // Contribution 19 - { - Avm_DECLARE_VIEWS(19); - auto tmp = (mem_glob_addr - ((mem_space_id * FF(4294967296UL)) + mem_addr)); - tmp *= scaling_factor; std::get<19>(evals) += tmp; } // Contribution 20 { Avm_DECLARE_VIEWS(20); - auto tmp = (main_sel_first * (-mem_lastAccess + FF(1))); + auto tmp = (mem_glob_addr - ((mem_space_id * FF(4294967296UL)) + mem_addr)); tmp *= scaling_factor; std::get<20>(evals) += tmp; } // Contribution 21 { Avm_DECLARE_VIEWS(21); - auto tmp = ((-mem_lastAccess + FF(1)) * (mem_glob_addr_shift - mem_glob_addr)); + auto tmp = (main_sel_first * (-mem_lastAccess + FF(1))); tmp *= scaling_factor; std::get<21>(evals) += tmp; } // Contribution 22 { Avm_DECLARE_VIEWS(22); - auto tmp = (mem_sel_rng_chk * (((((mem_lastAccess * (mem_glob_addr_shift - mem_glob_addr)) + - ((-mem_lastAccess + FF(1)) * (mem_tsp_shift - mem_tsp))) - - (mem_diff_hi * FF(4294967296UL))) - - (mem_diff_mid * FF(65536))) - - mem_diff_lo)); + auto tmp = ((-mem_lastAccess + FF(1)) * (mem_glob_addr_shift - mem_glob_addr)); tmp *= scaling_factor; std::get<22>(evals) += tmp; } // Contribution 23 { Avm_DECLARE_VIEWS(23); - auto tmp = (((-mem_lastAccess + FF(1)) * (-mem_rw_shift + FF(1))) * (mem_val_shift - mem_val)); + auto tmp = (mem_sel_rng_chk * (((((mem_lastAccess * (mem_glob_addr_shift - mem_glob_addr)) + + ((-mem_lastAccess + FF(1)) * (mem_tsp_shift - mem_tsp))) - + (mem_diff_hi * FF(4294967296UL))) - + (mem_diff_mid * FF(65536))) - + mem_diff_lo)); tmp *= scaling_factor; std::get<23>(evals) += tmp; } // Contribution 24 { Avm_DECLARE_VIEWS(24); - auto tmp = (((-mem_lastAccess + FF(1)) * (-mem_rw_shift + FF(1))) * (mem_tag_shift - mem_tag)); + auto tmp = (((-mem_lastAccess + FF(1)) * (-mem_rw_shift + FF(1))) * (mem_val_shift - mem_val)); tmp *= scaling_factor; std::get<24>(evals) += tmp; } // Contribution 25 { Avm_DECLARE_VIEWS(25); - auto tmp = ((mem_lastAccess * (-mem_rw_shift + FF(1))) * mem_val_shift); + auto tmp = (((-mem_lastAccess + FF(1)) * (-mem_rw_shift + FF(1))) * (mem_tag_shift - mem_tag)); tmp *= scaling_factor; std::get<25>(evals) += tmp; } // Contribution 26 { Avm_DECLARE_VIEWS(26); - auto tmp = (mem_skip_check_tag - - (mem_sel_op_cmov * ((mem_sel_op_d + (mem_sel_op_a * (-mem_sel_mov_ia_to_ic + FF(1)))) + - (mem_sel_op_b * (-mem_sel_mov_ib_to_ic + FF(1)))))); + auto tmp = ((mem_lastAccess * (-mem_rw_shift + FF(1))) * mem_val_shift); tmp *= scaling_factor; std::get<26>(evals) += tmp; } // Contribution 27 { Avm_DECLARE_VIEWS(27); - auto tmp = (((mem_tag * (-mem_skip_check_tag + FF(1))) * (-mem_rw + FF(1))) * - (((mem_r_in_tag - mem_tag) * (-mem_one_min_inv + FF(1))) - mem_tag_err)); + auto tmp = (mem_skip_check_tag - + (mem_sel_op_cmov * ((mem_sel_op_d + (mem_sel_op_a * (-mem_sel_mov_ia_to_ic + FF(1)))) + + (mem_sel_op_b * (-mem_sel_mov_ib_to_ic + FF(1)))))); tmp *= scaling_factor; std::get<27>(evals) += tmp; } // Contribution 28 { Avm_DECLARE_VIEWS(28); - auto tmp = ((mem_tag * (-mem_tag_err + FF(1))) * mem_one_min_inv); + auto tmp = (((mem_tag * (-mem_skip_check_tag + FF(1))) * (-mem_rw + FF(1))) * + (((mem_r_in_tag - mem_tag) * (-mem_one_min_inv + FF(1))) - mem_tag_err)); tmp *= scaling_factor; std::get<28>(evals) += tmp; } // Contribution 29 { Avm_DECLARE_VIEWS(29); - auto tmp = ((mem_skip_check_tag + mem_rw) * mem_tag_err); + auto tmp = ((mem_tag * (-mem_tag_err + FF(1))) * mem_one_min_inv); tmp *= scaling_factor; std::get<29>(evals) += tmp; } // Contribution 30 { Avm_DECLARE_VIEWS(30); - auto tmp = (mem_rw * (mem_w_in_tag - mem_tag)); + auto tmp = ((mem_skip_check_tag + mem_rw) * mem_tag_err); tmp *= scaling_factor; std::get<30>(evals) += tmp; } // Contribution 31 { Avm_DECLARE_VIEWS(31); - auto tmp = (mem_rw * mem_tag_err); + auto tmp = (mem_rw * (mem_w_in_tag - mem_tag)); tmp *= scaling_factor; std::get<31>(evals) += tmp; } // Contribution 32 { Avm_DECLARE_VIEWS(32); - auto tmp = (mem_sel_resolve_ind_addr_a * (mem_r_in_tag - FF(3))); + auto tmp = (mem_rw * mem_tag_err); tmp *= scaling_factor; std::get<32>(evals) += tmp; } // Contribution 33 { Avm_DECLARE_VIEWS(33); - auto tmp = (mem_sel_resolve_ind_addr_b * (mem_r_in_tag - FF(3))); + auto tmp = (mem_sel_resolve_ind_addr_a * (mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<33>(evals) += tmp; } // Contribution 34 { Avm_DECLARE_VIEWS(34); - auto tmp = (mem_sel_resolve_ind_addr_c * (mem_r_in_tag - FF(3))); + auto tmp = (mem_sel_resolve_ind_addr_b * (mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<34>(evals) += tmp; } // Contribution 35 { Avm_DECLARE_VIEWS(35); - auto tmp = (mem_sel_resolve_ind_addr_d * (mem_r_in_tag - FF(3))); + auto tmp = (mem_sel_resolve_ind_addr_c * (mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<35>(evals) += tmp; } // Contribution 36 { Avm_DECLARE_VIEWS(36); - auto tmp = (mem_sel_resolve_ind_addr_a * mem_rw); + auto tmp = (mem_sel_resolve_ind_addr_d * (mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<36>(evals) += tmp; } // Contribution 37 { Avm_DECLARE_VIEWS(37); - auto tmp = (mem_sel_resolve_ind_addr_b * mem_rw); + auto tmp = (mem_sel_resolve_ind_addr_a * mem_rw); tmp *= scaling_factor; std::get<37>(evals) += tmp; } // Contribution 38 { Avm_DECLARE_VIEWS(38); - auto tmp = (mem_sel_resolve_ind_addr_c * mem_rw); + auto tmp = (mem_sel_resolve_ind_addr_b * mem_rw); tmp *= scaling_factor; std::get<38>(evals) += tmp; } // Contribution 39 { Avm_DECLARE_VIEWS(39); - auto tmp = (mem_sel_resolve_ind_addr_d * mem_rw); + auto tmp = (mem_sel_resolve_ind_addr_c * mem_rw); tmp *= scaling_factor; std::get<39>(evals) += tmp; } // Contribution 40 { Avm_DECLARE_VIEWS(40); - auto tmp = ((mem_sel_mov_ia_to_ic + mem_sel_mov_ib_to_ic) * mem_tag_err); + auto tmp = (mem_sel_resolve_ind_addr_d * mem_rw); tmp *= scaling_factor; std::get<40>(evals) += tmp; } + // Contribution 41 + { + Avm_DECLARE_VIEWS(41); + auto tmp = (mem_sel_op_cd * (mem_rw - FF(1))); + tmp *= scaling_factor; + std::get<41>(evals) += tmp; + } + // Contribution 42 + { + Avm_DECLARE_VIEWS(42); + auto tmp = (mem_sel_op_cd * (mem_w_in_tag - FF(6))); + tmp *= scaling_factor; + std::get<42>(evals) += tmp; + } + // Contribution 43 + { + Avm_DECLARE_VIEWS(43); + auto tmp = ((mem_sel_mov_ia_to_ic + mem_sel_mov_ib_to_ic) * mem_tag_err); + tmp *= scaling_factor; + std::get<43>(evals) += tmp; + } } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp new file mode 100644 index 00000000000..f4a0e2f9fbf --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp @@ -0,0 +1,104 @@ +#pragma once + +#include "barretenberg/relations/generated/avm/declare_views.hpp" +#include "barretenberg/relations/relation_parameters.hpp" +#include "barretenberg/relations/relation_types.hpp" + +namespace bb::Avm_vm { + +template struct MemSliceRow { + FF slice_addr{}; + FF slice_addr_shift{}; + FF slice_cd_offset{}; + FF slice_cd_offset_shift{}; + FF slice_cnt{}; + FF slice_cnt_shift{}; + FF slice_one_min_inv{}; + FF slice_sel_cd{}; + FF slice_sel_start_cd{}; +}; + +inline std::string get_relation_label_mem_slice(int index) +{ + switch (index) { + case 2: + return "SLICE_CNT_ZERO_TEST1"; + case 3: + return "SLICE_CNT_ZERO_TEST2"; + case 4: + return "SLICE_CNT_DECREMENT"; + case 5: + return "ADDR_CNT_INCREMENT"; + case 6: + return "CD_OFFSET_INCREMENT"; + } + return std::to_string(index); +} + +template class mem_sliceImpl { + public: + using FF = FF_; + + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 3 }; + + template + void static accumulate(ContainerOverSubrelations& evals, + const AllEntities& new_term, + [[maybe_unused]] const RelationParameters&, + [[maybe_unused]] const FF& scaling_factor) + { + // Contribution 0 + { + Avm_DECLARE_VIEWS(0); + auto tmp = (slice_sel_cd * (-slice_sel_cd + FF(1))); + tmp *= scaling_factor; + std::get<0>(evals) += tmp; + } + // Contribution 1 + { + Avm_DECLARE_VIEWS(1); + auto tmp = (slice_sel_start_cd * (-slice_sel_start_cd + FF(1))); + tmp *= scaling_factor; + std::get<1>(evals) += tmp; + } + // Contribution 2 + { + Avm_DECLARE_VIEWS(2); + auto tmp = ((slice_cnt * (-slice_one_min_inv + FF(1))) - slice_sel_cd); + tmp *= scaling_factor; + std::get<2>(evals) += tmp; + } + // Contribution 3 + { + Avm_DECLARE_VIEWS(3); + auto tmp = ((-slice_sel_cd + FF(1)) * slice_one_min_inv); + tmp *= scaling_factor; + std::get<3>(evals) += tmp; + } + // Contribution 4 + { + Avm_DECLARE_VIEWS(4); + auto tmp = (slice_sel_cd * ((slice_cnt - FF(1)) - slice_cnt_shift)); + tmp *= scaling_factor; + std::get<4>(evals) += tmp; + } + // Contribution 5 + { + Avm_DECLARE_VIEWS(5); + auto tmp = (slice_sel_cd * ((slice_addr + FF(1)) - slice_addr_shift)); + tmp *= scaling_factor; + std::get<5>(evals) += tmp; + } + // Contribution 6 + { + Avm_DECLARE_VIEWS(6); + auto tmp = (slice_sel_cd * ((slice_cd_offset + FF(1)) - slice_cd_offset_shift)); + tmp *= scaling_factor; + std::get<6>(evals) += tmp; + } + } +}; + +template using mem_slice = Relation>; + +} // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp new file mode 100644 index 00000000000..9cdecefd1f0 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp @@ -0,0 +1,101 @@ + + +#pragma once + +#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" + +#include +#include + +namespace bb { + +class perm_cd_mem_permutation_settings { + public: + // This constant defines how many columns are bundled together to form each set. + constexpr static size_t COLUMNS_PER_SET = 4; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) + { + return (in.slice_sel_cd == 1 || in.mem_sel_op_cd == 1); + } + + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_const_entities(const AllEntities& in) + { + + return std::forward_as_tuple(in.perm_cd_mem, + in.slice_sel_cd, + in.slice_sel_cd, + in.mem_sel_op_cd, + in.slice_clk, + in.slice_space_id, + in.slice_addr, + in.slice_val, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); + } + + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_nonconst_entities(AllEntities& in) + { + + return std::forward_as_tuple(in.perm_cd_mem, + in.slice_sel_cd, + in.slice_sel_cd, + in.mem_sel_op_cd, + in.slice_clk, + in.slice_space_id, + in.slice_addr, + in.slice_val, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); + } +}; + +template using perm_cd_mem_relation = GenericPermutationRelation; +template using perm_cd_mem = GenericPermutation; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp new file mode 100644 index 00000000000..2eedfe53bf1 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp @@ -0,0 +1,98 @@ + + +#pragma once + +#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" + +#include +#include + +namespace bb { + +class perm_main_cd_copy_permutation_settings { + public: + // This constant defines how many columns are bundled together to form each set. + constexpr static size_t COLUMNS_PER_SET = 3; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) + { + return (in.main_sel_op_calldata_copy == 1 || in.slice_sel_start_cd == 1); + } + + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_const_entities(const AllEntities& in) + { + + return std::forward_as_tuple(in.perm_main_cd_copy, + in.main_sel_op_calldata_copy, + in.main_sel_op_calldata_copy, + in.slice_sel_start_cd, + in.main_ia, + in.main_ib, + in.main_mem_addr_c, + in.slice_cd_offset, + in.slice_cnt, + in.slice_addr); + } + + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_nonconst_entities(AllEntities& in) + { + + return std::forward_as_tuple(in.perm_main_cd_copy, + in.main_sel_op_calldata_copy, + in.main_sel_op_calldata_copy, + in.slice_sel_start_cd, + in.main_ia, + in.main_ib, + in.main_mem_addr_c, + in.slice_cd_offset, + in.slice_cnt, + in.slice_addr); + } +}; + +template +using perm_main_cd_copy_relation = GenericPermutationRelation; +template using perm_main_cd_copy = GenericPermutation; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index 2bfabec7273..01a98d02e5a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -19,6 +19,419 @@ namespace bb { +<<<<<<< HEAD +======= +template struct AvmFullRow { + FF main_clk{}; + FF main_sel_first{}; + FF kernel_kernel_inputs{}; + FF kernel_kernel_value_out{}; + FF kernel_kernel_side_effect_out{}; + FF kernel_kernel_metadata_out{}; + FF main_calldata{}; + FF alu_a_hi{}; + FF alu_a_lo{}; + FF alu_b_hi{}; + FF alu_b_lo{}; + FF alu_borrow{}; + FF alu_cf{}; + FF alu_clk{}; + FF alu_cmp_rng_ctr{}; + FF alu_div_u16_r0{}; + FF alu_div_u16_r1{}; + FF alu_div_u16_r2{}; + FF alu_div_u16_r3{}; + FF alu_div_u16_r4{}; + FF alu_div_u16_r5{}; + FF alu_div_u16_r6{}; + FF alu_div_u16_r7{}; + FF alu_divisor_hi{}; + FF alu_divisor_lo{}; + FF alu_ff_tag{}; + FF alu_ia{}; + FF alu_ib{}; + FF alu_ic{}; + FF alu_in_tag{}; + FF alu_op_add{}; + FF alu_op_cast{}; + FF alu_op_cast_prev{}; + FF alu_op_div{}; + FF alu_op_div_a_lt_b{}; + FF alu_op_div_std{}; + FF alu_op_eq{}; + FF alu_op_eq_diff_inv{}; + FF alu_op_lt{}; + FF alu_op_lte{}; + FF alu_op_mul{}; + FF alu_op_not{}; + FF alu_op_shl{}; + FF alu_op_shr{}; + FF alu_op_sub{}; + FF alu_p_a_borrow{}; + FF alu_p_b_borrow{}; + FF alu_p_sub_a_hi{}; + FF alu_p_sub_a_lo{}; + FF alu_p_sub_b_hi{}; + FF alu_p_sub_b_lo{}; + FF alu_partial_prod_hi{}; + FF alu_partial_prod_lo{}; + FF alu_quotient_hi{}; + FF alu_quotient_lo{}; + FF alu_remainder{}; + FF alu_res_hi{}; + FF alu_res_lo{}; + FF alu_sel_alu{}; + FF alu_sel_cmp{}; + FF alu_sel_div_rng_chk{}; + FF alu_sel_rng_chk{}; + FF alu_sel_rng_chk_lookup{}; + FF alu_sel_shift_which{}; + FF alu_shift_lt_bit_len{}; + FF alu_t_sub_s_bits{}; + FF alu_two_pow_s{}; + FF alu_two_pow_t_sub_s{}; + FF alu_u128_tag{}; + FF alu_u16_r0{}; + FF alu_u16_r1{}; + FF alu_u16_r10{}; + FF alu_u16_r11{}; + FF alu_u16_r12{}; + FF alu_u16_r13{}; + FF alu_u16_r14{}; + FF alu_u16_r2{}; + FF alu_u16_r3{}; + FF alu_u16_r4{}; + FF alu_u16_r5{}; + FF alu_u16_r6{}; + FF alu_u16_r7{}; + FF alu_u16_r8{}; + FF alu_u16_r9{}; + FF alu_u16_tag{}; + FF alu_u32_tag{}; + FF alu_u64_tag{}; + FF alu_u8_r0{}; + FF alu_u8_r1{}; + FF alu_u8_tag{}; + FF binary_acc_ia{}; + FF binary_acc_ib{}; + FF binary_acc_ic{}; + FF binary_clk{}; + FF binary_ia_bytes{}; + FF binary_ib_bytes{}; + FF binary_ic_bytes{}; + FF binary_in_tag{}; + FF binary_mem_tag_ctr{}; + FF binary_mem_tag_ctr_inv{}; + FF binary_op_id{}; + FF binary_sel_bin{}; + FF binary_start{}; + FF byte_lookup_sel_bin{}; + FF byte_lookup_table_byte_lengths{}; + FF byte_lookup_table_in_tags{}; + FF byte_lookup_table_input_a{}; + FF byte_lookup_table_input_b{}; + FF byte_lookup_table_op_id{}; + FF byte_lookup_table_output{}; + FF conversion_clk{}; + FF conversion_input{}; + FF conversion_num_limbs{}; + FF conversion_radix{}; + FF conversion_sel_to_radix_le{}; + FF gas_da_gas_fixed_table{}; + FF gas_l2_gas_fixed_table{}; + FF gas_sel_gas_cost{}; + FF keccakf1600_clk{}; + FF keccakf1600_input{}; + FF keccakf1600_output{}; + FF keccakf1600_sel_keccakf1600{}; + FF kernel_emit_l2_to_l1_msg_write_offset{}; + FF kernel_emit_note_hash_write_offset{}; + FF kernel_emit_nullifier_write_offset{}; + FF kernel_emit_unencrypted_log_write_offset{}; + FF kernel_kernel_in_offset{}; + FF kernel_kernel_out_offset{}; + FF kernel_l1_to_l2_msg_exists_write_offset{}; + FF kernel_note_hash_exist_write_offset{}; + FF kernel_nullifier_exists_write_offset{}; + FF kernel_nullifier_non_exists_write_offset{}; + FF kernel_q_public_input_kernel_add_to_table{}; + FF kernel_q_public_input_kernel_out_add_to_table{}; + FF kernel_side_effect_counter{}; + FF kernel_sload_write_offset{}; + FF kernel_sstore_write_offset{}; + FF main_abs_da_rem_gas_hi{}; + FF main_abs_da_rem_gas_lo{}; + FF main_abs_l2_rem_gas_hi{}; + FF main_abs_l2_rem_gas_lo{}; + FF main_alu_in_tag{}; + FF main_bin_op_id{}; + FF main_call_ptr{}; + FF main_da_gas_op_cost{}; + FF main_da_gas_remaining{}; + FF main_da_out_of_gas{}; + FF main_ia{}; + FF main_ib{}; + FF main_ic{}; + FF main_id{}; + FF main_id_zero{}; + FF main_ind_addr_a{}; + FF main_ind_addr_b{}; + FF main_ind_addr_c{}; + FF main_ind_addr_d{}; + FF main_internal_return_ptr{}; + FF main_inv{}; + FF main_l2_gas_op_cost{}; + FF main_l2_gas_remaining{}; + FF main_l2_out_of_gas{}; + FF main_mem_addr_a{}; + FF main_mem_addr_b{}; + FF main_mem_addr_c{}; + FF main_mem_addr_d{}; + FF main_op_err{}; + FF main_opcode_val{}; + FF main_pc{}; + FF main_r_in_tag{}; + FF main_rwa{}; + FF main_rwb{}; + FF main_rwc{}; + FF main_rwd{}; + FF main_sel_alu{}; + FF main_sel_bin{}; + FF main_sel_cd{}; + FF main_sel_gas_accounting_active{}; + FF main_sel_last{}; + FF main_sel_mem_op_a{}; + FF main_sel_mem_op_activate_gas{}; + FF main_sel_mem_op_b{}; + FF main_sel_mem_op_c{}; + FF main_sel_mem_op_d{}; + FF main_sel_mov_ia_to_ic{}; + FF main_sel_mov_ib_to_ic{}; + FF main_sel_op_add{}; + FF main_sel_op_address{}; + FF main_sel_op_and{}; + FF main_sel_op_block_number{}; + 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_coinbase{}; + FF main_sel_op_dagasleft{}; + FF main_sel_op_div{}; + FF main_sel_op_emit_l2_to_l1_msg{}; + FF main_sel_op_emit_note_hash{}; + FF main_sel_op_emit_nullifier{}; + FF main_sel_op_emit_unencrypted_log{}; + FF main_sel_op_eq{}; + FF main_sel_op_external_call{}; + FF main_sel_op_fdiv{}; + FF main_sel_op_fee_per_da_gas{}; + FF main_sel_op_fee_per_l2_gas{}; + FF main_sel_op_function_selector{}; + FF main_sel_op_get_contract_instance{}; + FF main_sel_op_halt{}; + FF main_sel_op_internal_call{}; + FF main_sel_op_internal_return{}; + FF main_sel_op_jump{}; + FF main_sel_op_jumpi{}; + FF main_sel_op_keccak{}; + FF main_sel_op_l1_to_l2_msg_exists{}; + FF main_sel_op_l2gasleft{}; + FF main_sel_op_lt{}; + FF main_sel_op_lte{}; + FF main_sel_op_mov{}; + FF main_sel_op_mul{}; + FF main_sel_op_not{}; + FF main_sel_op_note_hash_exists{}; + FF main_sel_op_nullifier_exists{}; + FF main_sel_op_or{}; + FF main_sel_op_pedersen{}; + FF main_sel_op_poseidon2{}; + FF main_sel_op_radix_le{}; + FF main_sel_op_sender{}; + FF main_sel_op_sha256{}; + FF main_sel_op_shl{}; + FF main_sel_op_shr{}; + FF main_sel_op_sload{}; + FF main_sel_op_sstore{}; + FF main_sel_op_storage_address{}; + FF main_sel_op_sub{}; + FF main_sel_op_timestamp{}; + FF main_sel_op_transaction_fee{}; + FF main_sel_op_version{}; + FF main_sel_op_xor{}; + FF main_sel_q_kernel_lookup{}; + FF main_sel_q_kernel_output_lookup{}; + FF main_sel_resolve_ind_addr_a{}; + FF main_sel_resolve_ind_addr_b{}; + FF main_sel_resolve_ind_addr_c{}; + FF main_sel_resolve_ind_addr_d{}; + FF main_sel_rng_16{}; + FF main_sel_rng_8{}; + FF main_space_id{}; + FF main_tag_err{}; + FF main_w_in_tag{}; + FF mem_addr{}; + FF mem_clk{}; + FF mem_diff_hi{}; + FF mem_diff_lo{}; + FF mem_diff_mid{}; + FF mem_glob_addr{}; + FF mem_last{}; + FF mem_lastAccess{}; + FF mem_one_min_inv{}; + FF mem_r_in_tag{}; + FF mem_rw{}; + FF mem_sel_mem{}; + FF mem_sel_mov_ia_to_ic{}; + FF mem_sel_mov_ib_to_ic{}; + FF mem_sel_op_a{}; + FF mem_sel_op_b{}; + FF mem_sel_op_c{}; + FF mem_sel_op_cd{}; + FF mem_sel_op_cmov{}; + FF mem_sel_op_d{}; + FF mem_sel_resolve_ind_addr_a{}; + FF mem_sel_resolve_ind_addr_b{}; + FF mem_sel_resolve_ind_addr_c{}; + FF mem_sel_resolve_ind_addr_d{}; + FF mem_sel_rng_chk{}; + FF mem_skip_check_tag{}; + FF mem_space_id{}; + FF mem_tag{}; + FF mem_tag_err{}; + FF mem_tsp{}; + FF mem_val{}; + FF mem_w_in_tag{}; + FF pedersen_clk{}; + FF pedersen_input{}; + FF pedersen_output{}; + FF pedersen_sel_pedersen{}; + FF poseidon2_clk{}; + FF poseidon2_input{}; + FF poseidon2_output{}; + FF poseidon2_sel_poseidon_perm{}; + FF powers_power_of_2{}; + FF sha256_clk{}; + FF sha256_input{}; + FF sha256_output{}; + FF sha256_sel_sha256_compression{}; + FF sha256_state{}; + FF slice_addr{}; + FF slice_cd_offset{}; + FF slice_clk{}; + FF slice_cnt{}; + FF slice_one_min_inv{}; + FF slice_sel_cd{}; + FF slice_sel_start_cd{}; + FF slice_space_id{}; + FF slice_val{}; + FF perm_cd_mem{}; + FF perm_main_alu{}; + FF perm_main_bin{}; + FF perm_main_conv{}; + FF perm_main_pos2_perm{}; + FF perm_main_pedersen{}; + FF perm_main_cd_copy{}; + FF perm_main_mem_a{}; + FF perm_main_mem_b{}; + FF perm_main_mem_c{}; + FF perm_main_mem_d{}; + FF perm_main_mem_ind_addr_a{}; + FF perm_main_mem_ind_addr_b{}; + FF perm_main_mem_ind_addr_c{}; + FF perm_main_mem_ind_addr_d{}; + FF lookup_byte_lengths{}; + FF lookup_byte_operations{}; + FF lookup_cd_value{}; + FF lookup_opcode_gas{}; + FF range_check_l2_gas_hi{}; + FF range_check_l2_gas_lo{}; + FF range_check_da_gas_hi{}; + FF range_check_da_gas_lo{}; + FF kernel_output_lookup{}; + FF lookup_into_kernel{}; + FF incl_main_tag_err{}; + FF incl_mem_tag_err{}; + FF lookup_mem_rng_chk_lo{}; + FF lookup_mem_rng_chk_mid{}; + FF lookup_mem_rng_chk_hi{}; + FF lookup_pow_2_0{}; + FF lookup_pow_2_1{}; + FF lookup_u8_0{}; + FF lookup_u8_1{}; + FF lookup_u16_0{}; + FF lookup_u16_1{}; + FF lookup_u16_2{}; + FF lookup_u16_3{}; + FF lookup_u16_4{}; + FF lookup_u16_5{}; + FF lookup_u16_6{}; + FF lookup_u16_7{}; + FF lookup_u16_8{}; + FF lookup_u16_9{}; + FF lookup_u16_10{}; + FF lookup_u16_11{}; + FF lookup_u16_12{}; + FF lookup_u16_13{}; + FF lookup_u16_14{}; + FF lookup_div_u16_0{}; + FF lookup_div_u16_1{}; + FF lookup_div_u16_2{}; + FF lookup_div_u16_3{}; + FF lookup_div_u16_4{}; + FF lookup_div_u16_5{}; + FF lookup_div_u16_6{}; + FF lookup_div_u16_7{}; + FF lookup_byte_lengths_counts{}; + FF lookup_byte_operations_counts{}; + FF lookup_cd_value_counts{}; + FF lookup_opcode_gas_counts{}; + FF range_check_l2_gas_hi_counts{}; + FF range_check_l2_gas_lo_counts{}; + FF range_check_da_gas_hi_counts{}; + FF range_check_da_gas_lo_counts{}; + FF kernel_output_lookup_counts{}; + FF lookup_into_kernel_counts{}; + FF incl_main_tag_err_counts{}; + FF incl_mem_tag_err_counts{}; + FF lookup_mem_rng_chk_lo_counts{}; + FF lookup_mem_rng_chk_mid_counts{}; + FF lookup_mem_rng_chk_hi_counts{}; + FF lookup_pow_2_0_counts{}; + FF lookup_pow_2_1_counts{}; + FF lookup_u8_0_counts{}; + FF lookup_u8_1_counts{}; + FF lookup_u16_0_counts{}; + FF lookup_u16_1_counts{}; + FF lookup_u16_2_counts{}; + FF lookup_u16_3_counts{}; + FF lookup_u16_4_counts{}; + FF lookup_u16_5_counts{}; + FF lookup_u16_6_counts{}; + FF lookup_u16_7_counts{}; + FF lookup_u16_8_counts{}; + FF lookup_u16_9_counts{}; + FF lookup_u16_10_counts{}; + FF lookup_u16_11_counts{}; + FF lookup_u16_12_counts{}; + FF lookup_u16_13_counts{}; + FF lookup_u16_14_counts{}; + FF lookup_div_u16_0_counts{}; + FF lookup_div_u16_1_counts{}; + FF lookup_div_u16_2_counts{}; + FF lookup_div_u16_3_counts{}; + FF lookup_div_u16_4_counts{}; + FF lookup_div_u16_5_counts{}; + FF lookup_div_u16_6_counts{}; + FF lookup_div_u16_7_counts{}; + + [[maybe_unused]] static std::vector names(); +}; + +template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); + +>>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) class AvmCircuitBuilder { public: using Flavor = bb::AvmFlavor; @@ -29,8 +442,8 @@ class AvmCircuitBuilder { using Polynomial = Flavor::Polynomial; using ProverPolynomials = Flavor::ProverPolynomials; - static constexpr size_t num_fixed_columns = 387; - static constexpr size_t num_polys = 387 + 65; + static constexpr size_t num_fixed_columns = 403; + static constexpr size_t num_polys = 403 + 68; std::vector rows; void set_trace(std::vector&& trace) { rows = std::move(trace); } @@ -222,6 +635,7 @@ class AvmCircuitBuilder { polys.main_rwd[i] = rows[i].main_rwd; polys.main_sel_alu[i] = rows[i].main_sel_alu; polys.main_sel_bin[i] = rows[i].main_sel_bin; + polys.main_sel_cd[i] = rows[i].main_sel_cd; polys.main_sel_gas_accounting_active[i] = rows[i].main_sel_gas_accounting_active; polys.main_sel_last[i] = rows[i].main_sel_last; polys.main_sel_mem_op_a[i] = rows[i].main_sel_mem_op_a; @@ -235,6 +649,7 @@ class AvmCircuitBuilder { polys.main_sel_op_address[i] = rows[i].main_sel_op_address; polys.main_sel_op_and[i] = rows[i].main_sel_op_and; polys.main_sel_op_block_number[i] = rows[i].main_sel_op_block_number; + polys.main_sel_op_calldata_copy[i] = rows[i].main_sel_op_calldata_copy; polys.main_sel_op_cast[i] = rows[i].main_sel_op_cast; polys.main_sel_op_chain_id[i] = rows[i].main_sel_op_chain_id; polys.main_sel_op_cmov[i] = rows[i].main_sel_op_cmov; @@ -311,6 +726,7 @@ class AvmCircuitBuilder { polys.mem_sel_op_a[i] = rows[i].mem_sel_op_a; polys.mem_sel_op_b[i] = rows[i].mem_sel_op_b; polys.mem_sel_op_c[i] = rows[i].mem_sel_op_c; + polys.mem_sel_op_cd[i] = rows[i].mem_sel_op_cd; polys.mem_sel_op_cmov[i] = rows[i].mem_sel_op_cmov; polys.mem_sel_op_d[i] = rows[i].mem_sel_op_d; polys.mem_sel_resolve_ind_addr_a[i] = rows[i].mem_sel_resolve_ind_addr_a; @@ -339,8 +755,18 @@ class AvmCircuitBuilder { polys.sha256_output[i] = rows[i].sha256_output; polys.sha256_sel_sha256_compression[i] = rows[i].sha256_sel_sha256_compression; polys.sha256_state[i] = rows[i].sha256_state; + polys.slice_addr[i] = rows[i].slice_addr; + polys.slice_cd_offset[i] = rows[i].slice_cd_offset; + polys.slice_clk[i] = rows[i].slice_clk; + polys.slice_cnt[i] = rows[i].slice_cnt; + polys.slice_one_min_inv[i] = rows[i].slice_one_min_inv; + polys.slice_sel_cd[i] = rows[i].slice_sel_cd; + polys.slice_sel_start_cd[i] = rows[i].slice_sel_start_cd; + polys.slice_space_id[i] = rows[i].slice_space_id; + polys.slice_val[i] = rows[i].slice_val; polys.lookup_byte_lengths_counts[i] = rows[i].lookup_byte_lengths_counts; polys.lookup_byte_operations_counts[i] = rows[i].lookup_byte_operations_counts; + polys.lookup_cd_value_counts[i] = rows[i].lookup_cd_value_counts; polys.lookup_opcode_gas_counts[i] = rows[i].lookup_opcode_gas_counts; polys.range_check_l2_gas_hi_counts[i] = rows[i].range_check_l2_gas_hi_counts; polys.range_check_l2_gas_lo_counts[i] = rows[i].range_check_l2_gas_lo_counts; @@ -453,6 +879,9 @@ class AvmCircuitBuilder { polys.mem_tag_shift = Polynomial(polys.mem_tag.shifted()); polys.mem_tsp_shift = Polynomial(polys.mem_tsp.shifted()); polys.mem_val_shift = Polynomial(polys.mem_val.shifted()); + polys.slice_addr_shift = Polynomial(polys.slice_addr.shifted()); + polys.slice_cd_offset_shift = Polynomial(polys.slice_cd_offset.shifted()); + polys.slice_cnt_shift = Polynomial(polys.slice_cnt.shifted()); return polys; } @@ -552,6 +981,10 @@ class AvmCircuitBuilder { auto mem = [=]() { return evaluate_relation.template operator()>("mem", Avm_vm::get_relation_label_mem); }; + auto mem_slice = [=]() { + return evaluate_relation.template operator()>("mem_slice", + Avm_vm::get_relation_label_mem_slice); + }; auto pedersen = [=]() { return evaluate_relation.template operator()>("pedersen", Avm_vm::get_relation_label_pedersen); @@ -570,6 +1003,9 @@ class AvmCircuitBuilder { }; // Check lookups + auto perm_cd_mem = [=]() { + return evaluate_logderivative.template operator()>("PERM_CD_MEM"); + }; auto perm_main_alu = [=]() { return evaluate_logderivative.template operator()>("PERM_MAIN_ALU"); }; @@ -585,6 +1021,9 @@ class AvmCircuitBuilder { auto perm_main_pedersen = [=]() { return evaluate_logderivative.template operator()>("PERM_MAIN_PEDERSEN"); }; + auto perm_main_cd_copy = [=]() { + return evaluate_logderivative.template operator()>("PERM_MAIN_CD_COPY"); + }; auto perm_main_mem_a = [=]() { return evaluate_logderivative.template operator()>("PERM_MAIN_MEM_A"); }; @@ -620,6 +1059,9 @@ class AvmCircuitBuilder { return evaluate_logderivative.template operator()>( "LOOKUP_BYTE_OPERATIONS"); }; + auto lookup_cd_value = [=]() { + return evaluate_logderivative.template operator()>("LOOKUP_CD_VALUE"); + }; auto lookup_opcode_gas = [=]() { return evaluate_logderivative.template operator()>("LOOKUP_OPCODE_GAS"); }; @@ -757,15 +1199,18 @@ class AvmCircuitBuilder { relation_futures.emplace_back(std::async(std::launch::async, kernel)); relation_futures.emplace_back(std::async(std::launch::async, main)); relation_futures.emplace_back(std::async(std::launch::async, mem)); + relation_futures.emplace_back(std::async(std::launch::async, mem_slice)); relation_futures.emplace_back(std::async(std::launch::async, pedersen)); relation_futures.emplace_back(std::async(std::launch::async, poseidon2)); relation_futures.emplace_back(std::async(std::launch::async, powers)); relation_futures.emplace_back(std::async(std::launch::async, sha256)); + relation_futures.emplace_back(std::async(std::launch::async, perm_cd_mem)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_alu)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_bin)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_conv)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_pos2_perm)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_pedersen)); + relation_futures.emplace_back(std::async(std::launch::async, perm_main_cd_copy)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_mem_a)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_mem_b)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_mem_c)); @@ -776,6 +1221,7 @@ class AvmCircuitBuilder { relation_futures.emplace_back(std::async(std::launch::async, perm_main_mem_ind_addr_d)); relation_futures.emplace_back(std::async(std::launch::async, lookup_byte_lengths)); relation_futures.emplace_back(std::async(std::launch::async, lookup_byte_operations)); + relation_futures.emplace_back(std::async(std::launch::async, lookup_cd_value)); relation_futures.emplace_back(std::async(std::launch::async, lookup_opcode_gas)); relation_futures.emplace_back(std::async(std::launch::async, range_check_l2_gas_hi)); relation_futures.emplace_back(std::async(std::launch::async, range_check_l2_gas_lo)); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index ae9c54f49c1..bd126afcaaa 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -23,6 +23,7 @@ #include "barretenberg/relations/generated/avm/kernel.hpp" #include "barretenberg/relations/generated/avm/main.hpp" #include "barretenberg/relations/generated/avm/mem.hpp" +#include "barretenberg/relations/generated/avm/mem_slice.hpp" #include "barretenberg/relations/generated/avm/pedersen.hpp" #include "barretenberg/relations/generated/avm/poseidon2.hpp" #include "barretenberg/relations/generated/avm/powers.hpp" @@ -34,6 +35,7 @@ #include "barretenberg/relations/generated/avm/kernel_output_lookup.hpp" #include "barretenberg/relations/generated/avm/lookup_byte_lengths.hpp" #include "barretenberg/relations/generated/avm/lookup_byte_operations.hpp" +#include "barretenberg/relations/generated/avm/lookup_cd_value.hpp" #include "barretenberg/relations/generated/avm/lookup_div_u16_0.hpp" #include "barretenberg/relations/generated/avm/lookup_div_u16_1.hpp" #include "barretenberg/relations/generated/avm/lookup_div_u16_2.hpp" @@ -66,8 +68,10 @@ #include "barretenberg/relations/generated/avm/lookup_u16_9.hpp" #include "barretenberg/relations/generated/avm/lookup_u8_0.hpp" #include "barretenberg/relations/generated/avm/lookup_u8_1.hpp" +#include "barretenberg/relations/generated/avm/perm_cd_mem.hpp" #include "barretenberg/relations/generated/avm/perm_main_alu.hpp" #include "barretenberg/relations/generated/avm/perm_main_bin.hpp" +#include "barretenberg/relations/generated/avm/perm_main_cd_copy.hpp" #include "barretenberg/relations/generated/avm/perm_main_conv.hpp" #include "barretenberg/relations/generated/avm/perm_main_mem_a.hpp" #include "barretenberg/relations/generated/avm/perm_main_mem_b.hpp" @@ -107,11 +111,11 @@ class AvmFlavor { using RelationSeparator = AvmFlavorSettings::RelationSeparator; static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 2; - static constexpr size_t NUM_WITNESS_ENTITIES = 385; + static constexpr size_t NUM_WITNESS_ENTITIES = 401; 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 = 452; + static constexpr size_t NUM_ALL_ENTITIES = 471; using MainRelations = std::tuple< // Relations @@ -123,6 +127,7 @@ class AvmFlavor { Avm_vm::kernel, Avm_vm::main, Avm_vm::mem, + Avm_vm::mem_slice, Avm_vm::pedersen, Avm_vm::poseidon2, Avm_vm::powers, @@ -130,11 +135,13 @@ class AvmFlavor { using LookupRelations = std::tuple< // Lookups + perm_cd_mem_relation, perm_main_alu_relation, perm_main_bin_relation, perm_main_conv_relation, perm_main_pos2_perm_relation, perm_main_pedersen_relation, + perm_main_cd_copy_relation, perm_main_mem_a_relation, perm_main_mem_b_relation, perm_main_mem_c_relation, @@ -145,6 +152,7 @@ class AvmFlavor { perm_main_mem_ind_addr_d_relation, lookup_byte_lengths_relation, lookup_byte_operations_relation, + lookup_cd_value_relation, lookup_opcode_gas_relation, range_check_l2_gas_hi_relation, range_check_l2_gas_lo_relation, @@ -392,6 +400,7 @@ class AvmFlavor { main_rwd, main_sel_alu, main_sel_bin, + main_sel_cd, main_sel_gas_accounting_active, main_sel_last, main_sel_mem_op_a, @@ -405,6 +414,7 @@ class AvmFlavor { 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, @@ -481,6 +491,7 @@ class AvmFlavor { mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, + mem_sel_op_cd, mem_sel_op_cmov, mem_sel_op_d, mem_sel_resolve_ind_addr_a, @@ -509,8 +520,18 @@ class AvmFlavor { sha256_output, sha256_sel_sha256_compression, sha256_state, + slice_addr, + slice_cd_offset, + slice_clk, + slice_cnt, + slice_one_min_inv, + slice_sel_cd, + slice_sel_start_cd, + slice_space_id, + slice_val, lookup_byte_lengths_counts, lookup_byte_operations_counts, + lookup_cd_value_counts, lookup_opcode_gas_counts, range_check_l2_gas_hi_counts, range_check_l2_gas_lo_counts, @@ -555,11 +576,13 @@ class AvmFlavor { template class DerivedWitnessEntities { public: DEFINE_FLAVOR_MEMBERS(DataType, + perm_cd_mem, perm_main_alu, perm_main_bin, perm_main_conv, perm_main_pos2_perm, perm_main_pedersen, + perm_main_cd_copy, perm_main_mem_a, perm_main_mem_b, perm_main_mem_c, @@ -570,6 +593,7 @@ class AvmFlavor { perm_main_mem_ind_addr_d, lookup_byte_lengths, lookup_byte_operations, + lookup_cd_value, lookup_opcode_gas, range_check_l2_gas_hi, range_check_l2_gas_lo, @@ -678,7 +702,10 @@ class AvmFlavor { mem_sel_mem_shift, mem_tag_shift, mem_tsp_shift, - mem_val_shift) + mem_val_shift, + slice_addr_shift, + slice_cd_offset_shift, + slice_cnt_shift) }; template @@ -748,7 +775,10 @@ class AvmFlavor { entities.mem_sel_mem, entities.mem_tag, entities.mem_tsp, - entities.mem_val }; + entities.mem_val, + entities.slice_addr, + entities.slice_cd_offset, + entities.slice_cnt }; } template @@ -849,8 +879,191 @@ class AvmFlavor { mem_sel_mem, mem_tag, mem_tsp, - mem_val }; + mem_val, + slice_addr, + slice_cd_offset, + slice_cnt }; } +<<<<<<< HEAD +======= + + void compute_logderivative_inverses(const RelationParameters& relation_parameters) + { + ProverPolynomials prover_polynomials = ProverPolynomials(*this); + + AVM_TRACK_TIME("compute_logderivative_inverse/perm_cd_mem_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_alu_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_bin_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_conv_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_pos2_perm_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_pedersen_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_cd_copy_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_a_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_b_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_c_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_d_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_a_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_b_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_c_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_d_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_byte_lengths_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_byte_operations_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_cd_value_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_opcode_gas_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/range_check_l2_gas_hi_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/range_check_l2_gas_lo_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/range_check_da_gas_hi_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/range_check_da_gas_lo_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/kernel_output_lookup_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_into_kernel_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/incl_main_tag_err_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/incl_mem_tag_err_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_lo_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_mid_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_hi_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_pow_2_0_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_pow_2_1_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u8_0_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u8_1_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_0_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_1_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_2_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_3_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_4_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_5_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_6_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_7_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_8_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_9_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_10_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_11_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_12_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_13_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_14_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_0_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_1_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_2_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_3_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_4_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_5_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_6_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_7_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + } +>>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) }; using VerificationKey = VerificationKey_, VerifierCommitmentKey>; @@ -2481,6 +2694,7 @@ class AvmFlavor { Base::main_rwd = "MAIN_RWD"; Base::main_sel_alu = "MAIN_SEL_ALU"; Base::main_sel_bin = "MAIN_SEL_BIN"; + Base::main_sel_cd = "MAIN_SEL_CD"; Base::main_sel_gas_accounting_active = "MAIN_SEL_GAS_ACCOUNTING_ACTIVE"; Base::main_sel_last = "MAIN_SEL_LAST"; Base::main_sel_mem_op_a = "MAIN_SEL_MEM_OP_A"; @@ -2494,6 +2708,7 @@ class AvmFlavor { Base::main_sel_op_address = "MAIN_SEL_OP_ADDRESS"; Base::main_sel_op_and = "MAIN_SEL_OP_AND"; Base::main_sel_op_block_number = "MAIN_SEL_OP_BLOCK_NUMBER"; + 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"; @@ -2570,6 +2785,7 @@ class AvmFlavor { 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_cd = "MEM_SEL_OP_CD"; Base::mem_sel_op_cmov = "MEM_SEL_OP_CMOV"; Base::mem_sel_op_d = "MEM_SEL_OP_D"; Base::mem_sel_resolve_ind_addr_a = "MEM_SEL_RESOLVE_IND_ADDR_A"; @@ -2598,11 +2814,22 @@ class AvmFlavor { Base::sha256_output = "SHA256_OUTPUT"; Base::sha256_sel_sha256_compression = "SHA256_SEL_SHA256_COMPRESSION"; Base::sha256_state = "SHA256_STATE"; + Base::slice_addr = "SLICE_ADDR"; + Base::slice_cd_offset = "SLICE_CD_OFFSET"; + Base::slice_clk = "SLICE_CLK"; + Base::slice_cnt = "SLICE_CNT"; + Base::slice_one_min_inv = "SLICE_ONE_MIN_INV"; + Base::slice_sel_cd = "SLICE_SEL_CD"; + Base::slice_sel_start_cd = "SLICE_SEL_START_CD"; + Base::slice_space_id = "SLICE_SPACE_ID"; + Base::slice_val = "SLICE_VAL"; + Base::perm_cd_mem = "PERM_CD_MEM"; Base::perm_main_alu = "PERM_MAIN_ALU"; Base::perm_main_bin = "PERM_MAIN_BIN"; Base::perm_main_conv = "PERM_MAIN_CONV"; Base::perm_main_pos2_perm = "PERM_MAIN_POS2_PERM"; Base::perm_main_pedersen = "PERM_MAIN_PEDERSEN"; + Base::perm_main_cd_copy = "PERM_MAIN_CD_COPY"; Base::perm_main_mem_a = "PERM_MAIN_MEM_A"; Base::perm_main_mem_b = "PERM_MAIN_MEM_B"; Base::perm_main_mem_c = "PERM_MAIN_MEM_C"; @@ -2613,6 +2840,7 @@ class AvmFlavor { Base::perm_main_mem_ind_addr_d = "PERM_MAIN_MEM_IND_ADDR_D"; Base::lookup_byte_lengths = "LOOKUP_BYTE_LENGTHS"; Base::lookup_byte_operations = "LOOKUP_BYTE_OPERATIONS"; + Base::lookup_cd_value = "LOOKUP_CD_VALUE"; Base::lookup_opcode_gas = "LOOKUP_OPCODE_GAS"; Base::range_check_l2_gas_hi = "RANGE_CHECK_L2_GAS_HI"; Base::range_check_l2_gas_lo = "RANGE_CHECK_L2_GAS_LO"; @@ -2654,6 +2882,7 @@ class AvmFlavor { Base::lookup_div_u16_7 = "LOOKUP_DIV_U16_7"; Base::lookup_byte_lengths_counts = "LOOKUP_BYTE_LENGTHS_COUNTS"; Base::lookup_byte_operations_counts = "LOOKUP_BYTE_OPERATIONS_COUNTS"; + Base::lookup_cd_value_counts = "LOOKUP_CD_VALUE_COUNTS"; Base::lookup_opcode_gas_counts = "LOOKUP_OPCODE_GAS_COUNTS"; Base::range_check_l2_gas_hi_counts = "RANGE_CHECK_L2_GAS_HI_COUNTS"; Base::range_check_l2_gas_lo_counts = "RANGE_CHECK_L2_GAS_LO_COUNTS"; @@ -2712,7 +2941,411 @@ class AvmFlavor { public: uint32_t circuit_size; +<<<<<<< HEAD std::array commitments; +======= + Commitment kernel_kernel_inputs; + Commitment kernel_kernel_value_out; + Commitment kernel_kernel_side_effect_out; + Commitment kernel_kernel_metadata_out; + Commitment main_calldata; + Commitment alu_a_hi; + Commitment alu_a_lo; + Commitment alu_b_hi; + Commitment alu_b_lo; + Commitment alu_borrow; + Commitment alu_cf; + Commitment alu_clk; + Commitment alu_cmp_rng_ctr; + Commitment alu_div_u16_r0; + Commitment alu_div_u16_r1; + Commitment alu_div_u16_r2; + Commitment alu_div_u16_r3; + Commitment alu_div_u16_r4; + Commitment alu_div_u16_r5; + Commitment alu_div_u16_r6; + Commitment alu_div_u16_r7; + Commitment alu_divisor_hi; + Commitment alu_divisor_lo; + Commitment alu_ff_tag; + Commitment alu_ia; + Commitment alu_ib; + Commitment alu_ic; + Commitment alu_in_tag; + Commitment alu_op_add; + Commitment alu_op_cast; + Commitment alu_op_cast_prev; + Commitment alu_op_div; + Commitment alu_op_div_a_lt_b; + Commitment alu_op_div_std; + Commitment alu_op_eq; + Commitment alu_op_eq_diff_inv; + Commitment alu_op_lt; + Commitment alu_op_lte; + Commitment alu_op_mul; + Commitment alu_op_not; + Commitment alu_op_shl; + Commitment alu_op_shr; + Commitment alu_op_sub; + Commitment alu_p_a_borrow; + Commitment alu_p_b_borrow; + Commitment alu_p_sub_a_hi; + Commitment alu_p_sub_a_lo; + Commitment alu_p_sub_b_hi; + Commitment alu_p_sub_b_lo; + Commitment alu_partial_prod_hi; + Commitment alu_partial_prod_lo; + Commitment alu_quotient_hi; + Commitment alu_quotient_lo; + Commitment alu_remainder; + Commitment alu_res_hi; + Commitment alu_res_lo; + Commitment alu_sel_alu; + Commitment alu_sel_cmp; + Commitment alu_sel_div_rng_chk; + Commitment alu_sel_rng_chk; + Commitment alu_sel_rng_chk_lookup; + Commitment alu_sel_shift_which; + Commitment alu_shift_lt_bit_len; + Commitment alu_t_sub_s_bits; + Commitment alu_two_pow_s; + Commitment alu_two_pow_t_sub_s; + Commitment alu_u128_tag; + Commitment alu_u16_r0; + Commitment alu_u16_r1; + Commitment alu_u16_r10; + Commitment alu_u16_r11; + Commitment alu_u16_r12; + Commitment alu_u16_r13; + Commitment alu_u16_r14; + Commitment alu_u16_r2; + Commitment alu_u16_r3; + Commitment alu_u16_r4; + Commitment alu_u16_r5; + Commitment alu_u16_r6; + Commitment alu_u16_r7; + Commitment alu_u16_r8; + Commitment alu_u16_r9; + Commitment alu_u16_tag; + Commitment alu_u32_tag; + Commitment alu_u64_tag; + Commitment alu_u8_r0; + Commitment alu_u8_r1; + Commitment alu_u8_tag; + Commitment binary_acc_ia; + Commitment binary_acc_ib; + Commitment binary_acc_ic; + Commitment binary_clk; + Commitment binary_ia_bytes; + Commitment binary_ib_bytes; + Commitment binary_ic_bytes; + Commitment binary_in_tag; + Commitment binary_mem_tag_ctr; + Commitment binary_mem_tag_ctr_inv; + Commitment binary_op_id; + Commitment binary_sel_bin; + Commitment binary_start; + Commitment byte_lookup_sel_bin; + Commitment byte_lookup_table_byte_lengths; + Commitment byte_lookup_table_in_tags; + Commitment byte_lookup_table_input_a; + Commitment byte_lookup_table_input_b; + Commitment byte_lookup_table_op_id; + Commitment byte_lookup_table_output; + Commitment conversion_clk; + Commitment conversion_input; + Commitment conversion_num_limbs; + Commitment conversion_radix; + Commitment conversion_sel_to_radix_le; + Commitment gas_da_gas_fixed_table; + Commitment gas_l2_gas_fixed_table; + Commitment gas_sel_gas_cost; + Commitment keccakf1600_clk; + Commitment keccakf1600_input; + Commitment keccakf1600_output; + Commitment keccakf1600_sel_keccakf1600; + Commitment kernel_emit_l2_to_l1_msg_write_offset; + Commitment kernel_emit_note_hash_write_offset; + Commitment kernel_emit_nullifier_write_offset; + Commitment kernel_emit_unencrypted_log_write_offset; + Commitment kernel_kernel_in_offset; + Commitment kernel_kernel_out_offset; + Commitment kernel_l1_to_l2_msg_exists_write_offset; + Commitment kernel_note_hash_exist_write_offset; + Commitment kernel_nullifier_exists_write_offset; + Commitment kernel_nullifier_non_exists_write_offset; + Commitment kernel_q_public_input_kernel_add_to_table; + Commitment kernel_q_public_input_kernel_out_add_to_table; + Commitment kernel_side_effect_counter; + Commitment kernel_sload_write_offset; + Commitment kernel_sstore_write_offset; + Commitment main_abs_da_rem_gas_hi; + Commitment main_abs_da_rem_gas_lo; + Commitment main_abs_l2_rem_gas_hi; + Commitment main_abs_l2_rem_gas_lo; + Commitment main_alu_in_tag; + Commitment main_bin_op_id; + Commitment main_call_ptr; + Commitment main_da_gas_op_cost; + Commitment main_da_gas_remaining; + Commitment main_da_out_of_gas; + Commitment main_ia; + Commitment main_ib; + Commitment main_ic; + Commitment main_id; + Commitment main_id_zero; + Commitment main_ind_addr_a; + Commitment main_ind_addr_b; + Commitment main_ind_addr_c; + Commitment main_ind_addr_d; + Commitment main_internal_return_ptr; + Commitment main_inv; + Commitment main_l2_gas_op_cost; + Commitment main_l2_gas_remaining; + Commitment main_l2_out_of_gas; + Commitment main_mem_addr_a; + Commitment main_mem_addr_b; + Commitment main_mem_addr_c; + Commitment main_mem_addr_d; + Commitment main_op_err; + Commitment main_opcode_val; + Commitment main_pc; + Commitment main_r_in_tag; + Commitment main_rwa; + Commitment main_rwb; + Commitment main_rwc; + Commitment main_rwd; + Commitment main_sel_alu; + Commitment main_sel_bin; + Commitment main_sel_cd; + Commitment main_sel_gas_accounting_active; + Commitment main_sel_last; + Commitment main_sel_mem_op_a; + Commitment main_sel_mem_op_activate_gas; + Commitment main_sel_mem_op_b; + Commitment main_sel_mem_op_c; + Commitment main_sel_mem_op_d; + Commitment main_sel_mov_ia_to_ic; + Commitment main_sel_mov_ib_to_ic; + Commitment main_sel_op_add; + Commitment main_sel_op_address; + Commitment main_sel_op_and; + Commitment main_sel_op_block_number; + Commitment main_sel_op_calldata_copy; + Commitment main_sel_op_cast; + Commitment main_sel_op_chain_id; + Commitment main_sel_op_cmov; + Commitment main_sel_op_coinbase; + Commitment main_sel_op_dagasleft; + Commitment main_sel_op_div; + Commitment main_sel_op_emit_l2_to_l1_msg; + Commitment main_sel_op_emit_note_hash; + Commitment main_sel_op_emit_nullifier; + Commitment main_sel_op_emit_unencrypted_log; + Commitment main_sel_op_eq; + Commitment main_sel_op_external_call; + Commitment main_sel_op_fdiv; + Commitment main_sel_op_fee_per_da_gas; + Commitment main_sel_op_fee_per_l2_gas; + Commitment main_sel_op_function_selector; + Commitment main_sel_op_get_contract_instance; + Commitment main_sel_op_halt; + Commitment main_sel_op_internal_call; + Commitment main_sel_op_internal_return; + Commitment main_sel_op_jump; + Commitment main_sel_op_jumpi; + Commitment main_sel_op_keccak; + Commitment main_sel_op_l1_to_l2_msg_exists; + Commitment main_sel_op_l2gasleft; + Commitment main_sel_op_lt; + Commitment main_sel_op_lte; + Commitment main_sel_op_mov; + Commitment main_sel_op_mul; + Commitment main_sel_op_not; + Commitment main_sel_op_note_hash_exists; + Commitment main_sel_op_nullifier_exists; + Commitment main_sel_op_or; + Commitment main_sel_op_pedersen; + Commitment main_sel_op_poseidon2; + Commitment main_sel_op_radix_le; + Commitment main_sel_op_sender; + Commitment main_sel_op_sha256; + Commitment main_sel_op_shl; + Commitment main_sel_op_shr; + Commitment main_sel_op_sload; + Commitment main_sel_op_sstore; + Commitment main_sel_op_storage_address; + Commitment main_sel_op_sub; + Commitment main_sel_op_timestamp; + Commitment main_sel_op_transaction_fee; + Commitment main_sel_op_version; + Commitment main_sel_op_xor; + Commitment main_sel_q_kernel_lookup; + Commitment main_sel_q_kernel_output_lookup; + Commitment main_sel_resolve_ind_addr_a; + Commitment main_sel_resolve_ind_addr_b; + Commitment main_sel_resolve_ind_addr_c; + Commitment main_sel_resolve_ind_addr_d; + Commitment main_sel_rng_16; + Commitment main_sel_rng_8; + Commitment main_space_id; + Commitment main_tag_err; + Commitment main_w_in_tag; + Commitment mem_addr; + Commitment mem_clk; + Commitment mem_diff_hi; + Commitment mem_diff_lo; + Commitment mem_diff_mid; + Commitment mem_glob_addr; + Commitment mem_last; + Commitment mem_lastAccess; + Commitment mem_one_min_inv; + Commitment mem_r_in_tag; + Commitment mem_rw; + Commitment mem_sel_mem; + Commitment mem_sel_mov_ia_to_ic; + Commitment mem_sel_mov_ib_to_ic; + Commitment mem_sel_op_a; + Commitment mem_sel_op_b; + Commitment mem_sel_op_c; + Commitment mem_sel_op_cd; + Commitment mem_sel_op_cmov; + Commitment mem_sel_op_d; + Commitment mem_sel_resolve_ind_addr_a; + Commitment mem_sel_resolve_ind_addr_b; + Commitment mem_sel_resolve_ind_addr_c; + Commitment mem_sel_resolve_ind_addr_d; + Commitment mem_sel_rng_chk; + Commitment mem_skip_check_tag; + Commitment mem_space_id; + Commitment mem_tag; + Commitment mem_tag_err; + Commitment mem_tsp; + Commitment mem_val; + Commitment mem_w_in_tag; + Commitment pedersen_clk; + Commitment pedersen_input; + Commitment pedersen_output; + Commitment pedersen_sel_pedersen; + Commitment poseidon2_clk; + Commitment poseidon2_input; + Commitment poseidon2_output; + Commitment poseidon2_sel_poseidon_perm; + Commitment powers_power_of_2; + Commitment sha256_clk; + Commitment sha256_input; + Commitment sha256_output; + Commitment sha256_sel_sha256_compression; + Commitment sha256_state; + Commitment slice_addr; + Commitment slice_cd_offset; + Commitment slice_clk; + Commitment slice_cnt; + Commitment slice_one_min_inv; + Commitment slice_sel_cd; + Commitment slice_sel_start_cd; + Commitment slice_space_id; + Commitment slice_val; + Commitment perm_cd_mem; + Commitment perm_main_alu; + Commitment perm_main_bin; + Commitment perm_main_conv; + Commitment perm_main_pos2_perm; + Commitment perm_main_pedersen; + Commitment perm_main_cd_copy; + Commitment perm_main_mem_a; + Commitment perm_main_mem_b; + Commitment perm_main_mem_c; + Commitment perm_main_mem_d; + Commitment perm_main_mem_ind_addr_a; + Commitment perm_main_mem_ind_addr_b; + Commitment perm_main_mem_ind_addr_c; + Commitment perm_main_mem_ind_addr_d; + Commitment lookup_byte_lengths; + Commitment lookup_byte_operations; + Commitment lookup_cd_value; + Commitment lookup_opcode_gas; + Commitment range_check_l2_gas_hi; + Commitment range_check_l2_gas_lo; + Commitment range_check_da_gas_hi; + Commitment range_check_da_gas_lo; + Commitment kernel_output_lookup; + Commitment lookup_into_kernel; + Commitment incl_main_tag_err; + Commitment incl_mem_tag_err; + Commitment lookup_mem_rng_chk_lo; + Commitment lookup_mem_rng_chk_mid; + Commitment lookup_mem_rng_chk_hi; + Commitment lookup_pow_2_0; + Commitment lookup_pow_2_1; + Commitment lookup_u8_0; + Commitment lookup_u8_1; + Commitment lookup_u16_0; + Commitment lookup_u16_1; + Commitment lookup_u16_2; + Commitment lookup_u16_3; + Commitment lookup_u16_4; + Commitment lookup_u16_5; + Commitment lookup_u16_6; + Commitment lookup_u16_7; + Commitment lookup_u16_8; + Commitment lookup_u16_9; + Commitment lookup_u16_10; + Commitment lookup_u16_11; + Commitment lookup_u16_12; + Commitment lookup_u16_13; + Commitment lookup_u16_14; + Commitment lookup_div_u16_0; + Commitment lookup_div_u16_1; + Commitment lookup_div_u16_2; + Commitment lookup_div_u16_3; + Commitment lookup_div_u16_4; + Commitment lookup_div_u16_5; + Commitment lookup_div_u16_6; + Commitment lookup_div_u16_7; + Commitment lookup_byte_lengths_counts; + Commitment lookup_byte_operations_counts; + Commitment lookup_cd_value_counts; + Commitment lookup_opcode_gas_counts; + Commitment range_check_l2_gas_hi_counts; + Commitment range_check_l2_gas_lo_counts; + Commitment range_check_da_gas_hi_counts; + Commitment range_check_da_gas_lo_counts; + Commitment kernel_output_lookup_counts; + Commitment lookup_into_kernel_counts; + Commitment incl_main_tag_err_counts; + Commitment incl_mem_tag_err_counts; + Commitment lookup_mem_rng_chk_lo_counts; + Commitment lookup_mem_rng_chk_mid_counts; + Commitment lookup_mem_rng_chk_hi_counts; + Commitment lookup_pow_2_0_counts; + Commitment lookup_pow_2_1_counts; + Commitment lookup_u8_0_counts; + Commitment lookup_u8_1_counts; + Commitment lookup_u16_0_counts; + Commitment lookup_u16_1_counts; + Commitment lookup_u16_2_counts; + Commitment lookup_u16_3_counts; + Commitment lookup_u16_4_counts; + Commitment lookup_u16_5_counts; + Commitment lookup_u16_6_counts; + Commitment lookup_u16_7_counts; + Commitment lookup_u16_8_counts; + Commitment lookup_u16_9_counts; + Commitment lookup_u16_10_counts; + Commitment lookup_u16_11_counts; + Commitment lookup_u16_12_counts; + Commitment lookup_u16_13_counts; + Commitment lookup_u16_14_counts; + Commitment lookup_div_u16_0_counts; + Commitment lookup_div_u16_1_counts; + Commitment lookup_div_u16_2_counts; + Commitment lookup_div_u16_3_counts; + Commitment lookup_div_u16_4_counts; + Commitment lookup_div_u16_5_counts; + Commitment lookup_div_u16_6_counts; + Commitment lookup_div_u16_7_counts; +>>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) std::vector> sumcheck_univariates; std::array sumcheck_evaluations; @@ -2732,9 +3365,426 @@ class AvmFlavor { circuit_size = deserialize_from_buffer(proof_data, num_frs_read); size_t log_n = numeric::get_msb(circuit_size); +<<<<<<< HEAD for (auto& commitment : commitments) { commitment = deserialize_from_buffer(proof_data, num_frs_read); } +======= + kernel_kernel_inputs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_value_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_side_effect_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_metadata_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_cf = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_cmp_rng_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_divisor_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_divisor_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ff_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_cast_prev = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div_a_lt_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div_std = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_eq_diff_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_a_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_b_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_partial_prod_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_partial_prod_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_quotient_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_quotient_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_remainder = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_res_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_res_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_cmp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_div_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_rng_chk_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_shift_which = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_shift_lt_bit_len = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_t_sub_s_bits = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_two_pow_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_two_pow_t_sub_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u128_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u32_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u64_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_mem_tag_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_mem_tag_ctr_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_in_tags = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_input_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_input_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_num_limbs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_radix = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_sel_to_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_da_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_l2_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_sel_gas_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_sel_keccakf1600 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_l2_to_l1_msg_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_note_hash_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_nullifier_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_unencrypted_log_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_in_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_out_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_l1_to_l2_msg_exists_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_note_hash_exist_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_nullifier_exists_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_nullifier_non_exists_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_q_public_input_kernel_add_to_table = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_q_public_input_kernel_out_add_to_table = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_side_effect_counter = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_sload_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_sstore_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_da_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_da_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_l2_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_l2_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_bin_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_call_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_gas_op_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_id_zero = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_internal_return_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_gas_op_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_op_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_opcode_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_pc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwa = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwb = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_gas_accounting_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_activate_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mov_ia_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mov_ib_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_and = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_block_number = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_calldata_copy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_chain_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_coinbase = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_dagasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_l2_to_l1_msg = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_note_hash = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_nullifier = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_unencrypted_log = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_external_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fdiv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fee_per_da_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fee_per_l2_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_function_selector = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_get_contract_instance = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_halt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_internal_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_internal_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_jump = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_jumpi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_keccak = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_l1_to_l2_msg_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_l2gasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_note_hash_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_nullifier_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_or = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_poseidon2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sender = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sha256 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sload = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sstore = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_storage_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_timestamp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_transaction_fee = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_version = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_xor = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_q_kernel_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_q_kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_glob_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_lastAccess = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_rw = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_mov_ia_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_mov_ib_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_skip_check_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tsp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_sel_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_sel_poseidon_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + powers_power_of_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_sel_sha256_compression = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_state = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_cd_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_cnt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_start_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_cd_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_conv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_pos2_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_cd_copy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_byte_operations = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_cd_value = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_opcode_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_l2_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_l2_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_da_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_da_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_into_kernel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + incl_main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + incl_mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_pow_2_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_pow_2_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u8_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u8_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_byte_lengths_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_byte_operations_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_cd_value_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_opcode_gas_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_l2_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_l2_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_da_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_da_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_output_lookup_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_into_kernel_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + incl_main_tag_err_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + incl_mem_tag_err_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_mid_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_pow_2_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_pow_2_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u8_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u8_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_2_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_3_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_4_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_5_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_6_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_7_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_8_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_9_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_10_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_11_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_12_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_13_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_14_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_2_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_3_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_4_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_5_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_6_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_7_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + +>>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) for (size_t i = 0; i < log_n; ++i) { sumcheck_univariates.emplace_back( deserialize_from_buffer>(Transcript::proof_data, @@ -2757,9 +3807,414 @@ class AvmFlavor { serialize_to_buffer(circuit_size, Transcript::proof_data); +<<<<<<< HEAD for (const auto& commitment : commitments) { serialize_to_buffer(commitment, Transcript::proof_data); } +======= + serialize_to_buffer(kernel_kernel_inputs, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_value_out, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_side_effect_out, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_metadata_out, Transcript::proof_data); + serialize_to_buffer(main_calldata, Transcript::proof_data); + serialize_to_buffer(alu_a_hi, Transcript::proof_data); + serialize_to_buffer(alu_a_lo, Transcript::proof_data); + serialize_to_buffer(alu_b_hi, Transcript::proof_data); + serialize_to_buffer(alu_b_lo, Transcript::proof_data); + serialize_to_buffer(alu_borrow, Transcript::proof_data); + serialize_to_buffer(alu_cf, Transcript::proof_data); + serialize_to_buffer(alu_clk, Transcript::proof_data); + serialize_to_buffer(alu_cmp_rng_ctr, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r0, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r1, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r2, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r3, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r4, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r5, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r6, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r7, Transcript::proof_data); + serialize_to_buffer(alu_divisor_hi, Transcript::proof_data); + serialize_to_buffer(alu_divisor_lo, Transcript::proof_data); + serialize_to_buffer(alu_ff_tag, Transcript::proof_data); + serialize_to_buffer(alu_ia, Transcript::proof_data); + serialize_to_buffer(alu_ib, Transcript::proof_data); + serialize_to_buffer(alu_ic, Transcript::proof_data); + serialize_to_buffer(alu_in_tag, Transcript::proof_data); + serialize_to_buffer(alu_op_add, Transcript::proof_data); + serialize_to_buffer(alu_op_cast, Transcript::proof_data); + serialize_to_buffer(alu_op_cast_prev, Transcript::proof_data); + serialize_to_buffer(alu_op_div, Transcript::proof_data); + serialize_to_buffer(alu_op_div_a_lt_b, Transcript::proof_data); + serialize_to_buffer(alu_op_div_std, Transcript::proof_data); + serialize_to_buffer(alu_op_eq, Transcript::proof_data); + serialize_to_buffer(alu_op_eq_diff_inv, Transcript::proof_data); + serialize_to_buffer(alu_op_lt, Transcript::proof_data); + serialize_to_buffer(alu_op_lte, Transcript::proof_data); + serialize_to_buffer(alu_op_mul, Transcript::proof_data); + serialize_to_buffer(alu_op_not, Transcript::proof_data); + serialize_to_buffer(alu_op_shl, Transcript::proof_data); + serialize_to_buffer(alu_op_shr, Transcript::proof_data); + serialize_to_buffer(alu_op_sub, Transcript::proof_data); + serialize_to_buffer(alu_p_a_borrow, Transcript::proof_data); + serialize_to_buffer(alu_p_b_borrow, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_a_hi, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_a_lo, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_b_hi, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_b_lo, Transcript::proof_data); + serialize_to_buffer(alu_partial_prod_hi, Transcript::proof_data); + serialize_to_buffer(alu_partial_prod_lo, Transcript::proof_data); + serialize_to_buffer(alu_quotient_hi, Transcript::proof_data); + serialize_to_buffer(alu_quotient_lo, Transcript::proof_data); + serialize_to_buffer(alu_remainder, Transcript::proof_data); + serialize_to_buffer(alu_res_hi, Transcript::proof_data); + serialize_to_buffer(alu_res_lo, Transcript::proof_data); + serialize_to_buffer(alu_sel_alu, Transcript::proof_data); + serialize_to_buffer(alu_sel_cmp, Transcript::proof_data); + serialize_to_buffer(alu_sel_div_rng_chk, Transcript::proof_data); + serialize_to_buffer(alu_sel_rng_chk, Transcript::proof_data); + serialize_to_buffer(alu_sel_rng_chk_lookup, Transcript::proof_data); + serialize_to_buffer(alu_sel_shift_which, Transcript::proof_data); + serialize_to_buffer(alu_shift_lt_bit_len, Transcript::proof_data); + serialize_to_buffer(alu_t_sub_s_bits, Transcript::proof_data); + serialize_to_buffer(alu_two_pow_s, Transcript::proof_data); + serialize_to_buffer(alu_two_pow_t_sub_s, Transcript::proof_data); + serialize_to_buffer(alu_u128_tag, Transcript::proof_data); + serialize_to_buffer(alu_u16_r0, Transcript::proof_data); + serialize_to_buffer(alu_u16_r1, Transcript::proof_data); + serialize_to_buffer(alu_u16_r10, Transcript::proof_data); + serialize_to_buffer(alu_u16_r11, Transcript::proof_data); + serialize_to_buffer(alu_u16_r12, Transcript::proof_data); + serialize_to_buffer(alu_u16_r13, Transcript::proof_data); + serialize_to_buffer(alu_u16_r14, Transcript::proof_data); + serialize_to_buffer(alu_u16_r2, Transcript::proof_data); + serialize_to_buffer(alu_u16_r3, Transcript::proof_data); + serialize_to_buffer(alu_u16_r4, Transcript::proof_data); + serialize_to_buffer(alu_u16_r5, Transcript::proof_data); + serialize_to_buffer(alu_u16_r6, Transcript::proof_data); + serialize_to_buffer(alu_u16_r7, Transcript::proof_data); + serialize_to_buffer(alu_u16_r8, Transcript::proof_data); + serialize_to_buffer(alu_u16_r9, Transcript::proof_data); + serialize_to_buffer(alu_u16_tag, Transcript::proof_data); + serialize_to_buffer(alu_u32_tag, Transcript::proof_data); + serialize_to_buffer(alu_u64_tag, Transcript::proof_data); + serialize_to_buffer(alu_u8_r0, Transcript::proof_data); + serialize_to_buffer(alu_u8_r1, Transcript::proof_data); + serialize_to_buffer(alu_u8_tag, Transcript::proof_data); + serialize_to_buffer(binary_acc_ia, Transcript::proof_data); + serialize_to_buffer(binary_acc_ib, Transcript::proof_data); + serialize_to_buffer(binary_acc_ic, Transcript::proof_data); + serialize_to_buffer(binary_clk, Transcript::proof_data); + serialize_to_buffer(binary_ia_bytes, Transcript::proof_data); + serialize_to_buffer(binary_ib_bytes, Transcript::proof_data); + serialize_to_buffer(binary_ic_bytes, Transcript::proof_data); + serialize_to_buffer(binary_in_tag, Transcript::proof_data); + serialize_to_buffer(binary_mem_tag_ctr, Transcript::proof_data); + serialize_to_buffer(binary_mem_tag_ctr_inv, Transcript::proof_data); + serialize_to_buffer(binary_op_id, Transcript::proof_data); + serialize_to_buffer(binary_sel_bin, Transcript::proof_data); + serialize_to_buffer(binary_start, Transcript::proof_data); + serialize_to_buffer(byte_lookup_sel_bin, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_byte_lengths, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_in_tags, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_input_a, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_input_b, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_op_id, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_output, Transcript::proof_data); + serialize_to_buffer(conversion_clk, Transcript::proof_data); + serialize_to_buffer(conversion_input, Transcript::proof_data); + serialize_to_buffer(conversion_num_limbs, Transcript::proof_data); + serialize_to_buffer(conversion_radix, Transcript::proof_data); + serialize_to_buffer(conversion_sel_to_radix_le, Transcript::proof_data); + serialize_to_buffer(gas_da_gas_fixed_table, Transcript::proof_data); + serialize_to_buffer(gas_l2_gas_fixed_table, Transcript::proof_data); + serialize_to_buffer(gas_sel_gas_cost, Transcript::proof_data); + serialize_to_buffer(keccakf1600_clk, Transcript::proof_data); + serialize_to_buffer(keccakf1600_input, Transcript::proof_data); + serialize_to_buffer(keccakf1600_output, Transcript::proof_data); + serialize_to_buffer(keccakf1600_sel_keccakf1600, Transcript::proof_data); + serialize_to_buffer(kernel_emit_l2_to_l1_msg_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_note_hash_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_nullifier_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_unencrypted_log_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_in_offset, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_out_offset, Transcript::proof_data); + serialize_to_buffer(kernel_l1_to_l2_msg_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_note_hash_exist_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_nullifier_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_nullifier_non_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_q_public_input_kernel_add_to_table, Transcript::proof_data); + serialize_to_buffer(kernel_q_public_input_kernel_out_add_to_table, Transcript::proof_data); + serialize_to_buffer(kernel_side_effect_counter, Transcript::proof_data); + serialize_to_buffer(kernel_sload_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_sstore_write_offset, Transcript::proof_data); + serialize_to_buffer(main_abs_da_rem_gas_hi, Transcript::proof_data); + serialize_to_buffer(main_abs_da_rem_gas_lo, Transcript::proof_data); + serialize_to_buffer(main_abs_l2_rem_gas_hi, Transcript::proof_data); + serialize_to_buffer(main_abs_l2_rem_gas_lo, Transcript::proof_data); + serialize_to_buffer(main_alu_in_tag, Transcript::proof_data); + serialize_to_buffer(main_bin_op_id, Transcript::proof_data); + serialize_to_buffer(main_call_ptr, Transcript::proof_data); + serialize_to_buffer(main_da_gas_op_cost, Transcript::proof_data); + serialize_to_buffer(main_da_gas_remaining, Transcript::proof_data); + serialize_to_buffer(main_da_out_of_gas, Transcript::proof_data); + serialize_to_buffer(main_ia, Transcript::proof_data); + serialize_to_buffer(main_ib, Transcript::proof_data); + serialize_to_buffer(main_ic, Transcript::proof_data); + serialize_to_buffer(main_id, Transcript::proof_data); + serialize_to_buffer(main_id_zero, Transcript::proof_data); + serialize_to_buffer(main_ind_addr_a, Transcript::proof_data); + serialize_to_buffer(main_ind_addr_b, Transcript::proof_data); + serialize_to_buffer(main_ind_addr_c, Transcript::proof_data); + serialize_to_buffer(main_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(main_internal_return_ptr, Transcript::proof_data); + serialize_to_buffer(main_inv, Transcript::proof_data); + serialize_to_buffer(main_l2_gas_op_cost, Transcript::proof_data); + serialize_to_buffer(main_l2_gas_remaining, Transcript::proof_data); + serialize_to_buffer(main_l2_out_of_gas, Transcript::proof_data); + serialize_to_buffer(main_mem_addr_a, Transcript::proof_data); + serialize_to_buffer(main_mem_addr_b, Transcript::proof_data); + serialize_to_buffer(main_mem_addr_c, Transcript::proof_data); + serialize_to_buffer(main_mem_addr_d, Transcript::proof_data); + serialize_to_buffer(main_op_err, Transcript::proof_data); + serialize_to_buffer(main_opcode_val, Transcript::proof_data); + serialize_to_buffer(main_pc, Transcript::proof_data); + serialize_to_buffer(main_r_in_tag, Transcript::proof_data); + serialize_to_buffer(main_rwa, Transcript::proof_data); + serialize_to_buffer(main_rwb, Transcript::proof_data); + serialize_to_buffer(main_rwc, Transcript::proof_data); + serialize_to_buffer(main_rwd, Transcript::proof_data); + serialize_to_buffer(main_sel_alu, Transcript::proof_data); + serialize_to_buffer(main_sel_bin, Transcript::proof_data); + serialize_to_buffer(main_sel_cd, Transcript::proof_data); + serialize_to_buffer(main_sel_gas_accounting_active, Transcript::proof_data); + serialize_to_buffer(main_sel_last, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_a, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_activate_gas, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_b, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_c, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_d, Transcript::proof_data); + serialize_to_buffer(main_sel_mov_ia_to_ic, Transcript::proof_data); + serialize_to_buffer(main_sel_mov_ib_to_ic, Transcript::proof_data); + serialize_to_buffer(main_sel_op_add, Transcript::proof_data); + serialize_to_buffer(main_sel_op_address, Transcript::proof_data); + serialize_to_buffer(main_sel_op_and, Transcript::proof_data); + serialize_to_buffer(main_sel_op_block_number, Transcript::proof_data); + serialize_to_buffer(main_sel_op_calldata_copy, Transcript::proof_data); + serialize_to_buffer(main_sel_op_cast, Transcript::proof_data); + serialize_to_buffer(main_sel_op_chain_id, Transcript::proof_data); + serialize_to_buffer(main_sel_op_cmov, Transcript::proof_data); + serialize_to_buffer(main_sel_op_coinbase, Transcript::proof_data); + serialize_to_buffer(main_sel_op_dagasleft, Transcript::proof_data); + serialize_to_buffer(main_sel_op_div, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_l2_to_l1_msg, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_note_hash, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_nullifier, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_unencrypted_log, Transcript::proof_data); + serialize_to_buffer(main_sel_op_eq, Transcript::proof_data); + serialize_to_buffer(main_sel_op_external_call, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fdiv, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fee_per_da_gas, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fee_per_l2_gas, Transcript::proof_data); + serialize_to_buffer(main_sel_op_function_selector, Transcript::proof_data); + serialize_to_buffer(main_sel_op_get_contract_instance, Transcript::proof_data); + serialize_to_buffer(main_sel_op_halt, Transcript::proof_data); + serialize_to_buffer(main_sel_op_internal_call, Transcript::proof_data); + serialize_to_buffer(main_sel_op_internal_return, Transcript::proof_data); + serialize_to_buffer(main_sel_op_jump, Transcript::proof_data); + serialize_to_buffer(main_sel_op_jumpi, Transcript::proof_data); + serialize_to_buffer(main_sel_op_keccak, Transcript::proof_data); + serialize_to_buffer(main_sel_op_l1_to_l2_msg_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_l2gasleft, Transcript::proof_data); + serialize_to_buffer(main_sel_op_lt, Transcript::proof_data); + serialize_to_buffer(main_sel_op_lte, Transcript::proof_data); + serialize_to_buffer(main_sel_op_mov, Transcript::proof_data); + serialize_to_buffer(main_sel_op_mul, Transcript::proof_data); + serialize_to_buffer(main_sel_op_not, Transcript::proof_data); + serialize_to_buffer(main_sel_op_note_hash_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_nullifier_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_or, Transcript::proof_data); + serialize_to_buffer(main_sel_op_pedersen, Transcript::proof_data); + serialize_to_buffer(main_sel_op_poseidon2, Transcript::proof_data); + serialize_to_buffer(main_sel_op_radix_le, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sender, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sha256, Transcript::proof_data); + serialize_to_buffer(main_sel_op_shl, Transcript::proof_data); + serialize_to_buffer(main_sel_op_shr, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sload, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sstore, Transcript::proof_data); + serialize_to_buffer(main_sel_op_storage_address, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sub, Transcript::proof_data); + serialize_to_buffer(main_sel_op_timestamp, Transcript::proof_data); + serialize_to_buffer(main_sel_op_transaction_fee, Transcript::proof_data); + serialize_to_buffer(main_sel_op_version, Transcript::proof_data); + serialize_to_buffer(main_sel_op_xor, Transcript::proof_data); + serialize_to_buffer(main_sel_q_kernel_lookup, Transcript::proof_data); + serialize_to_buffer(main_sel_q_kernel_output_lookup, Transcript::proof_data); + serialize_to_buffer(main_sel_resolve_ind_addr_a, Transcript::proof_data); + serialize_to_buffer(main_sel_resolve_ind_addr_b, Transcript::proof_data); + serialize_to_buffer(main_sel_resolve_ind_addr_c, Transcript::proof_data); + serialize_to_buffer(main_sel_resolve_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(main_sel_rng_16, Transcript::proof_data); + serialize_to_buffer(main_sel_rng_8, Transcript::proof_data); + serialize_to_buffer(main_space_id, Transcript::proof_data); + serialize_to_buffer(main_tag_err, Transcript::proof_data); + serialize_to_buffer(main_w_in_tag, Transcript::proof_data); + serialize_to_buffer(mem_addr, Transcript::proof_data); + serialize_to_buffer(mem_clk, Transcript::proof_data); + serialize_to_buffer(mem_diff_hi, Transcript::proof_data); + serialize_to_buffer(mem_diff_lo, Transcript::proof_data); + serialize_to_buffer(mem_diff_mid, Transcript::proof_data); + serialize_to_buffer(mem_glob_addr, Transcript::proof_data); + serialize_to_buffer(mem_last, Transcript::proof_data); + serialize_to_buffer(mem_lastAccess, Transcript::proof_data); + serialize_to_buffer(mem_one_min_inv, Transcript::proof_data); + serialize_to_buffer(mem_r_in_tag, Transcript::proof_data); + serialize_to_buffer(mem_rw, Transcript::proof_data); + serialize_to_buffer(mem_sel_mem, Transcript::proof_data); + serialize_to_buffer(mem_sel_mov_ia_to_ic, Transcript::proof_data); + serialize_to_buffer(mem_sel_mov_ib_to_ic, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_a, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_b, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_c, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_cd, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_cmov, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_d, Transcript::proof_data); + serialize_to_buffer(mem_sel_resolve_ind_addr_a, Transcript::proof_data); + serialize_to_buffer(mem_sel_resolve_ind_addr_b, Transcript::proof_data); + serialize_to_buffer(mem_sel_resolve_ind_addr_c, Transcript::proof_data); + serialize_to_buffer(mem_sel_resolve_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(mem_sel_rng_chk, Transcript::proof_data); + serialize_to_buffer(mem_skip_check_tag, Transcript::proof_data); + serialize_to_buffer(mem_space_id, Transcript::proof_data); + serialize_to_buffer(mem_tag, Transcript::proof_data); + serialize_to_buffer(mem_tag_err, Transcript::proof_data); + serialize_to_buffer(mem_tsp, Transcript::proof_data); + serialize_to_buffer(mem_val, Transcript::proof_data); + serialize_to_buffer(mem_w_in_tag, Transcript::proof_data); + serialize_to_buffer(pedersen_clk, Transcript::proof_data); + serialize_to_buffer(pedersen_input, Transcript::proof_data); + serialize_to_buffer(pedersen_output, Transcript::proof_data); + serialize_to_buffer(pedersen_sel_pedersen, Transcript::proof_data); + serialize_to_buffer(poseidon2_clk, Transcript::proof_data); + serialize_to_buffer(poseidon2_input, Transcript::proof_data); + serialize_to_buffer(poseidon2_output, Transcript::proof_data); + serialize_to_buffer(poseidon2_sel_poseidon_perm, Transcript::proof_data); + serialize_to_buffer(powers_power_of_2, Transcript::proof_data); + serialize_to_buffer(sha256_clk, Transcript::proof_data); + serialize_to_buffer(sha256_input, Transcript::proof_data); + serialize_to_buffer(sha256_output, Transcript::proof_data); + serialize_to_buffer(sha256_sel_sha256_compression, Transcript::proof_data); + serialize_to_buffer(sha256_state, Transcript::proof_data); + serialize_to_buffer(slice_addr, Transcript::proof_data); + serialize_to_buffer(slice_cd_offset, Transcript::proof_data); + serialize_to_buffer(slice_clk, Transcript::proof_data); + serialize_to_buffer(slice_cnt, Transcript::proof_data); + serialize_to_buffer(slice_one_min_inv, Transcript::proof_data); + serialize_to_buffer(slice_sel_cd, Transcript::proof_data); + serialize_to_buffer(slice_sel_start_cd, Transcript::proof_data); + serialize_to_buffer(slice_space_id, Transcript::proof_data); + serialize_to_buffer(slice_val, Transcript::proof_data); + serialize_to_buffer(perm_cd_mem, Transcript::proof_data); + serialize_to_buffer(perm_main_alu, Transcript::proof_data); + serialize_to_buffer(perm_main_bin, Transcript::proof_data); + serialize_to_buffer(perm_main_conv, Transcript::proof_data); + serialize_to_buffer(perm_main_pos2_perm, Transcript::proof_data); + serialize_to_buffer(perm_main_pedersen, Transcript::proof_data); + serialize_to_buffer(perm_main_cd_copy, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_a, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_b, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_c, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_d, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_ind_addr_a, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_ind_addr_b, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_ind_addr_c, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(lookup_byte_lengths, Transcript::proof_data); + serialize_to_buffer(lookup_byte_operations, Transcript::proof_data); + serialize_to_buffer(lookup_cd_value, Transcript::proof_data); + serialize_to_buffer(lookup_opcode_gas, Transcript::proof_data); + serialize_to_buffer(range_check_l2_gas_hi, Transcript::proof_data); + serialize_to_buffer(range_check_l2_gas_lo, Transcript::proof_data); + serialize_to_buffer(range_check_da_gas_hi, Transcript::proof_data); + serialize_to_buffer(range_check_da_gas_lo, Transcript::proof_data); + serialize_to_buffer(kernel_output_lookup, Transcript::proof_data); + serialize_to_buffer(lookup_into_kernel, Transcript::proof_data); + serialize_to_buffer(incl_main_tag_err, Transcript::proof_data); + serialize_to_buffer(incl_mem_tag_err, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_lo, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_mid, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_hi, Transcript::proof_data); + serialize_to_buffer(lookup_pow_2_0, Transcript::proof_data); + serialize_to_buffer(lookup_pow_2_1, Transcript::proof_data); + serialize_to_buffer(lookup_u8_0, Transcript::proof_data); + serialize_to_buffer(lookup_u8_1, Transcript::proof_data); + serialize_to_buffer(lookup_u16_0, Transcript::proof_data); + serialize_to_buffer(lookup_u16_1, Transcript::proof_data); + serialize_to_buffer(lookup_u16_2, Transcript::proof_data); + serialize_to_buffer(lookup_u16_3, Transcript::proof_data); + serialize_to_buffer(lookup_u16_4, Transcript::proof_data); + serialize_to_buffer(lookup_u16_5, Transcript::proof_data); + serialize_to_buffer(lookup_u16_6, Transcript::proof_data); + serialize_to_buffer(lookup_u16_7, Transcript::proof_data); + serialize_to_buffer(lookup_u16_8, Transcript::proof_data); + serialize_to_buffer(lookup_u16_9, Transcript::proof_data); + serialize_to_buffer(lookup_u16_10, Transcript::proof_data); + serialize_to_buffer(lookup_u16_11, Transcript::proof_data); + serialize_to_buffer(lookup_u16_12, Transcript::proof_data); + serialize_to_buffer(lookup_u16_13, Transcript::proof_data); + serialize_to_buffer(lookup_u16_14, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_0, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_1, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_2, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_3, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_4, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_5, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_6, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_7, Transcript::proof_data); + serialize_to_buffer(lookup_byte_lengths_counts, Transcript::proof_data); + serialize_to_buffer(lookup_byte_operations_counts, Transcript::proof_data); + serialize_to_buffer(lookup_cd_value_counts, Transcript::proof_data); + serialize_to_buffer(lookup_opcode_gas_counts, Transcript::proof_data); + serialize_to_buffer(range_check_l2_gas_hi_counts, Transcript::proof_data); + serialize_to_buffer(range_check_l2_gas_lo_counts, Transcript::proof_data); + serialize_to_buffer(range_check_da_gas_hi_counts, Transcript::proof_data); + serialize_to_buffer(range_check_da_gas_lo_counts, Transcript::proof_data); + serialize_to_buffer(kernel_output_lookup_counts, Transcript::proof_data); + serialize_to_buffer(lookup_into_kernel_counts, Transcript::proof_data); + serialize_to_buffer(incl_main_tag_err_counts, Transcript::proof_data); + serialize_to_buffer(incl_mem_tag_err_counts, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_lo_counts, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_mid_counts, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_hi_counts, Transcript::proof_data); + serialize_to_buffer(lookup_pow_2_0_counts, Transcript::proof_data); + serialize_to_buffer(lookup_pow_2_1_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u8_0_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u8_1_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_0_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_1_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_2_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_3_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_4_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_5_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_6_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_7_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_8_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_9_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_10_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_11_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_12_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_13_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_14_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_0_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_1_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_2_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_3_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_4_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_5_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_6_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_7_counts, Transcript::proof_data); + +>>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) for (size_t i = 0; i < log_n; ++i) { serialize_to_buffer(sumcheck_univariates[i], Transcript::proof_data); } diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp index 3cda79780a3..7c214616b3d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp @@ -193,6 +193,7 @@ template std::vector AvmFullRow::names() "main_rwd", "main_sel_alu", "main_sel_bin", + "main_sel_cd", "main_sel_gas_accounting_active", "main_sel_last", "main_sel_mem_op_a", @@ -206,6 +207,7 @@ template std::vector AvmFullRow::names() "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", @@ -282,6 +284,7 @@ template std::vector AvmFullRow::names() "mem_sel_op_a", "mem_sel_op_b", "mem_sel_op_c", + "mem_sel_op_cd", "mem_sel_op_cmov", "mem_sel_op_d", "mem_sel_resolve_ind_addr_a", @@ -310,11 +313,22 @@ template std::vector AvmFullRow::names() "sha256_output", "sha256_sel_sha256_compression", "sha256_state", + "slice_addr", + "slice_cd_offset", + "slice_clk", + "slice_cnt", + "slice_one_min_inv", + "slice_sel_cd", + "slice_sel_start_cd", + "slice_space_id", + "slice_val", + "perm_cd_mem", "perm_main_alu", "perm_main_bin", "perm_main_conv", "perm_main_pos2_perm", "perm_main_pedersen", + "perm_main_cd_copy", "perm_main_mem_a", "perm_main_mem_b", "perm_main_mem_c", @@ -325,6 +339,7 @@ template std::vector AvmFullRow::names() "perm_main_mem_ind_addr_d", "lookup_byte_lengths", "lookup_byte_operations", + "lookup_cd_value", "lookup_opcode_gas", "range_check_l2_gas_hi", "range_check_l2_gas_lo", @@ -366,6 +381,7 @@ template std::vector AvmFullRow::names() "lookup_div_u16_7", "lookup_byte_lengths_counts", "lookup_byte_operations_counts", + "lookup_cd_value_counts", "lookup_opcode_gas_counts", "range_check_l2_gas_hi_counts", "range_check_l2_gas_lo_counts", @@ -584,6 +600,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_rwd) // << "," << field_to_string(row.main_sel_alu) // << "," << field_to_string(row.main_sel_bin) // + << "," << field_to_string(row.main_sel_cd) // << "," << field_to_string(row.main_sel_gas_accounting_active) // << "," << field_to_string(row.main_sel_last) // << "," << field_to_string(row.main_sel_mem_op_a) // @@ -597,6 +614,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_sel_op_address) // << "," << field_to_string(row.main_sel_op_and) // << "," << field_to_string(row.main_sel_op_block_number) // + << "," << field_to_string(row.main_sel_op_calldata_copy) // << "," << field_to_string(row.main_sel_op_cast) // << "," << field_to_string(row.main_sel_op_chain_id) // << "," << field_to_string(row.main_sel_op_cmov) // @@ -673,6 +691,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.mem_sel_op_a) // << "," << field_to_string(row.mem_sel_op_b) // << "," << field_to_string(row.mem_sel_op_c) // + << "," << field_to_string(row.mem_sel_op_cd) // << "," << field_to_string(row.mem_sel_op_cmov) // << "," << field_to_string(row.mem_sel_op_d) // << "," << field_to_string(row.mem_sel_resolve_ind_addr_a) // @@ -701,11 +720,22 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.sha256_output) // << "," << field_to_string(row.sha256_sel_sha256_compression) // << "," << field_to_string(row.sha256_state) // + << "," << field_to_string(row.slice_addr) // + << "," << field_to_string(row.slice_cd_offset) // + << "," << field_to_string(row.slice_clk) // + << "," << field_to_string(row.slice_cnt) // + << "," << field_to_string(row.slice_one_min_inv) // + << "," << field_to_string(row.slice_sel_cd) // + << "," << field_to_string(row.slice_sel_start_cd) // + << "," << field_to_string(row.slice_space_id) // + << "," << field_to_string(row.slice_val) // + << "," << field_to_string(row.perm_cd_mem) // << "," << field_to_string(row.perm_main_alu) // << "," << field_to_string(row.perm_main_bin) // << "," << field_to_string(row.perm_main_conv) // << "," << field_to_string(row.perm_main_pos2_perm) // << "," << field_to_string(row.perm_main_pedersen) // + << "," << field_to_string(row.perm_main_cd_copy) // << "," << field_to_string(row.perm_main_mem_a) // << "," << field_to_string(row.perm_main_mem_b) // << "," << field_to_string(row.perm_main_mem_c) // @@ -716,6 +746,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.perm_main_mem_ind_addr_d) // << "," << field_to_string(row.lookup_byte_lengths) // << "," << field_to_string(row.lookup_byte_operations) // + << "," << field_to_string(row.lookup_cd_value) // << "," << field_to_string(row.lookup_opcode_gas) // << "," << field_to_string(row.range_check_l2_gas_hi) // << "," << field_to_string(row.range_check_l2_gas_lo) // @@ -757,6 +788,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.lookup_div_u16_7) // << "," << field_to_string(row.lookup_byte_lengths_counts) // << "," << field_to_string(row.lookup_byte_operations_counts) // + << "," << field_to_string(row.lookup_cd_value_counts) // << "," << field_to_string(row.lookup_opcode_gas_counts) // << "," << field_to_string(row.range_check_l2_gas_hi_counts) // << "," << field_to_string(row.range_check_l2_gas_lo_counts) // diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp index 23762777a9f..54470c49aa1 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp @@ -96,6 +96,7 @@ void AvmProver::execute_log_derivative_inverse_round() compute_logderivative_rel(relation_parameters, prover_polynomials, key->circuit_size); // Commit to all logderivative inverse polynomials +<<<<<<< HEAD for (auto [commitment, key_poly] : zip_view(witness_commitments.get_derived(), key->get_derived())) { commitment = commitment_key->commit(key_poly); } @@ -104,6 +105,128 @@ void AvmProver::execute_log_derivative_inverse_round() for (auto [label, commitment] : zip_view(commitment_labels.get_derived(), witness_commitments.get_derived())) { transcript->send_to_verifier(label, commitment); } +======= + witness_commitments.perm_cd_mem = commitment_key->commit(key->perm_cd_mem); + witness_commitments.perm_main_alu = commitment_key->commit(key->perm_main_alu); + witness_commitments.perm_main_bin = commitment_key->commit(key->perm_main_bin); + witness_commitments.perm_main_conv = commitment_key->commit(key->perm_main_conv); + witness_commitments.perm_main_pos2_perm = commitment_key->commit(key->perm_main_pos2_perm); + witness_commitments.perm_main_pedersen = commitment_key->commit(key->perm_main_pedersen); + witness_commitments.perm_main_cd_copy = commitment_key->commit(key->perm_main_cd_copy); + witness_commitments.perm_main_mem_a = commitment_key->commit(key->perm_main_mem_a); + witness_commitments.perm_main_mem_b = commitment_key->commit(key->perm_main_mem_b); + witness_commitments.perm_main_mem_c = commitment_key->commit(key->perm_main_mem_c); + witness_commitments.perm_main_mem_d = commitment_key->commit(key->perm_main_mem_d); + witness_commitments.perm_main_mem_ind_addr_a = commitment_key->commit(key->perm_main_mem_ind_addr_a); + witness_commitments.perm_main_mem_ind_addr_b = commitment_key->commit(key->perm_main_mem_ind_addr_b); + witness_commitments.perm_main_mem_ind_addr_c = commitment_key->commit(key->perm_main_mem_ind_addr_c); + witness_commitments.perm_main_mem_ind_addr_d = commitment_key->commit(key->perm_main_mem_ind_addr_d); + witness_commitments.lookup_byte_lengths = commitment_key->commit(key->lookup_byte_lengths); + witness_commitments.lookup_byte_operations = commitment_key->commit(key->lookup_byte_operations); + witness_commitments.lookup_cd_value = commitment_key->commit(key->lookup_cd_value); + witness_commitments.lookup_opcode_gas = commitment_key->commit(key->lookup_opcode_gas); + witness_commitments.range_check_l2_gas_hi = commitment_key->commit(key->range_check_l2_gas_hi); + witness_commitments.range_check_l2_gas_lo = commitment_key->commit(key->range_check_l2_gas_lo); + witness_commitments.range_check_da_gas_hi = commitment_key->commit(key->range_check_da_gas_hi); + witness_commitments.range_check_da_gas_lo = commitment_key->commit(key->range_check_da_gas_lo); + witness_commitments.kernel_output_lookup = commitment_key->commit(key->kernel_output_lookup); + witness_commitments.lookup_into_kernel = commitment_key->commit(key->lookup_into_kernel); + witness_commitments.incl_main_tag_err = commitment_key->commit(key->incl_main_tag_err); + witness_commitments.incl_mem_tag_err = commitment_key->commit(key->incl_mem_tag_err); + witness_commitments.lookup_mem_rng_chk_lo = commitment_key->commit(key->lookup_mem_rng_chk_lo); + witness_commitments.lookup_mem_rng_chk_mid = commitment_key->commit(key->lookup_mem_rng_chk_mid); + witness_commitments.lookup_mem_rng_chk_hi = commitment_key->commit(key->lookup_mem_rng_chk_hi); + witness_commitments.lookup_pow_2_0 = commitment_key->commit(key->lookup_pow_2_0); + witness_commitments.lookup_pow_2_1 = commitment_key->commit(key->lookup_pow_2_1); + witness_commitments.lookup_u8_0 = commitment_key->commit(key->lookup_u8_0); + witness_commitments.lookup_u8_1 = commitment_key->commit(key->lookup_u8_1); + witness_commitments.lookup_u16_0 = commitment_key->commit(key->lookup_u16_0); + witness_commitments.lookup_u16_1 = commitment_key->commit(key->lookup_u16_1); + witness_commitments.lookup_u16_2 = commitment_key->commit(key->lookup_u16_2); + witness_commitments.lookup_u16_3 = commitment_key->commit(key->lookup_u16_3); + witness_commitments.lookup_u16_4 = commitment_key->commit(key->lookup_u16_4); + witness_commitments.lookup_u16_5 = commitment_key->commit(key->lookup_u16_5); + witness_commitments.lookup_u16_6 = commitment_key->commit(key->lookup_u16_6); + witness_commitments.lookup_u16_7 = commitment_key->commit(key->lookup_u16_7); + witness_commitments.lookup_u16_8 = commitment_key->commit(key->lookup_u16_8); + witness_commitments.lookup_u16_9 = commitment_key->commit(key->lookup_u16_9); + witness_commitments.lookup_u16_10 = commitment_key->commit(key->lookup_u16_10); + witness_commitments.lookup_u16_11 = commitment_key->commit(key->lookup_u16_11); + witness_commitments.lookup_u16_12 = commitment_key->commit(key->lookup_u16_12); + witness_commitments.lookup_u16_13 = commitment_key->commit(key->lookup_u16_13); + witness_commitments.lookup_u16_14 = commitment_key->commit(key->lookup_u16_14); + witness_commitments.lookup_div_u16_0 = commitment_key->commit(key->lookup_div_u16_0); + witness_commitments.lookup_div_u16_1 = commitment_key->commit(key->lookup_div_u16_1); + witness_commitments.lookup_div_u16_2 = commitment_key->commit(key->lookup_div_u16_2); + witness_commitments.lookup_div_u16_3 = commitment_key->commit(key->lookup_div_u16_3); + witness_commitments.lookup_div_u16_4 = commitment_key->commit(key->lookup_div_u16_4); + witness_commitments.lookup_div_u16_5 = commitment_key->commit(key->lookup_div_u16_5); + witness_commitments.lookup_div_u16_6 = commitment_key->commit(key->lookup_div_u16_6); + witness_commitments.lookup_div_u16_7 = commitment_key->commit(key->lookup_div_u16_7); + + // Send all commitments to the verifier + transcript->send_to_verifier(commitment_labels.perm_cd_mem, witness_commitments.perm_cd_mem); + transcript->send_to_verifier(commitment_labels.perm_main_alu, witness_commitments.perm_main_alu); + transcript->send_to_verifier(commitment_labels.perm_main_bin, witness_commitments.perm_main_bin); + transcript->send_to_verifier(commitment_labels.perm_main_conv, witness_commitments.perm_main_conv); + transcript->send_to_verifier(commitment_labels.perm_main_pos2_perm, witness_commitments.perm_main_pos2_perm); + transcript->send_to_verifier(commitment_labels.perm_main_pedersen, witness_commitments.perm_main_pedersen); + transcript->send_to_verifier(commitment_labels.perm_main_cd_copy, witness_commitments.perm_main_cd_copy); + transcript->send_to_verifier(commitment_labels.perm_main_mem_a, witness_commitments.perm_main_mem_a); + transcript->send_to_verifier(commitment_labels.perm_main_mem_b, witness_commitments.perm_main_mem_b); + transcript->send_to_verifier(commitment_labels.perm_main_mem_c, witness_commitments.perm_main_mem_c); + transcript->send_to_verifier(commitment_labels.perm_main_mem_d, witness_commitments.perm_main_mem_d); + transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_a, + witness_commitments.perm_main_mem_ind_addr_a); + transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_b, + witness_commitments.perm_main_mem_ind_addr_b); + transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_c, + witness_commitments.perm_main_mem_ind_addr_c); + transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_d, + witness_commitments.perm_main_mem_ind_addr_d); + transcript->send_to_verifier(commitment_labels.lookup_byte_lengths, witness_commitments.lookup_byte_lengths); + transcript->send_to_verifier(commitment_labels.lookup_byte_operations, witness_commitments.lookup_byte_operations); + transcript->send_to_verifier(commitment_labels.lookup_cd_value, witness_commitments.lookup_cd_value); + transcript->send_to_verifier(commitment_labels.lookup_opcode_gas, witness_commitments.lookup_opcode_gas); + transcript->send_to_verifier(commitment_labels.range_check_l2_gas_hi, witness_commitments.range_check_l2_gas_hi); + transcript->send_to_verifier(commitment_labels.range_check_l2_gas_lo, witness_commitments.range_check_l2_gas_lo); + transcript->send_to_verifier(commitment_labels.range_check_da_gas_hi, witness_commitments.range_check_da_gas_hi); + transcript->send_to_verifier(commitment_labels.range_check_da_gas_lo, witness_commitments.range_check_da_gas_lo); + transcript->send_to_verifier(commitment_labels.kernel_output_lookup, witness_commitments.kernel_output_lookup); + transcript->send_to_verifier(commitment_labels.lookup_into_kernel, witness_commitments.lookup_into_kernel); + transcript->send_to_verifier(commitment_labels.incl_main_tag_err, witness_commitments.incl_main_tag_err); + transcript->send_to_verifier(commitment_labels.incl_mem_tag_err, witness_commitments.incl_mem_tag_err); + transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_lo, witness_commitments.lookup_mem_rng_chk_lo); + transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_mid, witness_commitments.lookup_mem_rng_chk_mid); + transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_hi, witness_commitments.lookup_mem_rng_chk_hi); + transcript->send_to_verifier(commitment_labels.lookup_pow_2_0, witness_commitments.lookup_pow_2_0); + transcript->send_to_verifier(commitment_labels.lookup_pow_2_1, witness_commitments.lookup_pow_2_1); + transcript->send_to_verifier(commitment_labels.lookup_u8_0, witness_commitments.lookup_u8_0); + transcript->send_to_verifier(commitment_labels.lookup_u8_1, witness_commitments.lookup_u8_1); + transcript->send_to_verifier(commitment_labels.lookup_u16_0, witness_commitments.lookup_u16_0); + transcript->send_to_verifier(commitment_labels.lookup_u16_1, witness_commitments.lookup_u16_1); + transcript->send_to_verifier(commitment_labels.lookup_u16_2, witness_commitments.lookup_u16_2); + transcript->send_to_verifier(commitment_labels.lookup_u16_3, witness_commitments.lookup_u16_3); + transcript->send_to_verifier(commitment_labels.lookup_u16_4, witness_commitments.lookup_u16_4); + transcript->send_to_verifier(commitment_labels.lookup_u16_5, witness_commitments.lookup_u16_5); + transcript->send_to_verifier(commitment_labels.lookup_u16_6, witness_commitments.lookup_u16_6); + transcript->send_to_verifier(commitment_labels.lookup_u16_7, witness_commitments.lookup_u16_7); + transcript->send_to_verifier(commitment_labels.lookup_u16_8, witness_commitments.lookup_u16_8); + transcript->send_to_verifier(commitment_labels.lookup_u16_9, witness_commitments.lookup_u16_9); + transcript->send_to_verifier(commitment_labels.lookup_u16_10, witness_commitments.lookup_u16_10); + transcript->send_to_verifier(commitment_labels.lookup_u16_11, witness_commitments.lookup_u16_11); + transcript->send_to_verifier(commitment_labels.lookup_u16_12, witness_commitments.lookup_u16_12); + transcript->send_to_verifier(commitment_labels.lookup_u16_13, witness_commitments.lookup_u16_13); + transcript->send_to_verifier(commitment_labels.lookup_u16_14, witness_commitments.lookup_u16_14); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_0, witness_commitments.lookup_div_u16_0); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_1, witness_commitments.lookup_div_u16_1); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_2, witness_commitments.lookup_div_u16_2); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_3, witness_commitments.lookup_div_u16_3); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_4, witness_commitments.lookup_div_u16_4); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_5, witness_commitments.lookup_div_u16_5); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_6, witness_commitments.lookup_div_u16_6); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_7, witness_commitments.lookup_div_u16_7); +>>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) } /** diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp index b1046c8400a..1e9486fe734 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp @@ -79,6 +79,7 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vectortemplate receive_from_prover(commitment_labels.perm_cd_mem); commitments.perm_main_alu = transcript->template receive_from_prover(commitment_labels.perm_main_alu); commitments.perm_main_bin = transcript->template receive_from_prover(commitment_labels.perm_main_bin); commitments.perm_main_conv = transcript->template receive_from_prover(commitment_labels.perm_main_conv); @@ -86,6 +87,8 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vectortemplate receive_from_prover(commitment_labels.perm_main_pos2_perm); commitments.perm_main_pedersen = transcript->template receive_from_prover(commitment_labels.perm_main_pedersen); + commitments.perm_main_cd_copy = + transcript->template receive_from_prover(commitment_labels.perm_main_cd_copy); commitments.perm_main_mem_a = transcript->template receive_from_prover(commitment_labels.perm_main_mem_a); commitments.perm_main_mem_b = @@ -106,6 +109,8 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vectortemplate receive_from_prover(commitment_labels.lookup_byte_lengths); commitments.lookup_byte_operations = transcript->template receive_from_prover(commitment_labels.lookup_byte_operations); + commitments.lookup_cd_value = + transcript->template receive_from_prover(commitment_labels.lookup_cd_value); commitments.lookup_opcode_gas = transcript->template receive_from_prover(commitment_labels.lookup_opcode_gas); commitments.range_check_l2_gas_hi = From 80c50738e8ca9324b1a3ab29c59255590d5078ad Mon Sep 17 00:00:00 2001 From: jeanmon Date: Thu, 4 Jul 2024 15:58:00 +0000 Subject: [PATCH 02/12] 7211: witness generation for calldata copy gadget --- barretenberg/cpp/pil/avm/main.pil | 13 +- .../relations/generated/avm/declare_views.hpp | 1 + .../relations/generated/avm/main.hpp | 20 +- .../generated/avm/perm_main_cd_copy.hpp | 10 +- .../vm/avm_trace/avm_gas_trace.cpp | 2 +- .../vm/avm_trace/avm_mem_trace.cpp | 58 +++-- .../vm/avm_trace/avm_mem_trace.hpp | 10 +- .../barretenberg/vm/avm_trace/avm_trace.cpp | 236 ++++++++---------- .../barretenberg/vm/avm_trace/avm_trace.hpp | 6 + .../vm/avm_trace/gadgets/avm_slice_trace.cpp | 43 ++++ .../vm/avm_trace/gadgets/avm_slice_trace.hpp | 58 +++++ .../vm/generated/avm_circuit_builder.hpp | 6 +- .../barretenberg/vm/generated/avm_flavor.hpp | 9 +- .../vm/generated/avm_full_row.cpp | 2 + 14 files changed, 299 insertions(+), 175 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp diff --git a/barretenberg/cpp/pil/avm/main.pil b/barretenberg/cpp/pil/avm/main.pil index 5f46a54471c..25cf9a8aa4a 100644 --- a/barretenberg/cpp/pil/avm/main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -486,7 +486,7 @@ namespace main(256); // TODO: sel_gas_accounting_active is activating gas accounting on a given row. All opcode with selectors // are activated through the relation below. The other opcodes which are implemented purely - // through memory sub-operations such as CALLDATACOPY, RETURN, SET are activated by + // through memory sub-operations such as RETURN, SET are activated by // setting a newly introduced boolean sel_mem_op_activate_gas which is set in witness generation. // We should remove this shortcut and constrain this activation through bytecode decomposition. // Alternatively, we introduce a boolean selector for the three opcodes mentioned above. @@ -664,13 +664,20 @@ namespace main(256); // We increment the side effect counter by 1 KERNEL_OUTPUT_SELECTORS * (kernel.side_effect_counter' - (kernel.side_effect_counter + 1)) = 0; + //===== Memory Slice Constraints ============================================ + pol commit sel_calldata_gadget; // Selector to activate the calldatacopy operation in the gadget (#[PERM_MAIN_CD_COPY]). + + // Activate only if tag_err is disabled + sel_calldata_gadget = sel_op_calldata_copy * (1 - tag_err); + + //====== Inter-table Constraints ============================================ + #[KERNEL_OUTPUT_LOOKUP] sel_q_kernel_output_lookup {kernel.kernel_out_offset, ia, kernel.side_effect_counter, ib} in kernel.q_public_input_kernel_out_add_to_table {clk, kernel.kernel_value_out, kernel.kernel_side_effect_out, kernel.kernel_metadata_out}; #[LOOKUP_INTO_KERNEL] sel_q_kernel_lookup { main.ia, kernel.kernel_in_offset } in kernel.q_public_input_kernel_add_to_table { kernel.kernel_inputs, clk }; - //====== Inter-table Constraints ============================================ #[INCL_MAIN_TAG_ERR] mem.tag_err {mem.clk} in tag_err {clk}; @@ -732,7 +739,7 @@ namespace main(256); pedersen.sel_pedersen {pedersen.clk, pedersen.input}; #[PERM_MAIN_CD_COPY] - sel_op_calldata_copy {ia, ib, mem_addr_c} + sel_calldata_gadget {ia, ib, mem_addr_c} is slice.sel_start_cd {slice.cd_offset, slice.cnt, slice.addr}; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp index a1fe196f78e..1fc65bda50c 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -184,6 +184,7 @@ [[maybe_unused]] auto main_rwd = View(new_term.main_rwd); \ [[maybe_unused]] auto main_sel_alu = View(new_term.main_sel_alu); \ [[maybe_unused]] auto main_sel_bin = View(new_term.main_sel_bin); \ + [[maybe_unused]] auto main_sel_calldata_gadget = View(new_term.main_sel_calldata_gadget); \ [[maybe_unused]] auto main_sel_cd = View(new_term.main_sel_cd); \ [[maybe_unused]] auto main_sel_gas_accounting_active = View(new_term.main_sel_gas_accounting_active); \ [[maybe_unused]] auto main_sel_last = View(new_term.main_sel_last); \ diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp index b0d5e28835c..518d37192a3 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp @@ -56,6 +56,7 @@ template struct MainRow { FF main_rwd{}; FF main_sel_alu{}; FF main_sel_bin{}; + FF main_sel_calldata_gadget{}; FF main_sel_first{}; FF main_sel_gas_accounting_active{}; FF main_sel_mem_op_a{}; @@ -230,9 +231,9 @@ inline std::string get_relation_label_main(int index) return "SLOAD_KERNEL_OUTPUT"; case 144: return "SSTORE_KERNEL_OUTPUT"; - case 147: - return "BIN_SEL_1"; case 148: + return "BIN_SEL_1"; + case 149: return "BIN_SEL_2"; } return std::to_string(index); @@ -242,12 +243,12 @@ template class mainImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 5, 5, 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, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2 }; template @@ -1450,17 +1451,24 @@ template class mainImpl { // Contribution 147 { Avm_DECLARE_VIEWS(147); - auto tmp = (main_bin_op_id - (main_sel_op_or + (main_sel_op_xor * FF(2)))); + auto tmp = (main_sel_calldata_gadget - (main_sel_op_calldata_copy * (-main_tag_err + FF(1)))); tmp *= scaling_factor; std::get<147>(evals) += tmp; } // Contribution 148 { Avm_DECLARE_VIEWS(148); - auto tmp = (main_sel_bin - ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)); + auto tmp = (main_bin_op_id - (main_sel_op_or + (main_sel_op_xor * FF(2)))); tmp *= scaling_factor; std::get<148>(evals) += tmp; } + // Contribution 149 + { + Avm_DECLARE_VIEWS(149); + auto tmp = (main_sel_bin - ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)); + tmp *= scaling_factor; + std::get<149>(evals) += tmp; + } } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp index 2eedfe53bf1..f23d5598e81 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp @@ -23,7 +23,7 @@ class perm_main_cd_copy_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.main_sel_op_calldata_copy == 1 || in.slice_sel_start_cd == 1); + return (in.main_sel_calldata_gadget == 1 || in.slice_sel_start_cd == 1); } /** @@ -47,8 +47,8 @@ class perm_main_cd_copy_permutation_settings { { return std::forward_as_tuple(in.perm_main_cd_copy, - in.main_sel_op_calldata_copy, - in.main_sel_op_calldata_copy, + in.main_sel_calldata_gadget, + in.main_sel_calldata_gadget, in.slice_sel_start_cd, in.main_ia, in.main_ib, @@ -79,8 +79,8 @@ class perm_main_cd_copy_permutation_settings { { return std::forward_as_tuple(in.perm_main_cd_copy, - in.main_sel_op_calldata_copy, - in.main_sel_op_calldata_copy, + in.main_sel_calldata_gadget, + in.main_sel_calldata_gadget, in.slice_sel_start_cd, in.main_ia, in.main_ib, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_gas_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_gas_trace.cpp index 59b0c41d9ba..241ee80c357 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_gas_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_gas_trace.cpp @@ -16,7 +16,7 @@ void AvmGasTraceBuilder::reset() std::vector AvmGasTraceBuilder::finalize() { return std::move(gas_trace); -}; +} void AvmGasTraceBuilder::set_initial_gas(uint32_t l2_gas, uint32_t da_gas) { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp index e46fb93d670..05f14e3c38f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp @@ -49,28 +49,29 @@ std::vector AvmMemTraceBuilder::finalize() * @param r_in_tag Read memory tag pertaining to the instruction * @param w_in_tag Write memory tag pertaining to the instruction * @param m_rw Boolean telling whether it is a load (false) or store operation (true). + * @param sel_op_cd Specific boolean selector for calldata_copy memory slice */ void AvmMemTraceBuilder::insert_in_mem_trace(uint8_t space_id, - uint32_t const m_clk, - uint32_t const m_sub_clk, - uint32_t const m_addr, + uint32_t m_clk, + uint32_t m_sub_clk, + uint32_t m_addr, FF const& m_val, - AvmMemoryTag const m_tag, - AvmMemoryTag const r_in_tag, - AvmMemoryTag const w_in_tag, - bool const m_rw) + AvmMemoryTag m_tag, + AvmMemoryTag r_in_tag, + AvmMemoryTag w_in_tag, + bool m_rw, + bool sel_op_cd) { - mem_trace.emplace_back(MemoryTraceEntry{ - .m_space_id = space_id, - .m_clk = m_clk, - .m_sub_clk = m_sub_clk, - .m_addr = m_addr, - .m_val = m_val, - .m_tag = m_tag, - .r_in_tag = r_in_tag, - .w_in_tag = w_in_tag, - .m_rw = m_rw, - }); + mem_trace.emplace_back(MemoryTraceEntry{ .m_space_id = space_id, + .m_clk = m_clk, + .m_sub_clk = m_sub_clk, + .m_addr = m_addr, + .m_val = m_val, + .m_tag = m_tag, + .r_in_tag = r_in_tag, + .w_in_tag = w_in_tag, + .m_rw = m_rw, + .m_sel_op_cd = sel_op_cd }); } // Memory operations need to be performed before the addition of the corresponding row in @@ -483,6 +484,27 @@ void AvmMemTraceBuilder::write_into_memory(uint8_t space_id, store_in_mem_trace(space_id, clk, interm_reg, addr, val, r_in_tag, w_in_tag); } +void AvmMemTraceBuilder::write_calldata_copy(std::vector const& calldata, + uint32_t clk, + uint8_t space_id, + uint32_t cd_offset, + uint32_t copy_size, + uint32_t direct_dst_offset) +{ + for (uint32_t i = 0; i < copy_size; i++) { + insert_in_mem_trace(space_id, + clk, + SUB_CLK_STORE_A, // Specific re-use of this value for calldatacopy write slice. + direct_dst_offset + i, + calldata.at(cd_offset + i), + AvmMemoryTag::FF, + AvmMemoryTag::U0, + AvmMemoryTag::FF, + true, + true); + } +} + bool AvmMemTraceBuilder::MemoryTraceEntry::operator<(const AvmMemTraceBuilder::MemoryTraceEntry& other) const { if (m_space_id < other.m_space_id) { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp index bd8e4b121e9..6fdafc4b683 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp @@ -43,6 +43,7 @@ class AvmMemTraceBuilder { bool m_sel_mov_ib_to_ic = false; bool m_sel_cmov = false; bool m_tag_err_count_relevant = false; + bool m_sel_op_cd = false; /** * @brief A comparator on MemoryTraceEntry to be used by sorting algorithm. We sort first by @@ -88,6 +89,12 @@ class AvmMemTraceBuilder { FF const& val, AvmMemoryTag r_in_tag, AvmMemoryTag w_in_tag); + void write_calldata_copy(std::vector const& calldata, + uint32_t clk, + uint8_t space_id, + uint32_t cd_offset, + uint32_t copy_size, + uint32_t direct_dst_offset); private: std::vector mem_trace; // Entries will be sorted by m_clk, m_sub_clk after finalize(). @@ -103,7 +110,8 @@ class AvmMemTraceBuilder { AvmMemoryTag m_tag, AvmMemoryTag r_in_tag, AvmMemoryTag w_in_tag, - bool m_rw); + bool m_rw, + bool sel_op_cd = false); void load_mismatch_tag_in_mem_trace(uint8_t space_id, uint32_t m_clk, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp index 805381a34e9..ff14ee01e7a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -23,6 +23,7 @@ #include "barretenberg/vm/avm_trace/avm_trace.hpp" #include "barretenberg/vm/avm_trace/fixed_gas.hpp" #include "barretenberg/vm/avm_trace/fixed_powers.hpp" +#include "barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp" namespace bb::avm_trace { @@ -1638,108 +1639,49 @@ void AvmTraceBuilder::op_fee_per_da_gas(uint8_t indirect, uint32_t dst_offset) */ void AvmTraceBuilder::op_calldata_copy(uint8_t indirect, uint32_t cd_offset, uint32_t copy_size, uint32_t dst_offset) { - // We parallelize storing memory operations in chunk of 3, i.e., 1 per intermediate register. - // The variable pos is an index pointing to the first storing operation (pertaining to intermediate - // register Ia) relative to cd_offset: - // cd_offset + pos: Ia memory store operation - // cd_offset + pos + 1: Ib memory store operation - // cd_offset + pos + 2: Ic memory store operation + auto clk = static_cast(main_trace.size()) + 1; - uint32_t pos = 0; uint32_t direct_dst_offset = dst_offset; // Will be overwritten in indirect mode. - while (pos < copy_size) { - FF ib(0); - FF ic(0); - uint32_t mem_op_b(0); - uint32_t mem_op_c(0); - uint32_t mem_addr_b(0); - uint32_t mem_addr_c(0); - uint32_t rwb(0); - uint32_t rwc(0); - auto clk = static_cast(main_trace.size()) + 1; - - FF ia = calldata.at(cd_offset + pos); - uint32_t mem_op_a(1); - uint32_t rwa = 1; - - bool indirect_flag = false; - bool tag_match = true; - - if (pos == 0 && is_operand_indirect(indirect, 0)) { - indirect_flag = true; - auto ind_read = mem_trace_builder.indirect_read_and_load_from_memory( - call_ptr, clk, IndirectRegister::IND_A, dst_offset); - direct_dst_offset = uint32_t(ind_read.val); - tag_match = ind_read.tag_match; - } - - uint32_t mem_addr_a = direct_dst_offset + pos; - - // Storing from Ia - mem_trace_builder.write_into_memory( - call_ptr, clk, IntermRegister::IA, mem_addr_a, ia, AvmMemoryTag::U0, AvmMemoryTag::FF); - - if (copy_size - pos > 1) { - ib = calldata.at(cd_offset + pos + 1); - mem_op_b = 1; - mem_addr_b = direct_dst_offset + pos + 1; - rwb = 1; - - // Storing from Ib - mem_trace_builder.write_into_memory( - call_ptr, clk, IntermRegister::IB, mem_addr_b, ib, AvmMemoryTag::U0, AvmMemoryTag::FF); - } - - if (copy_size - pos > 2) { - ic = calldata.at(cd_offset + pos + 2); - mem_op_c = 1; - mem_addr_c = direct_dst_offset + pos + 2; - rwc = 1; - - // Storing from Ic - mem_trace_builder.write_into_memory( - call_ptr, clk, IntermRegister::IC, mem_addr_c, ic, AvmMemoryTag::U0, AvmMemoryTag::FF); - } + bool indirect_flag = false; + bool tag_match = true; - // Constrain gas cost on the first row - if (pos == 0) { - gas_trace_builder.constrain_gas_lookup(clk, OpCode::CALLDATACOPY); - } + // The only memory operation performed from the main trace is a possible indirect load for resolving the + // direct destination offset stored in main_mem_addr_c. + // All the other memory operations are triggered by the slice gadget. - main_trace.push_back(Row{ - .main_clk = clk, - .main_call_ptr = call_ptr, - .main_ia = ia, - .main_ib = ib, - .main_ic = ic, - .main_ind_addr_a = indirect_flag ? FF(dst_offset) : FF(0), - .main_internal_return_ptr = FF(internal_return_ptr), - .main_mem_addr_a = FF(mem_addr_a), - .main_mem_addr_b = FF(mem_addr_b), - .main_mem_addr_c = FF(mem_addr_c), - .main_pc = FF(pc), - .main_rwa = FF(rwa), - .main_rwb = FF(rwb), - .main_rwc = FF(rwc), - .main_sel_mem_op_a = FF(mem_op_a), - .main_sel_mem_op_activate_gas = FF(static_cast( - pos == 0)), // TODO: remove in the long term. This activate gas only for the first row. - .main_sel_mem_op_b = FF(mem_op_b), - .main_sel_mem_op_c = FF(mem_op_c), - .main_sel_resolve_ind_addr_a = FF(static_cast(indirect_flag)), - .main_tag_err = FF(static_cast(!tag_match)), - .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), - }); + if (is_operand_indirect(indirect, 0)) { + indirect_flag = true; + auto ind_read = + mem_trace_builder.indirect_read_and_load_from_memory(call_ptr, clk, IndirectRegister::IND_C, dst_offset); + direct_dst_offset = uint32_t(ind_read.val); + tag_match = ind_read.tag_match; + } - if (copy_size - pos > 2) { // Guard to prevent overflow if copy_size is close to uint32_t maximum value. - pos += 3; - } else { - pos = copy_size; - } + if (tag_match) { + slice_trace_builder.create_calldata_copy_slice( + calldata, clk, call_ptr, cd_offset, copy_size, direct_dst_offset); + mem_trace_builder.write_calldata_copy(calldata, clk, call_ptr, cd_offset, copy_size, direct_dst_offset); } - pc++; + // Constrain gas cost + gas_trace_builder.constrain_gas_lookup(clk, OpCode::CALLDATACOPY); + + main_trace.push_back(Row{ + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = cd_offset, + .main_ib = copy_size, + .main_ind_addr_c = indirect_flag ? dst_offset : 0, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_addr_c = direct_dst_offset, + .main_pc = pc++, + .main_sel_calldata_gadget = static_cast(tag_match), + .main_sel_op_calldata_copy = 1, + .main_sel_resolve_ind_addr_c = static_cast(indirect_flag), + .main_tag_err = static_cast(!tag_match), + .main_w_in_tag = static_cast(AvmMemoryTag::FF), + }); } /************************************************************************************************** @@ -2310,7 +2252,6 @@ Row AvmTraceBuilder::create_kernel_output_opcode_with_set_metadata_output_from_h uint32_t data_offset, uint32_t metadata_offset) { - FF exists = execution_hints.get_side_effect_hints().at(side_effect_counter); // TODO: throw error if incorrect @@ -3407,11 +3348,11 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect, std::vector points_inf_vec; std::vector scalars_vec; AddressWithMode coords_offset = resolved_points_offset; - // Loading the points is a bit more complex since we need to read the coordinates and the infinity flags separately - // The current circuit constraints does not allow for multiple memory tags to be loaded from within the same row. - // If we could we would be able to replace the following loops with a single read_slice_to_memory call. - // For now we load the coordinates first and then the infinity flags, and finally splice them together when creating - // the points + // Loading the points is a bit more complex since we need to read the coordinates and the infinity flags + // separately The current circuit constraints does not allow for multiple memory tags to be loaded from within + // the same row. If we could we would be able to replace the following loops with a single read_slice_to_memory + // call. For now we load the coordinates first and then the infinity flags, and finally splice them together + // when creating the points // Read the coordinates first, +2 since we read 2 points per row, the first load could be indirect for (uint32_t i = 0; i < num_points; i++) { @@ -3465,7 +3406,8 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect, } // Scalar read length is num_points* 2 since scalars are stored as lo and hi limbs uint32_t scalar_read_length = num_points * 2; - // Scalars are easy to read since they are stored as [lo1, hi1, lo2, hi2, ...] with the types [FF, FF, FF,FF, ...] + // Scalars are easy to read since they are stored as [lo1, hi1, lo2, hi2, ...] with the types [FF, FF, FF,FF, + // ...] auto num_scalar_rows = read_slice_to_memory(call_ptr, clk, resolved_scalars_offset, @@ -3857,6 +3799,7 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c auto pedersen_trace = pedersen_trace_builder.finalize(); auto bin_trace = bin_trace_builder.finalize(); auto gas_trace = gas_trace_builder.finalize(); + auto slice_trace = slice_trace_builder.finalize(); const auto& fixed_gas_table = FixedGasTable::get(); size_t mem_trace_size = mem_trace.size(); size_t main_trace_size = main_trace.size(); @@ -3868,6 +3811,7 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c size_t pedersen_trace_size = pedersen_trace.size(); size_t bin_trace_size = bin_trace.size(); size_t gas_trace_size = gas_trace.size(); + size_t slice_trace_size = slice_trace.size(); // Data structure to collect all lookup counts pertaining to 16-bit/32-bit range checks in memory trace std::unordered_map mem_rng_check_lo_counts; @@ -3879,11 +3823,12 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c // 2**16 long) size_t const lookup_table_size = (bin_trace_size > 0 && range_check_required) ? 3 * (1 << 16) : 0; size_t const range_check_size = range_check_required ? UINT16_MAX + 1 : 0; - std::vector trace_sizes = { mem_trace_size, main_trace_size, alu_trace_size, - range_check_size, conv_trace_size, lookup_table_size, - sha256_trace_size, poseidon2_trace_size, pedersen_trace_size, - gas_trace_size + 1, KERNEL_INPUTS_LENGTH, KERNEL_OUTPUTS_LENGTH, - min_trace_size, fixed_gas_table.size() }; + std::vector trace_sizes = { mem_trace_size, main_trace_size, alu_trace_size, + range_check_size, conv_trace_size, lookup_table_size, + sha256_trace_size, poseidon2_trace_size, pedersen_trace_size, + gas_trace_size + 1, KERNEL_INPUTS_LENGTH, KERNEL_OUTPUTS_LENGTH, + min_trace_size, fixed_gas_table.size(), slice_trace_size, + calldata.size() }; auto trace_size = std::max_element(trace_sizes.begin(), trace_sizes.end()); // We only need to pad with zeroes to the size to the largest trace here, pow_2 padding is handled in the @@ -3925,40 +3870,44 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c 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_cd = FF(static_cast(src.m_sel_op_cd)); dest.incl_mem_tag_err_counts = FF(static_cast(src.m_tag_err_count_relevant)); - switch (src.m_sub_clk) { - case AvmMemTraceBuilder::SUB_CLK_LOAD_A: - case AvmMemTraceBuilder::SUB_CLK_STORE_A: - dest.mem_sel_op_a = 1; - break; - case AvmMemTraceBuilder::SUB_CLK_LOAD_B: - case AvmMemTraceBuilder::SUB_CLK_STORE_B: - dest.mem_sel_op_b = 1; - break; - case AvmMemTraceBuilder::SUB_CLK_LOAD_C: - case AvmMemTraceBuilder::SUB_CLK_STORE_C: - dest.mem_sel_op_c = 1; - break; - case AvmMemTraceBuilder::SUB_CLK_LOAD_D: - case AvmMemTraceBuilder::SUB_CLK_STORE_D: - dest.mem_sel_op_d = 1; - break; - case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_A: - dest.mem_sel_resolve_ind_addr_a = 1; - break; - case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_B: - dest.mem_sel_resolve_ind_addr_b = 1; - break; - case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_C: - dest.mem_sel_resolve_ind_addr_c = 1; - break; - case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_D: - dest.mem_sel_resolve_ind_addr_d = 1; - break; - default: - break; + // Calldatacopy memory operations are handled differently and are activated by m_sel_op_cd. + if (!src.m_sel_op_cd) { + switch (src.m_sub_clk) { + case AvmMemTraceBuilder::SUB_CLK_LOAD_A: + case AvmMemTraceBuilder::SUB_CLK_STORE_A: + dest.mem_sel_op_a = 1; + break; + case AvmMemTraceBuilder::SUB_CLK_LOAD_B: + case AvmMemTraceBuilder::SUB_CLK_STORE_B: + dest.mem_sel_op_b = 1; + break; + case AvmMemTraceBuilder::SUB_CLK_LOAD_C: + case AvmMemTraceBuilder::SUB_CLK_STORE_C: + dest.mem_sel_op_c = 1; + break; + case AvmMemTraceBuilder::SUB_CLK_LOAD_D: + case AvmMemTraceBuilder::SUB_CLK_STORE_D: + dest.mem_sel_op_d = 1; + break; + case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_A: + dest.mem_sel_resolve_ind_addr_a = 1; + break; + case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_B: + dest.mem_sel_resolve_ind_addr_b = 1; + break; + case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_C: + dest.mem_sel_resolve_ind_addr_c = 1; + break; + case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_D: + dest.mem_sel_resolve_ind_addr_d = 1; + break; + default: + break; + } } if (src.m_sel_cmov) { @@ -4208,6 +4157,13 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c dest.pedersen_sel_pedersen = FF(1); } + /********************************************************************************************** + * SLICE TRACE INCLUSION + **********************************************************************************************/ + for (size_t i = 0; i < slice_trace_size; i++) { + merge_into(main_trace.at(i), slice_trace.at(i)); + } + /********************************************************************************************** * BINARY TRACE INCLUSION **********************************************************************************************/ @@ -4653,6 +4609,11 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c main_trace.at(i).main_calldata = calldata.at(i); } + // calldata loookup counts for calldatacopy operations + for (auto const& [cd_offset, count] : slice_trace_builder.cd_lookup_counts) { + main_trace.at(cd_offset).lookup_cd_value_counts = count; + } + // Get tag_err counts from the mem_trace_builder if (range_check_required) { finalise_mem_trace_lookup_counts(); @@ -4692,6 +4653,7 @@ void AvmTraceBuilder::reset() poseidon2_trace_builder.reset(); keccak_trace_builder.reset(); pedersen_trace_builder.reset(); + slice_trace_builder.reset(); external_call_counter = 0; } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp index 01392ef683c..83a63b50d20 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp @@ -16,6 +16,11 @@ #include "barretenberg/vm/avm_trace/gadgets/avm_pedersen.hpp" #include "barretenberg/vm/avm_trace/gadgets/avm_poseidon2.hpp" #include "barretenberg/vm/avm_trace/gadgets/avm_sha256.hpp" +<<<<<<< HEAD +======= +#include "barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp" +#include "barretenberg/vm/generated/avm_circuit_builder.hpp" +>>>>>>> 9e38cd0464 (7211: witness generation for calldata copy gadget) namespace bb::avm_trace { @@ -185,6 +190,7 @@ class AvmTraceBuilder { AvmKeccakTraceBuilder keccak_trace_builder; AvmPedersenTraceBuilder pedersen_trace_builder; AvmEccTraceBuilder ecc_trace_builder; + AvmSliceTraceBuilder slice_trace_builder; std::vector calldata{}; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp new file mode 100644 index 00000000000..29ab56e5cda --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp @@ -0,0 +1,43 @@ +#include "barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp" + +#include +#include + +namespace bb::avm_trace { + +void AvmSliceTraceBuilder::reset() +{ + slice_trace.clear(); + cd_lookup_counts.clear(); +} + +std::vector AvmSliceTraceBuilder::finalize() +{ + return std::move(slice_trace); +} + +void AvmSliceTraceBuilder::create_calldata_copy_slice(std::vector const& calldata, + uint32_t clk, + uint8_t space_id, + uint32_t cd_offset, + uint32_t copy_size, + uint32_t direct_dst_offset) +{ + for (uint32_t i = 0; i < copy_size; i++) { + slice_trace.push_back({ .clk = clk, + .space_id = space_id, + .addr = direct_dst_offset + i, + .val = calldata.at(cd_offset + i), + .cd_offset = cd_offset + i, + .cnt = copy_size - i, + .one_min_inv = FF(1) - FF(copy_size - i).invert(), + .sel_start_cd = i == 0, + .sel_cd = true }); + cd_lookup_counts[cd_offset]++; + } + + // Delimiter zero row between two calldata_copy calls. + slice_trace.push_back({}); +} + +} // namespace bb::avm_trace \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp new file mode 100644 index 00000000000..e7dae26670d --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp @@ -0,0 +1,58 @@ +#pragma once + +#include "barretenberg/vm/avm_trace/avm_common.hpp" + +#include + +namespace bb::avm_trace { + +class AvmSliceTraceBuilder { + + public: + // Keeps track of the number of times a calldata value is copied. + // cd_offset -> count + std::unordered_map cd_lookup_counts; + + struct SliceTraceEntry { + uint32_t clk = 0; + uint8_t space_id = 0; + uint32_t addr = 0; + FF val{}; + uint32_t cd_offset = 0; + uint32_t cnt = 0; + FF one_min_inv{}; + + bool sel_start_cd = false; + bool sel_cd = false; + }; + + AvmSliceTraceBuilder() = default; + + void reset(); + std::vector finalize(); + + void create_calldata_copy_slice(std::vector const& calldata, + uint32_t clk, + uint8_t space_id, + uint32_t cd_offset, + uint32_t copy_size, + uint32_t direct_dst_offset); + + private: + std::vector slice_trace; +}; + +template void merge_into(DestRow& dest, AvmSliceTraceBuilder::SliceTraceEntry const& src) +{ + dest.slice_clk = src.clk; + dest.slice_space_id = src.space_id; + dest.slice_addr = src.addr; + dest.slice_val = src.val; + dest.slice_cd_offset = src.cd_offset; + dest.slice_cnt = src.cnt; + dest.slice_one_min_inv = src.one_min_inv; + dest.slice_sel_start_cd = src.sel_start_cd; + dest.slice_sel_cd = src.sel_cd; +} + +} // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index 01a98d02e5a..ede1cf5c9f7 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -197,6 +197,7 @@ template struct AvmFullRow { FF main_rwd{}; FF main_sel_alu{}; FF main_sel_bin{}; + FF main_sel_calldata_gadget{}; FF main_sel_cd{}; FF main_sel_gas_accounting_active{}; FF main_sel_last{}; @@ -442,8 +443,8 @@ class AvmCircuitBuilder { using Polynomial = Flavor::Polynomial; using ProverPolynomials = Flavor::ProverPolynomials; - static constexpr size_t num_fixed_columns = 403; - static constexpr size_t num_polys = 403 + 68; + static constexpr size_t num_fixed_columns = 404; + static constexpr size_t num_polys = 404 + 68; std::vector rows; void set_trace(std::vector&& trace) { rows = std::move(trace); } @@ -635,6 +636,7 @@ class AvmCircuitBuilder { polys.main_rwd[i] = rows[i].main_rwd; polys.main_sel_alu[i] = rows[i].main_sel_alu; polys.main_sel_bin[i] = rows[i].main_sel_bin; + polys.main_sel_calldata_gadget[i] = rows[i].main_sel_calldata_gadget; polys.main_sel_cd[i] = rows[i].main_sel_cd; polys.main_sel_gas_accounting_active[i] = rows[i].main_sel_gas_accounting_active; polys.main_sel_last[i] = rows[i].main_sel_last; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index bd126afcaaa..4d378c32490 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -111,11 +111,11 @@ class AvmFlavor { using RelationSeparator = AvmFlavorSettings::RelationSeparator; static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 2; - static constexpr size_t NUM_WITNESS_ENTITIES = 401; + static constexpr size_t NUM_WITNESS_ENTITIES = 402; 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 = 471; + static constexpr size_t NUM_ALL_ENTITIES = 472; using MainRelations = std::tuple< // Relations @@ -400,6 +400,7 @@ class AvmFlavor { main_rwd, main_sel_alu, main_sel_bin, + main_sel_calldata_gadget, main_sel_cd, main_sel_gas_accounting_active, main_sel_last, @@ -2694,6 +2695,7 @@ class AvmFlavor { Base::main_rwd = "MAIN_RWD"; Base::main_sel_alu = "MAIN_SEL_ALU"; Base::main_sel_bin = "MAIN_SEL_BIN"; + Base::main_sel_calldata_gadget = "MAIN_SEL_CALLDATA_GADGET"; Base::main_sel_cd = "MAIN_SEL_CD"; Base::main_sel_gas_accounting_active = "MAIN_SEL_GAS_ACCOUNTING_ACTIVE"; Base::main_sel_last = "MAIN_SEL_LAST"; @@ -3117,6 +3119,7 @@ class AvmFlavor { Commitment main_rwd; Commitment main_sel_alu; Commitment main_sel_bin; + Commitment main_sel_calldata_gadget; Commitment main_sel_cd; Commitment main_sel_gas_accounting_active; Commitment main_sel_last; @@ -3553,6 +3556,7 @@ class AvmFlavor { main_rwd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_calldata_gadget = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_gas_accounting_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3985,6 +3989,7 @@ class AvmFlavor { serialize_to_buffer(main_rwd, Transcript::proof_data); serialize_to_buffer(main_sel_alu, Transcript::proof_data); serialize_to_buffer(main_sel_bin, Transcript::proof_data); + serialize_to_buffer(main_sel_calldata_gadget, Transcript::proof_data); serialize_to_buffer(main_sel_cd, Transcript::proof_data); serialize_to_buffer(main_sel_gas_accounting_active, Transcript::proof_data); serialize_to_buffer(main_sel_last, Transcript::proof_data); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp index 7c214616b3d..f510e87c96f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp @@ -193,6 +193,7 @@ template std::vector AvmFullRow::names() "main_rwd", "main_sel_alu", "main_sel_bin", + "main_sel_calldata_gadget", "main_sel_cd", "main_sel_gas_accounting_active", "main_sel_last", @@ -600,6 +601,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_rwd) // << "," << field_to_string(row.main_sel_alu) // << "," << field_to_string(row.main_sel_bin) // + << "," << field_to_string(row.main_sel_calldata_gadget) // << "," << field_to_string(row.main_sel_cd) // << "," << field_to_string(row.main_sel_gas_accounting_active) // << "," << field_to_string(row.main_sel_last) // From cce97617128449008a5ed81a743c9b356cd7a267 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Fri, 5 Jul 2024 07:52:17 +0000 Subject: [PATCH 03/12] 7211: some renaming and fixing unit tests --- .../cpp/pil/avm/gadgets/mem_slice.pil | 25 +++++----- barretenberg/cpp/pil/avm/main.pil | 10 ++-- barretenberg/cpp/pil/avm/mem.pil | 10 ++-- .../relations/generated/avm/declare_views.hpp | 10 ++-- .../generated/avm/lookup_cd_value.hpp | 14 +++--- .../relations/generated/avm/main.hpp | 4 +- .../relations/generated/avm/mem.hpp | 10 ++-- .../relations/generated/avm/mem_slice.hpp | 18 +++---- .../relations/generated/avm/perm_cd_mem.hpp | 14 +++--- .../generated/avm/perm_main_cd_copy.hpp | 14 +++--- .../vm/avm_trace/avm_mem_trace.cpp | 37 +++++++++----- .../vm/avm_trace/avm_mem_trace.hpp | 5 +- .../barretenberg/vm/avm_trace/avm_trace.cpp | 9 ++-- .../vm/avm_trace/gadgets/avm_slice_trace.cpp | 17 ++++--- .../vm/avm_trace/gadgets/avm_slice_trace.hpp | 13 ++--- .../vm/generated/avm_circuit_builder.hpp | 20 ++++---- .../barretenberg/vm/generated/avm_flavor.hpp | 50 +++++++++---------- .../vm/generated/avm_full_row.cpp | 20 ++++---- 18 files changed, 160 insertions(+), 140 deletions(-) diff --git a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil index c0ed7ad5c8d..463e9815fc7 100644 --- a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil +++ b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil @@ -4,8 +4,8 @@ namespace slice(256); pol commit clk; - pol commit sel_start_cd; // Selector to indicate the start of calldatacopy. Used in permutation with the main trace. - pol commit sel_cd; // Selector for any row involved in a callatacopy operation. + pol commit sel_start_cd_cpy; // Selector to indicate the start of calldatacopy. Used in permutation with the main trace. + pol commit sel_cd_cpy; // Selector for any row involved in a callatacopy operation. pol commit cnt; // Decreasing counter to track the number of memory operations. pol commit space_id; // Copied from main trace. pol commit addr; // Address pertaining to the memory operation. @@ -13,26 +13,27 @@ namespace slice(256); pol commit cd_offset; // Offset of the calldata element. It is used to get the correct value from calldata. pol commit one_min_inv; // Helper column to assert zero/non-zero equality of cnt; - sel_cd * (1 - sel_cd) = 0; + sel_cd_cpy * (1 - sel_cd_cpy) = 0; // TODO: might not be required - sel_start_cd * (1 - sel_start_cd) = 0; + sel_start_cd_cpy * (1 - sel_start_cd_cpy) = 0; - // Show that cnt != 0 <==> sel_cd == 1 + // Show that cnt != 0 <==> sel_cd_cpy == 1 // one_min_inv == 1 - cnt^(-1) if cnt != 0 else == 0 #[SLICE_CNT_ZERO_TEST1] - cnt * (1 - one_min_inv) - sel_cd = 0; + cnt * (1 - one_min_inv) - sel_cd_cpy = 0; #[SLICE_CNT_ZERO_TEST2] - (1 - sel_cd) * one_min_inv = 0; + (1 - sel_cd_cpy) * one_min_inv = 0; #[SLICE_CNT_DECREMENT] - sel_cd * (cnt - 1 - cnt') = 0; + sel_cd_cpy * (cnt - 1 - cnt') = 0; + #[ADDR_CNT_INCREMENT] - sel_cd * (addr + 1 - addr') = 0; + sel_cd_cpy * (addr + 1 - addr') = 0; #[CD_OFFSET_INCREMENT] - sel_cd * (cd_offset + 1 - cd_offset') = 0; + sel_cd_cpy * (cd_offset + 1 - cd_offset') = 0; #[LOOKUP_CD_VALUE] - sel_cd {cd_offset, val} in main.sel_cd {main.clk, main.calldata}; + sel_cd_cpy {cd_offset, val} in main.sel_calldata {main.clk, main.calldata}; #[PERM_CD_MEM] - sel_cd {clk, space_id, addr, val} is mem.sel_op_cd {mem.clk, mem.space_id, mem.addr, mem.val}; + sel_cd_cpy {clk, space_id, addr, val} is mem.sel_op_cd_cpy {mem.clk, mem.space_id, mem.addr, mem.val}; diff --git a/barretenberg/cpp/pil/avm/main.pil b/barretenberg/cpp/pil/avm/main.pil index 25cf9a8aa4a..353fedab47f 100644 --- a/barretenberg/cpp/pil/avm/main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -21,7 +21,7 @@ namespace main(256); //===== PUBLIC COLUMNS========================================================= pol public calldata; - pol commit sel_cd; // Selector used for lookup in calldata. TODO: Might be removed or made constant. + pol commit sel_calldata; // Selector used for lookup in calldata. TODO: Might be removed or made constant. //===== KERNEL INPUTS ========================================================= // Kernel lookup selector opcodes @@ -665,10 +665,10 @@ namespace main(256); KERNEL_OUTPUT_SELECTORS * (kernel.side_effect_counter' - (kernel.side_effect_counter + 1)) = 0; //===== Memory Slice Constraints ============================================ - pol commit sel_calldata_gadget; // Selector to activate the calldatacopy operation in the gadget (#[PERM_MAIN_CD_COPY]). + pol commit sel_cd_cpy_gadget; // Selector to activate the calldatacopy operation in the gadget (#[PERM_MAIN_CD_COPY]). // Activate only if tag_err is disabled - sel_calldata_gadget = sel_op_calldata_copy * (1 - tag_err); + sel_cd_cpy_gadget = sel_op_calldata_copy * (1 - tag_err); //====== Inter-table Constraints ============================================ @@ -739,9 +739,9 @@ namespace main(256); pedersen.sel_pedersen {pedersen.clk, pedersen.input}; #[PERM_MAIN_CD_COPY] - sel_calldata_gadget {ia, ib, mem_addr_c} + sel_cd_cpy_gadget {ia, ib, mem_addr_c} is - slice.sel_start_cd {slice.cd_offset, slice.cnt, slice.addr}; + slice.sel_start_cd_cpy {slice.cd_offset, slice.cnt, slice.addr}; #[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} diff --git a/barretenberg/cpp/pil/avm/mem.pil b/barretenberg/cpp/pil/avm/mem.pil index cded6b54361..2e7a80d45d6 100644 --- a/barretenberg/cpp/pil/avm/mem.pil +++ b/barretenberg/cpp/pil/avm/mem.pil @@ -33,7 +33,7 @@ namespace mem(256); pol commit sel_resolve_ind_addr_d; // Selector for calldata_copy memory operations triggered from memory slice gadget. - pol commit sel_op_cd; + pol commit sel_op_cd_cpy; // Selectors related to MOV/CMOV opcodes (copied from main trace for loading operation on intermediated register ia/ib) // Boolean constraint is performed in main trace. @@ -60,7 +60,7 @@ namespace mem(256); sel_op_b * (1 - sel_op_b) = 0; sel_op_c * (1 - sel_op_c) = 0; sel_op_d * (1 - sel_op_d) = 0; - sel_op_cd * (1 - sel_op_cd) = 0; + sel_op_cd_cpy * (1 - sel_op_cd_cpy) = 0; sel_resolve_ind_addr_a * (1 - sel_resolve_ind_addr_a) = 0; sel_resolve_ind_addr_b * (1 - sel_resolve_ind_addr_b) = 0; sel_resolve_ind_addr_c * (1 - sel_resolve_ind_addr_c) = 0; @@ -72,7 +72,7 @@ namespace mem(256); // Definition of sel_mem sel_mem = sel_op_a + sel_op_b + sel_op_c + sel_op_d + sel_resolve_ind_addr_a + sel_resolve_ind_addr_b + sel_resolve_ind_addr_c + sel_resolve_ind_addr_d - + sel_op_cd; + + sel_op_cd_cpy; // Maximum one memory operation enabled per row sel_mem * (sel_mem - 1) = 0; // TODO: might be infered by the main trace @@ -219,8 +219,8 @@ namespace mem(256); sel_resolve_ind_addr_d * rw = 0; //====== CALLDATACOPY specific constraints ================================== - sel_op_cd * (rw - 1) = 0; - sel_op_cd * (w_in_tag - 6) = 0; + sel_op_cd_cpy * (rw - 1) = 0; + sel_op_cd_cpy * (w_in_tag - 6) = 0; //====== MOV/CMOV Opcode Tag Constraint ===================================== // The following constraint ensures that the r_in_tag is set to tag for diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp index 1fc65bda50c..7dedfa78eaa 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -184,8 +184,8 @@ [[maybe_unused]] auto main_rwd = View(new_term.main_rwd); \ [[maybe_unused]] auto main_sel_alu = View(new_term.main_sel_alu); \ [[maybe_unused]] auto main_sel_bin = View(new_term.main_sel_bin); \ - [[maybe_unused]] auto main_sel_calldata_gadget = View(new_term.main_sel_calldata_gadget); \ - [[maybe_unused]] auto main_sel_cd = View(new_term.main_sel_cd); \ + [[maybe_unused]] auto main_sel_calldata = View(new_term.main_sel_calldata); \ + [[maybe_unused]] auto main_sel_cd_cpy_gadget = View(new_term.main_sel_cd_cpy_gadget); \ [[maybe_unused]] auto main_sel_gas_accounting_active = View(new_term.main_sel_gas_accounting_active); \ [[maybe_unused]] auto main_sel_last = View(new_term.main_sel_last); \ [[maybe_unused]] auto main_sel_mem_op_a = View(new_term.main_sel_mem_op_a); \ @@ -276,7 +276,7 @@ [[maybe_unused]] auto mem_sel_op_a = View(new_term.mem_sel_op_a); \ [[maybe_unused]] auto mem_sel_op_b = View(new_term.mem_sel_op_b); \ [[maybe_unused]] auto mem_sel_op_c = View(new_term.mem_sel_op_c); \ - [[maybe_unused]] auto mem_sel_op_cd = View(new_term.mem_sel_op_cd); \ + [[maybe_unused]] auto mem_sel_op_cd_cpy = View(new_term.mem_sel_op_cd_cpy); \ [[maybe_unused]] auto mem_sel_op_cmov = View(new_term.mem_sel_op_cmov); \ [[maybe_unused]] auto mem_sel_op_d = View(new_term.mem_sel_op_d); \ [[maybe_unused]] auto mem_sel_resolve_ind_addr_a = View(new_term.mem_sel_resolve_ind_addr_a); \ @@ -310,8 +310,8 @@ [[maybe_unused]] auto slice_clk = View(new_term.slice_clk); \ [[maybe_unused]] auto slice_cnt = View(new_term.slice_cnt); \ [[maybe_unused]] auto slice_one_min_inv = View(new_term.slice_one_min_inv); \ - [[maybe_unused]] auto slice_sel_cd = View(new_term.slice_sel_cd); \ - [[maybe_unused]] auto slice_sel_start_cd = View(new_term.slice_sel_start_cd); \ + [[maybe_unused]] auto slice_sel_cd_cpy = View(new_term.slice_sel_cd_cpy); \ + [[maybe_unused]] auto slice_sel_start_cd_cpy = View(new_term.slice_sel_start_cd_cpy); \ [[maybe_unused]] auto slice_space_id = View(new_term.slice_space_id); \ [[maybe_unused]] auto slice_val = View(new_term.slice_val); \ [[maybe_unused]] auto perm_cd_mem = View(new_term.perm_cd_mem); \ diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp index 176b115f89a..52f1f0054f9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp @@ -87,7 +87,7 @@ class lookup_cd_value_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.slice_sel_cd == 1 || in.main_sel_cd == 1); + return (in.slice_sel_cd_cpy == 1 || in.main_sel_calldata == 1); } /** @@ -104,8 +104,8 @@ class lookup_cd_value_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.slice_sel_cd); - const auto is_table_entry = View(in.main_sel_cd); + const auto is_operation = View(in.slice_sel_cd_cpy); + const auto is_table_entry = View(in.main_sel_calldata); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,8 +135,8 @@ class lookup_cd_value_lookup_settings { return std::forward_as_tuple(in.lookup_cd_value, in.lookup_cd_value_counts, - in.slice_sel_cd, - in.main_sel_cd, + in.slice_sel_cd_cpy, + in.main_sel_calldata, in.slice_cd_offset, in.slice_val, in.main_clk, @@ -155,8 +155,8 @@ class lookup_cd_value_lookup_settings { return std::forward_as_tuple(in.lookup_cd_value, in.lookup_cd_value_counts, - in.slice_sel_cd, - in.main_sel_cd, + in.slice_sel_cd_cpy, + in.main_sel_calldata, in.slice_cd_offset, in.slice_val, in.main_clk, diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp index 518d37192a3..8455d9fe483 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp @@ -56,7 +56,7 @@ template struct MainRow { FF main_rwd{}; FF main_sel_alu{}; FF main_sel_bin{}; - FF main_sel_calldata_gadget{}; + FF main_sel_cd_cpy_gadget{}; FF main_sel_first{}; FF main_sel_gas_accounting_active{}; FF main_sel_mem_op_a{}; @@ -1451,7 +1451,7 @@ template class mainImpl { // Contribution 147 { Avm_DECLARE_VIEWS(147); - auto tmp = (main_sel_calldata_gadget - (main_sel_op_calldata_copy * (-main_tag_err + FF(1)))); + auto tmp = (main_sel_cd_cpy_gadget - (main_sel_op_calldata_copy * (-main_tag_err + FF(1)))); tmp *= scaling_factor; std::get<147>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp index 4d6142eb31e..2bfe89dd24e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp @@ -28,7 +28,7 @@ template struct MemRow { FF mem_sel_op_a{}; FF mem_sel_op_b{}; FF mem_sel_op_c{}; - FF mem_sel_op_cd{}; + FF mem_sel_op_cd_cpy{}; FF mem_sel_op_cmov{}; FF mem_sel_op_d{}; FF mem_sel_resolve_ind_addr_a{}; @@ -162,7 +162,7 @@ template class memImpl { // Contribution 8 { Avm_DECLARE_VIEWS(8); - auto tmp = (mem_sel_op_cd * (-mem_sel_op_cd + FF(1))); + auto tmp = (mem_sel_op_cd_cpy * (-mem_sel_op_cd_cpy + FF(1))); tmp *= scaling_factor; std::get<8>(evals) += tmp; } @@ -203,7 +203,7 @@ template class memImpl { mem_sel_resolve_ind_addr_b) + mem_sel_resolve_ind_addr_c) + mem_sel_resolve_ind_addr_d) + - mem_sel_op_cd)); + mem_sel_op_cd_cpy)); tmp *= scaling_factor; std::get<13>(evals) += tmp; } @@ -417,14 +417,14 @@ template class memImpl { // Contribution 41 { Avm_DECLARE_VIEWS(41); - auto tmp = (mem_sel_op_cd * (mem_rw - FF(1))); + auto tmp = (mem_sel_op_cd_cpy * (mem_rw - FF(1))); tmp *= scaling_factor; std::get<41>(evals) += tmp; } // Contribution 42 { Avm_DECLARE_VIEWS(42); - auto tmp = (mem_sel_op_cd * (mem_w_in_tag - FF(6))); + auto tmp = (mem_sel_op_cd_cpy * (mem_w_in_tag - FF(6))); tmp *= scaling_factor; std::get<42>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp index f4a0e2f9fbf..a5ab245a42a 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp @@ -14,8 +14,8 @@ template struct MemSliceRow { FF slice_cnt{}; FF slice_cnt_shift{}; FF slice_one_min_inv{}; - FF slice_sel_cd{}; - FF slice_sel_start_cd{}; + FF slice_sel_cd_cpy{}; + FF slice_sel_start_cd_cpy{}; }; inline std::string get_relation_label_mem_slice(int index) @@ -50,49 +50,49 @@ template class mem_sliceImpl { // Contribution 0 { Avm_DECLARE_VIEWS(0); - auto tmp = (slice_sel_cd * (-slice_sel_cd + FF(1))); + auto tmp = (slice_sel_cd_cpy * (-slice_sel_cd_cpy + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } // Contribution 1 { Avm_DECLARE_VIEWS(1); - auto tmp = (slice_sel_start_cd * (-slice_sel_start_cd + FF(1))); + auto tmp = (slice_sel_start_cd_cpy * (-slice_sel_start_cd_cpy + FF(1))); tmp *= scaling_factor; std::get<1>(evals) += tmp; } // Contribution 2 { Avm_DECLARE_VIEWS(2); - auto tmp = ((slice_cnt * (-slice_one_min_inv + FF(1))) - slice_sel_cd); + auto tmp = ((slice_cnt * (-slice_one_min_inv + FF(1))) - slice_sel_cd_cpy); tmp *= scaling_factor; std::get<2>(evals) += tmp; } // Contribution 3 { Avm_DECLARE_VIEWS(3); - auto tmp = ((-slice_sel_cd + FF(1)) * slice_one_min_inv); + auto tmp = ((-slice_sel_cd_cpy + FF(1)) * slice_one_min_inv); tmp *= scaling_factor; std::get<3>(evals) += tmp; } // Contribution 4 { Avm_DECLARE_VIEWS(4); - auto tmp = (slice_sel_cd * ((slice_cnt - FF(1)) - slice_cnt_shift)); + auto tmp = (slice_sel_cd_cpy * ((slice_cnt - FF(1)) - slice_cnt_shift)); tmp *= scaling_factor; std::get<4>(evals) += tmp; } // Contribution 5 { Avm_DECLARE_VIEWS(5); - auto tmp = (slice_sel_cd * ((slice_addr + FF(1)) - slice_addr_shift)); + auto tmp = (slice_sel_cd_cpy * ((slice_addr + FF(1)) - slice_addr_shift)); tmp *= scaling_factor; std::get<5>(evals) += tmp; } // Contribution 6 { Avm_DECLARE_VIEWS(6); - auto tmp = (slice_sel_cd * ((slice_cd_offset + FF(1)) - slice_cd_offset_shift)); + auto tmp = (slice_sel_cd_cpy * ((slice_cd_offset + FF(1)) - slice_cd_offset_shift)); tmp *= scaling_factor; std::get<6>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp index 9cdecefd1f0..fd4b61fa8e4 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp @@ -23,7 +23,7 @@ class perm_cd_mem_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.slice_sel_cd == 1 || in.mem_sel_op_cd == 1); + return (in.slice_sel_cd_cpy == 1 || in.mem_sel_op_cd_cpy == 1); } /** @@ -47,9 +47,9 @@ class perm_cd_mem_permutation_settings { { return std::forward_as_tuple(in.perm_cd_mem, - in.slice_sel_cd, - in.slice_sel_cd, - in.mem_sel_op_cd, + in.slice_sel_cd_cpy, + in.slice_sel_cd_cpy, + in.mem_sel_op_cd_cpy, in.slice_clk, in.slice_space_id, in.slice_addr, @@ -81,9 +81,9 @@ class perm_cd_mem_permutation_settings { { return std::forward_as_tuple(in.perm_cd_mem, - in.slice_sel_cd, - in.slice_sel_cd, - in.mem_sel_op_cd, + in.slice_sel_cd_cpy, + in.slice_sel_cd_cpy, + in.mem_sel_op_cd_cpy, in.slice_clk, in.slice_space_id, in.slice_addr, diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp index f23d5598e81..4c68f7601e2 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp @@ -23,7 +23,7 @@ class perm_main_cd_copy_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.main_sel_calldata_gadget == 1 || in.slice_sel_start_cd == 1); + return (in.main_sel_cd_cpy_gadget == 1 || in.slice_sel_start_cd_cpy == 1); } /** @@ -47,9 +47,9 @@ class perm_main_cd_copy_permutation_settings { { return std::forward_as_tuple(in.perm_main_cd_copy, - in.main_sel_calldata_gadget, - in.main_sel_calldata_gadget, - in.slice_sel_start_cd, + in.main_sel_cd_cpy_gadget, + in.main_sel_cd_cpy_gadget, + in.slice_sel_start_cd_cpy, in.main_ia, in.main_ib, in.main_mem_addr_c, @@ -79,9 +79,9 @@ class perm_main_cd_copy_permutation_settings { { return std::forward_as_tuple(in.perm_main_cd_copy, - in.main_sel_calldata_gadget, - in.main_sel_calldata_gadget, - in.slice_sel_start_cd, + in.main_sel_cd_cpy_gadget, + in.main_sel_cd_cpy_gadget, + in.slice_sel_start_cd_cpy, in.main_ia, in.main_ib, in.main_mem_addr_c, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp index 05f14e3c38f..ecbe7b6c82a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp @@ -49,7 +49,7 @@ std::vector AvmMemTraceBuilder::finalize() * @param r_in_tag Read memory tag pertaining to the instruction * @param w_in_tag Write memory tag pertaining to the instruction * @param m_rw Boolean telling whether it is a load (false) or store operation (true). - * @param sel_op_cd Specific boolean selector for calldata_copy memory slice + * @param sel_op_cd_cpy Specific boolean selector for calldata_copy memory slice */ void AvmMemTraceBuilder::insert_in_mem_trace(uint8_t space_id, uint32_t m_clk, @@ -60,7 +60,7 @@ void AvmMemTraceBuilder::insert_in_mem_trace(uint8_t space_id, AvmMemoryTag r_in_tag, AvmMemoryTag w_in_tag, bool m_rw, - bool sel_op_cd) + bool m_sel_op_cd_cpy) { mem_trace.emplace_back(MemoryTraceEntry{ .m_space_id = space_id, .m_clk = m_clk, @@ -71,7 +71,7 @@ void AvmMemTraceBuilder::insert_in_mem_trace(uint8_t space_id, .r_in_tag = r_in_tag, .w_in_tag = w_in_tag, .m_rw = m_rw, - .m_sel_op_cd = sel_op_cd }); + .m_sel_op_cd_cpy = m_sel_op_cd_cpy }); } // Memory operations need to be performed before the addition of the corresponding row in @@ -473,14 +473,7 @@ void AvmMemTraceBuilder::write_into_memory(uint8_t space_id, AvmMemoryTag r_in_tag, AvmMemoryTag w_in_tag) { - MemEntry memEntry{ val, w_in_tag }; - auto& mem_space = memory.at(space_id); - auto it = mem_space.find(addr); - if (it != mem_space.end()) { - it->second = memEntry; - } else { - mem_space.emplace(addr, memEntry); - } + write_in_simulated_mem_table(space_id, addr, val, w_in_tag); store_in_mem_trace(space_id, clk, interm_reg, addr, val, r_in_tag, w_in_tag); } @@ -492,11 +485,14 @@ void AvmMemTraceBuilder::write_calldata_copy(std::vector const& calldata, uint32_t direct_dst_offset) { for (uint32_t i = 0; i < copy_size; i++) { + auto addr = direct_dst_offset + i; + auto val = calldata.at(cd_offset + i); + write_in_simulated_mem_table(space_id, addr, val, AvmMemoryTag::FF); insert_in_mem_trace(space_id, clk, SUB_CLK_STORE_A, // Specific re-use of this value for calldatacopy write slice. - direct_dst_offset + i, - calldata.at(cd_offset + i), + addr, + val, AvmMemoryTag::FF, AvmMemoryTag::U0, AvmMemoryTag::FF, @@ -536,4 +532,19 @@ bool AvmMemTraceBuilder::MemoryTraceEntry::operator<(const AvmMemTraceBuilder::M return m_sub_clk < other.m_sub_clk; } +void AvmMemTraceBuilder::write_in_simulated_mem_table(uint8_t space_id, + uint32_t addr, + FF const& val, + AvmMemoryTag w_in_tag) +{ + MemEntry memEntry{ val, w_in_tag }; + auto& mem_space = memory.at(space_id); + auto it = mem_space.find(addr); + if (it != mem_space.end()) { + it->second = memEntry; + } else { + mem_space.emplace(addr, memEntry); + } +} + } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp index 6fdafc4b683..23e8799f3c1 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp @@ -43,7 +43,7 @@ class AvmMemTraceBuilder { bool m_sel_mov_ib_to_ic = false; bool m_sel_cmov = false; bool m_tag_err_count_relevant = false; - bool m_sel_op_cd = false; + bool m_sel_op_cd_cpy = false; /** * @brief A comparator on MemoryTraceEntry to be used by sorting algorithm. We sort first by @@ -111,7 +111,7 @@ class AvmMemTraceBuilder { AvmMemoryTag r_in_tag, AvmMemoryTag w_in_tag, bool m_rw, - bool sel_op_cd = false); + bool m_sel_op_cd_cpy = false); void load_mismatch_tag_in_mem_trace(uint8_t space_id, uint32_t m_clk, @@ -136,5 +136,6 @@ class AvmMemTraceBuilder { FF const& val, AvmMemoryTag r_in_tag, AvmMemoryTag w_in_tag); + void write_in_simulated_mem_table(uint8_t space_id, uint32_t addr, FF const& val, AvmMemoryTag w_in_tag); }; } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp index ff14ee01e7a..a03ad1ba28a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -1676,7 +1676,7 @@ void AvmTraceBuilder::op_calldata_copy(uint8_t indirect, uint32_t cd_offset, uin .main_internal_return_ptr = FF(internal_return_ptr), .main_mem_addr_c = direct_dst_offset, .main_pc = pc++, - .main_sel_calldata_gadget = static_cast(tag_match), + .main_sel_cd_cpy_gadget = static_cast(tag_match), .main_sel_op_calldata_copy = 1, .main_sel_resolve_ind_addr_c = static_cast(indirect_flag), .main_tag_err = static_cast(!tag_match), @@ -3870,12 +3870,12 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c 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_cd = FF(static_cast(src.m_sel_op_cd)); + dest.mem_sel_op_cd_cpy = FF(static_cast(src.m_sel_op_cd_cpy)); dest.incl_mem_tag_err_counts = FF(static_cast(src.m_tag_err_count_relevant)); // Calldatacopy memory operations are handled differently and are activated by m_sel_op_cd. - if (!src.m_sel_op_cd) { + if (!src.m_sel_op_cd_cpy) { switch (src.m_sub_clk) { case AvmMemTraceBuilder::SUB_CLK_LOAD_A: case AvmMemTraceBuilder::SUB_CLK_STORE_A: @@ -4604,9 +4604,10 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c std::get(kernel_trace_builder.public_inputs).at(i); } - // calldata column inclusion + // calldata column inclusion and selector for (size_t i = 0; i < calldata.size(); i++) { main_trace.at(i).main_calldata = calldata.at(i); + main_trace.at(i).main_sel_calldata = 1; } // calldata loookup counts for calldatacopy operations diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp index 29ab56e5cda..ebbbb0b2446 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp @@ -26,18 +26,23 @@ void AvmSliceTraceBuilder::create_calldata_copy_slice(std::vector const& cal for (uint32_t i = 0; i < copy_size; i++) { slice_trace.push_back({ .clk = clk, .space_id = space_id, - .addr = direct_dst_offset + i, + .addr_ff = FF(direct_dst_offset + i), .val = calldata.at(cd_offset + i), .cd_offset = cd_offset + i, .cnt = copy_size - i, .one_min_inv = FF(1) - FF(copy_size - i).invert(), - .sel_start_cd = i == 0, - .sel_cd = true }); - cd_lookup_counts[cd_offset]++; + .sel_start_cd_cpy = i == 0, + .sel_cd_cpy = true }); + cd_lookup_counts[cd_offset + i]++; } - // Delimiter zero row between two calldata_copy calls. - slice_trace.push_back({}); + // Last extra row for a calldatacopy operation. cnt is zero and we have to add extra dummy + // values for addr and cd_offset to satisfy the constraints: #[ADDR_CNT_INCREMENT] and #[CD_OFFSET_INCREMENT] + // Alternatively, we would have to increase the degree of these two relations. + // Note that addr = 2^32 would be a valid value here, therefore we do not wrap modulo 2^32. + // cd_offset is fine as the circuit trace cannot reach a size of 2^32. + slice_trace.emplace_back( + SliceTraceEntry{ .addr_ff = FF(direct_dst_offset + copy_size - 1) + 1, .cd_offset = cd_offset + copy_size }); } } // namespace bb::avm_trace \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp index e7dae26670d..ddc7809fb57 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp @@ -16,14 +16,15 @@ class AvmSliceTraceBuilder { struct SliceTraceEntry { uint32_t clk = 0; uint8_t space_id = 0; - uint32_t addr = 0; + FF addr_ff = 0; // Should normally be uint32_t but the last witness addr of a calldatacopy operation row might + // be FF(2^32). FF val{}; uint32_t cd_offset = 0; uint32_t cnt = 0; FF one_min_inv{}; - bool sel_start_cd = false; - bool sel_cd = false; + bool sel_start_cd_cpy = false; + bool sel_cd_cpy = false; }; AvmSliceTraceBuilder() = default; @@ -46,13 +47,13 @@ template void merge_into(DestRow& dest, AvmSliceTraceBuilder: { dest.slice_clk = src.clk; dest.slice_space_id = src.space_id; - dest.slice_addr = src.addr; + dest.slice_addr = src.addr_ff; dest.slice_val = src.val; dest.slice_cd_offset = src.cd_offset; dest.slice_cnt = src.cnt; dest.slice_one_min_inv = src.one_min_inv; - dest.slice_sel_start_cd = src.sel_start_cd; - dest.slice_sel_cd = src.sel_cd; + dest.slice_sel_start_cd_cpy = src.sel_start_cd_cpy; + dest.slice_sel_cd_cpy = src.sel_cd_cpy; } } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index ede1cf5c9f7..9c30cad8abf 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -197,8 +197,8 @@ template struct AvmFullRow { FF main_rwd{}; FF main_sel_alu{}; FF main_sel_bin{}; - FF main_sel_calldata_gadget{}; - FF main_sel_cd{}; + FF main_sel_calldata{}; + FF main_sel_cd_cpy_gadget{}; FF main_sel_gas_accounting_active{}; FF main_sel_last{}; FF main_sel_mem_op_a{}; @@ -289,7 +289,7 @@ template struct AvmFullRow { FF mem_sel_op_a{}; FF mem_sel_op_b{}; FF mem_sel_op_c{}; - FF mem_sel_op_cd{}; + FF mem_sel_op_cd_cpy{}; FF mem_sel_op_cmov{}; FF mem_sel_op_d{}; FF mem_sel_resolve_ind_addr_a{}; @@ -323,8 +323,8 @@ template struct AvmFullRow { FF slice_clk{}; FF slice_cnt{}; FF slice_one_min_inv{}; - FF slice_sel_cd{}; - FF slice_sel_start_cd{}; + FF slice_sel_cd_cpy{}; + FF slice_sel_start_cd_cpy{}; FF slice_space_id{}; FF slice_val{}; FF perm_cd_mem{}; @@ -636,8 +636,8 @@ class AvmCircuitBuilder { polys.main_rwd[i] = rows[i].main_rwd; polys.main_sel_alu[i] = rows[i].main_sel_alu; polys.main_sel_bin[i] = rows[i].main_sel_bin; - polys.main_sel_calldata_gadget[i] = rows[i].main_sel_calldata_gadget; - polys.main_sel_cd[i] = rows[i].main_sel_cd; + polys.main_sel_calldata[i] = rows[i].main_sel_calldata; + polys.main_sel_cd_cpy_gadget[i] = rows[i].main_sel_cd_cpy_gadget; polys.main_sel_gas_accounting_active[i] = rows[i].main_sel_gas_accounting_active; polys.main_sel_last[i] = rows[i].main_sel_last; polys.main_sel_mem_op_a[i] = rows[i].main_sel_mem_op_a; @@ -728,7 +728,7 @@ class AvmCircuitBuilder { polys.mem_sel_op_a[i] = rows[i].mem_sel_op_a; polys.mem_sel_op_b[i] = rows[i].mem_sel_op_b; polys.mem_sel_op_c[i] = rows[i].mem_sel_op_c; - polys.mem_sel_op_cd[i] = rows[i].mem_sel_op_cd; + polys.mem_sel_op_cd_cpy[i] = rows[i].mem_sel_op_cd_cpy; polys.mem_sel_op_cmov[i] = rows[i].mem_sel_op_cmov; polys.mem_sel_op_d[i] = rows[i].mem_sel_op_d; polys.mem_sel_resolve_ind_addr_a[i] = rows[i].mem_sel_resolve_ind_addr_a; @@ -762,8 +762,8 @@ class AvmCircuitBuilder { polys.slice_clk[i] = rows[i].slice_clk; polys.slice_cnt[i] = rows[i].slice_cnt; polys.slice_one_min_inv[i] = rows[i].slice_one_min_inv; - polys.slice_sel_cd[i] = rows[i].slice_sel_cd; - polys.slice_sel_start_cd[i] = rows[i].slice_sel_start_cd; + polys.slice_sel_cd_cpy[i] = rows[i].slice_sel_cd_cpy; + polys.slice_sel_start_cd_cpy[i] = rows[i].slice_sel_start_cd_cpy; polys.slice_space_id[i] = rows[i].slice_space_id; polys.slice_val[i] = rows[i].slice_val; polys.lookup_byte_lengths_counts[i] = rows[i].lookup_byte_lengths_counts; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index 4d378c32490..a8efedf2088 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -400,8 +400,8 @@ class AvmFlavor { main_rwd, main_sel_alu, main_sel_bin, - main_sel_calldata_gadget, - main_sel_cd, + main_sel_calldata, + main_sel_cd_cpy_gadget, main_sel_gas_accounting_active, main_sel_last, main_sel_mem_op_a, @@ -492,7 +492,7 @@ class AvmFlavor { mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, - mem_sel_op_cd, + mem_sel_op_cd_cpy, mem_sel_op_cmov, mem_sel_op_d, mem_sel_resolve_ind_addr_a, @@ -526,8 +526,8 @@ class AvmFlavor { slice_clk, slice_cnt, slice_one_min_inv, - slice_sel_cd, - slice_sel_start_cd, + slice_sel_cd_cpy, + slice_sel_start_cd_cpy, slice_space_id, slice_val, lookup_byte_lengths_counts, @@ -2695,8 +2695,8 @@ class AvmFlavor { Base::main_rwd = "MAIN_RWD"; Base::main_sel_alu = "MAIN_SEL_ALU"; Base::main_sel_bin = "MAIN_SEL_BIN"; - Base::main_sel_calldata_gadget = "MAIN_SEL_CALLDATA_GADGET"; - Base::main_sel_cd = "MAIN_SEL_CD"; + Base::main_sel_calldata = "MAIN_SEL_CALLDATA"; + Base::main_sel_cd_cpy_gadget = "MAIN_SEL_CD_CPY_GADGET"; Base::main_sel_gas_accounting_active = "MAIN_SEL_GAS_ACCOUNTING_ACTIVE"; Base::main_sel_last = "MAIN_SEL_LAST"; Base::main_sel_mem_op_a = "MAIN_SEL_MEM_OP_A"; @@ -2787,7 +2787,7 @@ class AvmFlavor { 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_cd = "MEM_SEL_OP_CD"; + Base::mem_sel_op_cd_cpy = "MEM_SEL_OP_CD_CPY"; Base::mem_sel_op_cmov = "MEM_SEL_OP_CMOV"; Base::mem_sel_op_d = "MEM_SEL_OP_D"; Base::mem_sel_resolve_ind_addr_a = "MEM_SEL_RESOLVE_IND_ADDR_A"; @@ -2821,8 +2821,8 @@ class AvmFlavor { Base::slice_clk = "SLICE_CLK"; Base::slice_cnt = "SLICE_CNT"; Base::slice_one_min_inv = "SLICE_ONE_MIN_INV"; - Base::slice_sel_cd = "SLICE_SEL_CD"; - Base::slice_sel_start_cd = "SLICE_SEL_START_CD"; + Base::slice_sel_cd_cpy = "SLICE_SEL_CD_CPY"; + Base::slice_sel_start_cd_cpy = "SLICE_SEL_START_CD_CPY"; Base::slice_space_id = "SLICE_SPACE_ID"; Base::slice_val = "SLICE_VAL"; Base::perm_cd_mem = "PERM_CD_MEM"; @@ -3119,8 +3119,8 @@ class AvmFlavor { Commitment main_rwd; Commitment main_sel_alu; Commitment main_sel_bin; - Commitment main_sel_calldata_gadget; - Commitment main_sel_cd; + Commitment main_sel_calldata; + Commitment main_sel_cd_cpy_gadget; Commitment main_sel_gas_accounting_active; Commitment main_sel_last; Commitment main_sel_mem_op_a; @@ -3211,7 +3211,7 @@ class AvmFlavor { Commitment mem_sel_op_a; Commitment mem_sel_op_b; Commitment mem_sel_op_c; - Commitment mem_sel_op_cd; + Commitment mem_sel_op_cd_cpy; Commitment mem_sel_op_cmov; Commitment mem_sel_op_d; Commitment mem_sel_resolve_ind_addr_a; @@ -3245,8 +3245,8 @@ class AvmFlavor { Commitment slice_clk; Commitment slice_cnt; Commitment slice_one_min_inv; - Commitment slice_sel_cd; - Commitment slice_sel_start_cd; + Commitment slice_sel_cd_cpy; + Commitment slice_sel_start_cd_cpy; Commitment slice_space_id; Commitment slice_val; Commitment perm_cd_mem; @@ -3556,8 +3556,8 @@ class AvmFlavor { main_rwd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_calldata_gadget = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_cd_cpy_gadget = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_gas_accounting_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3650,7 +3650,7 @@ class AvmFlavor { mem_sel_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3684,8 +3684,8 @@ class AvmFlavor { slice_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_cnt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_start_cd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_start_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_cd_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3989,8 +3989,8 @@ class AvmFlavor { serialize_to_buffer(main_rwd, Transcript::proof_data); serialize_to_buffer(main_sel_alu, Transcript::proof_data); serialize_to_buffer(main_sel_bin, Transcript::proof_data); - serialize_to_buffer(main_sel_calldata_gadget, Transcript::proof_data); - serialize_to_buffer(main_sel_cd, Transcript::proof_data); + serialize_to_buffer(main_sel_calldata, Transcript::proof_data); + serialize_to_buffer(main_sel_cd_cpy_gadget, Transcript::proof_data); serialize_to_buffer(main_sel_gas_accounting_active, Transcript::proof_data); serialize_to_buffer(main_sel_last, Transcript::proof_data); serialize_to_buffer(main_sel_mem_op_a, Transcript::proof_data); @@ -4081,7 +4081,7 @@ class AvmFlavor { serialize_to_buffer(mem_sel_op_a, Transcript::proof_data); serialize_to_buffer(mem_sel_op_b, Transcript::proof_data); serialize_to_buffer(mem_sel_op_c, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_cd, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_cd_cpy, Transcript::proof_data); serialize_to_buffer(mem_sel_op_cmov, Transcript::proof_data); serialize_to_buffer(mem_sel_op_d, Transcript::proof_data); serialize_to_buffer(mem_sel_resolve_ind_addr_a, Transcript::proof_data); @@ -4115,8 +4115,8 @@ class AvmFlavor { serialize_to_buffer(slice_clk, Transcript::proof_data); serialize_to_buffer(slice_cnt, Transcript::proof_data); serialize_to_buffer(slice_one_min_inv, Transcript::proof_data); - serialize_to_buffer(slice_sel_cd, Transcript::proof_data); - serialize_to_buffer(slice_sel_start_cd, Transcript::proof_data); + serialize_to_buffer(slice_sel_cd_cpy, Transcript::proof_data); + serialize_to_buffer(slice_sel_start_cd_cpy, Transcript::proof_data); serialize_to_buffer(slice_space_id, Transcript::proof_data); serialize_to_buffer(slice_val, Transcript::proof_data); serialize_to_buffer(perm_cd_mem, Transcript::proof_data); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp index f510e87c96f..d49e9277b0e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp @@ -193,8 +193,8 @@ template std::vector AvmFullRow::names() "main_rwd", "main_sel_alu", "main_sel_bin", - "main_sel_calldata_gadget", - "main_sel_cd", + "main_sel_calldata", + "main_sel_cd_cpy_gadget", "main_sel_gas_accounting_active", "main_sel_last", "main_sel_mem_op_a", @@ -285,7 +285,7 @@ template std::vector AvmFullRow::names() "mem_sel_op_a", "mem_sel_op_b", "mem_sel_op_c", - "mem_sel_op_cd", + "mem_sel_op_cd_cpy", "mem_sel_op_cmov", "mem_sel_op_d", "mem_sel_resolve_ind_addr_a", @@ -319,8 +319,8 @@ template std::vector AvmFullRow::names() "slice_clk", "slice_cnt", "slice_one_min_inv", - "slice_sel_cd", - "slice_sel_start_cd", + "slice_sel_cd_cpy", + "slice_sel_start_cd_cpy", "slice_space_id", "slice_val", "perm_cd_mem", @@ -601,8 +601,8 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_rwd) // << "," << field_to_string(row.main_sel_alu) // << "," << field_to_string(row.main_sel_bin) // - << "," << field_to_string(row.main_sel_calldata_gadget) // - << "," << field_to_string(row.main_sel_cd) // + << "," << field_to_string(row.main_sel_calldata) // + << "," << field_to_string(row.main_sel_cd_cpy_gadget) // << "," << field_to_string(row.main_sel_gas_accounting_active) // << "," << field_to_string(row.main_sel_last) // << "," << field_to_string(row.main_sel_mem_op_a) // @@ -693,7 +693,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.mem_sel_op_a) // << "," << field_to_string(row.mem_sel_op_b) // << "," << field_to_string(row.mem_sel_op_c) // - << "," << field_to_string(row.mem_sel_op_cd) // + << "," << field_to_string(row.mem_sel_op_cd_cpy) // << "," << field_to_string(row.mem_sel_op_cmov) // << "," << field_to_string(row.mem_sel_op_d) // << "," << field_to_string(row.mem_sel_resolve_ind_addr_a) // @@ -727,8 +727,8 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.slice_clk) // << "," << field_to_string(row.slice_cnt) // << "," << field_to_string(row.slice_one_min_inv) // - << "," << field_to_string(row.slice_sel_cd) // - << "," << field_to_string(row.slice_sel_start_cd) // + << "," << field_to_string(row.slice_sel_cd_cpy) // + << "," << field_to_string(row.slice_sel_start_cd_cpy) // << "," << field_to_string(row.slice_space_id) // << "," << field_to_string(row.slice_val) // << "," << field_to_string(row.perm_cd_mem) // From 3aa9cba0a0f1a426983851061fc802c3beab33d0 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Fri, 5 Jul 2024 09:07:05 +0000 Subject: [PATCH 04/12] 7211: Some renaming --- .../barretenberg/vm/tests/avm_cast.test.cpp | 90 ++++---- .../vm/tests/avm_inter_table.test.cpp | 202 +++++++++--------- .../vm/tests/avm_mem_opcodes.test.cpp | 146 ++++++------- 3 files changed, 219 insertions(+), 219 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp index 11d9768300d..de12256404a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp @@ -26,9 +26,9 @@ class AvmCastTests : public ::testing::Test { std::vector calldata; std::vector trace; - size_t main_addr; - size_t alu_addr; - size_t mem_addr_c; + size_t main_row_idx; + size_t alu_row_idx; + size_t mem_c_row_idx; void gen_trace( uint128_t const& a, uint32_t src_address, uint32_t dst_address, AvmMemoryTag src_tag, AvmMemoryTag dst_tag) @@ -44,20 +44,20 @@ class AvmCastTests : public ::testing::Test { { auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_cast == FF(1); }); ASSERT_TRUE(row != trace.end()); - main_addr = static_cast(row - trace.begin()); + main_row_idx = static_cast(row - trace.begin()); // Find the corresponding Alu trace row auto clk = row->main_clk; auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); ASSERT_TRUE(alu_row != trace.end()); - alu_addr = static_cast(alu_row - trace.begin()); + alu_row_idx = static_cast(alu_row - trace.begin()); // Mem entry output ic write operation auto mem_row_c = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_STORE_C; }); ASSERT_TRUE(mem_row_c != trace.end()); - mem_addr_c = static_cast(mem_row_c - trace.begin()); + mem_c_row_idx = static_cast(mem_row_c - trace.begin()); } void validate_cast_trace(FF const& a, @@ -70,7 +70,7 @@ class AvmCastTests : public ::testing::Test { ) { - auto const& row = trace.at(main_addr); + auto const& row = trace.at(main_row_idx); EXPECT_THAT(row, AllOf(MAIN_ROW_FIELD_EQ(sel_op_cast, 1), MAIN_ROW_FIELD_EQ(ia, a), @@ -90,7 +90,7 @@ class AvmCastTests : public ::testing::Test { MAIN_ROW_FIELD_EQ(sel_rng_8, 1), MAIN_ROW_FIELD_EQ(sel_rng_16, 1))); - auto const& alu_row = trace.at(alu_addr); + auto const& alu_row = trace.at(alu_row_idx); EXPECT_THAT(alu_row, AllOf(ALU_ROW_FIELD_EQ(op_cast, 1), ALU_ROW_FIELD_EQ(ia, a), @@ -108,7 +108,7 @@ class AvmCastTests : public ::testing::Test { ALU_ROW_FIELD_EQ(sel_alu, 1))); // Check that there is a second ALU row - auto alu_row_next = trace.at(alu_addr + 1); + auto alu_row_next = trace.at(alu_row_idx + 1); EXPECT_THAT(alu_row_next, AllOf(ALU_ROW_FIELD_EQ(op_cast, 0), ALU_ROW_FIELD_EQ(op_cast_prev, 1))); // We still want the ability to enable proving through the environment variable and therefore we do not pass @@ -256,13 +256,13 @@ TEST_F(AvmCastTests, indirectAddrWrongResolutionU64ToU8) TEST_F(AvmCastNegativeTests, nonTruncatedOutputMainIc) { gen_trace(300, 0, 1, AvmMemoryTag::U16, AvmMemoryTag::U8); - ASSERT_EQ(trace.at(main_addr).main_ic, 44); + ASSERT_EQ(trace.at(main_row_idx).main_ic, 44); // Replace the output in main trace with the non-truncated value - trace.at(main_addr).main_ic = 300; + trace.at(main_row_idx).main_ic = 300; // Adapt the memory trace entry - trace.at(mem_addr_c).mem_val = 300; + trace.at(mem_c_row_idx).mem_val = 300; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -270,13 +270,13 @@ TEST_F(AvmCastNegativeTests, nonTruncatedOutputMainIc) TEST_F(AvmCastNegativeTests, wrongOutputMainIc) { gen_trace(151515, 0, 1, AvmMemoryTag::U32, AvmMemoryTag::FF); - ASSERT_EQ(trace.at(main_addr).main_ic, 151515); + ASSERT_EQ(trace.at(main_row_idx).main_ic, 151515); // Replace the output in main trace with a wrong value - trace.at(main_addr).main_ic = 151516; + trace.at(main_row_idx).main_ic = 151516; // Adapt the memory trace entry - trace.at(mem_addr_c).mem_val = 151516; + trace.at(mem_c_row_idx).mem_val = 151516; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -284,12 +284,12 @@ TEST_F(AvmCastNegativeTests, wrongOutputMainIc) TEST_F(AvmCastNegativeTests, wrongOutputAluIc) { gen_trace(6582736, 0, 1, AvmMemoryTag::U128, AvmMemoryTag::U16); - ASSERT_EQ(trace.at(alu_addr).alu_ic, 29136); + ASSERT_EQ(trace.at(alu_row_idx).alu_ic, 29136); // Replace output in ALU, MAIN, and MEM trace - trace.at(alu_addr).alu_ic = 33; - trace.at(main_addr).main_ic = 33; - trace.at(mem_addr_c).mem_val = 33; + trace.at(alu_row_idx).alu_ic = 33; + trace.at(main_row_idx).main_ic = 33; + trace.at(mem_c_row_idx).mem_val = 33; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "ALU_OP_CAST"); } @@ -304,7 +304,7 @@ TEST_F(AvmCastNegativeTests, wrongLimbDecompositionInput) trace = trace_builder.finalize(); gen_indices(); - trace.at(alu_addr).alu_a_lo -= 23; + trace.at(alu_row_idx).alu_a_lo -= 23; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "INPUT_DECOMP_1"); } @@ -312,9 +312,9 @@ TEST_F(AvmCastNegativeTests, wrongLimbDecompositionInput) TEST_F(AvmCastNegativeTests, wrongPSubALo) { gen_trace(12345, 0, 1, AvmMemoryTag::U32, AvmMemoryTag::U16); - ASSERT_EQ(trace.at(alu_addr).alu_ic, 12345); + ASSERT_EQ(trace.at(alu_row_idx).alu_ic, 12345); - trace.at(alu_addr).alu_p_sub_a_lo += 3; + trace.at(alu_row_idx).alu_p_sub_a_lo += 3; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUB_LO_1"); } @@ -329,7 +329,7 @@ TEST_F(AvmCastNegativeTests, wrongPSubAHi) trace = trace_builder.finalize(); gen_indices(); - trace.at(alu_addr).alu_p_sub_a_hi += 3; + trace.at(alu_row_idx).alu_p_sub_a_hi += 3; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUB_HI_1"); } @@ -338,7 +338,7 @@ TEST_F(AvmCastNegativeTests, disableRangecheck) { gen_trace(123, 23, 43, AvmMemoryTag::U8, AvmMemoryTag::U8); - trace.at(alu_addr).alu_sel_rng_chk_lookup = 0; + trace.at(alu_row_idx).alu_sel_rng_chk_lookup = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "RNG_CHK_LOOKUP_SELECTOR"); } @@ -346,16 +346,16 @@ TEST_F(AvmCastNegativeTests, disableRangecheckSub) { gen_trace(123, 23, 43, AvmMemoryTag::U8, AvmMemoryTag::U8); - trace.at(alu_addr + 1).alu_sel_rng_chk_lookup = 0; + trace.at(alu_row_idx + 1).alu_sel_rng_chk_lookup = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "RNG_CHK_LOOKUP_SELECTOR"); } TEST_F(AvmCastNegativeTests, wrongRangeCheckDecompositionLo) { gen_trace(987344323, 23, 43, AvmMemoryTag::FF, AvmMemoryTag::U128); - ASSERT_EQ(trace.at(alu_addr).alu_ic, 987344323); + ASSERT_EQ(trace.at(alu_row_idx).alu_ic, 987344323); - trace.at(alu_addr).alu_u16_r0 = 5555; + trace.at(alu_row_idx).alu_u16_r0 = 5555; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOWER_CMP_RNG_CHK"); } @@ -369,17 +369,17 @@ TEST_F(AvmCastNegativeTests, wrongRangeCheckDecompositionHi) trace = trace_builder.finalize(); gen_indices(); - trace.at(alu_addr).alu_u16_r9 = 5555; + trace.at(alu_row_idx).alu_u16_r9 = 5555; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "UPPER_CMP_RNG_CHK"); } TEST_F(AvmCastNegativeTests, outOfRangeU8Registers) { gen_trace(987344323, 23, 43, AvmMemoryTag::FF, AvmMemoryTag::U128); - ASSERT_EQ(trace.at(alu_addr).alu_ic, 987344323); + ASSERT_EQ(trace.at(alu_row_idx).alu_ic, 987344323); - trace.at(alu_addr).alu_u8_r0 += 256; - trace.at(alu_addr).alu_u8_r1 -= 1; // Adjust so that the decomposition is correct. + trace.at(alu_row_idx).alu_u8_r0 += 256; + trace.at(alu_row_idx).alu_u8_r1 -= 1; // Adjust so that the decomposition is correct. EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "Lookup LOOKUP_U8_0"); } @@ -387,10 +387,10 @@ TEST_F(AvmCastNegativeTests, outOfRangeU8Registers) TEST_F(AvmCastNegativeTests, outOfRangeU16Registers) { gen_trace(987344323, 23, 43, AvmMemoryTag::FF, AvmMemoryTag::U128); - ASSERT_EQ(trace.at(alu_addr).alu_ic, 987344323); + ASSERT_EQ(trace.at(alu_row_idx).alu_ic, 987344323); - trace.at(alu_addr).alu_u16_r0 += 65536; - trace.at(alu_addr).alu_u16_r1 -= 1; // Adjust so that the decomposition is correct. + trace.at(alu_row_idx).alu_u16_r0 += 65536; + trace.at(alu_row_idx).alu_u16_r1 -= 1; // Adjust so that the decomposition is correct. EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "Lookup LOOKUP_U16_0"); } @@ -398,10 +398,10 @@ TEST_F(AvmCastNegativeTests, outOfRangeU16Registers) TEST_F(AvmCastNegativeTests, wrongCopySubLoForRangeCheck) { gen_trace(987344323, 23, 43, AvmMemoryTag::U64, AvmMemoryTag::U128); - ASSERT_EQ(trace.at(alu_addr).alu_ic, 987344323); + ASSERT_EQ(trace.at(alu_row_idx).alu_ic, 987344323); - ASSERT_EQ(trace.at(alu_addr + 1).alu_a_lo, trace.at(alu_addr).alu_p_sub_a_lo); - trace.at(alu_addr + 1).alu_a_lo -= 1; + ASSERT_EQ(trace.at(alu_row_idx + 1).alu_a_lo, trace.at(alu_row_idx).alu_p_sub_a_lo); + trace.at(alu_row_idx + 1).alu_a_lo -= 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OP_CAST_RNG_CHECK_P_SUB_A_LOW"); } @@ -415,33 +415,33 @@ TEST_F(AvmCastNegativeTests, wrongCopySubHiForRangeCheck) trace = trace_builder.finalize(); gen_indices(); - ASSERT_EQ(trace.at(alu_addr + 1).alu_a_hi, trace.at(alu_addr).alu_p_sub_a_hi); - trace.at(alu_addr + 1).alu_a_hi += 2; + ASSERT_EQ(trace.at(alu_row_idx + 1).alu_a_hi, trace.at(alu_row_idx).alu_p_sub_a_hi); + trace.at(alu_row_idx + 1).alu_a_hi += 2; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OP_CAST_RNG_CHECK_P_SUB_A_HIGH"); } TEST_F(AvmCastNegativeTests, secondRowNoOp) { gen_trace(6583, 0, 1, AvmMemoryTag::U64, AvmMemoryTag::U8); - ASSERT_EQ(trace.at(alu_addr).alu_ic, 183); + ASSERT_EQ(trace.at(alu_row_idx).alu_ic, 183); // We have to enable alu_sel otherwise another relation will fail. - trace.at(alu_addr + 1).alu_sel_alu = 1; + trace.at(alu_row_idx + 1).alu_sel_alu = 1; // Add an LT selector in the next row (second part of the cast operation) auto trace_lt = trace; - trace_lt.at(alu_addr + 1).alu_op_lt = 1; + trace_lt.at(alu_row_idx + 1).alu_op_lt = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace_lt)), "TWO_LINE_OP_NO_OVERLAP"); // Try with EQ selector auto trace_eq = trace; - trace_eq.at(alu_addr + 1).alu_op_eq = 1; + trace_eq.at(alu_row_idx + 1).alu_op_eq = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace_eq)), "TWO_LINE_OP_NO_OVERLAP"); // Try with a second cast selector - trace.at(alu_addr + 1).alu_op_cast = 1; + trace.at(alu_row_idx + 1).alu_op_cast = 1; // Adjust to not violate #[RNG_CHK_LOOKUP_SELECTOR] - trace.at(alu_addr + 1).alu_sel_rng_chk_lookup = 2; + trace.at(alu_row_idx + 1).alu_sel_rng_chk_lookup = 2; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "TWO_LINE_OP_NO_OVERLAP"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_inter_table.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_inter_table.test.cpp index 400d0a480b4..79855ca1de6 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_inter_table.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_inter_table.test.cpp @@ -44,9 +44,9 @@ class AvmInterTableTests : public ::testing::Test { class AvmPermMainAluNegativeTests : public AvmInterTableTests { protected: std::vector trace; - size_t main_addr; - size_t mem_addr; - size_t alu_addr; + size_t main_row_idx; + size_t mem_row_idx; + size_t alu_row_idx; void SetUp() override { @@ -78,9 +78,9 @@ class AvmPermMainAluNegativeTests : public AvmInterTableTests { }); ASSERT_TRUE(mem_row != trace.end()); - main_addr = static_cast(row - trace.begin()); - alu_addr = static_cast(alu_row - trace.begin()); - mem_addr = static_cast(mem_row - trace.begin()); + main_row_idx = static_cast(row - trace.begin()); + alu_row_idx = static_cast(alu_row - trace.begin()); + mem_row_idx = static_cast(mem_row - trace.begin()); } }; @@ -88,8 +88,8 @@ TEST_F(AvmPermMainAluNegativeTests, wrongAluOutputCopyInMain) { // Mutate the multiplication output. Note that the output alu counterpart is still valid // and pass the multiplication relation. - trace.at(main_addr).main_ic = 1008; - trace.at(mem_addr).mem_val = 1008; + trace.at(main_row_idx).main_ic = 1008; + trace.at(mem_row_idx).mem_val = 1008; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -97,10 +97,10 @@ TEST_F(AvmPermMainAluNegativeTests, wrongAluOutputCopyInMain) TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIaInput) { // Mutate the input of alu_ia and adapt the output ic accordingly. - trace.at(alu_addr).alu_ia = 20; - trace.at(alu_addr).alu_ic = 1060; // 20 * 53; required to pass the alu mul relation - trace.at(alu_addr).alu_u8_r0 = 36; // 1060 % 256 = 36 - trace.at(alu_addr).alu_u8_r1 = 4; // 4 * 256 = 1024 + trace.at(alu_row_idx).alu_ia = 20; + trace.at(alu_row_idx).alu_ic = 1060; // 20 * 53; required to pass the alu mul relation + trace.at(alu_row_idx).alu_u8_r0 = 36; // 1060 % 256 = 36 + trace.at(alu_row_idx).alu_u8_r1 = 4; // 4 * 256 = 1024 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -108,30 +108,30 @@ TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIaInput) TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIbInput) { // Mutate the input of alu_ia and adapt the output ic accordingly. - trace.at(alu_addr).alu_ib = 10; - trace.at(alu_addr).alu_ic = 190; // 19 * 10; required to pass the alu mul relation - trace.at(alu_addr).alu_u8_r0 = 190; - trace.at(alu_addr).alu_u8_r1 = 0; + trace.at(alu_row_idx).alu_ib = 10; + trace.at(alu_row_idx).alu_ic = 190; // 19 * 10; required to pass the alu mul relation + trace.at(alu_row_idx).alu_u8_r0 = 190; + trace.at(alu_row_idx).alu_u8_r1 = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluOpSelector) { - trace.at(alu_addr).alu_op_mul = 0; - trace.at(alu_addr).alu_op_add = 1; - trace.at(alu_addr).alu_ic = 72; // 19 + 53 - trace.at(alu_addr).alu_u8_r0 = 72; - trace.at(alu_addr).alu_u8_r1 = 0; + trace.at(alu_row_idx).alu_op_mul = 0; + trace.at(alu_row_idx).alu_op_add = 1; + trace.at(alu_row_idx).alu_ic = 72; // 19 + 53 + trace.at(alu_row_idx).alu_u8_r0 = 72; + trace.at(alu_row_idx).alu_u8_r1 = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } TEST_F(AvmPermMainAluNegativeTests, removeAluSelector) { - trace.at(alu_addr).alu_sel_alu = 0; - trace.at(alu_addr).alu_op_mul = 0; - trace.at(alu_addr).alu_sel_rng_chk_lookup = 0; + trace.at(alu_row_idx).alu_sel_alu = 0; + trace.at(alu_row_idx).alu_op_mul = 0; + trace.at(alu_row_idx).alu_sel_rng_chk_lookup = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -142,9 +142,9 @@ TEST_F(AvmPermMainAluNegativeTests, removeAluSelector) class AvmRangeCheckNegativeTests : public AvmInterTableTests { protected: std::vector trace; - size_t main_addr; - size_t mem_addr; - size_t alu_addr; + size_t main_row_idx; + size_t mem_row_idx; + size_t alu_row_idx; void genTraceAdd( uint128_t const& a, uint128_t const& b, uint128_t const& c, AvmMemoryTag tag, uint32_t min_trace_size = 0) @@ -174,9 +174,9 @@ class AvmRangeCheckNegativeTests : public AvmInterTableTests { }); ASSERT_TRUE(mem_row != trace.end()); - main_addr = static_cast(row - trace.begin()); - alu_addr = static_cast(alu_row - trace.begin()); - mem_addr = static_cast(mem_row - trace.begin()); + main_row_idx = static_cast(row - trace.begin()); + alu_row_idx = static_cast(alu_row - trace.begin()); + mem_row_idx = static_cast(mem_row - trace.begin()); }; }; @@ -191,9 +191,9 @@ TEST_F(AvmRangeCheckNegativeTests, additionU8Reg0) // All constraints except range checks on u8_r0, u8_r1 are satisfied. FF const fake_c = FF(15).add(-FF(2).pow(254)); - auto& row = trace.at(main_addr); - auto& mem_row = trace.at(mem_addr); - auto& alu_row = trace.at(alu_addr); + auto& row = trace.at(main_row_idx); + auto& mem_row = trace.at(mem_row_idx); + auto& alu_row = trace.at(alu_row_idx); row.main_ic = fake_c; mem_row.mem_val = fake_c; @@ -221,9 +221,9 @@ TEST_F(AvmRangeCheckNegativeTests, additionU8Reg0) TEST_F(AvmRangeCheckNegativeTests, additionU8Reg1) { genTraceAdd(19, 20, 39, AvmMemoryTag::U8); - auto& row = trace.at(main_addr); - auto& mem_row = trace.at(mem_addr); - auto& alu_row = trace.at(alu_addr); + auto& row = trace.at(main_row_idx); + auto& mem_row = trace.at(mem_row_idx); + auto& alu_row = trace.at(alu_row_idx); // a + b = u8_r0 + 2^8 * u8_r1 (mod p) // We recall that p-1 is a multiple of a large power of two. @@ -259,9 +259,9 @@ TEST_F(AvmRangeCheckNegativeTests, additionU8Reg1) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg0) { genTraceAdd(1200, 2000, 3200, AvmMemoryTag::U16, 130); - auto& row = trace.at(main_addr); - auto& mem_row = trace.at(mem_addr); - auto& alu_row = trace.at(alu_addr); + auto& row = trace.at(main_row_idx); + auto& mem_row = trace.at(mem_row_idx); + auto& alu_row = trace.at(alu_row_idx); // a + b = u8_r0 + 2^8 * u8_r1 + 2^16 * u16_r0 (mod p) // We recall that p-1 is a multiple of a large power of two. @@ -306,7 +306,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg7) genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); auto trace_original = trace; - auto& alu_row = trace.at(alu_addr); + auto& alu_row = trace.at(alu_row_idx); alu_row.alu_u16_r7 = FF(235655); auto trace_same_cnt = trace; @@ -323,7 +323,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg7) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg8) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_addr).alu_u16_r8 = FF(235655); + trace.at(alu_row_idx).alu_u16_r8 = FF(235655); trace.at(1).lookup_u16_8_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_8"); } @@ -332,7 +332,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg8) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg9) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_addr).alu_u16_r9 = FF(235655); + trace.at(alu_row_idx).alu_u16_r9 = FF(235655); trace.at(1).lookup_u16_9_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_9"); } @@ -341,7 +341,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg9) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg10) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_addr).alu_u16_r10 = FF(235655); + trace.at(alu_row_idx).alu_u16_r10 = FF(235655); trace.at(1).lookup_u16_10_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_10"); } @@ -350,7 +350,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg10) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg11) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_addr).alu_u16_r11 = FF(235655); + trace.at(alu_row_idx).alu_u16_r11 = FF(235655); trace.at(1).lookup_u16_11_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_11"); } @@ -359,7 +359,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg11) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg12) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_addr).alu_u16_r12 = FF(235655); + trace.at(alu_row_idx).alu_u16_r12 = FF(235655); trace.at(1).lookup_u16_12_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_12"); } @@ -368,7 +368,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg12) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg13) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_addr).alu_u16_r13 = FF(235655); + trace.at(alu_row_idx).alu_u16_r13 = FF(235655); trace.at(1).lookup_u16_13_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_13"); } @@ -377,7 +377,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg13) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg14) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_addr).alu_u16_r14 = FF(235655); + trace.at(alu_row_idx).alu_u16_r14 = FF(235655); trace.at(1).lookup_u16_14_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_14"); } @@ -388,11 +388,11 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg14) class AvmPermMainMemNegativeTests : public AvmInterTableTests { protected: std::vector trace; - size_t main_addr; - size_t mem_addr_a; - size_t mem_addr_b; - size_t mem_addr_c; - size_t alu_addr; + size_t main_row_idx; + size_t mem_a_row_idx; + size_t mem_b_row_idx; + size_t mem_c_row_idx; + size_t alu_row_idx; // Helper function to generate a trace with a subtraction // for c = a - b at arbitray chosen addresses 52 (a), 11 (b), 55 (c). @@ -433,11 +433,11 @@ class AvmPermMainMemNegativeTests : public AvmInterTableTests { }); ASSERT_TRUE(mem_row_b != trace.end()); - main_addr = static_cast(row - trace.begin()); - alu_addr = static_cast(alu_row - trace.begin()); - mem_addr_a = static_cast(mem_row_a - trace.begin()); - mem_addr_b = static_cast(mem_row_b - trace.begin()); - mem_addr_c = static_cast(mem_row_c - trace.begin()); + main_row_idx = static_cast(row - trace.begin()); + alu_row_idx = static_cast(alu_row - trace.begin()); + mem_a_row_idx = static_cast(mem_row_a - trace.begin()); + mem_b_row_idx = static_cast(mem_row_b - trace.begin()); + mem_c_row_idx = static_cast(mem_row_c - trace.begin()); } }; // Error tag propagation from memory trace back to the main trace. @@ -483,8 +483,8 @@ TEST_F(AvmPermMainMemNegativeTests, tagErrNotCopiedInMain) TEST_F(AvmPermMainMemNegativeTests, wrongValueIaInMem) { executeSub(21, 3); - trace.at(mem_addr_a).mem_val = 26; // Correct value: 21 - trace.at(mem_addr_a - 1).mem_val = 26; // We need to adjust the write operation beforehand (set opcode). + trace.at(mem_a_row_idx).mem_val = 26; // Correct value: 21 + trace.at(mem_a_row_idx - 1).mem_val = 26; // We need to adjust the write operation beforehand (set opcode). EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -492,8 +492,8 @@ TEST_F(AvmPermMainMemNegativeTests, wrongValueIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongValueIbInMem) { executeSub(21, 3); - trace.at(mem_addr_b).mem_val = 7; // Correct value: 3 - trace.at(mem_addr_b - 1).mem_val = 7; // We need to adjust the write operation beforehand (set opcode). + trace.at(mem_b_row_idx).mem_val = 7; // Correct value: 3 + trace.at(mem_b_row_idx - 1).mem_val = 7; // We need to adjust the write operation beforehand (set opcode). EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -501,7 +501,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongValueIbInMem) TEST_F(AvmPermMainMemNegativeTests, wrongValueIcInMem) { executeSub(21, 3); - trace.at(mem_addr_c).mem_val = 17; // Correct value: 18 = 21 - 3 + trace.at(mem_c_row_idx).mem_val = 17; // Correct value: 18 = 21 - 3 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -509,7 +509,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongValueIcInMem) TEST_F(AvmPermMainMemNegativeTests, wrongAddressIaInMain) { executeSub(21, 3); - trace.at(main_addr).main_mem_addr_a = 28; // Correct address: 52 + trace.at(main_row_idx).main_mem_addr_a = 28; // Correct address: 52 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -517,7 +517,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongAddressIaInMain) TEST_F(AvmPermMainMemNegativeTests, wrongAddressIbInMain) { executeSub(21, 3); - trace.at(main_addr).main_mem_addr_b = 2; // Correct address: 11 + trace.at(main_row_idx).main_mem_addr_b = 2; // Correct address: 11 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -525,7 +525,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongAddressIbInMain) TEST_F(AvmPermMainMemNegativeTests, wrongAddressIcInMain) { executeSub(21, 3); - trace.at(main_addr).main_mem_addr_c = 75; // Correct address: 55 + trace.at(main_row_idx).main_mem_addr_c = 75; // Correct address: 55 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -534,13 +534,13 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIaInMem) { executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U32); - trace.at(mem_addr_a).mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_addr_a).mem_tag = wrong_in_tag; + trace.at(mem_a_row_idx).mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 + trace.at(mem_a_row_idx).mem_tag = wrong_in_tag; // We need to adjust the write operation beforehand (set opcode). - trace.at(mem_addr_a - 1).mem_r_in_tag = wrong_in_tag; - trace.at(mem_addr_a - 1).mem_w_in_tag = wrong_in_tag; - trace.at(mem_addr_a - 1).mem_tag = wrong_in_tag; + trace.at(mem_a_row_idx - 1).mem_r_in_tag = wrong_in_tag; + trace.at(mem_a_row_idx - 1).mem_w_in_tag = wrong_in_tag; + trace.at(mem_a_row_idx - 1).mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -549,13 +549,13 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIbInMem) { executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U16); - trace.at(mem_addr_b).mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_addr_b).mem_tag = wrong_in_tag; + trace.at(mem_b_row_idx).mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 + trace.at(mem_b_row_idx).mem_tag = wrong_in_tag; // We need to adjust the write operation beforehand (set opcode). - trace.at(mem_addr_b - 1).mem_r_in_tag = wrong_in_tag; - trace.at(mem_addr_b - 1).mem_w_in_tag = wrong_in_tag; - trace.at(mem_addr_b - 1).mem_tag = wrong_in_tag; + trace.at(mem_b_row_idx - 1).mem_r_in_tag = wrong_in_tag; + trace.at(mem_b_row_idx - 1).mem_w_in_tag = wrong_in_tag; + trace.at(mem_b_row_idx - 1).mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -564,8 +564,8 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIcInMem) { executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U128); - trace.at(mem_addr_c).mem_w_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_addr_c).mem_tag = wrong_in_tag; + trace.at(mem_c_row_idx).mem_w_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 + trace.at(mem_c_row_idx).mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -573,15 +573,15 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIcInMem) TEST_F(AvmPermMainMemNegativeTests, wrongRwIaInMem) { executeSub(21, 3); - trace.at(mem_addr_a).mem_rw = 1; // Write instead of read. + trace.at(mem_a_row_idx).mem_rw = 1; // Write instead of read. // Adjust timestamp value - trace.at(mem_addr_a).mem_tsp += FF(AvmMemTraceBuilder::SUB_CLK_STORE_A - AvmMemTraceBuilder::SUB_CLK_LOAD_A); + trace.at(mem_a_row_idx).mem_tsp += FF(AvmMemTraceBuilder::SUB_CLK_STORE_A - AvmMemTraceBuilder::SUB_CLK_LOAD_A); // Adjust diff value of previous row as well - FF diff = trace.at(mem_addr_a - 1).mem_diff_lo + trace.at(mem_addr_a - 1).mem_diff_mid * FF(1 << 16) + + FF diff = trace.at(mem_a_row_idx - 1).mem_diff_lo + trace.at(mem_a_row_idx - 1).mem_diff_mid * FF(1 << 16) + FF(AvmMemTraceBuilder::SUB_CLK_STORE_A - AvmMemTraceBuilder::SUB_CLK_LOAD_A); - trace.at(mem_addr_a - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); - trace.at(mem_addr_a - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); + trace.at(mem_a_row_idx - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); + trace.at(mem_a_row_idx - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -589,15 +589,15 @@ TEST_F(AvmPermMainMemNegativeTests, wrongRwIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongRwIbInMem) { executeSub(21, 3); - trace.at(mem_addr_b).mem_rw = 1; // Write instead of read. + trace.at(mem_b_row_idx).mem_rw = 1; // Write instead of read. // Adjust timestamp value - trace.at(mem_addr_b).mem_tsp += FF(AvmMemTraceBuilder::SUB_CLK_STORE_B - AvmMemTraceBuilder::SUB_CLK_LOAD_B); + trace.at(mem_b_row_idx).mem_tsp += FF(AvmMemTraceBuilder::SUB_CLK_STORE_B - AvmMemTraceBuilder::SUB_CLK_LOAD_B); // Adjust diff value of previous row as well - FF diff = trace.at(mem_addr_b - 1).mem_diff_lo + trace.at(mem_addr_b - 1).mem_diff_mid * FF(1 << 16) + + FF diff = trace.at(mem_b_row_idx - 1).mem_diff_lo + trace.at(mem_b_row_idx - 1).mem_diff_mid * FF(1 << 16) + FF(AvmMemTraceBuilder::SUB_CLK_STORE_B - AvmMemTraceBuilder::SUB_CLK_LOAD_B); - trace.at(mem_addr_b - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); - trace.at(mem_addr_b - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); + trace.at(mem_b_row_idx - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); + trace.at(mem_b_row_idx - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -608,10 +608,10 @@ TEST_F(AvmPermMainMemNegativeTests, wrongRwIcInMem) // a write for a read of Ic below leads to a violation that the memory // is initialized with zero values. executeSub(11, 11); - trace.at(mem_addr_c).mem_rw = 0; // Read instead of write. + trace.at(mem_c_row_idx).mem_rw = 0; // Read instead of write. // Adjust timestamp value. - trace.at(mem_addr_c).mem_tsp -= FF(AvmMemTraceBuilder::SUB_CLK_STORE_C - AvmMemTraceBuilder::SUB_CLK_LOAD_C); + trace.at(mem_c_row_idx).mem_tsp -= FF(AvmMemTraceBuilder::SUB_CLK_STORE_C - AvmMemTraceBuilder::SUB_CLK_LOAD_C); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -619,13 +619,13 @@ TEST_F(AvmPermMainMemNegativeTests, wrongRwIcInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIaInMem) { executeSub(87, 23); - trace.at(mem_addr_a).mem_clk += 3; - trace.at(mem_addr_a).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 3; + trace.at(mem_a_row_idx).mem_clk += 3; + trace.at(mem_a_row_idx).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 3; // Adjust diff value of previous row as well - FF diff = trace.at(mem_addr_a - 1).mem_diff_lo + trace.at(mem_addr_a - 1).mem_diff_mid * FF(1 << 16) + + FF diff = trace.at(mem_a_row_idx - 1).mem_diff_lo + trace.at(mem_a_row_idx - 1).mem_diff_mid * FF(1 << 16) + FF(AvmMemTraceBuilder::NUM_SUB_CLK * 3); - trace.at(mem_addr_a - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); - trace.at(mem_addr_a - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); + trace.at(mem_a_row_idx - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); + trace.at(mem_a_row_idx - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -633,12 +633,12 @@ TEST_F(AvmPermMainMemNegativeTests, wrongClkIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIbInMem) { executeSub(87, 23); - trace.at(mem_addr_b).mem_clk += 5; - trace.at(mem_addr_b).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 5; - FF diff = trace.at(mem_addr_b - 1).mem_diff_lo + trace.at(mem_addr_b - 1).mem_diff_mid * FF(1 << 16) + + trace.at(mem_b_row_idx).mem_clk += 5; + trace.at(mem_b_row_idx).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 5; + FF diff = trace.at(mem_b_row_idx - 1).mem_diff_lo + trace.at(mem_b_row_idx - 1).mem_diff_mid * FF(1 << 16) + FF(AvmMemTraceBuilder::NUM_SUB_CLK * 5); - trace.at(mem_addr_b - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); - trace.at(mem_addr_b - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); + trace.at(mem_b_row_idx - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); + trace.at(mem_b_row_idx - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -646,8 +646,8 @@ TEST_F(AvmPermMainMemNegativeTests, wrongClkIbInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIcInMem) { executeSub(87, 23); - trace.at(mem_addr_c).mem_clk += 7; - trace.at(mem_addr_c).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 7; + trace.at(mem_c_row_idx).mem_clk += 7; + trace.at(mem_c_row_idx).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 7; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp index 94157443a75..d826ab084ca 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp @@ -29,15 +29,15 @@ class AvmMemOpcodeTests : public ::testing::Test { protected: std::vector trace; - size_t main_addr; - size_t mem_a_addr; - size_t mem_b_addr; - size_t mem_c_addr; - size_t mem_d_addr; - size_t mem_ind_a_addr; - size_t mem_ind_b_addr; - size_t mem_ind_c_addr; - size_t mem_ind_d_addr; + size_t main_row_idx; + size_t mem_a_row_idx; + size_t mem_b_row_idx; + size_t mem_c_row_idx; + size_t mem_d_row_idx; + size_t mem_ind_a_row_idx; + size_t mem_ind_b_row_idx; + size_t mem_ind_c_row_idx; + size_t mem_ind_d_row_idx; void build_mov_trace(bool indirect, uint128_t const& val, @@ -84,14 +84,14 @@ class AvmMemOpcodeTests : public ::testing::Test { auto row = std::ranges::find_if(trace.begin(), trace.end(), gen_matcher(clk, AvmMemTraceBuilder::SUB_CLK_LOAD_A)); ASSERT_TRUE(row != trace.end()); - mem_a_addr = static_cast(row - trace.begin()); + mem_a_row_idx = static_cast(row - trace.begin()); // Find the memory trace position of the indirect load for register ia. if (indirect) { row = std::ranges::find_if( trace.begin(), trace.end(), gen_matcher(clk, AvmMemTraceBuilder::SUB_CLK_IND_LOAD_A)); ASSERT_TRUE(row != trace.end()); - mem_ind_a_addr = static_cast(row - trace.begin()); + mem_ind_a_row_idx = static_cast(row - trace.begin()); } } @@ -101,14 +101,14 @@ class AvmMemOpcodeTests : public ::testing::Test { auto row = std::ranges::find_if(trace.begin(), trace.end(), gen_matcher(clk, AvmMemTraceBuilder::SUB_CLK_STORE_C)); ASSERT_TRUE(row != trace.end()); - mem_c_addr = static_cast(row - trace.begin()); + mem_c_row_idx = static_cast(row - trace.begin()); // Find the memory trace position of the indirect load for register ic. if (indirect) { row = std::ranges::find_if( trace.begin(), trace.end(), gen_matcher(clk, AvmMemTraceBuilder::SUB_CLK_IND_LOAD_C)); ASSERT_TRUE(row != trace.end()); - mem_ind_c_addr = static_cast(row - trace.begin()); + mem_ind_c_row_idx = static_cast(row - trace.begin()); } } @@ -117,7 +117,7 @@ class AvmMemOpcodeTests : public ::testing::Test { // Find the first row enabling the MOV selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mov == FF(1); }); ASSERT_TRUE(row != trace.end()); - main_addr = static_cast(row - trace.begin()); + main_row_idx = static_cast(row - trace.begin()); auto clk = row->main_clk; @@ -130,7 +130,7 @@ class AvmMemOpcodeTests : public ::testing::Test { // 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_addr = static_cast(row - trace.begin()); + main_row_idx = static_cast(row - trace.begin()); auto clk = row->main_clk; compute_index_a(clk, is_operand_indirect(indirect, 0)); @@ -139,27 +139,27 @@ class AvmMemOpcodeTests : public ::testing::Test { // 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_addr = static_cast(row - trace.begin()); + 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_addr = static_cast(row - trace.begin()); + 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_addr = static_cast(row - trace.begin()); + 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_addr = static_cast(row - trace.begin()); + mem_ind_d_row_idx = static_cast(row - trace.begin()); } } @@ -174,7 +174,7 @@ class AvmMemOpcodeTests : public ::testing::Test { { compute_mov_indices(indirect); FF const val_ff = uint256_t::from_uint128(val); - auto const& main_row = trace.at(main_addr); + auto const& main_row = trace.at(main_row_idx); if (indirect) { EXPECT_THAT( @@ -190,7 +190,7 @@ class AvmMemOpcodeTests : public ::testing::Test { MAIN_ROW_FIELD_EQ(r_in_tag, static_cast(tag)), MAIN_ROW_FIELD_EQ(w_in_tag, static_cast(tag)))); - auto const& mem_a_row = trace.at(mem_a_addr); + auto const& mem_a_row = trace.at(mem_a_row_idx); EXPECT_THAT(mem_a_row, AllOf(MEM_ROW_FIELD_EQ(tag_err, 0), @@ -202,7 +202,7 @@ class AvmMemOpcodeTests : public ::testing::Test { MEM_ROW_FIELD_EQ(rw, 0), MEM_ROW_FIELD_EQ(sel_op_a, 1))); - auto const& mem_c_row = trace.at(mem_c_addr); + auto const& mem_c_row = trace.at(mem_c_row_idx); EXPECT_THAT(mem_c_row, AllOf(MEM_ROW_FIELD_EQ(tag_err, 0), @@ -213,7 +213,7 @@ class AvmMemOpcodeTests : public ::testing::Test { MEM_ROW_FIELD_EQ(sel_op_c, 1))); if (indirect) { - auto const& mem_ind_a_row = trace.at(mem_ind_a_addr); + auto const& mem_ind_a_row = trace.at(mem_ind_a_row_idx); EXPECT_THAT(mem_ind_a_row, AllOf(MEM_ROW_FIELD_EQ(tag_err, 0), MEM_ROW_FIELD_EQ(r_in_tag, static_cast(AvmMemoryTag::U32)), @@ -224,7 +224,7 @@ class AvmMemOpcodeTests : public ::testing::Test { MEM_ROW_FIELD_EQ(val, dir_src_offset), MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_a, 1))); - auto const& mem_ind_c_row = trace.at(mem_ind_c_addr); + auto const& mem_ind_c_row = trace.at(mem_ind_c_row_idx); EXPECT_THAT(mem_ind_c_row, AllOf(MEM_ROW_FIELD_EQ(tag_err, 0), MEM_ROW_FIELD_EQ(r_in_tag, static_cast(AvmMemoryTag::U32)), @@ -254,7 +254,7 @@ class AvmMemOpcodeTests : public ::testing::Test { FF const& mov_val = mov_a ? a : b; FF const inv = mov_a ? d.invert() : 1; - EXPECT_THAT(trace.at(main_addr), + 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), @@ -282,7 +282,7 @@ class AvmMemOpcodeTests : public ::testing::Test { MAIN_ROW_FIELD_EQ(w_in_tag, static_cast(mov_tag)), MAIN_ROW_FIELD_EQ(inv, inv))); - EXPECT_THAT(trace.at(mem_a_addr), + 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)), @@ -294,7 +294,7 @@ class AvmMemOpcodeTests : public ::testing::Test { MEM_ROW_FIELD_EQ(sel_op_a, 1), MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_a, 0))); - EXPECT_THAT(trace.at(mem_b_addr), + 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)), @@ -307,7 +307,7 @@ class AvmMemOpcodeTests : public ::testing::Test { MEM_ROW_FIELD_EQ(sel_op_b, 1), MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_b, 0))); - EXPECT_THAT(trace.at(mem_c_addr), + 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)), @@ -319,7 +319,7 @@ class AvmMemOpcodeTests : public ::testing::Test { MEM_ROW_FIELD_EQ(sel_op_c, 1), MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_c, 0))); - EXPECT_THAT(trace.at(mem_d_addr), + 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)), @@ -395,8 +395,8 @@ TEST_F(AvmMemOpcodeTests, indirectMovInvalidAddressTag) compute_mov_indices(true); - EXPECT_EQ(trace.at(main_addr).main_tag_err, 1); - EXPECT_THAT(trace.at(mem_ind_c_addr), + EXPECT_EQ(trace.at(main_row_idx).main_tag_err, 1); + EXPECT_THAT(trace.at(mem_ind_c_row_idx), AllOf(MEM_ROW_FIELD_EQ(tag_err, 1), MEM_ROW_FIELD_EQ(tag, static_cast(AvmMemoryTag::U128)), MEM_ROW_FIELD_EQ(r_in_tag, static_cast(AvmMemoryTag::U32)), @@ -535,7 +535,7 @@ TEST_F(AvmMemOpcodeTests, directSet) MAIN_ROW_FIELD_EQ(rwc, 1), MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_c, 0))); - EXPECT_THAT(trace.at(mem_c_addr), + EXPECT_THAT(trace.at(mem_c_row_idx), AllOf(MEM_ROW_FIELD_EQ(val, 5683), MEM_ROW_FIELD_EQ(addr, 99), MEM_ROW_FIELD_EQ(sel_op_c, 1), @@ -564,7 +564,7 @@ TEST_F(AvmMemOpcodeTests, indirectSet) MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_c, 1), MAIN_ROW_FIELD_EQ(ind_addr_c, 10))); - EXPECT_THAT(trace.at(mem_c_addr), + EXPECT_THAT(trace.at(mem_c_row_idx), AllOf(MEM_ROW_FIELD_EQ(val, 1979), MEM_ROW_FIELD_EQ(addr, 100), MEM_ROW_FIELD_EQ(sel_op_c, 1), @@ -573,7 +573,7 @@ TEST_F(AvmMemOpcodeTests, indirectSet) MEM_ROW_FIELD_EQ(w_in_tag, static_cast(AvmMemoryTag::U64)), MEM_ROW_FIELD_EQ(tag, static_cast(AvmMemoryTag::U64)))); - EXPECT_THAT(trace.at(mem_ind_c_addr), + EXPECT_THAT(trace.at(mem_ind_c_row_idx), AllOf(MEM_ROW_FIELD_EQ(val, 100), MEM_ROW_FIELD_EQ(addr, 10), MEM_ROW_FIELD_EQ(sel_op_c, 0), @@ -602,7 +602,7 @@ TEST_F(AvmMemOpcodeTests, indirectSetWrongTag) MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_c, 1), MAIN_ROW_FIELD_EQ(ind_addr_c, 10))); - EXPECT_THAT(trace.at(mem_ind_c_addr), + EXPECT_THAT(trace.at(mem_ind_c_row_idx), AllOf(MEM_ROW_FIELD_EQ(val, 100), MEM_ROW_FIELD_EQ(addr, 10), MEM_ROW_FIELD_EQ(sel_op_c, 0), @@ -629,7 +629,7 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputErrorTag) { build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(main_addr).main_tag_err = 1; + trace.at(main_row_idx).main_tag_err = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "INCL_MEM_TAG_ERR"); } @@ -638,7 +638,7 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputValue) { build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(main_addr).main_ic = 233; + trace.at(main_row_idx).main_ic = 233; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_A"); } @@ -647,7 +647,7 @@ TEST_F(AvmMemOpcodeNegativeTests, indMovWrongOutputValue) { build_mov_trace(true, 8732, 23, 24, AvmMemoryTag::U16, 432, 876); compute_mov_indices(true); - trace.at(main_addr).main_ic = 8733; + trace.at(main_row_idx).main_ic = 8733; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_A"); } @@ -667,14 +667,14 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagLoadIa) auto trace_tmp = trace; - trace.at(mem_a_addr).mem_r_in_tag = tag_u64; - trace.at(mem_a_addr).mem_tag_err = 1; - trace.at(mem_a_addr).mem_one_min_inv = one_min_inverse_diff; - trace.at(mem_c_addr).mem_tag = tag_u64; - trace.at(mem_c_addr).mem_w_in_tag = tag_u64; - trace.at(main_addr).main_r_in_tag = tag_u64; - trace.at(main_addr).main_w_in_tag = tag_u64; - trace.at(main_addr).main_tag_err = 1; + trace.at(mem_a_row_idx).mem_r_in_tag = tag_u64; + trace.at(mem_a_row_idx).mem_tag_err = 1; + trace.at(mem_a_row_idx).mem_one_min_inv = one_min_inverse_diff; + trace.at(mem_c_row_idx).mem_tag = tag_u64; + trace.at(mem_c_row_idx).mem_w_in_tag = tag_u64; + trace.at(main_row_idx).main_r_in_tag = tag_u64; + trace.at(main_row_idx).main_w_in_tag = tag_u64; + trace.at(main_row_idx).main_tag_err = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_TAG"); } @@ -690,17 +690,17 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagDisabledSelector) build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(mem_a_addr).mem_r_in_tag = tag_u64; - trace.at(mem_a_addr).mem_w_in_tag = tag_u64; - trace.at(mem_a_addr).mem_tag_err = 1; - trace.at(mem_a_addr).mem_one_min_inv = one_min_inverse_diff; - trace.at(mem_a_addr).mem_sel_mov_ia_to_ic = 0; - trace.at(mem_c_addr).mem_tag = tag_u64; - trace.at(mem_c_addr).mem_r_in_tag = tag_u64; - trace.at(mem_c_addr).mem_w_in_tag = tag_u64; - trace.at(main_addr).main_r_in_tag = tag_u64; - trace.at(main_addr).main_w_in_tag = tag_u64; - trace.at(main_addr).main_tag_err = 1; + trace.at(mem_a_row_idx).mem_r_in_tag = tag_u64; + trace.at(mem_a_row_idx).mem_w_in_tag = tag_u64; + trace.at(mem_a_row_idx).mem_tag_err = 1; + trace.at(mem_a_row_idx).mem_one_min_inv = one_min_inverse_diff; + trace.at(mem_a_row_idx).mem_sel_mov_ia_to_ic = 0; + trace.at(mem_c_row_idx).mem_tag = tag_u64; + trace.at(mem_c_row_idx).mem_r_in_tag = tag_u64; + trace.at(mem_c_row_idx).mem_w_in_tag = tag_u64; + trace.at(main_row_idx).main_r_in_tag = tag_u64; + trace.at(main_row_idx).main_w_in_tag = tag_u64; + trace.at(main_row_idx).main_tag_err = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -714,10 +714,10 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagInMainTrace) build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(mem_c_addr).mem_tag = tag_u64; - trace.at(mem_c_addr).mem_w_in_tag = tag_u64; - trace.at(main_addr).main_w_in_tag = tag_u64; - trace.at(main_addr).main_tag_err = 1; + trace.at(mem_c_row_idx).mem_tag = tag_u64; + trace.at(mem_c_row_idx).mem_w_in_tag = tag_u64; + trace.at(main_row_idx).main_w_in_tag = tag_u64; + trace.at(main_row_idx).main_tag_err = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_MAIN_SAME_TAG"); } @@ -730,8 +730,8 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagMainTraceRead) build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(mem_c_addr).mem_tag = tag_u64; - trace.at(mem_c_addr).mem_w_in_tag = tag_u64; + trace.at(mem_c_row_idx).mem_tag = tag_u64; + trace.at(mem_c_row_idx).mem_w_in_tag = tag_u64; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -743,7 +743,7 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovBInsteadA) { build_cmov_trace_neg_test(true); - trace.at(main_addr).main_ic = 1980; + trace.at(main_row_idx).main_ic = 1980; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_A"); } @@ -751,7 +751,7 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovAInsteadB) { build_cmov_trace_neg_test(false); - trace.at(main_addr).main_ic = 1979; + trace.at(main_row_idx).main_ic = 1979; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_B"); } @@ -759,9 +759,9 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovAChangeTag) { build_cmov_trace_neg_test(true); - trace.at(mem_c_addr).mem_tag = static_cast(AvmMemoryTag::U32); - trace.at(mem_c_addr).mem_w_in_tag = static_cast(AvmMemoryTag::U32); - trace.at(main_addr).main_w_in_tag = static_cast(AvmMemoryTag::U32); + 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"); } @@ -770,7 +770,7 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovASkipCheckAbuse) { build_cmov_trace_neg_test(true); - trace.at(mem_a_addr).mem_skip_check_tag = 1; + 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"); } @@ -779,8 +779,8 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovASkipCheckAbuseDisableSelMovA) { build_cmov_trace_neg_test(true); - trace.at(mem_a_addr).mem_skip_check_tag = 1; - trace.at(mem_a_addr).mem_sel_mov_ia_to_ic = 0; + 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"); } @@ -789,8 +789,8 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovBSkipCheckAbuseDisableSelMovB) { build_cmov_trace_neg_test(false); - trace.at(mem_b_addr).mem_skip_check_tag = 1; - trace.at(mem_b_addr).mem_sel_mov_ib_to_ic = 0; + 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"); } From d3d090c3640638ffcd1ee0d60dbde4cd7808ec6c Mon Sep 17 00:00:00 2001 From: jeanmon Date: Fri, 5 Jul 2024 15:40:17 +0000 Subject: [PATCH 05/12] 7211: unit tests for calldata copy gadget --- .../vm/tests/avm_mem_opcodes.test.cpp | 2 - .../barretenberg/vm/tests/avm_slice.test.cpp | 336 ++++++++++++++++++ .../barretenberg/vm/tests/helpers.test.cpp | 9 +- .../barretenberg/vm/tests/helpers.test.hpp | 4 +- 4 files changed, 346 insertions(+), 5 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp index d826ab084ca..c7c8a21c794 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp @@ -7,8 +7,6 @@ #include #include -#define MEM_ROW_FIELD_EQ(field_name, expression) Field(#field_name, &Row::mem_##field_name, expression) - namespace tests_avm { using namespace bb; diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp new file mode 100644 index 00000000000..ed8c9a95d84 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp @@ -0,0 +1,336 @@ +#include "avm_common.test.hpp" +#include "barretenberg/vm/avm_trace/avm_common.hpp" +#include "barretenberg/vm/tests/helpers.test.hpp" +#include +#include + +#include + +#define SLICE_ROW_FIELD_EQ(field_name, expression) Field(#field_name, &Row::slice_##field_name, expression) + +namespace tests_avm { + +using namespace bb; +using namespace bb::avm_trace; +using namespace testing; + +class AvmSliceTests : public ::testing::Test { + public: + AvmSliceTests() + : public_inputs(generate_base_public_inputs()) + , trace_builder(AvmTraceBuilder(public_inputs)) + { + srs::init_crs_factory("../srs_db/ignition"); + } + + void gen_trace_builder(std::vector const& calldata) + { + trace_builder = AvmTraceBuilder(public_inputs, {}, 0, calldata); + this->calldata = calldata; + } + + void gen_single_calldata_copy( + bool indirect, uint32_t cd_size, uint32_t cd_offset, uint32_t copy_size, uint32_t dst_offset) + { + ASSERT_LE(cd_offset + copy_size, cd_size); + std::vector calldata; + for (size_t i = 0; i < cd_size; i++) { + calldata.emplace_back(i * i); + } + + gen_trace_builder(calldata); + trace_builder.op_calldata_copy(static_cast(indirect), cd_offset, copy_size, dst_offset); + trace_builder.op_return(0, 0, 0); + trace = trace_builder.finalize(); + } + + void validate_single_calldata_copy_trace(uint32_t cd_offset, + uint32_t copy_size, + uint32_t dst_offset, + bool proof_verif = false) + { + // Find the first row enabling the calldata_copy selector + auto row = std::ranges::find_if( + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_calldata_copy == FF(1); }); + + ASSERT_TRUE(row != trace.end()); + + // Memory trace view pertaining to the calldata_copy operation. + auto clk = row->main_clk; + auto mem_view = std::views::filter(trace, [clk](Row r) { + return r.mem_clk == clk && r.mem_rw == 1 && r.mem_sel_op_cd_cpy == 1 && + r.mem_tag == static_cast(AvmMemoryTag::FF); + }); + + // Check that the memory operations are as expected. + size_t count = 0; + for (auto const& mem_row : mem_view) { + EXPECT_THAT(mem_row, + AllOf(MEM_ROW_FIELD_EQ(val, (cd_offset + count) * (cd_offset + count)), + MEM_ROW_FIELD_EQ(addr, dst_offset + count), + MEM_ROW_FIELD_EQ(tag, static_cast(AvmMemoryTag::FF)), + MEM_ROW_FIELD_EQ(w_in_tag, static_cast(AvmMemoryTag::FF)), + MEM_ROW_FIELD_EQ(r_in_tag, static_cast(AvmMemoryTag::U0)), + MEM_ROW_FIELD_EQ(tag_err, 0))); + count++; + } + + EXPECT_EQ(count, copy_size); + + // Slice trace view pertaining to the calldata_copy operation. + auto slice_view = + std::views::filter(trace, [clk](Row r) { return r.slice_clk == clk && r.slice_sel_cd_cpy == 1; }); + + FF last_clk = 0; + + // Check that the slice trace is as expected. + count = 0; + for (auto const& slice_row : slice_view) { + EXPECT_THAT(slice_row, + AllOf(SLICE_ROW_FIELD_EQ(val, (cd_offset + count) * (cd_offset + count)), + SLICE_ROW_FIELD_EQ(addr, dst_offset + count), + SLICE_ROW_FIELD_EQ(cd_offset, cd_offset + count), + SLICE_ROW_FIELD_EQ(cnt, copy_size - count), + SLICE_ROW_FIELD_EQ(sel_start_cd_cpy, static_cast(count == 0)))); + count++; + + if (count == copy_size) { + last_clk = slice_row.main_clk; + } + } + + // Check that the extra final row is well-formed. + EXPECT_THAT(trace.at(static_cast(last_clk + 1)), + AllOf(SLICE_ROW_FIELD_EQ(addr, FF(dst_offset) + FF(copy_size)), + SLICE_ROW_FIELD_EQ(cd_offset, cd_offset + copy_size), + SLICE_ROW_FIELD_EQ(cnt, 0), + SLICE_ROW_FIELD_EQ(clk, 0), + SLICE_ROW_FIELD_EQ(sel_cd_cpy, 0), + SLICE_ROW_FIELD_EQ(sel_start_cd_cpy, 0))); + + if (proof_verif) { + validate_trace(std::move(trace), public_inputs, calldata, true); + } else { + validate_trace(std::move(trace), public_inputs, calldata); + } + } + + VmPublicInputs public_inputs; + AvmTraceBuilder trace_builder; + std::vector calldata; + + std::vector trace; + size_t main_row_idx; + size_t alu_row_idx; + size_t mem_row_idx; +}; + +TEST_F(AvmSliceTests, simpleCopyAllCDValues) +{ + gen_single_calldata_copy(false, 12, 0, 12, 25); + validate_single_calldata_copy_trace(0, 12, 25, true); +} + +TEST_F(AvmSliceTests, singleCopyCDElement) +{ + gen_single_calldata_copy(false, 12, 5, 1, 25); + validate_single_calldata_copy_trace(5, 1, 25); +} + +TEST_F(AvmSliceTests, longCopyAllCDValues) +{ + gen_single_calldata_copy(false, 2000, 0, 2000, 873); + validate_single_calldata_copy_trace(0, 2000, 873); +} + +TEST_F(AvmSliceTests, copyFirstHalfCDValues) +{ + gen_single_calldata_copy(false, 12, 0, 6, 98127); + validate_single_calldata_copy_trace(0, 6, 98127); +} + +TEST_F(AvmSliceTests, copySecondHalfCDValues) +{ + gen_single_calldata_copy(false, 12, 6, 6, 0); + validate_single_calldata_copy_trace(6, 6, 0); +} + +TEST_F(AvmSliceTests, copyToHighestMemOffset) +{ + gen_single_calldata_copy(false, 8, 2, 6, UINT32_MAX - 5); + validate_single_calldata_copy_trace(2, 6, UINT32_MAX - 5); +} + +TEST_F(AvmSliceTests, twoCallsNoOverlap) +{ + calldata = { 2, 3, 4, 5, 6 }; + + gen_trace_builder(calldata); + trace_builder.op_calldata_copy(0, 0, 2, 34); + trace_builder.op_calldata_copy(0, 3, 2, 2123); + trace_builder.op_return(0, 0, 0); + trace = trace_builder.finalize(); + + // Main trace views of rows enabling the calldata_copy selector + auto main_view = std::views::filter(trace, [](Row r) { return r.main_sel_op_calldata_copy == FF(1); }); + + std::vector main_rows; + for (auto const& row : main_view) { + main_rows.push_back(row); + } + + EXPECT_EQ(main_rows.size(), 2); + + EXPECT_THAT(main_rows.at(0), + AllOf(MAIN_ROW_FIELD_EQ(ia, 0), + MAIN_ROW_FIELD_EQ(ib, 2), + MAIN_ROW_FIELD_EQ(mem_addr_c, 34), + MAIN_ROW_FIELD_EQ(clk, 1))); + EXPECT_THAT(main_rows.at(1), + AllOf(MAIN_ROW_FIELD_EQ(ia, 3), + MAIN_ROW_FIELD_EQ(ib, 2), + MAIN_ROW_FIELD_EQ(mem_addr_c, 2123), + MAIN_ROW_FIELD_EQ(clk, 2))); + + validate_trace(std::move(trace), public_inputs, calldata); +} + +TEST_F(AvmSliceTests, indirectTwoCallsOverlap) +{ + calldata = { 2, 3, 4, 5, 6 }; + + gen_trace_builder(calldata); + trace_builder.op_set(0, 34, 100, AvmMemoryTag::U32); // indirect address 100 resolves to 34 + trace_builder.op_set(0, 2123, 101, AvmMemoryTag::U32); // indirect address 101 resolves to 2123 + trace_builder.op_calldata_copy(1, 1, 3, 100); + trace_builder.op_calldata_copy(1, 2, 3, 101); + trace_builder.op_return(0, 0, 0); + trace = trace_builder.finalize(); + + // Main trace views of rows enabling the calldata_copy selector + auto main_view = std::views::filter(trace, [](Row r) { return r.main_sel_op_calldata_copy == FF(1); }); + + std::vector main_rows; + for (auto const& row : main_view) { + main_rows.push_back(row); + } + + EXPECT_EQ(main_rows.size(), 2); + + EXPECT_THAT(main_rows.at(0), + AllOf(MAIN_ROW_FIELD_EQ(ia, 1), + MAIN_ROW_FIELD_EQ(ib, 3), + MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_c, 1), + MAIN_ROW_FIELD_EQ(ind_addr_c, 100), + MAIN_ROW_FIELD_EQ(mem_addr_c, 34), + MAIN_ROW_FIELD_EQ(clk, 3))); + EXPECT_THAT(main_rows.at(1), + AllOf(MAIN_ROW_FIELD_EQ(ia, 2), + MAIN_ROW_FIELD_EQ(ib, 3), + MAIN_ROW_FIELD_EQ(sel_resolve_ind_addr_c, 1), + MAIN_ROW_FIELD_EQ(ind_addr_c, 101), + MAIN_ROW_FIELD_EQ(mem_addr_c, 2123), + MAIN_ROW_FIELD_EQ(clk, 4))); + + validate_trace(std::move(trace), public_inputs, calldata); +} + +TEST_F(AvmSliceTests, indirectFailedResolution) +{ + calldata = { 2, 3, 4, 5, 6 }; + + gen_trace_builder(calldata); + trace_builder.op_set(0, 34, 100, AvmMemoryTag::U16); // indirect address 100 resolves to 34 + trace_builder.op_calldata_copy(1, 1, 3, 100); + trace_builder.halt(); + trace = trace_builder.finalize(); + + // Check that slice trace is empty + auto slice_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.slice_sel_cd_cpy == 1; }); + EXPECT_EQ(slice_row, trace.end()); + + auto count = std::ranges::count_if(trace.begin(), trace.end(), [](Row r) { return r.mem_sel_op_cd_cpy == 1; }); + // Check that MEM trace does not contain any entry related to calldata_copy write. + EXPECT_EQ(count, 0); + + // Find the first row enabling the calldata_copy selector + auto row = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_calldata_copy == FF(1); }); + + ASSERT_TRUE(row != trace.end()); + auto clk = row->main_clk; + auto mem_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.mem_clk == clk; }); + + EXPECT_EQ(mem_row->mem_rw, 0); + EXPECT_EQ(mem_row->mem_sel_resolve_ind_addr_c, 1); + + validate_trace(std::move(trace), public_inputs, calldata); +} + +class AvmSliceNegativeTests : public AvmSliceTests {}; + +TEST_F(AvmSliceNegativeTests, wrongCDValueInSlice) +{ + gen_single_calldata_copy(false, 10, 0, 10, 0); + + trace.at(3).slice_val = 98; + + // Adapt corresponding MEM trace entry in a consistent way. + auto clk = trace.at(3).slice_clk; + auto addr = trace.at(3).slice_addr; + auto mem_row = std::ranges::find_if( + trace.begin(), trace.end(), [clk, addr](Row r) { return r.mem_clk == clk && r.mem_addr == addr; }); + mem_row->mem_val = 98; + + EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_CD_VALUE"); +} + +TEST_F(AvmSliceNegativeTests, wrongCDValueInMemory) +{ + gen_single_calldata_copy(false, 10, 0, 10, 0); + + auto clk = trace.at(5).slice_clk; + auto addr = trace.at(5).slice_addr; + auto mem_row = std::ranges::find_if( + trace.begin(), trace.end(), [clk, addr](Row r) { return r.mem_clk == clk && r.mem_addr == addr; }); + mem_row->mem_val = 98; + + EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_CD_MEM"); +} + +TEST_F(AvmSliceNegativeTests, wrongCDValueInCalldataColumn) +{ + gen_single_calldata_copy(false, 10, 0, 10, 0); + + trace.at(2).main_calldata = 12; + EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_CD_VALUE"); +} + +TEST_F(AvmSliceNegativeTests, wrongCDValueInCalldataVerifier) +{ + calldata = { 2, 3, 4, 5, 6 }; + + gen_trace_builder(calldata); + trace_builder.op_calldata_copy(0, 1, 3, 100); + trace_builder.op_return(0, 0, 0); + trace = trace_builder.finalize(); + + validate_trace(std::move(trace), public_inputs, { 2, 3, 4, 5, 7 }, true, true); +} + +TEST_F(AvmSliceNegativeTests, disableMemWriteEntry) +{ + gen_single_calldata_copy(false, 10, 0, 10, 0); + + // Multiple adjustements to get valid MEM trace. + trace.at(10).mem_sel_op_cd_cpy = 0; + trace.at(10).mem_sel_mem = 0; + trace.at(9).mem_last = 1; + trace.at(10).mem_last = 0; + trace.at(10).mem_tsp = 12; + trace.at(9).mem_sel_rng_chk = 0; + + EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_CD_MEM"); +} + +} // namespace tests_avm diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp index d84f11226de..5ffab2c65e2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp @@ -37,7 +37,8 @@ void validate_trace_check_circuit(std::vector&& trace) void validate_trace(std::vector&& trace, VmPublicInputs const& public_inputs, std::vector const& calldata, - bool with_proof) + bool with_proof, + bool expect_proof_failure) { auto circuit_builder = AvmCircuitBuilder(); circuit_builder.set_trace(std::move(trace)); @@ -55,7 +56,11 @@ void validate_trace(std::vector&& trace, bool verified = verifier.verify_proof(proof, { public_inputs_as_vec }); - EXPECT_TRUE(verified); + if (expect_proof_failure) { + EXPECT_FALSE(verified); + } else { + EXPECT_TRUE(verified); + } } }; diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp index e2c80155ada..dc7982fe6ae 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp @@ -15,6 +15,7 @@ } #define MAIN_ROW_FIELD_EQ(field_name, expression) Field(#field_name, &Row::main_##field_name, expression) +#define MEM_ROW_FIELD_EQ(field_name, expression) Field(#field_name, &Row::mem_##field_name, expression) namespace tests_avm { @@ -31,7 +32,8 @@ void validate_trace_check_circuit(std::vector&& trace); void validate_trace(std::vector&& trace, VmPublicInputs const& public_inputs = {}, std::vector const& calldata = {}, - bool with_proof = bb::avm_trace::ENABLE_PROVING); + bool with_proof = bb::avm_trace::ENABLE_PROVING, + bool expect_proof_failure = false); void mutate_ic_in_trace(std::vector& trace, std::function&& selectRow, FF const& newValue, From 282c336e1ed77fd6bbd1d3f5c6a55303367efb0c Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:08:22 +0200 Subject: [PATCH 06/12] Update barretenberg/cpp/pil/avm/mem.pil --- barretenberg/cpp/pil/avm/mem.pil | 2 +- .../generated/avm/incl_main_tag_err.hpp | 95 ++++++++++++++++++- .../generated/avm/incl_mem_tag_err.hpp | 95 ++++++++++++++++++- .../generated/avm/kernel_output_lookup.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_byte_lengths.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_byte_operations.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_div_u16_0.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_div_u16_1.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_div_u16_2.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_div_u16_3.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_div_u16_4.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_div_u16_5.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_div_u16_6.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_div_u16_7.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_into_kernel.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_mem_rng_chk_hi.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_mem_rng_chk_lo.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_mem_rng_chk_mid.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_opcode_gas.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_pow_2_0.hpp | 95 ++++++++++++++++++- .../generated/avm/lookup_pow_2_1.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_0.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_1.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_10.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_11.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_12.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_13.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_14.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_2.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_3.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_4.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_5.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_6.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_7.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_8.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u16_9.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u8_0.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/lookup_u8_1.hpp | 95 ++++++++++++++++++- .../relations/generated/avm/perm_main_alu.hpp | 47 ++++++++- .../relations/generated/avm/perm_main_bin.hpp | 47 ++++++++- .../generated/avm/perm_main_conv.hpp | 47 ++++++++- .../generated/avm/perm_main_mem_a.hpp | 47 ++++++++- .../generated/avm/perm_main_mem_b.hpp | 47 ++++++++- .../generated/avm/perm_main_mem_c.hpp | 47 ++++++++- .../generated/avm/perm_main_mem_d.hpp | 47 ++++++++- .../avm/perm_main_mem_ind_addr_a.hpp | 47 ++++++++- .../avm/perm_main_mem_ind_addr_b.hpp | 47 ++++++++- .../avm/perm_main_mem_ind_addr_c.hpp | 47 ++++++++- .../avm/perm_main_mem_ind_addr_d.hpp | 47 ++++++++- .../generated/avm/perm_main_pedersen.hpp | 47 ++++++++- .../generated/avm/perm_main_pos2_perm.hpp | 47 ++++++++- .../generated/avm/range_check_da_gas_hi.hpp | 95 ++++++++++++++++++- .../generated/avm/range_check_da_gas_lo.hpp | 95 ++++++++++++++++++- .../generated/avm/range_check_l2_gas_hi.hpp | 95 ++++++++++++++++++- .../generated/avm/range_check_l2_gas_lo.hpp | 95 ++++++++++++++++++- 55 files changed, 4453 insertions(+), 55 deletions(-) diff --git a/barretenberg/cpp/pil/avm/mem.pil b/barretenberg/cpp/pil/avm/mem.pil index 2e7a80d45d6..400723d1529 100644 --- a/barretenberg/cpp/pil/avm/mem.pil +++ b/barretenberg/cpp/pil/avm/mem.pil @@ -220,7 +220,7 @@ namespace mem(256); //====== CALLDATACOPY specific constraints ================================== sel_op_cd_cpy * (rw - 1) = 0; - sel_op_cd_cpy * (w_in_tag - 6) = 0; + sel_op_cd_cpy * (w_in_tag - 6) = 0; // Only write elements of type FF //====== MOV/CMOV Opcode Tag Constraint ===================================== // The following constraint ensures that the r_in_tag is set to tag for diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp index 6cfb74059d9..d60e79da075 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class incl_main_tag_err_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_tag_err == 1 || in.main_tag_err == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class incl_main_tag_err_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.incl_main_tag_err, in.incl_main_tag_err_counts, in.mem_tag_err, @@ -42,8 +127,16 @@ class incl_main_tag_err_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.incl_main_tag_err, in.incl_main_tag_err_counts, in.mem_tag_err, @@ -60,4 +153,4 @@ class incl_main_tag_err_relation : public GenericLookupRelation using incl_main_tag_err = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp index a3c55ff966b..0da1e65ec86 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class incl_mem_tag_err_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_tag_err == 1 || in.mem_tag_err == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,14 +95,44 @@ class incl_mem_tag_err_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple( in.incl_mem_tag_err, in.incl_mem_tag_err_counts, in.main_tag_err, in.mem_tag_err, in.main_clk, in.mem_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple( in.incl_mem_tag_err, in.incl_mem_tag_err_counts, in.main_tag_err, in.mem_tag_err, in.main_clk, in.mem_clk); } @@ -52,4 +145,4 @@ class incl_mem_tag_err_relation : public GenericLookupRelation using incl_mem_tag_err = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp index d432d46bc2c..55cef760374 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class kernel_output_lookup_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 4; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_q_kernel_output_lookup == 1 || in.kernel_q_public_input_kernel_out_add_to_table == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class kernel_output_lookup_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.kernel_output_lookup, in.kernel_output_lookup_counts, in.main_sel_q_kernel_output_lookup, @@ -48,8 +133,16 @@ class kernel_output_lookup_lookup_settings { in.kernel_kernel_metadata_out); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.kernel_output_lookup, in.kernel_output_lookup_counts, in.main_sel_q_kernel_output_lookup, @@ -72,4 +165,4 @@ class kernel_output_lookup_relation : public GenericLookupRelation using kernel_output_lookup = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp index 093c0f5b6ea..621cb507880 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_byte_lengths_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.binary_start == 1 || in.byte_lookup_sel_bin == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_byte_lengths_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_byte_lengths, in.lookup_byte_lengths_counts, in.binary_start, @@ -44,8 +129,16 @@ class lookup_byte_lengths_lookup_settings { in.byte_lookup_table_byte_lengths); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_byte_lengths, in.lookup_byte_lengths_counts, in.binary_start, @@ -64,4 +157,4 @@ class lookup_byte_lengths_relation : public GenericLookupRelation using lookup_byte_lengths = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp index 0961460086e..07a3c654382 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_byte_operations_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 4; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.binary_sel_bin == 1 || in.byte_lookup_sel_bin == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_byte_operations_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_byte_operations, in.lookup_byte_operations_counts, in.binary_sel_bin, @@ -48,8 +133,16 @@ class lookup_byte_operations_lookup_settings { in.byte_lookup_table_output); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_byte_operations, in.lookup_byte_operations_counts, in.binary_sel_bin, @@ -72,4 +165,4 @@ class lookup_byte_operations_relation : public GenericLookupRelation using lookup_byte_operations = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp index 99c91af7b93..4a7d1c776dc 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_div_u16_0_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_div_u16_0_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_0, in.lookup_div_u16_0_counts, in.alu_sel_div_rng_chk, @@ -42,8 +127,16 @@ class lookup_div_u16_0_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_0, in.lookup_div_u16_0_counts, in.alu_sel_div_rng_chk, @@ -60,4 +153,4 @@ class lookup_div_u16_0_relation : public GenericLookupRelation using lookup_div_u16_0 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp index d95c608d0b9..b2f89970b6f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_div_u16_1_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_div_u16_1_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_1, in.lookup_div_u16_1_counts, in.alu_sel_div_rng_chk, @@ -42,8 +127,16 @@ class lookup_div_u16_1_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_1, in.lookup_div_u16_1_counts, in.alu_sel_div_rng_chk, @@ -60,4 +153,4 @@ class lookup_div_u16_1_relation : public GenericLookupRelation using lookup_div_u16_1 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp index b1b9036f498..481aed81e53 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_div_u16_2_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_div_u16_2_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_2, in.lookup_div_u16_2_counts, in.alu_sel_div_rng_chk, @@ -42,8 +127,16 @@ class lookup_div_u16_2_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_2, in.lookup_div_u16_2_counts, in.alu_sel_div_rng_chk, @@ -60,4 +153,4 @@ class lookup_div_u16_2_relation : public GenericLookupRelation using lookup_div_u16_2 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp index 56680df40c0..0a99f0825e9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_div_u16_3_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_div_u16_3_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_3, in.lookup_div_u16_3_counts, in.alu_sel_div_rng_chk, @@ -42,8 +127,16 @@ class lookup_div_u16_3_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_3, in.lookup_div_u16_3_counts, in.alu_sel_div_rng_chk, @@ -60,4 +153,4 @@ class lookup_div_u16_3_relation : public GenericLookupRelation using lookup_div_u16_3 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp index 5c02f3c52ca..3446acb2b09 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_div_u16_4_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_div_u16_4_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_4, in.lookup_div_u16_4_counts, in.alu_sel_div_rng_chk, @@ -42,8 +127,16 @@ class lookup_div_u16_4_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_4, in.lookup_div_u16_4_counts, in.alu_sel_div_rng_chk, @@ -60,4 +153,4 @@ class lookup_div_u16_4_relation : public GenericLookupRelation using lookup_div_u16_4 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp index b8923c750e5..46879db512a 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_div_u16_5_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_div_u16_5_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_5, in.lookup_div_u16_5_counts, in.alu_sel_div_rng_chk, @@ -42,8 +127,16 @@ class lookup_div_u16_5_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_5, in.lookup_div_u16_5_counts, in.alu_sel_div_rng_chk, @@ -60,4 +153,4 @@ class lookup_div_u16_5_relation : public GenericLookupRelation using lookup_div_u16_5 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp index a6486bb05ac..2c3ffdc0332 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_div_u16_6_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_div_u16_6_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_6, in.lookup_div_u16_6_counts, in.alu_sel_div_rng_chk, @@ -42,8 +127,16 @@ class lookup_div_u16_6_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_6, in.lookup_div_u16_6_counts, in.alu_sel_div_rng_chk, @@ -60,4 +153,4 @@ class lookup_div_u16_6_relation : public GenericLookupRelation using lookup_div_u16_6 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp index c52978bade9..69c385419b6 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_div_u16_7_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_div_u16_7_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_7, in.lookup_div_u16_7_counts, in.alu_sel_div_rng_chk, @@ -42,8 +127,16 @@ class lookup_div_u16_7_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_div_u16_7, in.lookup_div_u16_7_counts, in.alu_sel_div_rng_chk, @@ -60,4 +153,4 @@ class lookup_div_u16_7_relation : public GenericLookupRelation using lookup_div_u16_7 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp index 4fe44d760c5..5fe7e715a8f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_into_kernel_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_q_kernel_lookup == 1 || in.kernel_q_public_input_kernel_add_to_table == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_into_kernel_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_into_kernel, in.lookup_into_kernel_counts, in.main_sel_q_kernel_lookup, @@ -44,8 +129,16 @@ class lookup_into_kernel_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_into_kernel, in.lookup_into_kernel_counts, in.main_sel_q_kernel_lookup, @@ -64,4 +157,4 @@ class lookup_into_kernel_relation : public GenericLookupRelation using lookup_into_kernel = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp index b0db8e3f3a8..180dcb9393f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_mem_rng_chk_hi_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_8 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_mem_rng_chk_hi_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_mem_rng_chk_hi, in.lookup_mem_rng_chk_hi_counts, in.mem_sel_rng_chk, @@ -42,8 +127,16 @@ class lookup_mem_rng_chk_hi_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_mem_rng_chk_hi, in.lookup_mem_rng_chk_hi_counts, in.mem_sel_rng_chk, @@ -60,4 +153,4 @@ class lookup_mem_rng_chk_hi_relation : public GenericLookupRelation using lookup_mem_rng_chk_hi = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp index 7a0dca83ce3..57442b2054b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_mem_rng_chk_lo_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_mem_rng_chk_lo_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_mem_rng_chk_lo, in.lookup_mem_rng_chk_lo_counts, in.mem_sel_rng_chk, @@ -42,8 +127,16 @@ class lookup_mem_rng_chk_lo_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_mem_rng_chk_lo, in.lookup_mem_rng_chk_lo_counts, in.mem_sel_rng_chk, @@ -60,4 +153,4 @@ class lookup_mem_rng_chk_lo_relation : public GenericLookupRelation using lookup_mem_rng_chk_lo = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp index e44547863c6..88f855f41d7 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_mem_rng_chk_mid_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_mem_rng_chk_mid_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_mem_rng_chk_mid, in.lookup_mem_rng_chk_mid_counts, in.mem_sel_rng_chk, @@ -42,8 +127,16 @@ class lookup_mem_rng_chk_mid_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_mem_rng_chk_mid, in.lookup_mem_rng_chk_mid_counts, in.mem_sel_rng_chk, @@ -60,4 +153,4 @@ class lookup_mem_rng_chk_mid_relation : public GenericLookupRelation using lookup_mem_rng_chk_mid = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp index a62f68e5b4f..2446a37a4b8 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_opcode_gas_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 3; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.gas_sel_gas_cost == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_opcode_gas_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_opcode_gas, in.lookup_opcode_gas_counts, in.main_sel_gas_accounting_active, @@ -46,8 +131,16 @@ class lookup_opcode_gas_lookup_settings { in.gas_da_gas_fixed_table); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_opcode_gas, in.lookup_opcode_gas_counts, in.main_sel_gas_accounting_active, @@ -68,4 +161,4 @@ class lookup_opcode_gas_relation : public GenericLookupRelation using lookup_opcode_gas = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp index e9e73ca0b9d..ebbc612aae6 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_pow_2_0_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_shift_which == 1 || in.main_sel_rng_8 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_pow_2_0_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_pow_2_0, in.lookup_pow_2_0_counts, in.alu_sel_shift_which, @@ -44,8 +129,16 @@ class lookup_pow_2_0_lookup_settings { in.powers_power_of_2); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_pow_2_0, in.lookup_pow_2_0_counts, in.alu_sel_shift_which, @@ -64,4 +157,4 @@ class lookup_pow_2_0_relation : public GenericLookupRelation using lookup_pow_2_0 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp index 55a5eec29b7..a4fbebf983b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_pow_2_1_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_shift_which == 1 || in.main_sel_rng_8 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_pow_2_1_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_pow_2_1, in.lookup_pow_2_1_counts, in.alu_sel_shift_which, @@ -44,8 +129,16 @@ class lookup_pow_2_1_lookup_settings { in.powers_power_of_2); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_pow_2_1, in.lookup_pow_2_1_counts, in.alu_sel_shift_which, @@ -64,4 +157,4 @@ class lookup_pow_2_1_relation : public GenericLookupRelation using lookup_pow_2_1 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp index 70a2e3ac66e..350ff6c0f46 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_0_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_0_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_0, in.lookup_u16_0_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_0_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_0, in.lookup_u16_0_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_0_relation : public GenericLookupRelati }; template using lookup_u16_0 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp index e391e04bc72..8bcb5e54bcb 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_1_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_1_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_1, in.lookup_u16_1_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_1_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_1, in.lookup_u16_1_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_1_relation : public GenericLookupRelati }; template using lookup_u16_1 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp index 1b30139552c..1821105464e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_10_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_10_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_10, in.lookup_u16_10_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_10_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_10, in.lookup_u16_10_counts, in.alu_sel_rng_chk_lookup, @@ -60,4 +153,4 @@ class lookup_u16_10_relation : public GenericLookupRelation using lookup_u16_10 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp index 860588384db..53a93aa31ab 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_11_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_11_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_11, in.lookup_u16_11_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_11_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_11, in.lookup_u16_11_counts, in.alu_sel_rng_chk_lookup, @@ -60,4 +153,4 @@ class lookup_u16_11_relation : public GenericLookupRelation using lookup_u16_11 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp index 0acfe46bc14..0ecd9cc8727 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_12_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_12_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_12, in.lookup_u16_12_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_12_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_12, in.lookup_u16_12_counts, in.alu_sel_rng_chk_lookup, @@ -60,4 +153,4 @@ class lookup_u16_12_relation : public GenericLookupRelation using lookup_u16_12 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp index 87eaa2d6bb1..75dcb50aeb1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_13_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_13_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_13, in.lookup_u16_13_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_13_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_13, in.lookup_u16_13_counts, in.alu_sel_rng_chk_lookup, @@ -60,4 +153,4 @@ class lookup_u16_13_relation : public GenericLookupRelation using lookup_u16_13 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp index ea9a74cc8d1..c9ad7b55f20 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_14_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_14_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_14, in.lookup_u16_14_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_14_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_14, in.lookup_u16_14_counts, in.alu_sel_rng_chk_lookup, @@ -60,4 +153,4 @@ class lookup_u16_14_relation : public GenericLookupRelation using lookup_u16_14 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp index 35a34762d1b..5cbd19c80f4 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_2_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_2_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_2, in.lookup_u16_2_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_2_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_2, in.lookup_u16_2_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_2_relation : public GenericLookupRelati }; template using lookup_u16_2 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp index 50284c84860..38d640e8cd9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_3_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_3_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_3, in.lookup_u16_3_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_3_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_3, in.lookup_u16_3_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_3_relation : public GenericLookupRelati }; template using lookup_u16_3 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp index b5cd10a6670..aa3c28499f0 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_4_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_4_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_4, in.lookup_u16_4_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_4_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_4, in.lookup_u16_4_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_4_relation : public GenericLookupRelati }; template using lookup_u16_4 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp index 1f313268b6e..d0b8ddcdd66 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_5_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_5_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_5, in.lookup_u16_5_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_5_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_5, in.lookup_u16_5_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_5_relation : public GenericLookupRelati }; template using lookup_u16_5 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp index c4aef86a50c..b3f127af6b9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_6_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_6_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_6, in.lookup_u16_6_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_6_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_6, in.lookup_u16_6_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_6_relation : public GenericLookupRelati }; template using lookup_u16_6 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp index b1496c4403a..af8817b80f8 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_7_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_7_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_7, in.lookup_u16_7_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_7_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_7, in.lookup_u16_7_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_7_relation : public GenericLookupRelati }; template using lookup_u16_7 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp index e2080cc7190..c9d9748e086 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_8_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_8_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_8, in.lookup_u16_8_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_8_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_8, in.lookup_u16_8_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_8_relation : public GenericLookupRelati }; template using lookup_u16_8 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp index 40b258e5942..28326b2bd4f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u16_9_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u16_9_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_9, in.lookup_u16_9_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u16_9_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u16_9, in.lookup_u16_9_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u16_9_relation : public GenericLookupRelati }; template using lookup_u16_9 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp index 568ecd3731d..45da35a4e83 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u8_0_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_8 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u8_0_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u8_0, in.lookup_u8_0_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u8_0_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u8_0, in.lookup_u8_0_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u8_0_relation : public GenericLookupRelatio }; template using lookup_u8_0 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp index 3b78d561e68..550fca44bbf 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class lookup_u8_1_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_8 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class lookup_u8_1_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.lookup_u8_1, in.lookup_u8_1_counts, in.alu_sel_rng_chk_lookup, @@ -42,8 +127,16 @@ class lookup_u8_1_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.lookup_u8_1, in.lookup_u8_1_counts, in.alu_sel_rng_chk_lookup, @@ -59,4 +152,4 @@ template class lookup_u8_1_relation : public GenericLookupRelatio }; template using lookup_u8_1 = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp index c96e000c2da..244da70cc8a 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_alu_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 16; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_alu == 1 || in.alu_sel_alu == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_alu, in.main_sel_alu, in.main_sel_alu, @@ -57,8 +84,26 @@ class perm_main_alu_permutation_settings { in.alu_in_tag); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_alu, in.main_sel_alu, in.main_sel_alu, @@ -105,4 +150,4 @@ class perm_main_alu_relation : public GenericPermutationRelation using perm_main_alu = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp index 42c820a4b84..d07397b7a7d 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_bin_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 6; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_bin == 1 || in.binary_start == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_bin, in.main_sel_bin, in.main_sel_bin, @@ -37,8 +64,26 @@ class perm_main_bin_permutation_settings { in.binary_in_tag); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_bin, in.main_sel_bin, in.main_sel_bin, @@ -65,4 +110,4 @@ class perm_main_bin_relation : public GenericPermutationRelation using perm_main_bin = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp index 20b6d13e322..d25e5de9f5e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_conv_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_op_radix_le == 1 || in.conversion_sel_to_radix_le == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_conv, in.main_sel_op_radix_le, in.main_sel_op_radix_le, @@ -33,8 +60,26 @@ class perm_main_conv_permutation_settings { in.conversion_num_limbs); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_conv, in.main_sel_op_radix_le, in.main_sel_op_radix_le, @@ -57,4 +102,4 @@ class perm_main_conv_relation : public GenericPermutationRelation using perm_main_conv = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp index 2efb6d21b31..3a92e5b02b7 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_mem_a_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 9; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_mem_op_a == 1 || in.mem_sel_op_a == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_a, in.main_sel_mem_op_a, in.main_sel_mem_op_a, @@ -43,8 +70,26 @@ class perm_main_mem_a_permutation_settings { in.mem_sel_op_cmov); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_a, in.main_sel_mem_op_a, in.main_sel_mem_op_a, @@ -77,4 +122,4 @@ class perm_main_mem_a_relation : public GenericPermutationRelation using perm_main_mem_a = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp index 0f7a88a66f1..1641f8afb9e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_mem_b_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 9; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_mem_op_b == 1 || in.mem_sel_op_b == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_b, in.main_sel_mem_op_b, in.main_sel_mem_op_b, @@ -43,8 +70,26 @@ class perm_main_mem_b_permutation_settings { in.mem_sel_op_cmov); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_b, in.main_sel_mem_op_b, in.main_sel_mem_op_b, @@ -77,4 +122,4 @@ class perm_main_mem_b_relation : public GenericPermutationRelation using perm_main_mem_b = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp index f1888c7ce18..f490ba21a61 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_mem_c_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 7; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_mem_op_c == 1 || in.mem_sel_op_c == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_c, in.main_sel_mem_op_c, in.main_sel_mem_op_c, @@ -39,8 +66,26 @@ class perm_main_mem_c_permutation_settings { in.mem_w_in_tag); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_c, in.main_sel_mem_op_c, in.main_sel_mem_op_c, @@ -69,4 +114,4 @@ class perm_main_mem_c_relation : public GenericPermutationRelation using perm_main_mem_c = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp index 2cb433eed79..ebfba06722f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_mem_d_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 8; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_mem_op_d == 1 || in.mem_sel_op_d == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_d, in.main_sel_mem_op_d, in.main_sel_mem_op_d, @@ -41,8 +68,26 @@ class perm_main_mem_d_permutation_settings { in.mem_sel_op_cmov); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_d, in.main_sel_mem_op_d, in.main_sel_mem_op_d, @@ -73,4 +118,4 @@ class perm_main_mem_d_relation : public GenericPermutationRelation using perm_main_mem_d = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_a.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_a.hpp index 5d6267e60a9..15bc219942b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_a.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_a.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_mem_ind_addr_a_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_resolve_ind_addr_a == 1 || in.mem_sel_resolve_ind_addr_a == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_ind_addr_a, in.main_sel_resolve_ind_addr_a, in.main_sel_resolve_ind_addr_a, @@ -33,8 +60,26 @@ class perm_main_mem_ind_addr_a_permutation_settings { in.mem_val); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_ind_addr_a, in.main_sel_resolve_ind_addr_a, in.main_sel_resolve_ind_addr_a, @@ -59,4 +104,4 @@ class perm_main_mem_ind_addr_a_relation template using perm_main_mem_ind_addr_a = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_b.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_b.hpp index 708696d3343..be6f4ad2a53 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_b.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_b.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_mem_ind_addr_b_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_resolve_ind_addr_b == 1 || in.mem_sel_resolve_ind_addr_b == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_ind_addr_b, in.main_sel_resolve_ind_addr_b, in.main_sel_resolve_ind_addr_b, @@ -33,8 +60,26 @@ class perm_main_mem_ind_addr_b_permutation_settings { in.mem_val); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_ind_addr_b, in.main_sel_resolve_ind_addr_b, in.main_sel_resolve_ind_addr_b, @@ -59,4 +104,4 @@ class perm_main_mem_ind_addr_b_relation template using perm_main_mem_ind_addr_b = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_c.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_c.hpp index 011cee0cdba..fef2108e379 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_c.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_c.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_mem_ind_addr_c_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_resolve_ind_addr_c == 1 || in.mem_sel_resolve_ind_addr_c == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_ind_addr_c, in.main_sel_resolve_ind_addr_c, in.main_sel_resolve_ind_addr_c, @@ -33,8 +60,26 @@ class perm_main_mem_ind_addr_c_permutation_settings { in.mem_val); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_ind_addr_c, in.main_sel_resolve_ind_addr_c, in.main_sel_resolve_ind_addr_c, @@ -59,4 +104,4 @@ class perm_main_mem_ind_addr_c_relation template using perm_main_mem_ind_addr_c = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp index 0db50634041..a87a3e64cd6 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_mem_ind_addr_d_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_resolve_ind_addr_d == 1 || in.mem_sel_resolve_ind_addr_d == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_ind_addr_d, in.main_sel_resolve_ind_addr_d, in.main_sel_resolve_ind_addr_d, @@ -33,8 +60,26 @@ class perm_main_mem_ind_addr_d_permutation_settings { in.mem_val); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_mem_ind_addr_d, in.main_sel_resolve_ind_addr_d, in.main_sel_resolve_ind_addr_d, @@ -59,4 +104,4 @@ class perm_main_mem_ind_addr_d_relation template using perm_main_mem_ind_addr_d = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp index 16e141e8481..90cf5793872 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_pedersen_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 2; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_op_pedersen == 1 || in.pedersen_sel_pedersen == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_pedersen, in.main_sel_op_pedersen, in.main_sel_op_pedersen, @@ -29,8 +56,26 @@ class perm_main_pedersen_permutation_settings { in.pedersen_input); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_pedersen, in.main_sel_op_pedersen, in.main_sel_op_pedersen, @@ -49,4 +94,4 @@ class perm_main_pedersen_relation : public GenericPermutationRelation using perm_main_pedersen = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp index e79de4c0020..50c553b6a09 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -12,13 +14,38 @@ class perm_main_pos2_perm_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 3; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_op_poseidon2 == 1 || in.poseidon2_sel_poseidon_perm == 1); } + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.perm_main_pos2_perm, in.main_sel_op_poseidon2, in.main_sel_op_poseidon2, @@ -31,8 +58,26 @@ class perm_main_pos2_perm_permutation_settings { in.poseidon2_output); } + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.perm_main_pos2_perm, in.main_sel_op_poseidon2, in.main_sel_op_poseidon2, @@ -53,4 +98,4 @@ class perm_main_pos2_perm_relation : public GenericPermutationRelation using perm_main_pos2_perm = GenericPermutation; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp index 47629f26071..eed623674b3 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class range_check_da_gas_hi_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class range_check_da_gas_hi_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.range_check_da_gas_hi, in.range_check_da_gas_hi_counts, in.main_sel_gas_accounting_active, @@ -42,8 +127,16 @@ class range_check_da_gas_hi_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.range_check_da_gas_hi, in.range_check_da_gas_hi_counts, in.main_sel_gas_accounting_active, @@ -60,4 +153,4 @@ class range_check_da_gas_hi_relation : public GenericLookupRelation using range_check_da_gas_hi = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp index f006e63ecb4..ba5e9708062 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class range_check_da_gas_lo_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class range_check_da_gas_lo_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.range_check_da_gas_lo, in.range_check_da_gas_lo_counts, in.main_sel_gas_accounting_active, @@ -42,8 +127,16 @@ class range_check_da_gas_lo_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.range_check_da_gas_lo, in.range_check_da_gas_lo_counts, in.main_sel_gas_accounting_active, @@ -60,4 +153,4 @@ class range_check_da_gas_lo_relation : public GenericLookupRelation using range_check_da_gas_lo = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp index b0009a37bee..ea696204975 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class range_check_l2_gas_hi_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class range_check_l2_gas_hi_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.range_check_l2_gas_hi, in.range_check_l2_gas_hi_counts, in.main_sel_gas_accounting_active, @@ -42,8 +127,16 @@ class range_check_l2_gas_hi_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.range_check_l2_gas_hi, in.range_check_l2_gas_hi_counts, in.main_sel_gas_accounting_active, @@ -60,4 +153,4 @@ class range_check_l2_gas_hi_relation : public GenericLookupRelation using range_check_l2_gas_hi = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp index e55a6539853..16dc2c0435d 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,20 +11,81 @@ namespace bb { class range_check_l2_gas_lo_lookup_settings { public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + static constexpr size_t WRITE_TERM_DEGREE = 0; + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.main_sel_rng_16 == 1); } + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -32,8 +95,30 @@ class range_check_l2_gas_lo_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + template static inline auto get_const_entities(const AllEntities& in) { + return std::forward_as_tuple(in.range_check_l2_gas_lo, in.range_check_l2_gas_lo_counts, in.main_sel_gas_accounting_active, @@ -42,8 +127,16 @@ class range_check_l2_gas_lo_lookup_settings { in.main_clk); } + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + template static inline auto get_nonconst_entities(AllEntities& in) { + return std::forward_as_tuple(in.range_check_l2_gas_lo, in.range_check_l2_gas_lo_counts, in.main_sel_gas_accounting_active, @@ -60,4 +153,4 @@ class range_check_l2_gas_lo_relation : public GenericLookupRelation using range_check_l2_gas_lo = GenericLookup; -} // namespace bb \ No newline at end of file +} // namespace bb From f75247ce00ed6b1616fb4e62262ccf07e8ac704e Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 10 Jul 2024 11:01:12 +0000 Subject: [PATCH 07/12] 7211 - rebase on master fixes --- .../generated/avm/incl_main_tag_err.hpp | 95 +- .../generated/avm/incl_mem_tag_err.hpp | 95 +- .../generated/avm/kernel_output_lookup.hpp | 95 +- .../generated/avm/lookup_byte_lengths.hpp | 95 +- .../generated/avm/lookup_byte_operations.hpp | 95 +- .../generated/avm/lookup_cd_value.hpp | 115 +- .../generated/avm/lookup_div_u16_0.hpp | 95 +- .../generated/avm/lookup_div_u16_1.hpp | 95 +- .../generated/avm/lookup_div_u16_2.hpp | 95 +- .../generated/avm/lookup_div_u16_3.hpp | 95 +- .../generated/avm/lookup_div_u16_4.hpp | 95 +- .../generated/avm/lookup_div_u16_5.hpp | 95 +- .../generated/avm/lookup_div_u16_6.hpp | 95 +- .../generated/avm/lookup_div_u16_7.hpp | 95 +- .../generated/avm/lookup_into_kernel.hpp | 95 +- .../generated/avm/lookup_mem_rng_chk_hi.hpp | 95 +- .../generated/avm/lookup_mem_rng_chk_lo.hpp | 95 +- .../generated/avm/lookup_mem_rng_chk_mid.hpp | 95 +- .../generated/avm/lookup_opcode_gas.hpp | 95 +- .../generated/avm/lookup_pow_2_0.hpp | 95 +- .../generated/avm/lookup_pow_2_1.hpp | 95 +- .../relations/generated/avm/lookup_u16_0.hpp | 95 +- .../relations/generated/avm/lookup_u16_1.hpp | 95 +- .../relations/generated/avm/lookup_u16_10.hpp | 95 +- .../relations/generated/avm/lookup_u16_11.hpp | 95 +- .../relations/generated/avm/lookup_u16_12.hpp | 95 +- .../relations/generated/avm/lookup_u16_13.hpp | 95 +- .../relations/generated/avm/lookup_u16_14.hpp | 95 +- .../relations/generated/avm/lookup_u16_2.hpp | 95 +- .../relations/generated/avm/lookup_u16_3.hpp | 95 +- .../relations/generated/avm/lookup_u16_4.hpp | 95 +- .../relations/generated/avm/lookup_u16_5.hpp | 95 +- .../relations/generated/avm/lookup_u16_6.hpp | 95 +- .../relations/generated/avm/lookup_u16_7.hpp | 95 +- .../relations/generated/avm/lookup_u16_8.hpp | 95 +- .../relations/generated/avm/lookup_u16_9.hpp | 95 +- .../relations/generated/avm/lookup_u8_0.hpp | 95 +- .../relations/generated/avm/lookup_u8_1.hpp | 95 +- .../relations/generated/avm/main.hpp | 18 +- .../relations/generated/avm/perm_cd_mem.hpp | 53 +- .../relations/generated/avm/perm_main_alu.hpp | 47 +- .../relations/generated/avm/perm_main_bin.hpp | 47 +- .../generated/avm/perm_main_cd_copy.hpp | 52 +- .../generated/avm/perm_main_conv.hpp | 47 +- .../generated/avm/perm_main_mem_a.hpp | 47 +- .../generated/avm/perm_main_mem_b.hpp | 47 +- .../generated/avm/perm_main_mem_c.hpp | 47 +- .../generated/avm/perm_main_mem_d.hpp | 47 +- .../avm/perm_main_mem_ind_addr_a.hpp | 47 +- .../avm/perm_main_mem_ind_addr_b.hpp | 47 +- .../avm/perm_main_mem_ind_addr_c.hpp | 47 +- .../avm/perm_main_mem_ind_addr_d.hpp | 47 +- .../generated/avm/perm_main_pedersen.hpp | 47 +- .../generated/avm/perm_main_pos2_perm.hpp | 47 +- .../generated/avm/range_check_da_gas_hi.hpp | 95 +- .../generated/avm/range_check_da_gas_lo.hpp | 95 +- .../generated/avm/range_check_l2_gas_hi.hpp | 95 +- .../generated/avm/range_check_l2_gas_lo.hpp | 95 +- .../barretenberg/vm/avm_trace/avm_helper.cpp | 1 - .../barretenberg/vm/avm_trace/avm_trace.hpp | 4 - .../vm/generated/avm_circuit_builder.cpp | 839 ++++++++++ .../vm/generated/avm_circuit_builder.hpp | 414 ----- .../barretenberg/vm/generated/avm_flavor.hpp | 1409 ----------------- .../vm/generated/avm_full_row.hpp | 17 + .../barretenberg/vm/generated/avm_prover.cpp | 123 -- 65 files changed, 936 insertions(+), 6615 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp index d60e79da075..6cfb74059d9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class incl_main_tag_err_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_tag_err == 1 || in.main_tag_err == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class incl_main_tag_err_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.incl_main_tag_err, in.incl_main_tag_err_counts, in.mem_tag_err, @@ -127,16 +42,8 @@ class incl_main_tag_err_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.incl_main_tag_err, in.incl_main_tag_err_counts, in.mem_tag_err, @@ -153,4 +60,4 @@ class incl_main_tag_err_relation : public GenericLookupRelation using incl_main_tag_err = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp index 0da1e65ec86..a3c55ff966b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class incl_mem_tag_err_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_tag_err == 1 || in.mem_tag_err == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,44 +32,14 @@ class incl_mem_tag_err_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple( in.incl_mem_tag_err, in.incl_mem_tag_err_counts, in.main_tag_err, in.mem_tag_err, in.main_clk, in.mem_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple( in.incl_mem_tag_err, in.incl_mem_tag_err_counts, in.main_tag_err, in.mem_tag_err, in.main_clk, in.mem_clk); } @@ -145,4 +52,4 @@ class incl_mem_tag_err_relation : public GenericLookupRelation using incl_mem_tag_err = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp index 55cef760374..d432d46bc2c 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class kernel_output_lookup_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 4; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_q_kernel_output_lookup == 1 || in.kernel_q_public_input_kernel_out_add_to_table == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class kernel_output_lookup_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.kernel_output_lookup, in.kernel_output_lookup_counts, in.main_sel_q_kernel_output_lookup, @@ -133,16 +48,8 @@ class kernel_output_lookup_lookup_settings { in.kernel_kernel_metadata_out); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.kernel_output_lookup, in.kernel_output_lookup_counts, in.main_sel_q_kernel_output_lookup, @@ -165,4 +72,4 @@ class kernel_output_lookup_relation : public GenericLookupRelation using kernel_output_lookup = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp index 621cb507880..093c0f5b6ea 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_byte_lengths_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.binary_start == 1 || in.byte_lookup_sel_bin == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_byte_lengths_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_byte_lengths, in.lookup_byte_lengths_counts, in.binary_start, @@ -129,16 +44,8 @@ class lookup_byte_lengths_lookup_settings { in.byte_lookup_table_byte_lengths); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_byte_lengths, in.lookup_byte_lengths_counts, in.binary_start, @@ -157,4 +64,4 @@ class lookup_byte_lengths_relation : public GenericLookupRelation using lookup_byte_lengths = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp index 07a3c654382..0961460086e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_byte_operations_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 4; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.binary_sel_bin == 1 || in.byte_lookup_sel_bin == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_byte_operations_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_byte_operations, in.lookup_byte_operations_counts, in.binary_sel_bin, @@ -133,16 +48,8 @@ class lookup_byte_operations_lookup_settings { in.byte_lookup_table_output); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_byte_operations, in.lookup_byte_operations_counts, in.binary_sel_bin, @@ -165,4 +72,4 @@ class lookup_byte_operations_relation : public GenericLookupRelation using lookup_byte_operations = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp index 52f1f0054f9..a7fb1382dcc 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,97 +7,22 @@ namespace bb { -/** - * @brief This class contains an example of how to set LookupSettings classes used by the - * GenericLookupRelationImpl class to specify a scaled lookup - * - * @details To create your own lookup: - * 1) Create a copy of this class and rename it - * 2) Update all the values with the ones needed for your lookup - * 3) Update "DECLARE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS" and "DEFINE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS" to - * include the new settings - * 4) Add the relation with the chosen settings to Relations in the flavor (for example,"` - * using Relations = std::tuple>;)` - * - */ class lookup_cd_value_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.slice_sel_cd_cpy == 1 || in.main_sel_calldata == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -109,30 +32,8 @@ class lookup_cd_value_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_cd_value, in.lookup_cd_value_counts, in.slice_sel_cd_cpy, @@ -143,16 +44,8 @@ class lookup_cd_value_lookup_settings { in.main_calldata); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_cd_value, in.lookup_cd_value_counts, in.slice_sel_cd_cpy, @@ -164,7 +57,11 @@ class lookup_cd_value_lookup_settings { } }; -template using lookup_cd_value_relation = GenericLookupRelation; +template +class lookup_cd_value_relation : public GenericLookupRelation { + public: + static constexpr const char* NAME = "lookup_cd_value"; +}; template using lookup_cd_value = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp index 4a7d1c776dc..99c91af7b93 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_div_u16_0_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_div_u16_0_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_0, in.lookup_div_u16_0_counts, in.alu_sel_div_rng_chk, @@ -127,16 +42,8 @@ class lookup_div_u16_0_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_0, in.lookup_div_u16_0_counts, in.alu_sel_div_rng_chk, @@ -153,4 +60,4 @@ class lookup_div_u16_0_relation : public GenericLookupRelation using lookup_div_u16_0 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp index b2f89970b6f..d95c608d0b9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_div_u16_1_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_div_u16_1_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_1, in.lookup_div_u16_1_counts, in.alu_sel_div_rng_chk, @@ -127,16 +42,8 @@ class lookup_div_u16_1_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_1, in.lookup_div_u16_1_counts, in.alu_sel_div_rng_chk, @@ -153,4 +60,4 @@ class lookup_div_u16_1_relation : public GenericLookupRelation using lookup_div_u16_1 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp index 481aed81e53..b1b9036f498 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_div_u16_2_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_div_u16_2_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_2, in.lookup_div_u16_2_counts, in.alu_sel_div_rng_chk, @@ -127,16 +42,8 @@ class lookup_div_u16_2_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_2, in.lookup_div_u16_2_counts, in.alu_sel_div_rng_chk, @@ -153,4 +60,4 @@ class lookup_div_u16_2_relation : public GenericLookupRelation using lookup_div_u16_2 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp index 0a99f0825e9..56680df40c0 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_div_u16_3_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_div_u16_3_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_3, in.lookup_div_u16_3_counts, in.alu_sel_div_rng_chk, @@ -127,16 +42,8 @@ class lookup_div_u16_3_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_3, in.lookup_div_u16_3_counts, in.alu_sel_div_rng_chk, @@ -153,4 +60,4 @@ class lookup_div_u16_3_relation : public GenericLookupRelation using lookup_div_u16_3 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp index 3446acb2b09..5c02f3c52ca 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_div_u16_4_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_div_u16_4_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_4, in.lookup_div_u16_4_counts, in.alu_sel_div_rng_chk, @@ -127,16 +42,8 @@ class lookup_div_u16_4_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_4, in.lookup_div_u16_4_counts, in.alu_sel_div_rng_chk, @@ -153,4 +60,4 @@ class lookup_div_u16_4_relation : public GenericLookupRelation using lookup_div_u16_4 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp index 46879db512a..b8923c750e5 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_div_u16_5_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_div_u16_5_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_5, in.lookup_div_u16_5_counts, in.alu_sel_div_rng_chk, @@ -127,16 +42,8 @@ class lookup_div_u16_5_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_5, in.lookup_div_u16_5_counts, in.alu_sel_div_rng_chk, @@ -153,4 +60,4 @@ class lookup_div_u16_5_relation : public GenericLookupRelation using lookup_div_u16_5 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp index 2c3ffdc0332..a6486bb05ac 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_div_u16_6_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_div_u16_6_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_6, in.lookup_div_u16_6_counts, in.alu_sel_div_rng_chk, @@ -127,16 +42,8 @@ class lookup_div_u16_6_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_6, in.lookup_div_u16_6_counts, in.alu_sel_div_rng_chk, @@ -153,4 +60,4 @@ class lookup_div_u16_6_relation : public GenericLookupRelation using lookup_div_u16_6 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp index 69c385419b6..c52978bade9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_div_u16_7_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_div_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_div_u16_7_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_7, in.lookup_div_u16_7_counts, in.alu_sel_div_rng_chk, @@ -127,16 +42,8 @@ class lookup_div_u16_7_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_div_u16_7, in.lookup_div_u16_7_counts, in.alu_sel_div_rng_chk, @@ -153,4 +60,4 @@ class lookup_div_u16_7_relation : public GenericLookupRelation using lookup_div_u16_7 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp index 5fe7e715a8f..4fe44d760c5 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_into_kernel_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_q_kernel_lookup == 1 || in.kernel_q_public_input_kernel_add_to_table == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_into_kernel_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_into_kernel, in.lookup_into_kernel_counts, in.main_sel_q_kernel_lookup, @@ -129,16 +44,8 @@ class lookup_into_kernel_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_into_kernel, in.lookup_into_kernel_counts, in.main_sel_q_kernel_lookup, @@ -157,4 +64,4 @@ class lookup_into_kernel_relation : public GenericLookupRelation using lookup_into_kernel = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp index 180dcb9393f..b0db8e3f3a8 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_mem_rng_chk_hi_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_8 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_mem_rng_chk_hi_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_hi, in.lookup_mem_rng_chk_hi_counts, in.mem_sel_rng_chk, @@ -127,16 +42,8 @@ class lookup_mem_rng_chk_hi_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_hi, in.lookup_mem_rng_chk_hi_counts, in.mem_sel_rng_chk, @@ -153,4 +60,4 @@ class lookup_mem_rng_chk_hi_relation : public GenericLookupRelation using lookup_mem_rng_chk_hi = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp index 57442b2054b..7a0dca83ce3 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_mem_rng_chk_lo_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_mem_rng_chk_lo_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_lo, in.lookup_mem_rng_chk_lo_counts, in.mem_sel_rng_chk, @@ -127,16 +42,8 @@ class lookup_mem_rng_chk_lo_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_lo, in.lookup_mem_rng_chk_lo_counts, in.mem_sel_rng_chk, @@ -153,4 +60,4 @@ class lookup_mem_rng_chk_lo_relation : public GenericLookupRelation using lookup_mem_rng_chk_lo = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp index 88f855f41d7..e44547863c6 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_mem_rng_chk_mid_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_mem_rng_chk_mid_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_mid, in.lookup_mem_rng_chk_mid_counts, in.mem_sel_rng_chk, @@ -127,16 +42,8 @@ class lookup_mem_rng_chk_mid_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_mid, in.lookup_mem_rng_chk_mid_counts, in.mem_sel_rng_chk, @@ -153,4 +60,4 @@ class lookup_mem_rng_chk_mid_relation : public GenericLookupRelation using lookup_mem_rng_chk_mid = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp index 2446a37a4b8..a62f68e5b4f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_opcode_gas_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 3; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.gas_sel_gas_cost == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_opcode_gas_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_opcode_gas, in.lookup_opcode_gas_counts, in.main_sel_gas_accounting_active, @@ -131,16 +46,8 @@ class lookup_opcode_gas_lookup_settings { in.gas_da_gas_fixed_table); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_opcode_gas, in.lookup_opcode_gas_counts, in.main_sel_gas_accounting_active, @@ -161,4 +68,4 @@ class lookup_opcode_gas_relation : public GenericLookupRelation using lookup_opcode_gas = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp index ebbc612aae6..e9e73ca0b9d 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_pow_2_0_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_shift_which == 1 || in.main_sel_rng_8 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_pow_2_0_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_pow_2_0, in.lookup_pow_2_0_counts, in.alu_sel_shift_which, @@ -129,16 +44,8 @@ class lookup_pow_2_0_lookup_settings { in.powers_power_of_2); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_pow_2_0, in.lookup_pow_2_0_counts, in.alu_sel_shift_which, @@ -157,4 +64,4 @@ class lookup_pow_2_0_relation : public GenericLookupRelation using lookup_pow_2_0 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp index a4fbebf983b..55a5eec29b7 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_pow_2_1_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_shift_which == 1 || in.main_sel_rng_8 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_pow_2_1_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_pow_2_1, in.lookup_pow_2_1_counts, in.alu_sel_shift_which, @@ -129,16 +44,8 @@ class lookup_pow_2_1_lookup_settings { in.powers_power_of_2); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_pow_2_1, in.lookup_pow_2_1_counts, in.alu_sel_shift_which, @@ -157,4 +64,4 @@ class lookup_pow_2_1_relation : public GenericLookupRelation using lookup_pow_2_1 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp index 350ff6c0f46..70a2e3ac66e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_0_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_0_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_0, in.lookup_u16_0_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_0_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_0, in.lookup_u16_0_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_0_relation : public GenericLookupRelati }; template using lookup_u16_0 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp index 8bcb5e54bcb..e391e04bc72 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_1_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_1_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_1, in.lookup_u16_1_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_1_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_1, in.lookup_u16_1_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_1_relation : public GenericLookupRelati }; template using lookup_u16_1 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp index 1821105464e..1b30139552c 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_10_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_10_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_10, in.lookup_u16_10_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_10_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_10, in.lookup_u16_10_counts, in.alu_sel_rng_chk_lookup, @@ -153,4 +60,4 @@ class lookup_u16_10_relation : public GenericLookupRelation using lookup_u16_10 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp index 53a93aa31ab..860588384db 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_11_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_11_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_11, in.lookup_u16_11_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_11_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_11, in.lookup_u16_11_counts, in.alu_sel_rng_chk_lookup, @@ -153,4 +60,4 @@ class lookup_u16_11_relation : public GenericLookupRelation using lookup_u16_11 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp index 0ecd9cc8727..0acfe46bc14 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_12_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_12_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_12, in.lookup_u16_12_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_12_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_12, in.lookup_u16_12_counts, in.alu_sel_rng_chk_lookup, @@ -153,4 +60,4 @@ class lookup_u16_12_relation : public GenericLookupRelation using lookup_u16_12 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp index 75dcb50aeb1..87eaa2d6bb1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_13_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_13_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_13, in.lookup_u16_13_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_13_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_13, in.lookup_u16_13_counts, in.alu_sel_rng_chk_lookup, @@ -153,4 +60,4 @@ class lookup_u16_13_relation : public GenericLookupRelation using lookup_u16_13 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp index c9ad7b55f20..ea9a74cc8d1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_14_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_14_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_14, in.lookup_u16_14_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_14_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_14, in.lookup_u16_14_counts, in.alu_sel_rng_chk_lookup, @@ -153,4 +60,4 @@ class lookup_u16_14_relation : public GenericLookupRelation using lookup_u16_14 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp index 5cbd19c80f4..35a34762d1b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_2_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_2_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_2, in.lookup_u16_2_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_2_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_2, in.lookup_u16_2_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_2_relation : public GenericLookupRelati }; template using lookup_u16_2 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp index 38d640e8cd9..50284c84860 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_3_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_3_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_3, in.lookup_u16_3_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_3_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_3, in.lookup_u16_3_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_3_relation : public GenericLookupRelati }; template using lookup_u16_3 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp index aa3c28499f0..b5cd10a6670 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_4_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_4_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_4, in.lookup_u16_4_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_4_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_4, in.lookup_u16_4_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_4_relation : public GenericLookupRelati }; template using lookup_u16_4 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp index d0b8ddcdd66..1f313268b6e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_5_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_5_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_5, in.lookup_u16_5_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_5_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_5, in.lookup_u16_5_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_5_relation : public GenericLookupRelati }; template using lookup_u16_5 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp index b3f127af6b9..c4aef86a50c 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_6_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_6_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_6, in.lookup_u16_6_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_6_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_6, in.lookup_u16_6_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_6_relation : public GenericLookupRelati }; template using lookup_u16_6 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp index af8817b80f8..b1496c4403a 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_7_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_7_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_7, in.lookup_u16_7_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_7_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_7, in.lookup_u16_7_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_7_relation : public GenericLookupRelati }; template using lookup_u16_7 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp index c9d9748e086..e2080cc7190 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_8_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_8_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_8, in.lookup_u16_8_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_8_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_8, in.lookup_u16_8_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_8_relation : public GenericLookupRelati }; template using lookup_u16_8 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp index 28326b2bd4f..40b258e5942 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u16_9_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u16_9_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_9, in.lookup_u16_9_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u16_9_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u16_9, in.lookup_u16_9_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u16_9_relation : public GenericLookupRelati }; template using lookup_u16_9 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp index 45da35a4e83..568ecd3731d 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u8_0_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_8 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u8_0_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u8_0, in.lookup_u8_0_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u8_0_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u8_0, in.lookup_u8_0_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u8_0_relation : public GenericLookupRelatio }; template using lookup_u8_0 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp index 550fca44bbf..3b78d561e68 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class lookup_u8_1_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_rng_chk_lookup == 1 || in.main_sel_rng_8 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class lookup_u8_1_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_u8_1, in.lookup_u8_1_counts, in.alu_sel_rng_chk_lookup, @@ -127,16 +42,8 @@ class lookup_u8_1_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_u8_1, in.lookup_u8_1_counts, in.alu_sel_rng_chk_lookup, @@ -152,4 +59,4 @@ template class lookup_u8_1_relation : public GenericLookupRelatio }; template using lookup_u8_1 = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp index 8455d9fe483..82289efd5b2 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp @@ -1233,63 +1233,63 @@ template class mainImpl { // Contribution 118 { Avm_DECLARE_VIEWS(118); - auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(40))); + auto tmp = (main_sel_op_function_selector * (kernel_kernel_in_offset - FF(2))); tmp *= scaling_factor; std::get<118>(evals) += tmp; } // Contribution 119 { Avm_DECLARE_VIEWS(119); - auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(29))); + auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(39))); tmp *= scaling_factor; std::get<119>(evals) += tmp; } // Contribution 120 { Avm_DECLARE_VIEWS(120); - auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(30))); + auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(28))); tmp *= scaling_factor; std::get<120>(evals) += tmp; } // Contribution 121 { Avm_DECLARE_VIEWS(121); - auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(31))); + auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(29))); tmp *= scaling_factor; std::get<121>(evals) += tmp; } // Contribution 122 { Avm_DECLARE_VIEWS(122); - auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(32))); + auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(30))); tmp *= scaling_factor; std::get<122>(evals) += tmp; } // Contribution 123 { Avm_DECLARE_VIEWS(123); - auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(33))); + auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(31))); tmp *= scaling_factor; std::get<123>(evals) += tmp; } // Contribution 124 { Avm_DECLARE_VIEWS(124); - auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(35))); + auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(32))); tmp *= scaling_factor; std::get<124>(evals) += tmp; } // Contribution 125 { Avm_DECLARE_VIEWS(125); - auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(36))); + auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(34))); tmp *= scaling_factor; std::get<125>(evals) += tmp; } // Contribution 126 { Avm_DECLARE_VIEWS(126); - auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(36))); + auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(35))); tmp *= scaling_factor; std::get<126>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp index fd4b61fa8e4..fa14ab3a16c 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_cd_mem.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_cd_mem_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.slice_sel_cd_cpy == 1 || in.mem_sel_op_cd_cpy == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_cd_mem, in.slice_sel_cd_cpy, in.slice_sel_cd_cpy, @@ -60,26 +33,8 @@ class perm_cd_mem_permutation_settings { in.mem_val); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_cd_mem, in.slice_sel_cd_cpy, in.slice_sel_cd_cpy, @@ -95,7 +50,11 @@ class perm_cd_mem_permutation_settings { } }; -template using perm_cd_mem_relation = GenericPermutationRelation; +template +class perm_cd_mem_relation : public GenericPermutationRelation { + public: + static constexpr const char* NAME = "perm_cd_mem"; +}; template using perm_cd_mem = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp index 244da70cc8a..c96e000c2da 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_alu_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 16; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_alu == 1 || in.alu_sel_alu == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_alu, in.main_sel_alu, in.main_sel_alu, @@ -84,26 +57,8 @@ class perm_main_alu_permutation_settings { in.alu_in_tag); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_alu, in.main_sel_alu, in.main_sel_alu, @@ -150,4 +105,4 @@ class perm_main_alu_relation : public GenericPermutationRelation using perm_main_alu = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp index d07397b7a7d..42c820a4b84 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_bin_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 6; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_bin == 1 || in.binary_start == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_bin, in.main_sel_bin, in.main_sel_bin, @@ -64,26 +37,8 @@ class perm_main_bin_permutation_settings { in.binary_in_tag); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_bin, in.main_sel_bin, in.main_sel_bin, @@ -110,4 +65,4 @@ class perm_main_bin_relation : public GenericPermutationRelation using perm_main_bin = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp index 4c68f7601e2..60111a5c2cd 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_cd_copy_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 3; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_cd_cpy_gadget == 1 || in.slice_sel_start_cd_cpy == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_cd_copy, in.main_sel_cd_cpy_gadget, in.main_sel_cd_cpy_gadget, @@ -58,26 +31,8 @@ class perm_main_cd_copy_permutation_settings { in.slice_addr); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_cd_copy, in.main_sel_cd_cpy_gadget, in.main_sel_cd_cpy_gadget, @@ -92,7 +47,10 @@ class perm_main_cd_copy_permutation_settings { }; template -using perm_main_cd_copy_relation = GenericPermutationRelation; +class perm_main_cd_copy_relation : public GenericPermutationRelation { + public: + static constexpr const char* NAME = "perm_main_cd_copy"; +}; template using perm_main_cd_copy = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp index d25e5de9f5e..20b6d13e322 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_conv_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_op_radix_le == 1 || in.conversion_sel_to_radix_le == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_conv, in.main_sel_op_radix_le, in.main_sel_op_radix_le, @@ -60,26 +33,8 @@ class perm_main_conv_permutation_settings { in.conversion_num_limbs); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_conv, in.main_sel_op_radix_le, in.main_sel_op_radix_le, @@ -102,4 +57,4 @@ class perm_main_conv_relation : public GenericPermutationRelation using perm_main_conv = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp index 3a92e5b02b7..2efb6d21b31 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_mem_a_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 9; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_mem_op_a == 1 || in.mem_sel_op_a == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_a, in.main_sel_mem_op_a, in.main_sel_mem_op_a, @@ -70,26 +43,8 @@ class perm_main_mem_a_permutation_settings { in.mem_sel_op_cmov); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_a, in.main_sel_mem_op_a, in.main_sel_mem_op_a, @@ -122,4 +77,4 @@ class perm_main_mem_a_relation : public GenericPermutationRelation using perm_main_mem_a = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp index 1641f8afb9e..0f7a88a66f1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_mem_b_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 9; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_mem_op_b == 1 || in.mem_sel_op_b == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_b, in.main_sel_mem_op_b, in.main_sel_mem_op_b, @@ -70,26 +43,8 @@ class perm_main_mem_b_permutation_settings { in.mem_sel_op_cmov); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_b, in.main_sel_mem_op_b, in.main_sel_mem_op_b, @@ -122,4 +77,4 @@ class perm_main_mem_b_relation : public GenericPermutationRelation using perm_main_mem_b = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp index f490ba21a61..f1888c7ce18 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_mem_c_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 7; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_mem_op_c == 1 || in.mem_sel_op_c == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_c, in.main_sel_mem_op_c, in.main_sel_mem_op_c, @@ -66,26 +39,8 @@ class perm_main_mem_c_permutation_settings { in.mem_w_in_tag); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_c, in.main_sel_mem_op_c, in.main_sel_mem_op_c, @@ -114,4 +69,4 @@ class perm_main_mem_c_relation : public GenericPermutationRelation using perm_main_mem_c = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp index ebfba06722f..2cb433eed79 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_mem_d_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 8; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_mem_op_d == 1 || in.mem_sel_op_d == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_d, in.main_sel_mem_op_d, in.main_sel_mem_op_d, @@ -68,26 +41,8 @@ class perm_main_mem_d_permutation_settings { in.mem_sel_op_cmov); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_d, in.main_sel_mem_op_d, in.main_sel_mem_op_d, @@ -118,4 +73,4 @@ class perm_main_mem_d_relation : public GenericPermutationRelation using perm_main_mem_d = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_a.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_a.hpp index 15bc219942b..5d6267e60a9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_a.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_a.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_mem_ind_addr_a_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_resolve_ind_addr_a == 1 || in.mem_sel_resolve_ind_addr_a == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_ind_addr_a, in.main_sel_resolve_ind_addr_a, in.main_sel_resolve_ind_addr_a, @@ -60,26 +33,8 @@ class perm_main_mem_ind_addr_a_permutation_settings { in.mem_val); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_ind_addr_a, in.main_sel_resolve_ind_addr_a, in.main_sel_resolve_ind_addr_a, @@ -104,4 +59,4 @@ class perm_main_mem_ind_addr_a_relation template using perm_main_mem_ind_addr_a = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_b.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_b.hpp index be6f4ad2a53..708696d3343 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_b.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_b.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_mem_ind_addr_b_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_resolve_ind_addr_b == 1 || in.mem_sel_resolve_ind_addr_b == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_ind_addr_b, in.main_sel_resolve_ind_addr_b, in.main_sel_resolve_ind_addr_b, @@ -60,26 +33,8 @@ class perm_main_mem_ind_addr_b_permutation_settings { in.mem_val); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_ind_addr_b, in.main_sel_resolve_ind_addr_b, in.main_sel_resolve_ind_addr_b, @@ -104,4 +59,4 @@ class perm_main_mem_ind_addr_b_relation template using perm_main_mem_ind_addr_b = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_c.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_c.hpp index fef2108e379..011cee0cdba 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_c.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_c.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_mem_ind_addr_c_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_resolve_ind_addr_c == 1 || in.mem_sel_resolve_ind_addr_c == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_ind_addr_c, in.main_sel_resolve_ind_addr_c, in.main_sel_resolve_ind_addr_c, @@ -60,26 +33,8 @@ class perm_main_mem_ind_addr_c_permutation_settings { in.mem_val); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_ind_addr_c, in.main_sel_resolve_ind_addr_c, in.main_sel_resolve_ind_addr_c, @@ -104,4 +59,4 @@ class perm_main_mem_ind_addr_c_relation template using perm_main_mem_ind_addr_c = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp index a87a3e64cd6..0db50634041 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_mem_ind_addr_d_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 4; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_resolve_ind_addr_d == 1 || in.mem_sel_resolve_ind_addr_d == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_ind_addr_d, in.main_sel_resolve_ind_addr_d, in.main_sel_resolve_ind_addr_d, @@ -60,26 +33,8 @@ class perm_main_mem_ind_addr_d_permutation_settings { in.mem_val); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_mem_ind_addr_d, in.main_sel_resolve_ind_addr_d, in.main_sel_resolve_ind_addr_d, @@ -104,4 +59,4 @@ class perm_main_mem_ind_addr_d_relation template using perm_main_mem_ind_addr_d = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp index 90cf5793872..16e141e8481 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_pedersen_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 2; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_op_pedersen == 1 || in.pedersen_sel_pedersen == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_pedersen, in.main_sel_op_pedersen, in.main_sel_op_pedersen, @@ -56,26 +29,8 @@ class perm_main_pedersen_permutation_settings { in.pedersen_input); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_pedersen, in.main_sel_op_pedersen, in.main_sel_op_pedersen, @@ -94,4 +49,4 @@ class perm_main_pedersen_relation : public GenericPermutationRelation using perm_main_pedersen = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp index 50c553b6a09..e79de4c0020 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_pos2_perm_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 3; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_op_poseidon2 == 1 || in.poseidon2_sel_poseidon_perm == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_pos2_perm, in.main_sel_op_poseidon2, in.main_sel_op_poseidon2, @@ -58,26 +31,8 @@ class perm_main_pos2_perm_permutation_settings { in.poseidon2_output); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_pos2_perm, in.main_sel_op_poseidon2, in.main_sel_op_poseidon2, @@ -98,4 +53,4 @@ class perm_main_pos2_perm_relation : public GenericPermutationRelation using perm_main_pos2_perm = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp index eed623674b3..47629f26071 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class range_check_da_gas_hi_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class range_check_da_gas_hi_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.range_check_da_gas_hi, in.range_check_da_gas_hi_counts, in.main_sel_gas_accounting_active, @@ -127,16 +42,8 @@ class range_check_da_gas_hi_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.range_check_da_gas_hi, in.range_check_da_gas_hi_counts, in.main_sel_gas_accounting_active, @@ -153,4 +60,4 @@ class range_check_da_gas_hi_relation : public GenericLookupRelation using range_check_da_gas_hi = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp index ba5e9708062..f006e63ecb4 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class range_check_da_gas_lo_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class range_check_da_gas_lo_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.range_check_da_gas_lo, in.range_check_da_gas_lo_counts, in.main_sel_gas_accounting_active, @@ -127,16 +42,8 @@ class range_check_da_gas_lo_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.range_check_da_gas_lo, in.range_check_da_gas_lo_counts, in.main_sel_gas_accounting_active, @@ -153,4 +60,4 @@ class range_check_da_gas_lo_relation : public GenericLookupRelation using range_check_da_gas_lo = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp index ea696204975..b0009a37bee 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class range_check_l2_gas_hi_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class range_check_l2_gas_hi_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.range_check_l2_gas_hi, in.range_check_l2_gas_hi_counts, in.main_sel_gas_accounting_active, @@ -127,16 +42,8 @@ class range_check_l2_gas_hi_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.range_check_l2_gas_hi, in.range_check_l2_gas_hi_counts, in.main_sel_gas_accounting_active, @@ -153,4 +60,4 @@ class range_check_l2_gas_hi_relation : public GenericLookupRelation using range_check_l2_gas_hi = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp index 16dc2c0435d..e55a6539853 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -11,81 +9,20 @@ namespace bb { class range_check_l2_gas_lo_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 1; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_gas_accounting_active == 1 || in.main_sel_rng_16 == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -95,30 +32,8 @@ class range_check_l2_gas_lo_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.range_check_l2_gas_lo, in.range_check_l2_gas_lo_counts, in.main_sel_gas_accounting_active, @@ -127,16 +42,8 @@ class range_check_l2_gas_lo_lookup_settings { in.main_clk); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.range_check_l2_gas_lo, in.range_check_l2_gas_lo_counts, in.main_sel_gas_accounting_active, @@ -153,4 +60,4 @@ class range_check_l2_gas_lo_relation : public GenericLookupRelation using range_check_l2_gas_lo = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp index 231b62278a9..99c3d10cac4 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp @@ -3,7 +3,6 @@ #include #include "barretenberg/vm/avm_trace/avm_mem_trace.hpp" -#include "barretenberg/vm/generated/avm_circuit_builder.hpp" namespace bb::avm_trace { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp index 83a63b50d20..376bc7071dc 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp @@ -16,11 +16,7 @@ #include "barretenberg/vm/avm_trace/gadgets/avm_pedersen.hpp" #include "barretenberg/vm/avm_trace/gadgets/avm_poseidon2.hpp" #include "barretenberg/vm/avm_trace/gadgets/avm_sha256.hpp" -<<<<<<< HEAD -======= #include "barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp" -#include "barretenberg/vm/generated/avm_circuit_builder.hpp" ->>>>>>> 9e38cd0464 (7211: witness generation for calldata copy gadget) namespace bb::avm_trace { diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp new file mode 100644 index 00000000000..edc9470914e --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp @@ -0,0 +1,839 @@ +#include "barretenberg/vm/generated/avm_circuit_builder.hpp" + +namespace bb { +namespace { + +template std::string field_to_string(const FF& ff) +{ + std::ostringstream os; + os << ff; + std::string raw = os.str(); + auto first_not_zero = raw.find_first_not_of('0', 2); + std::string result = "0x" + (first_not_zero != std::string::npos ? raw.substr(first_not_zero) : "0"); + return result; +} + +} // namespace + +template std::vector AvmFullRow::names() +{ + return { "main_clk", + "main_sel_first", + "kernel_kernel_inputs", + "kernel_kernel_value_out", + "kernel_kernel_side_effect_out", + "kernel_kernel_metadata_out", + "main_calldata", + "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", + "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", + "conversion_clk", + "conversion_input", + "conversion_num_limbs", + "conversion_radix", + "conversion_sel_to_radix_le", + "gas_da_gas_fixed_table", + "gas_l2_gas_fixed_table", + "gas_sel_gas_cost", + "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_cd_cpy_gadget", + "main_sel_gas_accounting_active", + "main_sel_last", + "main_sel_mem_op_a", + "main_sel_mem_op_activate_gas", + "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_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_rng_16", + "main_sel_rng_8", + "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_cd_cpy", + "mem_sel_op_cmov", + "mem_sel_op_d", + "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_clk", + "poseidon2_input", + "poseidon2_output", + "poseidon2_sel_poseidon_perm", + "powers_power_of_2", + "sha256_clk", + "sha256_input", + "sha256_output", + "sha256_sel_sha256_compression", + "sha256_state", + "slice_addr", + "slice_cd_offset", + "slice_clk", + "slice_cnt", + "slice_one_min_inv", + "slice_sel_cd_cpy", + "slice_sel_start_cd_cpy", + "slice_space_id", + "slice_val", + "perm_cd_mem", + "perm_main_alu", + "perm_main_bin", + "perm_main_conv", + "perm_main_pos2_perm", + "perm_main_pedersen", + "perm_main_cd_copy", + "perm_main_mem_a", + "perm_main_mem_b", + "perm_main_mem_c", + "perm_main_mem_d", + "perm_main_mem_ind_addr_a", + "perm_main_mem_ind_addr_b", + "perm_main_mem_ind_addr_c", + "perm_main_mem_ind_addr_d", + "lookup_byte_lengths", + "lookup_byte_operations", + "lookup_cd_value", + "lookup_opcode_gas", + "range_check_l2_gas_hi", + "range_check_l2_gas_lo", + "range_check_da_gas_hi", + "range_check_da_gas_lo", + "kernel_output_lookup", + "lookup_into_kernel", + "incl_main_tag_err", + "incl_mem_tag_err", + "lookup_mem_rng_chk_lo", + "lookup_mem_rng_chk_mid", + "lookup_mem_rng_chk_hi", + "lookup_pow_2_0", + "lookup_pow_2_1", + "lookup_u8_0", + "lookup_u8_1", + "lookup_u16_0", + "lookup_u16_1", + "lookup_u16_2", + "lookup_u16_3", + "lookup_u16_4", + "lookup_u16_5", + "lookup_u16_6", + "lookup_u16_7", + "lookup_u16_8", + "lookup_u16_9", + "lookup_u16_10", + "lookup_u16_11", + "lookup_u16_12", + "lookup_u16_13", + "lookup_u16_14", + "lookup_div_u16_0", + "lookup_div_u16_1", + "lookup_div_u16_2", + "lookup_div_u16_3", + "lookup_div_u16_4", + "lookup_div_u16_5", + "lookup_div_u16_6", + "lookup_div_u16_7", + "lookup_byte_lengths_counts", + "lookup_byte_operations_counts", + "lookup_cd_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" }; +} + +template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row) +{ + return os << field_to_string(row.main_clk) // + << "," << field_to_string(row.main_sel_first) // + << "," << field_to_string(row.kernel_kernel_inputs) // + << "," << field_to_string(row.kernel_kernel_value_out) // + << "," << field_to_string(row.kernel_kernel_side_effect_out) // + << "," << field_to_string(row.kernel_kernel_metadata_out) // + << "," << field_to_string(row.main_calldata) // + << "," << field_to_string(row.alu_a_hi) // + << "," << field_to_string(row.alu_a_lo) // + << "," << field_to_string(row.alu_b_hi) // + << "," << field_to_string(row.alu_b_lo) // + << "," << field_to_string(row.alu_borrow) // + << "," << field_to_string(row.alu_cf) // + << "," << field_to_string(row.alu_clk) // + << "," << field_to_string(row.alu_cmp_rng_ctr) // + << "," << field_to_string(row.alu_div_u16_r0) // + << "," << field_to_string(row.alu_div_u16_r1) // + << "," << field_to_string(row.alu_div_u16_r2) // + << "," << field_to_string(row.alu_div_u16_r3) // + << "," << field_to_string(row.alu_div_u16_r4) // + << "," << field_to_string(row.alu_div_u16_r5) // + << "," << field_to_string(row.alu_div_u16_r6) // + << "," << field_to_string(row.alu_div_u16_r7) // + << "," << field_to_string(row.alu_divisor_hi) // + << "," << field_to_string(row.alu_divisor_lo) // + << "," << field_to_string(row.alu_ff_tag) // + << "," << field_to_string(row.alu_ia) // + << "," << field_to_string(row.alu_ib) // + << "," << field_to_string(row.alu_ic) // + << "," << field_to_string(row.alu_in_tag) // + << "," << field_to_string(row.alu_op_add) // + << "," << field_to_string(row.alu_op_cast) // + << "," << field_to_string(row.alu_op_cast_prev) // + << "," << field_to_string(row.alu_op_div) // + << "," << field_to_string(row.alu_op_div_a_lt_b) // + << "," << field_to_string(row.alu_op_div_std) // + << "," << field_to_string(row.alu_op_eq) // + << "," << field_to_string(row.alu_op_eq_diff_inv) // + << "," << field_to_string(row.alu_op_lt) // + << "," << field_to_string(row.alu_op_lte) // + << "," << field_to_string(row.alu_op_mul) // + << "," << field_to_string(row.alu_op_not) // + << "," << field_to_string(row.alu_op_shl) // + << "," << field_to_string(row.alu_op_shr) // + << "," << field_to_string(row.alu_op_sub) // + << "," << field_to_string(row.alu_p_a_borrow) // + << "," << field_to_string(row.alu_p_b_borrow) // + << "," << field_to_string(row.alu_p_sub_a_hi) // + << "," << field_to_string(row.alu_p_sub_a_lo) // + << "," << field_to_string(row.alu_p_sub_b_hi) // + << "," << field_to_string(row.alu_p_sub_b_lo) // + << "," << field_to_string(row.alu_partial_prod_hi) // + << "," << field_to_string(row.alu_partial_prod_lo) // + << "," << field_to_string(row.alu_quotient_hi) // + << "," << field_to_string(row.alu_quotient_lo) // + << "," << field_to_string(row.alu_remainder) // + << "," << field_to_string(row.alu_res_hi) // + << "," << field_to_string(row.alu_res_lo) // + << "," << field_to_string(row.alu_sel_alu) // + << "," << field_to_string(row.alu_sel_cmp) // + << "," << field_to_string(row.alu_sel_div_rng_chk) // + << "," << field_to_string(row.alu_sel_rng_chk) // + << "," << field_to_string(row.alu_sel_rng_chk_lookup) // + << "," << field_to_string(row.alu_sel_shift_which) // + << "," << field_to_string(row.alu_shift_lt_bit_len) // + << "," << field_to_string(row.alu_t_sub_s_bits) // + << "," << field_to_string(row.alu_two_pow_s) // + << "," << field_to_string(row.alu_two_pow_t_sub_s) // + << "," << field_to_string(row.alu_u128_tag) // + << "," << field_to_string(row.alu_u16_r0) // + << "," << field_to_string(row.alu_u16_r1) // + << "," << field_to_string(row.alu_u16_r10) // + << "," << field_to_string(row.alu_u16_r11) // + << "," << field_to_string(row.alu_u16_r12) // + << "," << field_to_string(row.alu_u16_r13) // + << "," << field_to_string(row.alu_u16_r14) // + << "," << field_to_string(row.alu_u16_r2) // + << "," << field_to_string(row.alu_u16_r3) // + << "," << field_to_string(row.alu_u16_r4) // + << "," << field_to_string(row.alu_u16_r5) // + << "," << field_to_string(row.alu_u16_r6) // + << "," << field_to_string(row.alu_u16_r7) // + << "," << field_to_string(row.alu_u16_r8) // + << "," << field_to_string(row.alu_u16_r9) // + << "," << field_to_string(row.alu_u16_tag) // + << "," << field_to_string(row.alu_u32_tag) // + << "," << field_to_string(row.alu_u64_tag) // + << "," << field_to_string(row.alu_u8_r0) // + << "," << field_to_string(row.alu_u8_r1) // + << "," << field_to_string(row.alu_u8_tag) // + << "," << field_to_string(row.binary_acc_ia) // + << "," << field_to_string(row.binary_acc_ib) // + << "," << field_to_string(row.binary_acc_ic) // + << "," << field_to_string(row.binary_clk) // + << "," << field_to_string(row.binary_ia_bytes) // + << "," << field_to_string(row.binary_ib_bytes) // + << "," << field_to_string(row.binary_ic_bytes) // + << "," << field_to_string(row.binary_in_tag) // + << "," << field_to_string(row.binary_mem_tag_ctr) // + << "," << field_to_string(row.binary_mem_tag_ctr_inv) // + << "," << field_to_string(row.binary_op_id) // + << "," << field_to_string(row.binary_sel_bin) // + << "," << field_to_string(row.binary_start) // + << "," << field_to_string(row.byte_lookup_sel_bin) // + << "," << field_to_string(row.byte_lookup_table_byte_lengths) // + << "," << field_to_string(row.byte_lookup_table_in_tags) // + << "," << field_to_string(row.byte_lookup_table_input_a) // + << "," << field_to_string(row.byte_lookup_table_input_b) // + << "," << field_to_string(row.byte_lookup_table_op_id) // + << "," << field_to_string(row.byte_lookup_table_output) // + << "," << field_to_string(row.conversion_clk) // + << "," << field_to_string(row.conversion_input) // + << "," << field_to_string(row.conversion_num_limbs) // + << "," << field_to_string(row.conversion_radix) // + << "," << field_to_string(row.conversion_sel_to_radix_le) // + << "," << field_to_string(row.gas_da_gas_fixed_table) // + << "," << field_to_string(row.gas_l2_gas_fixed_table) // + << "," << field_to_string(row.gas_sel_gas_cost) // + << "," << field_to_string(row.keccakf1600_clk) // + << "," << field_to_string(row.keccakf1600_input) // + << "," << field_to_string(row.keccakf1600_output) // + << "," << field_to_string(row.keccakf1600_sel_keccakf1600) // + << "," << field_to_string(row.kernel_emit_l2_to_l1_msg_write_offset) // + << "," << field_to_string(row.kernel_emit_note_hash_write_offset) // + << "," << field_to_string(row.kernel_emit_nullifier_write_offset) // + << "," << field_to_string(row.kernel_emit_unencrypted_log_write_offset) // + << "," << field_to_string(row.kernel_kernel_in_offset) // + << "," << field_to_string(row.kernel_kernel_out_offset) // + << "," << field_to_string(row.kernel_l1_to_l2_msg_exists_write_offset) // + << "," << field_to_string(row.kernel_note_hash_exist_write_offset) // + << "," << field_to_string(row.kernel_nullifier_exists_write_offset) // + << "," << field_to_string(row.kernel_nullifier_non_exists_write_offset) // + << "," << field_to_string(row.kernel_q_public_input_kernel_add_to_table) // + << "," << field_to_string(row.kernel_q_public_input_kernel_out_add_to_table) // + << "," << field_to_string(row.kernel_side_effect_counter) // + << "," << field_to_string(row.kernel_sload_write_offset) // + << "," << field_to_string(row.kernel_sstore_write_offset) // + << "," << field_to_string(row.main_abs_da_rem_gas_hi) // + << "," << field_to_string(row.main_abs_da_rem_gas_lo) // + << "," << field_to_string(row.main_abs_l2_rem_gas_hi) // + << "," << field_to_string(row.main_abs_l2_rem_gas_lo) // + << "," << field_to_string(row.main_alu_in_tag) // + << "," << field_to_string(row.main_bin_op_id) // + << "," << field_to_string(row.main_call_ptr) // + << "," << field_to_string(row.main_da_gas_op_cost) // + << "," << field_to_string(row.main_da_gas_remaining) // + << "," << field_to_string(row.main_da_out_of_gas) // + << "," << field_to_string(row.main_ia) // + << "," << field_to_string(row.main_ib) // + << "," << field_to_string(row.main_ic) // + << "," << field_to_string(row.main_id) // + << "," << field_to_string(row.main_id_zero) // + << "," << field_to_string(row.main_ind_addr_a) // + << "," << field_to_string(row.main_ind_addr_b) // + << "," << field_to_string(row.main_ind_addr_c) // + << "," << field_to_string(row.main_ind_addr_d) // + << "," << field_to_string(row.main_internal_return_ptr) // + << "," << field_to_string(row.main_inv) // + << "," << field_to_string(row.main_l2_gas_op_cost) // + << "," << field_to_string(row.main_l2_gas_remaining) // + << "," << field_to_string(row.main_l2_out_of_gas) // + << "," << field_to_string(row.main_mem_addr_a) // + << "," << field_to_string(row.main_mem_addr_b) // + << "," << field_to_string(row.main_mem_addr_c) // + << "," << field_to_string(row.main_mem_addr_d) // + << "," << field_to_string(row.main_op_err) // + << "," << field_to_string(row.main_opcode_val) // + << "," << field_to_string(row.main_pc) // + << "," << field_to_string(row.main_r_in_tag) // + << "," << field_to_string(row.main_rwa) // + << "," << field_to_string(row.main_rwb) // + << "," << field_to_string(row.main_rwc) // + << "," << field_to_string(row.main_rwd) // + << "," << field_to_string(row.main_sel_alu) // + << "," << field_to_string(row.main_sel_bin) // + << "," << field_to_string(row.main_sel_calldata) // + << "," << field_to_string(row.main_sel_cd_cpy_gadget) // + << "," << field_to_string(row.main_sel_gas_accounting_active) // + << "," << field_to_string(row.main_sel_last) // + << "," << field_to_string(row.main_sel_mem_op_a) // + << "," << field_to_string(row.main_sel_mem_op_activate_gas) // + << "," << field_to_string(row.main_sel_mem_op_b) // + << "," << field_to_string(row.main_sel_mem_op_c) // + << "," << field_to_string(row.main_sel_mem_op_d) // + << "," << field_to_string(row.main_sel_mov_ia_to_ic) // + << "," << field_to_string(row.main_sel_mov_ib_to_ic) // + << "," << field_to_string(row.main_sel_op_add) // + << "," << field_to_string(row.main_sel_op_address) // + << "," << field_to_string(row.main_sel_op_and) // + << "," << field_to_string(row.main_sel_op_block_number) // + << "," << field_to_string(row.main_sel_op_calldata_copy) // + << "," << field_to_string(row.main_sel_op_cast) // + << "," << field_to_string(row.main_sel_op_chain_id) // + << "," << field_to_string(row.main_sel_op_cmov) // + << "," << field_to_string(row.main_sel_op_coinbase) // + << "," << field_to_string(row.main_sel_op_dagasleft) // + << "," << field_to_string(row.main_sel_op_div) // + << "," << field_to_string(row.main_sel_op_emit_l2_to_l1_msg) // + << "," << field_to_string(row.main_sel_op_emit_note_hash) // + << "," << field_to_string(row.main_sel_op_emit_nullifier) // + << "," << field_to_string(row.main_sel_op_emit_unencrypted_log) // + << "," << field_to_string(row.main_sel_op_eq) // + << "," << field_to_string(row.main_sel_op_external_call) // + << "," << field_to_string(row.main_sel_op_fdiv) // + << "," << field_to_string(row.main_sel_op_fee_per_da_gas) // + << "," << field_to_string(row.main_sel_op_fee_per_l2_gas) // + << "," << field_to_string(row.main_sel_op_function_selector) // + << "," << field_to_string(row.main_sel_op_get_contract_instance) // + << "," << field_to_string(row.main_sel_op_halt) // + << "," << field_to_string(row.main_sel_op_internal_call) // + << "," << field_to_string(row.main_sel_op_internal_return) // + << "," << field_to_string(row.main_sel_op_jump) // + << "," << field_to_string(row.main_sel_op_jumpi) // + << "," << field_to_string(row.main_sel_op_keccak) // + << "," << field_to_string(row.main_sel_op_l1_to_l2_msg_exists) // + << "," << field_to_string(row.main_sel_op_l2gasleft) // + << "," << field_to_string(row.main_sel_op_lt) // + << "," << field_to_string(row.main_sel_op_lte) // + << "," << field_to_string(row.main_sel_op_mov) // + << "," << field_to_string(row.main_sel_op_mul) // + << "," << field_to_string(row.main_sel_op_not) // + << "," << field_to_string(row.main_sel_op_note_hash_exists) // + << "," << field_to_string(row.main_sel_op_nullifier_exists) // + << "," << field_to_string(row.main_sel_op_or) // + << "," << field_to_string(row.main_sel_op_pedersen) // + << "," << field_to_string(row.main_sel_op_poseidon2) // + << "," << field_to_string(row.main_sel_op_radix_le) // + << "," << field_to_string(row.main_sel_op_sender) // + << "," << field_to_string(row.main_sel_op_sha256) // + << "," << field_to_string(row.main_sel_op_shl) // + << "," << field_to_string(row.main_sel_op_shr) // + << "," << field_to_string(row.main_sel_op_sload) // + << "," << field_to_string(row.main_sel_op_sstore) // + << "," << field_to_string(row.main_sel_op_storage_address) // + << "," << field_to_string(row.main_sel_op_sub) // + << "," << field_to_string(row.main_sel_op_timestamp) // + << "," << field_to_string(row.main_sel_op_transaction_fee) // + << "," << field_to_string(row.main_sel_op_version) // + << "," << field_to_string(row.main_sel_op_xor) // + << "," << field_to_string(row.main_sel_q_kernel_lookup) // + << "," << field_to_string(row.main_sel_q_kernel_output_lookup) // + << "," << field_to_string(row.main_sel_resolve_ind_addr_a) // + << "," << field_to_string(row.main_sel_resolve_ind_addr_b) // + << "," << field_to_string(row.main_sel_resolve_ind_addr_c) // + << "," << field_to_string(row.main_sel_resolve_ind_addr_d) // + << "," << field_to_string(row.main_sel_rng_16) // + << "," << field_to_string(row.main_sel_rng_8) // + << "," << field_to_string(row.main_space_id) // + << "," << field_to_string(row.main_tag_err) // + << "," << field_to_string(row.main_w_in_tag) // + << "," << field_to_string(row.mem_addr) // + << "," << field_to_string(row.mem_clk) // + << "," << field_to_string(row.mem_diff_hi) // + << "," << field_to_string(row.mem_diff_lo) // + << "," << field_to_string(row.mem_diff_mid) // + << "," << field_to_string(row.mem_glob_addr) // + << "," << field_to_string(row.mem_last) // + << "," << field_to_string(row.mem_lastAccess) // + << "," << field_to_string(row.mem_one_min_inv) // + << "," << field_to_string(row.mem_r_in_tag) // + << "," << field_to_string(row.mem_rw) // + << "," << field_to_string(row.mem_sel_mem) // + << "," << field_to_string(row.mem_sel_mov_ia_to_ic) // + << "," << field_to_string(row.mem_sel_mov_ib_to_ic) // + << "," << field_to_string(row.mem_sel_op_a) // + << "," << field_to_string(row.mem_sel_op_b) // + << "," << field_to_string(row.mem_sel_op_c) // + << "," << field_to_string(row.mem_sel_op_cd_cpy) // + << "," << field_to_string(row.mem_sel_op_cmov) // + << "," << field_to_string(row.mem_sel_op_d) // + << "," << field_to_string(row.mem_sel_resolve_ind_addr_a) // + << "," << field_to_string(row.mem_sel_resolve_ind_addr_b) // + << "," << field_to_string(row.mem_sel_resolve_ind_addr_c) // + << "," << field_to_string(row.mem_sel_resolve_ind_addr_d) // + << "," << field_to_string(row.mem_sel_rng_chk) // + << "," << field_to_string(row.mem_skip_check_tag) // + << "," << field_to_string(row.mem_space_id) // + << "," << field_to_string(row.mem_tag) // + << "," << field_to_string(row.mem_tag_err) // + << "," << field_to_string(row.mem_tsp) // + << "," << field_to_string(row.mem_val) // + << "," << field_to_string(row.mem_w_in_tag) // + << "," << field_to_string(row.pedersen_clk) // + << "," << field_to_string(row.pedersen_input) // + << "," << field_to_string(row.pedersen_output) // + << "," << field_to_string(row.pedersen_sel_pedersen) // + << "," << field_to_string(row.poseidon2_clk) // + << "," << field_to_string(row.poseidon2_input) // + << "," << field_to_string(row.poseidon2_output) // + << "," << field_to_string(row.poseidon2_sel_poseidon_perm) // + << "," << field_to_string(row.powers_power_of_2) // + << "," << field_to_string(row.sha256_clk) // + << "," << field_to_string(row.sha256_input) // + << "," << field_to_string(row.sha256_output) // + << "," << field_to_string(row.sha256_sel_sha256_compression) // + << "," << field_to_string(row.sha256_state) // + << "," << field_to_string(row.slice_addr) // + << "," << field_to_string(row.slice_cd_offset) // + << "," << field_to_string(row.slice_clk) // + << "," << field_to_string(row.slice_cnt) // + << "," << field_to_string(row.slice_one_min_inv) // + << "," << field_to_string(row.slice_sel_cd_cpy) // + << "," << field_to_string(row.slice_sel_start_cd_cpy) // + << "," << field_to_string(row.slice_space_id) // + << "," << field_to_string(row.slice_val) // + << "," << field_to_string(row.perm_cd_mem) // + << "," << field_to_string(row.perm_main_alu) // + << "," << field_to_string(row.perm_main_bin) // + << "," << field_to_string(row.perm_main_conv) // + << "," << field_to_string(row.perm_main_pos2_perm) // + << "," << field_to_string(row.perm_main_pedersen) // + << "," << field_to_string(row.perm_main_cd_copy) // + << "," << field_to_string(row.perm_main_mem_a) // + << "," << field_to_string(row.perm_main_mem_b) // + << "," << field_to_string(row.perm_main_mem_c) // + << "," << field_to_string(row.perm_main_mem_d) // + << "," << field_to_string(row.perm_main_mem_ind_addr_a) // + << "," << field_to_string(row.perm_main_mem_ind_addr_b) // + << "," << field_to_string(row.perm_main_mem_ind_addr_c) // + << "," << field_to_string(row.perm_main_mem_ind_addr_d) // + << "," << field_to_string(row.lookup_byte_lengths) // + << "," << field_to_string(row.lookup_byte_operations) // + << "," << field_to_string(row.lookup_cd_value) // + << "," << field_to_string(row.lookup_opcode_gas) // + << "," << field_to_string(row.range_check_l2_gas_hi) // + << "," << field_to_string(row.range_check_l2_gas_lo) // + << "," << field_to_string(row.range_check_da_gas_hi) // + << "," << field_to_string(row.range_check_da_gas_lo) // + << "," << field_to_string(row.kernel_output_lookup) // + << "," << field_to_string(row.lookup_into_kernel) // + << "," << field_to_string(row.incl_main_tag_err) // + << "," << field_to_string(row.incl_mem_tag_err) // + << "," << field_to_string(row.lookup_mem_rng_chk_lo) // + << "," << field_to_string(row.lookup_mem_rng_chk_mid) // + << "," << field_to_string(row.lookup_mem_rng_chk_hi) // + << "," << field_to_string(row.lookup_pow_2_0) // + << "," << field_to_string(row.lookup_pow_2_1) // + << "," << field_to_string(row.lookup_u8_0) // + << "," << field_to_string(row.lookup_u8_1) // + << "," << field_to_string(row.lookup_u16_0) // + << "," << field_to_string(row.lookup_u16_1) // + << "," << field_to_string(row.lookup_u16_2) // + << "," << field_to_string(row.lookup_u16_3) // + << "," << field_to_string(row.lookup_u16_4) // + << "," << field_to_string(row.lookup_u16_5) // + << "," << field_to_string(row.lookup_u16_6) // + << "," << field_to_string(row.lookup_u16_7) // + << "," << field_to_string(row.lookup_u16_8) // + << "," << field_to_string(row.lookup_u16_9) // + << "," << field_to_string(row.lookup_u16_10) // + << "," << field_to_string(row.lookup_u16_11) // + << "," << field_to_string(row.lookup_u16_12) // + << "," << field_to_string(row.lookup_u16_13) // + << "," << field_to_string(row.lookup_u16_14) // + << "," << field_to_string(row.lookup_div_u16_0) // + << "," << field_to_string(row.lookup_div_u16_1) // + << "," << field_to_string(row.lookup_div_u16_2) // + << "," << field_to_string(row.lookup_div_u16_3) // + << "," << field_to_string(row.lookup_div_u16_4) // + << "," << field_to_string(row.lookup_div_u16_5) // + << "," << field_to_string(row.lookup_div_u16_6) // + << "," << field_to_string(row.lookup_div_u16_7) // + << "," << field_to_string(row.lookup_byte_lengths_counts) // + << "," << field_to_string(row.lookup_byte_operations_counts) // + << "," << field_to_string(row.lookup_cd_value_counts) // + << "," << field_to_string(row.lookup_opcode_gas_counts) // + << "," << field_to_string(row.range_check_l2_gas_hi_counts) // + << "," << field_to_string(row.range_check_l2_gas_lo_counts) // + << "," << field_to_string(row.range_check_da_gas_hi_counts) // + << "," << field_to_string(row.range_check_da_gas_lo_counts) // + << "," << field_to_string(row.kernel_output_lookup_counts) // + << "," << field_to_string(row.lookup_into_kernel_counts) // + << "," << field_to_string(row.incl_main_tag_err_counts) // + << "," << field_to_string(row.incl_mem_tag_err_counts) // + << "," << field_to_string(row.lookup_mem_rng_chk_lo_counts) // + << "," << field_to_string(row.lookup_mem_rng_chk_mid_counts) // + << "," << field_to_string(row.lookup_mem_rng_chk_hi_counts) // + << "," << field_to_string(row.lookup_pow_2_0_counts) // + << "," << field_to_string(row.lookup_pow_2_1_counts) // + << "," << field_to_string(row.lookup_u8_0_counts) // + << "," << field_to_string(row.lookup_u8_1_counts) // + << "," << field_to_string(row.lookup_u16_0_counts) // + << "," << field_to_string(row.lookup_u16_1_counts) // + << "," << field_to_string(row.lookup_u16_2_counts) // + << "," << field_to_string(row.lookup_u16_3_counts) // + << "," << field_to_string(row.lookup_u16_4_counts) // + << "," << field_to_string(row.lookup_u16_5_counts) // + << "," << field_to_string(row.lookup_u16_6_counts) // + << "," << field_to_string(row.lookup_u16_7_counts) // + << "," << field_to_string(row.lookup_u16_8_counts) // + << "," << field_to_string(row.lookup_u16_9_counts) // + << "," << field_to_string(row.lookup_u16_10_counts) // + << "," << field_to_string(row.lookup_u16_11_counts) // + << "," << field_to_string(row.lookup_u16_12_counts) // + << "," << field_to_string(row.lookup_u16_13_counts) // + << "," << field_to_string(row.lookup_u16_14_counts) // + << "," << field_to_string(row.lookup_div_u16_0_counts) // + << "," << field_to_string(row.lookup_div_u16_1_counts) // + << "," << field_to_string(row.lookup_div_u16_2_counts) // + << "," << field_to_string(row.lookup_div_u16_3_counts) // + << "," << field_to_string(row.lookup_div_u16_4_counts) // + << "," << field_to_string(row.lookup_div_u16_5_counts) // + << "," << field_to_string(row.lookup_div_u16_6_counts) // + << "," << field_to_string(row.lookup_div_u16_7_counts) // + ; +} + +// Explicit template instantiation. +template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); +template std::vector AvmFullRow::names(); + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index 9c30cad8abf..b30ff790970 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -19,420 +19,6 @@ namespace bb { -<<<<<<< HEAD -======= -template struct AvmFullRow { - FF main_clk{}; - FF main_sel_first{}; - FF kernel_kernel_inputs{}; - FF kernel_kernel_value_out{}; - FF kernel_kernel_side_effect_out{}; - FF kernel_kernel_metadata_out{}; - FF main_calldata{}; - FF alu_a_hi{}; - FF alu_a_lo{}; - FF alu_b_hi{}; - FF alu_b_lo{}; - FF alu_borrow{}; - FF alu_cf{}; - FF alu_clk{}; - FF alu_cmp_rng_ctr{}; - FF alu_div_u16_r0{}; - FF alu_div_u16_r1{}; - FF alu_div_u16_r2{}; - FF alu_div_u16_r3{}; - FF alu_div_u16_r4{}; - FF alu_div_u16_r5{}; - FF alu_div_u16_r6{}; - FF alu_div_u16_r7{}; - FF alu_divisor_hi{}; - FF alu_divisor_lo{}; - FF alu_ff_tag{}; - FF alu_ia{}; - FF alu_ib{}; - FF alu_ic{}; - FF alu_in_tag{}; - FF alu_op_add{}; - FF alu_op_cast{}; - FF alu_op_cast_prev{}; - FF alu_op_div{}; - FF alu_op_div_a_lt_b{}; - FF alu_op_div_std{}; - FF alu_op_eq{}; - FF alu_op_eq_diff_inv{}; - FF alu_op_lt{}; - FF alu_op_lte{}; - FF alu_op_mul{}; - FF alu_op_not{}; - FF alu_op_shl{}; - FF alu_op_shr{}; - FF alu_op_sub{}; - FF alu_p_a_borrow{}; - FF alu_p_b_borrow{}; - FF alu_p_sub_a_hi{}; - FF alu_p_sub_a_lo{}; - FF alu_p_sub_b_hi{}; - FF alu_p_sub_b_lo{}; - FF alu_partial_prod_hi{}; - FF alu_partial_prod_lo{}; - FF alu_quotient_hi{}; - FF alu_quotient_lo{}; - FF alu_remainder{}; - FF alu_res_hi{}; - FF alu_res_lo{}; - FF alu_sel_alu{}; - FF alu_sel_cmp{}; - FF alu_sel_div_rng_chk{}; - FF alu_sel_rng_chk{}; - FF alu_sel_rng_chk_lookup{}; - FF alu_sel_shift_which{}; - FF alu_shift_lt_bit_len{}; - FF alu_t_sub_s_bits{}; - FF alu_two_pow_s{}; - FF alu_two_pow_t_sub_s{}; - FF alu_u128_tag{}; - FF alu_u16_r0{}; - FF alu_u16_r1{}; - FF alu_u16_r10{}; - FF alu_u16_r11{}; - FF alu_u16_r12{}; - FF alu_u16_r13{}; - FF alu_u16_r14{}; - FF alu_u16_r2{}; - FF alu_u16_r3{}; - FF alu_u16_r4{}; - FF alu_u16_r5{}; - FF alu_u16_r6{}; - FF alu_u16_r7{}; - FF alu_u16_r8{}; - FF alu_u16_r9{}; - FF alu_u16_tag{}; - FF alu_u32_tag{}; - FF alu_u64_tag{}; - FF alu_u8_r0{}; - FF alu_u8_r1{}; - FF alu_u8_tag{}; - FF binary_acc_ia{}; - FF binary_acc_ib{}; - FF binary_acc_ic{}; - FF binary_clk{}; - FF binary_ia_bytes{}; - FF binary_ib_bytes{}; - FF binary_ic_bytes{}; - FF binary_in_tag{}; - FF binary_mem_tag_ctr{}; - FF binary_mem_tag_ctr_inv{}; - FF binary_op_id{}; - FF binary_sel_bin{}; - FF binary_start{}; - FF byte_lookup_sel_bin{}; - FF byte_lookup_table_byte_lengths{}; - FF byte_lookup_table_in_tags{}; - FF byte_lookup_table_input_a{}; - FF byte_lookup_table_input_b{}; - FF byte_lookup_table_op_id{}; - FF byte_lookup_table_output{}; - FF conversion_clk{}; - FF conversion_input{}; - FF conversion_num_limbs{}; - FF conversion_radix{}; - FF conversion_sel_to_radix_le{}; - FF gas_da_gas_fixed_table{}; - FF gas_l2_gas_fixed_table{}; - FF gas_sel_gas_cost{}; - FF keccakf1600_clk{}; - FF keccakf1600_input{}; - FF keccakf1600_output{}; - FF keccakf1600_sel_keccakf1600{}; - FF kernel_emit_l2_to_l1_msg_write_offset{}; - FF kernel_emit_note_hash_write_offset{}; - FF kernel_emit_nullifier_write_offset{}; - FF kernel_emit_unencrypted_log_write_offset{}; - FF kernel_kernel_in_offset{}; - FF kernel_kernel_out_offset{}; - FF kernel_l1_to_l2_msg_exists_write_offset{}; - FF kernel_note_hash_exist_write_offset{}; - FF kernel_nullifier_exists_write_offset{}; - FF kernel_nullifier_non_exists_write_offset{}; - FF kernel_q_public_input_kernel_add_to_table{}; - FF kernel_q_public_input_kernel_out_add_to_table{}; - FF kernel_side_effect_counter{}; - FF kernel_sload_write_offset{}; - FF kernel_sstore_write_offset{}; - FF main_abs_da_rem_gas_hi{}; - FF main_abs_da_rem_gas_lo{}; - FF main_abs_l2_rem_gas_hi{}; - FF main_abs_l2_rem_gas_lo{}; - FF main_alu_in_tag{}; - FF main_bin_op_id{}; - FF main_call_ptr{}; - FF main_da_gas_op_cost{}; - FF main_da_gas_remaining{}; - FF main_da_out_of_gas{}; - FF main_ia{}; - FF main_ib{}; - FF main_ic{}; - FF main_id{}; - FF main_id_zero{}; - FF main_ind_addr_a{}; - FF main_ind_addr_b{}; - FF main_ind_addr_c{}; - FF main_ind_addr_d{}; - FF main_internal_return_ptr{}; - FF main_inv{}; - FF main_l2_gas_op_cost{}; - FF main_l2_gas_remaining{}; - FF main_l2_out_of_gas{}; - FF main_mem_addr_a{}; - FF main_mem_addr_b{}; - FF main_mem_addr_c{}; - FF main_mem_addr_d{}; - FF main_op_err{}; - FF main_opcode_val{}; - FF main_pc{}; - FF main_r_in_tag{}; - FF main_rwa{}; - FF main_rwb{}; - FF main_rwc{}; - FF main_rwd{}; - FF main_sel_alu{}; - FF main_sel_bin{}; - FF main_sel_calldata{}; - FF main_sel_cd_cpy_gadget{}; - FF main_sel_gas_accounting_active{}; - FF main_sel_last{}; - FF main_sel_mem_op_a{}; - FF main_sel_mem_op_activate_gas{}; - FF main_sel_mem_op_b{}; - FF main_sel_mem_op_c{}; - FF main_sel_mem_op_d{}; - FF main_sel_mov_ia_to_ic{}; - FF main_sel_mov_ib_to_ic{}; - FF main_sel_op_add{}; - FF main_sel_op_address{}; - FF main_sel_op_and{}; - FF main_sel_op_block_number{}; - 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_coinbase{}; - FF main_sel_op_dagasleft{}; - FF main_sel_op_div{}; - FF main_sel_op_emit_l2_to_l1_msg{}; - FF main_sel_op_emit_note_hash{}; - FF main_sel_op_emit_nullifier{}; - FF main_sel_op_emit_unencrypted_log{}; - FF main_sel_op_eq{}; - FF main_sel_op_external_call{}; - FF main_sel_op_fdiv{}; - FF main_sel_op_fee_per_da_gas{}; - FF main_sel_op_fee_per_l2_gas{}; - FF main_sel_op_function_selector{}; - FF main_sel_op_get_contract_instance{}; - FF main_sel_op_halt{}; - FF main_sel_op_internal_call{}; - FF main_sel_op_internal_return{}; - FF main_sel_op_jump{}; - FF main_sel_op_jumpi{}; - FF main_sel_op_keccak{}; - FF main_sel_op_l1_to_l2_msg_exists{}; - FF main_sel_op_l2gasleft{}; - FF main_sel_op_lt{}; - FF main_sel_op_lte{}; - FF main_sel_op_mov{}; - FF main_sel_op_mul{}; - FF main_sel_op_not{}; - FF main_sel_op_note_hash_exists{}; - FF main_sel_op_nullifier_exists{}; - FF main_sel_op_or{}; - FF main_sel_op_pedersen{}; - FF main_sel_op_poseidon2{}; - FF main_sel_op_radix_le{}; - FF main_sel_op_sender{}; - FF main_sel_op_sha256{}; - FF main_sel_op_shl{}; - FF main_sel_op_shr{}; - FF main_sel_op_sload{}; - FF main_sel_op_sstore{}; - FF main_sel_op_storage_address{}; - FF main_sel_op_sub{}; - FF main_sel_op_timestamp{}; - FF main_sel_op_transaction_fee{}; - FF main_sel_op_version{}; - FF main_sel_op_xor{}; - FF main_sel_q_kernel_lookup{}; - FF main_sel_q_kernel_output_lookup{}; - FF main_sel_resolve_ind_addr_a{}; - FF main_sel_resolve_ind_addr_b{}; - FF main_sel_resolve_ind_addr_c{}; - FF main_sel_resolve_ind_addr_d{}; - FF main_sel_rng_16{}; - FF main_sel_rng_8{}; - FF main_space_id{}; - FF main_tag_err{}; - FF main_w_in_tag{}; - FF mem_addr{}; - FF mem_clk{}; - FF mem_diff_hi{}; - FF mem_diff_lo{}; - FF mem_diff_mid{}; - FF mem_glob_addr{}; - FF mem_last{}; - FF mem_lastAccess{}; - FF mem_one_min_inv{}; - FF mem_r_in_tag{}; - FF mem_rw{}; - FF mem_sel_mem{}; - FF mem_sel_mov_ia_to_ic{}; - FF mem_sel_mov_ib_to_ic{}; - FF mem_sel_op_a{}; - FF mem_sel_op_b{}; - FF mem_sel_op_c{}; - FF mem_sel_op_cd_cpy{}; - FF mem_sel_op_cmov{}; - FF mem_sel_op_d{}; - FF mem_sel_resolve_ind_addr_a{}; - FF mem_sel_resolve_ind_addr_b{}; - FF mem_sel_resolve_ind_addr_c{}; - FF mem_sel_resolve_ind_addr_d{}; - FF mem_sel_rng_chk{}; - FF mem_skip_check_tag{}; - FF mem_space_id{}; - FF mem_tag{}; - FF mem_tag_err{}; - FF mem_tsp{}; - FF mem_val{}; - FF mem_w_in_tag{}; - FF pedersen_clk{}; - FF pedersen_input{}; - FF pedersen_output{}; - FF pedersen_sel_pedersen{}; - FF poseidon2_clk{}; - FF poseidon2_input{}; - FF poseidon2_output{}; - FF poseidon2_sel_poseidon_perm{}; - FF powers_power_of_2{}; - FF sha256_clk{}; - FF sha256_input{}; - FF sha256_output{}; - FF sha256_sel_sha256_compression{}; - FF sha256_state{}; - FF slice_addr{}; - FF slice_cd_offset{}; - FF slice_clk{}; - FF slice_cnt{}; - FF slice_one_min_inv{}; - FF slice_sel_cd_cpy{}; - FF slice_sel_start_cd_cpy{}; - FF slice_space_id{}; - FF slice_val{}; - FF perm_cd_mem{}; - FF perm_main_alu{}; - FF perm_main_bin{}; - FF perm_main_conv{}; - FF perm_main_pos2_perm{}; - FF perm_main_pedersen{}; - FF perm_main_cd_copy{}; - FF perm_main_mem_a{}; - FF perm_main_mem_b{}; - FF perm_main_mem_c{}; - FF perm_main_mem_d{}; - FF perm_main_mem_ind_addr_a{}; - FF perm_main_mem_ind_addr_b{}; - FF perm_main_mem_ind_addr_c{}; - FF perm_main_mem_ind_addr_d{}; - FF lookup_byte_lengths{}; - FF lookup_byte_operations{}; - FF lookup_cd_value{}; - FF lookup_opcode_gas{}; - FF range_check_l2_gas_hi{}; - FF range_check_l2_gas_lo{}; - FF range_check_da_gas_hi{}; - FF range_check_da_gas_lo{}; - FF kernel_output_lookup{}; - FF lookup_into_kernel{}; - FF incl_main_tag_err{}; - FF incl_mem_tag_err{}; - FF lookup_mem_rng_chk_lo{}; - FF lookup_mem_rng_chk_mid{}; - FF lookup_mem_rng_chk_hi{}; - FF lookup_pow_2_0{}; - FF lookup_pow_2_1{}; - FF lookup_u8_0{}; - FF lookup_u8_1{}; - FF lookup_u16_0{}; - FF lookup_u16_1{}; - FF lookup_u16_2{}; - FF lookup_u16_3{}; - FF lookup_u16_4{}; - FF lookup_u16_5{}; - FF lookup_u16_6{}; - FF lookup_u16_7{}; - FF lookup_u16_8{}; - FF lookup_u16_9{}; - FF lookup_u16_10{}; - FF lookup_u16_11{}; - FF lookup_u16_12{}; - FF lookup_u16_13{}; - FF lookup_u16_14{}; - FF lookup_div_u16_0{}; - FF lookup_div_u16_1{}; - FF lookup_div_u16_2{}; - FF lookup_div_u16_3{}; - FF lookup_div_u16_4{}; - FF lookup_div_u16_5{}; - FF lookup_div_u16_6{}; - FF lookup_div_u16_7{}; - FF lookup_byte_lengths_counts{}; - FF lookup_byte_operations_counts{}; - FF lookup_cd_value_counts{}; - FF lookup_opcode_gas_counts{}; - FF range_check_l2_gas_hi_counts{}; - FF range_check_l2_gas_lo_counts{}; - FF range_check_da_gas_hi_counts{}; - FF range_check_da_gas_lo_counts{}; - FF kernel_output_lookup_counts{}; - FF lookup_into_kernel_counts{}; - FF incl_main_tag_err_counts{}; - FF incl_mem_tag_err_counts{}; - FF lookup_mem_rng_chk_lo_counts{}; - FF lookup_mem_rng_chk_mid_counts{}; - FF lookup_mem_rng_chk_hi_counts{}; - FF lookup_pow_2_0_counts{}; - FF lookup_pow_2_1_counts{}; - FF lookup_u8_0_counts{}; - FF lookup_u8_1_counts{}; - FF lookup_u16_0_counts{}; - FF lookup_u16_1_counts{}; - FF lookup_u16_2_counts{}; - FF lookup_u16_3_counts{}; - FF lookup_u16_4_counts{}; - FF lookup_u16_5_counts{}; - FF lookup_u16_6_counts{}; - FF lookup_u16_7_counts{}; - FF lookup_u16_8_counts{}; - FF lookup_u16_9_counts{}; - FF lookup_u16_10_counts{}; - FF lookup_u16_11_counts{}; - FF lookup_u16_12_counts{}; - FF lookup_u16_13_counts{}; - FF lookup_u16_14_counts{}; - FF lookup_div_u16_0_counts{}; - FF lookup_div_u16_1_counts{}; - FF lookup_div_u16_2_counts{}; - FF lookup_div_u16_3_counts{}; - FF lookup_div_u16_4_counts{}; - FF lookup_div_u16_5_counts{}; - FF lookup_div_u16_6_counts{}; - FF lookup_div_u16_7_counts{}; - - [[maybe_unused]] static std::vector names(); -}; - -template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); - ->>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) class AvmCircuitBuilder { public: using Flavor = bb::AvmFlavor; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index a8efedf2088..67bebdf2d51 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -885,186 +885,6 @@ class AvmFlavor { slice_cd_offset, slice_cnt }; } -<<<<<<< HEAD -======= - - void compute_logderivative_inverses(const RelationParameters& relation_parameters) - { - ProverPolynomials prover_polynomials = ProverPolynomials(*this); - - AVM_TRACK_TIME("compute_logderivative_inverse/perm_cd_mem_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_alu_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_bin_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_conv_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_pos2_perm_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_pedersen_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_cd_copy_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_a_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_b_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_c_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_d_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_a_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_b_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_c_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_d_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_byte_lengths_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_byte_operations_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_cd_value_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_opcode_gas_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/range_check_l2_gas_hi_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/range_check_l2_gas_lo_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/range_check_da_gas_hi_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/range_check_da_gas_lo_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/kernel_output_lookup_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_into_kernel_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/incl_main_tag_err_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/incl_mem_tag_err_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_lo_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_mid_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_hi_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_pow_2_0_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_pow_2_1_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u8_0_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u8_1_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_0_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_1_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_2_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_3_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_4_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_5_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_6_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_7_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_8_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_9_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_10_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_11_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_12_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_13_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_14_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_0_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_1_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_2_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_3_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_4_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_5_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_6_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_7_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - } ->>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) }; using VerificationKey = VerificationKey_, VerifierCommitmentKey>; @@ -2943,412 +2763,7 @@ class AvmFlavor { public: uint32_t circuit_size; -<<<<<<< HEAD std::array commitments; -======= - Commitment kernel_kernel_inputs; - Commitment kernel_kernel_value_out; - Commitment kernel_kernel_side_effect_out; - Commitment kernel_kernel_metadata_out; - Commitment main_calldata; - Commitment alu_a_hi; - Commitment alu_a_lo; - Commitment alu_b_hi; - Commitment alu_b_lo; - Commitment alu_borrow; - Commitment alu_cf; - Commitment alu_clk; - Commitment alu_cmp_rng_ctr; - Commitment alu_div_u16_r0; - Commitment alu_div_u16_r1; - Commitment alu_div_u16_r2; - Commitment alu_div_u16_r3; - Commitment alu_div_u16_r4; - Commitment alu_div_u16_r5; - Commitment alu_div_u16_r6; - Commitment alu_div_u16_r7; - Commitment alu_divisor_hi; - Commitment alu_divisor_lo; - Commitment alu_ff_tag; - Commitment alu_ia; - Commitment alu_ib; - Commitment alu_ic; - Commitment alu_in_tag; - Commitment alu_op_add; - Commitment alu_op_cast; - Commitment alu_op_cast_prev; - Commitment alu_op_div; - Commitment alu_op_div_a_lt_b; - Commitment alu_op_div_std; - Commitment alu_op_eq; - Commitment alu_op_eq_diff_inv; - Commitment alu_op_lt; - Commitment alu_op_lte; - Commitment alu_op_mul; - Commitment alu_op_not; - Commitment alu_op_shl; - Commitment alu_op_shr; - Commitment alu_op_sub; - Commitment alu_p_a_borrow; - Commitment alu_p_b_borrow; - Commitment alu_p_sub_a_hi; - Commitment alu_p_sub_a_lo; - Commitment alu_p_sub_b_hi; - Commitment alu_p_sub_b_lo; - Commitment alu_partial_prod_hi; - Commitment alu_partial_prod_lo; - Commitment alu_quotient_hi; - Commitment alu_quotient_lo; - Commitment alu_remainder; - Commitment alu_res_hi; - Commitment alu_res_lo; - Commitment alu_sel_alu; - Commitment alu_sel_cmp; - Commitment alu_sel_div_rng_chk; - Commitment alu_sel_rng_chk; - Commitment alu_sel_rng_chk_lookup; - Commitment alu_sel_shift_which; - Commitment alu_shift_lt_bit_len; - Commitment alu_t_sub_s_bits; - Commitment alu_two_pow_s; - Commitment alu_two_pow_t_sub_s; - Commitment alu_u128_tag; - Commitment alu_u16_r0; - Commitment alu_u16_r1; - Commitment alu_u16_r10; - Commitment alu_u16_r11; - Commitment alu_u16_r12; - Commitment alu_u16_r13; - Commitment alu_u16_r14; - Commitment alu_u16_r2; - Commitment alu_u16_r3; - Commitment alu_u16_r4; - Commitment alu_u16_r5; - Commitment alu_u16_r6; - Commitment alu_u16_r7; - Commitment alu_u16_r8; - Commitment alu_u16_r9; - Commitment alu_u16_tag; - Commitment alu_u32_tag; - Commitment alu_u64_tag; - Commitment alu_u8_r0; - Commitment alu_u8_r1; - Commitment alu_u8_tag; - Commitment binary_acc_ia; - Commitment binary_acc_ib; - Commitment binary_acc_ic; - Commitment binary_clk; - Commitment binary_ia_bytes; - Commitment binary_ib_bytes; - Commitment binary_ic_bytes; - Commitment binary_in_tag; - Commitment binary_mem_tag_ctr; - Commitment binary_mem_tag_ctr_inv; - Commitment binary_op_id; - Commitment binary_sel_bin; - Commitment binary_start; - Commitment byte_lookup_sel_bin; - Commitment byte_lookup_table_byte_lengths; - Commitment byte_lookup_table_in_tags; - Commitment byte_lookup_table_input_a; - Commitment byte_lookup_table_input_b; - Commitment byte_lookup_table_op_id; - Commitment byte_lookup_table_output; - Commitment conversion_clk; - Commitment conversion_input; - Commitment conversion_num_limbs; - Commitment conversion_radix; - Commitment conversion_sel_to_radix_le; - Commitment gas_da_gas_fixed_table; - Commitment gas_l2_gas_fixed_table; - Commitment gas_sel_gas_cost; - Commitment keccakf1600_clk; - Commitment keccakf1600_input; - Commitment keccakf1600_output; - Commitment keccakf1600_sel_keccakf1600; - Commitment kernel_emit_l2_to_l1_msg_write_offset; - Commitment kernel_emit_note_hash_write_offset; - Commitment kernel_emit_nullifier_write_offset; - Commitment kernel_emit_unencrypted_log_write_offset; - Commitment kernel_kernel_in_offset; - Commitment kernel_kernel_out_offset; - Commitment kernel_l1_to_l2_msg_exists_write_offset; - Commitment kernel_note_hash_exist_write_offset; - Commitment kernel_nullifier_exists_write_offset; - Commitment kernel_nullifier_non_exists_write_offset; - Commitment kernel_q_public_input_kernel_add_to_table; - Commitment kernel_q_public_input_kernel_out_add_to_table; - Commitment kernel_side_effect_counter; - Commitment kernel_sload_write_offset; - Commitment kernel_sstore_write_offset; - Commitment main_abs_da_rem_gas_hi; - Commitment main_abs_da_rem_gas_lo; - Commitment main_abs_l2_rem_gas_hi; - Commitment main_abs_l2_rem_gas_lo; - Commitment main_alu_in_tag; - Commitment main_bin_op_id; - Commitment main_call_ptr; - Commitment main_da_gas_op_cost; - Commitment main_da_gas_remaining; - Commitment main_da_out_of_gas; - Commitment main_ia; - Commitment main_ib; - Commitment main_ic; - Commitment main_id; - Commitment main_id_zero; - Commitment main_ind_addr_a; - Commitment main_ind_addr_b; - Commitment main_ind_addr_c; - Commitment main_ind_addr_d; - Commitment main_internal_return_ptr; - Commitment main_inv; - Commitment main_l2_gas_op_cost; - Commitment main_l2_gas_remaining; - Commitment main_l2_out_of_gas; - Commitment main_mem_addr_a; - Commitment main_mem_addr_b; - Commitment main_mem_addr_c; - Commitment main_mem_addr_d; - Commitment main_op_err; - Commitment main_opcode_val; - Commitment main_pc; - Commitment main_r_in_tag; - Commitment main_rwa; - Commitment main_rwb; - Commitment main_rwc; - Commitment main_rwd; - Commitment main_sel_alu; - Commitment main_sel_bin; - Commitment main_sel_calldata; - Commitment main_sel_cd_cpy_gadget; - Commitment main_sel_gas_accounting_active; - Commitment main_sel_last; - Commitment main_sel_mem_op_a; - Commitment main_sel_mem_op_activate_gas; - Commitment main_sel_mem_op_b; - Commitment main_sel_mem_op_c; - Commitment main_sel_mem_op_d; - Commitment main_sel_mov_ia_to_ic; - Commitment main_sel_mov_ib_to_ic; - Commitment main_sel_op_add; - Commitment main_sel_op_address; - Commitment main_sel_op_and; - Commitment main_sel_op_block_number; - Commitment main_sel_op_calldata_copy; - Commitment main_sel_op_cast; - Commitment main_sel_op_chain_id; - Commitment main_sel_op_cmov; - Commitment main_sel_op_coinbase; - Commitment main_sel_op_dagasleft; - Commitment main_sel_op_div; - Commitment main_sel_op_emit_l2_to_l1_msg; - Commitment main_sel_op_emit_note_hash; - Commitment main_sel_op_emit_nullifier; - Commitment main_sel_op_emit_unencrypted_log; - Commitment main_sel_op_eq; - Commitment main_sel_op_external_call; - Commitment main_sel_op_fdiv; - Commitment main_sel_op_fee_per_da_gas; - Commitment main_sel_op_fee_per_l2_gas; - Commitment main_sel_op_function_selector; - Commitment main_sel_op_get_contract_instance; - Commitment main_sel_op_halt; - Commitment main_sel_op_internal_call; - Commitment main_sel_op_internal_return; - Commitment main_sel_op_jump; - Commitment main_sel_op_jumpi; - Commitment main_sel_op_keccak; - Commitment main_sel_op_l1_to_l2_msg_exists; - Commitment main_sel_op_l2gasleft; - Commitment main_sel_op_lt; - Commitment main_sel_op_lte; - Commitment main_sel_op_mov; - Commitment main_sel_op_mul; - Commitment main_sel_op_not; - Commitment main_sel_op_note_hash_exists; - Commitment main_sel_op_nullifier_exists; - Commitment main_sel_op_or; - Commitment main_sel_op_pedersen; - Commitment main_sel_op_poseidon2; - Commitment main_sel_op_radix_le; - Commitment main_sel_op_sender; - Commitment main_sel_op_sha256; - Commitment main_sel_op_shl; - Commitment main_sel_op_shr; - Commitment main_sel_op_sload; - Commitment main_sel_op_sstore; - Commitment main_sel_op_storage_address; - Commitment main_sel_op_sub; - Commitment main_sel_op_timestamp; - Commitment main_sel_op_transaction_fee; - Commitment main_sel_op_version; - Commitment main_sel_op_xor; - Commitment main_sel_q_kernel_lookup; - Commitment main_sel_q_kernel_output_lookup; - Commitment main_sel_resolve_ind_addr_a; - Commitment main_sel_resolve_ind_addr_b; - Commitment main_sel_resolve_ind_addr_c; - Commitment main_sel_resolve_ind_addr_d; - Commitment main_sel_rng_16; - Commitment main_sel_rng_8; - Commitment main_space_id; - Commitment main_tag_err; - Commitment main_w_in_tag; - Commitment mem_addr; - Commitment mem_clk; - Commitment mem_diff_hi; - Commitment mem_diff_lo; - Commitment mem_diff_mid; - Commitment mem_glob_addr; - Commitment mem_last; - Commitment mem_lastAccess; - Commitment mem_one_min_inv; - Commitment mem_r_in_tag; - Commitment mem_rw; - Commitment mem_sel_mem; - Commitment mem_sel_mov_ia_to_ic; - Commitment mem_sel_mov_ib_to_ic; - Commitment mem_sel_op_a; - Commitment mem_sel_op_b; - Commitment mem_sel_op_c; - Commitment mem_sel_op_cd_cpy; - Commitment mem_sel_op_cmov; - Commitment mem_sel_op_d; - Commitment mem_sel_resolve_ind_addr_a; - Commitment mem_sel_resolve_ind_addr_b; - Commitment mem_sel_resolve_ind_addr_c; - Commitment mem_sel_resolve_ind_addr_d; - Commitment mem_sel_rng_chk; - Commitment mem_skip_check_tag; - Commitment mem_space_id; - Commitment mem_tag; - Commitment mem_tag_err; - Commitment mem_tsp; - Commitment mem_val; - Commitment mem_w_in_tag; - Commitment pedersen_clk; - Commitment pedersen_input; - Commitment pedersen_output; - Commitment pedersen_sel_pedersen; - Commitment poseidon2_clk; - Commitment poseidon2_input; - Commitment poseidon2_output; - Commitment poseidon2_sel_poseidon_perm; - Commitment powers_power_of_2; - Commitment sha256_clk; - Commitment sha256_input; - Commitment sha256_output; - Commitment sha256_sel_sha256_compression; - Commitment sha256_state; - Commitment slice_addr; - Commitment slice_cd_offset; - Commitment slice_clk; - Commitment slice_cnt; - Commitment slice_one_min_inv; - Commitment slice_sel_cd_cpy; - Commitment slice_sel_start_cd_cpy; - Commitment slice_space_id; - Commitment slice_val; - Commitment perm_cd_mem; - Commitment perm_main_alu; - Commitment perm_main_bin; - Commitment perm_main_conv; - Commitment perm_main_pos2_perm; - Commitment perm_main_pedersen; - Commitment perm_main_cd_copy; - Commitment perm_main_mem_a; - Commitment perm_main_mem_b; - Commitment perm_main_mem_c; - Commitment perm_main_mem_d; - Commitment perm_main_mem_ind_addr_a; - Commitment perm_main_mem_ind_addr_b; - Commitment perm_main_mem_ind_addr_c; - Commitment perm_main_mem_ind_addr_d; - Commitment lookup_byte_lengths; - Commitment lookup_byte_operations; - Commitment lookup_cd_value; - Commitment lookup_opcode_gas; - Commitment range_check_l2_gas_hi; - Commitment range_check_l2_gas_lo; - Commitment range_check_da_gas_hi; - Commitment range_check_da_gas_lo; - Commitment kernel_output_lookup; - Commitment lookup_into_kernel; - Commitment incl_main_tag_err; - Commitment incl_mem_tag_err; - Commitment lookup_mem_rng_chk_lo; - Commitment lookup_mem_rng_chk_mid; - Commitment lookup_mem_rng_chk_hi; - Commitment lookup_pow_2_0; - Commitment lookup_pow_2_1; - Commitment lookup_u8_0; - Commitment lookup_u8_1; - Commitment lookup_u16_0; - Commitment lookup_u16_1; - Commitment lookup_u16_2; - Commitment lookup_u16_3; - Commitment lookup_u16_4; - Commitment lookup_u16_5; - Commitment lookup_u16_6; - Commitment lookup_u16_7; - Commitment lookup_u16_8; - Commitment lookup_u16_9; - Commitment lookup_u16_10; - Commitment lookup_u16_11; - Commitment lookup_u16_12; - Commitment lookup_u16_13; - Commitment lookup_u16_14; - Commitment lookup_div_u16_0; - Commitment lookup_div_u16_1; - Commitment lookup_div_u16_2; - Commitment lookup_div_u16_3; - Commitment lookup_div_u16_4; - Commitment lookup_div_u16_5; - Commitment lookup_div_u16_6; - Commitment lookup_div_u16_7; - Commitment lookup_byte_lengths_counts; - Commitment lookup_byte_operations_counts; - Commitment lookup_cd_value_counts; - Commitment lookup_opcode_gas_counts; - Commitment range_check_l2_gas_hi_counts; - Commitment range_check_l2_gas_lo_counts; - Commitment range_check_da_gas_hi_counts; - Commitment range_check_da_gas_lo_counts; - Commitment kernel_output_lookup_counts; - Commitment lookup_into_kernel_counts; - Commitment incl_main_tag_err_counts; - Commitment incl_mem_tag_err_counts; - Commitment lookup_mem_rng_chk_lo_counts; - Commitment lookup_mem_rng_chk_mid_counts; - Commitment lookup_mem_rng_chk_hi_counts; - Commitment lookup_pow_2_0_counts; - Commitment lookup_pow_2_1_counts; - Commitment lookup_u8_0_counts; - Commitment lookup_u8_1_counts; - Commitment lookup_u16_0_counts; - Commitment lookup_u16_1_counts; - Commitment lookup_u16_2_counts; - Commitment lookup_u16_3_counts; - Commitment lookup_u16_4_counts; - Commitment lookup_u16_5_counts; - Commitment lookup_u16_6_counts; - Commitment lookup_u16_7_counts; - Commitment lookup_u16_8_counts; - Commitment lookup_u16_9_counts; - Commitment lookup_u16_10_counts; - Commitment lookup_u16_11_counts; - Commitment lookup_u16_12_counts; - Commitment lookup_u16_13_counts; - Commitment lookup_u16_14_counts; - Commitment lookup_div_u16_0_counts; - Commitment lookup_div_u16_1_counts; - Commitment lookup_div_u16_2_counts; - Commitment lookup_div_u16_3_counts; - Commitment lookup_div_u16_4_counts; - Commitment lookup_div_u16_5_counts; - Commitment lookup_div_u16_6_counts; - Commitment lookup_div_u16_7_counts; ->>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) std::vector> sumcheck_univariates; std::array sumcheck_evaluations; @@ -3368,427 +2783,9 @@ class AvmFlavor { circuit_size = deserialize_from_buffer(proof_data, num_frs_read); size_t log_n = numeric::get_msb(circuit_size); -<<<<<<< HEAD for (auto& commitment : commitments) { commitment = deserialize_from_buffer(proof_data, num_frs_read); } -======= - kernel_kernel_inputs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_value_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_side_effect_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_metadata_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_cf = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_cmp_rng_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_divisor_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_divisor_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_ff_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_cast_prev = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_div_a_lt_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_div_std = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_eq_diff_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_a_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_b_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_sub_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_sub_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_sub_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_sub_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_partial_prod_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_partial_prod_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_quotient_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_quotient_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_remainder = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_res_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_res_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_cmp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_div_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_rng_chk_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_shift_which = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_shift_lt_bit_len = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_t_sub_s_bits = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_two_pow_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_two_pow_t_sub_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u128_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u32_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u64_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u8_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u8_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u8_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_acc_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_acc_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_acc_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_mem_tag_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_mem_tag_ctr_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_in_tags = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_input_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_input_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_num_limbs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_radix = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_sel_to_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - gas_da_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - gas_l2_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - gas_sel_gas_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - keccakf1600_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - keccakf1600_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - keccakf1600_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - keccakf1600_sel_keccakf1600 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_emit_l2_to_l1_msg_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_emit_note_hash_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_emit_nullifier_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_emit_unencrypted_log_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_in_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_out_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_l1_to_l2_msg_exists_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_note_hash_exist_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_nullifier_exists_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_nullifier_non_exists_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_q_public_input_kernel_add_to_table = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_q_public_input_kernel_out_add_to_table = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_side_effect_counter = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_sload_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_sstore_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_abs_da_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_abs_da_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_abs_l2_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_abs_l2_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_bin_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_call_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_da_gas_op_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_da_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_da_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_id_zero = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_internal_return_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_l2_gas_op_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_l2_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_l2_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_mem_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_mem_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_mem_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_mem_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_op_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_opcode_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_pc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_rwa = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_rwb = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_rwc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_rwd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_cd_cpy_gadget = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_gas_accounting_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_activate_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mov_ia_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mov_ib_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_and = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_block_number = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_calldata_copy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_chain_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_coinbase = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_dagasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_emit_l2_to_l1_msg = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_emit_note_hash = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_emit_nullifier = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_emit_unencrypted_log = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_external_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_fdiv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_fee_per_da_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_fee_per_l2_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_function_selector = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_get_contract_instance = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_halt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_internal_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_internal_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_jump = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_jumpi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_keccak = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_l1_to_l2_msg_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_l2gasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_note_hash_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_nullifier_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_or = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_poseidon2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sender = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sha256 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sload = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sstore = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_storage_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_timestamp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_transaction_fee = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_version = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_xor = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_q_kernel_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_q_kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_diff_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_diff_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_diff_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_glob_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_lastAccess = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_rw = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_mov_ia_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_mov_ib_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_skip_check_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_tsp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - pedersen_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - pedersen_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - pedersen_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - pedersen_sel_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - poseidon2_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - poseidon2_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - poseidon2_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - poseidon2_sel_poseidon_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - powers_power_of_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_sel_sha256_compression = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_state = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_cd_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_cnt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_start_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_cd_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_conv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_pos2_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_cd_copy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_byte_operations = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_cd_value = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_opcode_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_l2_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_l2_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_da_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_da_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_into_kernel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - incl_main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - incl_mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_pow_2_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_pow_2_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u8_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u8_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_byte_lengths_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_byte_operations_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_cd_value_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_opcode_gas_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_l2_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_l2_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_da_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_da_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_output_lookup_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_into_kernel_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - incl_main_tag_err_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - incl_mem_tag_err_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_mid_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_pow_2_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_pow_2_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u8_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u8_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_2_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_3_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_4_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_5_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_6_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_7_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_8_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_9_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_10_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_11_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_12_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_13_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_14_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_2_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_3_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_4_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_5_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_6_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_7_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - ->>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) for (size_t i = 0; i < log_n; ++i) { sumcheck_univariates.emplace_back( deserialize_from_buffer>(Transcript::proof_data, @@ -3811,415 +2808,9 @@ class AvmFlavor { serialize_to_buffer(circuit_size, Transcript::proof_data); -<<<<<<< HEAD for (const auto& commitment : commitments) { serialize_to_buffer(commitment, Transcript::proof_data); } -======= - serialize_to_buffer(kernel_kernel_inputs, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_value_out, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_side_effect_out, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_metadata_out, Transcript::proof_data); - serialize_to_buffer(main_calldata, Transcript::proof_data); - serialize_to_buffer(alu_a_hi, Transcript::proof_data); - serialize_to_buffer(alu_a_lo, Transcript::proof_data); - serialize_to_buffer(alu_b_hi, Transcript::proof_data); - serialize_to_buffer(alu_b_lo, Transcript::proof_data); - serialize_to_buffer(alu_borrow, Transcript::proof_data); - serialize_to_buffer(alu_cf, Transcript::proof_data); - serialize_to_buffer(alu_clk, Transcript::proof_data); - serialize_to_buffer(alu_cmp_rng_ctr, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r0, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r1, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r2, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r3, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r4, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r5, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r6, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r7, Transcript::proof_data); - serialize_to_buffer(alu_divisor_hi, Transcript::proof_data); - serialize_to_buffer(alu_divisor_lo, Transcript::proof_data); - serialize_to_buffer(alu_ff_tag, Transcript::proof_data); - serialize_to_buffer(alu_ia, Transcript::proof_data); - serialize_to_buffer(alu_ib, Transcript::proof_data); - serialize_to_buffer(alu_ic, Transcript::proof_data); - serialize_to_buffer(alu_in_tag, Transcript::proof_data); - serialize_to_buffer(alu_op_add, Transcript::proof_data); - serialize_to_buffer(alu_op_cast, Transcript::proof_data); - serialize_to_buffer(alu_op_cast_prev, Transcript::proof_data); - serialize_to_buffer(alu_op_div, Transcript::proof_data); - serialize_to_buffer(alu_op_div_a_lt_b, Transcript::proof_data); - serialize_to_buffer(alu_op_div_std, Transcript::proof_data); - serialize_to_buffer(alu_op_eq, Transcript::proof_data); - serialize_to_buffer(alu_op_eq_diff_inv, Transcript::proof_data); - serialize_to_buffer(alu_op_lt, Transcript::proof_data); - serialize_to_buffer(alu_op_lte, Transcript::proof_data); - serialize_to_buffer(alu_op_mul, Transcript::proof_data); - serialize_to_buffer(alu_op_not, Transcript::proof_data); - serialize_to_buffer(alu_op_shl, Transcript::proof_data); - serialize_to_buffer(alu_op_shr, Transcript::proof_data); - serialize_to_buffer(alu_op_sub, Transcript::proof_data); - serialize_to_buffer(alu_p_a_borrow, Transcript::proof_data); - serialize_to_buffer(alu_p_b_borrow, Transcript::proof_data); - serialize_to_buffer(alu_p_sub_a_hi, Transcript::proof_data); - serialize_to_buffer(alu_p_sub_a_lo, Transcript::proof_data); - serialize_to_buffer(alu_p_sub_b_hi, Transcript::proof_data); - serialize_to_buffer(alu_p_sub_b_lo, Transcript::proof_data); - serialize_to_buffer(alu_partial_prod_hi, Transcript::proof_data); - serialize_to_buffer(alu_partial_prod_lo, Transcript::proof_data); - serialize_to_buffer(alu_quotient_hi, Transcript::proof_data); - serialize_to_buffer(alu_quotient_lo, Transcript::proof_data); - serialize_to_buffer(alu_remainder, Transcript::proof_data); - serialize_to_buffer(alu_res_hi, Transcript::proof_data); - serialize_to_buffer(alu_res_lo, Transcript::proof_data); - serialize_to_buffer(alu_sel_alu, Transcript::proof_data); - serialize_to_buffer(alu_sel_cmp, Transcript::proof_data); - serialize_to_buffer(alu_sel_div_rng_chk, Transcript::proof_data); - serialize_to_buffer(alu_sel_rng_chk, Transcript::proof_data); - serialize_to_buffer(alu_sel_rng_chk_lookup, Transcript::proof_data); - serialize_to_buffer(alu_sel_shift_which, Transcript::proof_data); - serialize_to_buffer(alu_shift_lt_bit_len, Transcript::proof_data); - serialize_to_buffer(alu_t_sub_s_bits, Transcript::proof_data); - serialize_to_buffer(alu_two_pow_s, Transcript::proof_data); - serialize_to_buffer(alu_two_pow_t_sub_s, Transcript::proof_data); - serialize_to_buffer(alu_u128_tag, Transcript::proof_data); - serialize_to_buffer(alu_u16_r0, Transcript::proof_data); - serialize_to_buffer(alu_u16_r1, Transcript::proof_data); - serialize_to_buffer(alu_u16_r10, Transcript::proof_data); - serialize_to_buffer(alu_u16_r11, Transcript::proof_data); - serialize_to_buffer(alu_u16_r12, Transcript::proof_data); - serialize_to_buffer(alu_u16_r13, Transcript::proof_data); - serialize_to_buffer(alu_u16_r14, Transcript::proof_data); - serialize_to_buffer(alu_u16_r2, Transcript::proof_data); - serialize_to_buffer(alu_u16_r3, Transcript::proof_data); - serialize_to_buffer(alu_u16_r4, Transcript::proof_data); - serialize_to_buffer(alu_u16_r5, Transcript::proof_data); - serialize_to_buffer(alu_u16_r6, Transcript::proof_data); - serialize_to_buffer(alu_u16_r7, Transcript::proof_data); - serialize_to_buffer(alu_u16_r8, Transcript::proof_data); - serialize_to_buffer(alu_u16_r9, Transcript::proof_data); - serialize_to_buffer(alu_u16_tag, Transcript::proof_data); - serialize_to_buffer(alu_u32_tag, Transcript::proof_data); - serialize_to_buffer(alu_u64_tag, Transcript::proof_data); - serialize_to_buffer(alu_u8_r0, Transcript::proof_data); - serialize_to_buffer(alu_u8_r1, Transcript::proof_data); - serialize_to_buffer(alu_u8_tag, Transcript::proof_data); - serialize_to_buffer(binary_acc_ia, Transcript::proof_data); - serialize_to_buffer(binary_acc_ib, Transcript::proof_data); - serialize_to_buffer(binary_acc_ic, Transcript::proof_data); - serialize_to_buffer(binary_clk, Transcript::proof_data); - serialize_to_buffer(binary_ia_bytes, Transcript::proof_data); - serialize_to_buffer(binary_ib_bytes, Transcript::proof_data); - serialize_to_buffer(binary_ic_bytes, Transcript::proof_data); - serialize_to_buffer(binary_in_tag, Transcript::proof_data); - serialize_to_buffer(binary_mem_tag_ctr, Transcript::proof_data); - serialize_to_buffer(binary_mem_tag_ctr_inv, Transcript::proof_data); - serialize_to_buffer(binary_op_id, Transcript::proof_data); - serialize_to_buffer(binary_sel_bin, Transcript::proof_data); - serialize_to_buffer(binary_start, Transcript::proof_data); - serialize_to_buffer(byte_lookup_sel_bin, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_byte_lengths, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_in_tags, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_input_a, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_input_b, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_op_id, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_output, Transcript::proof_data); - serialize_to_buffer(conversion_clk, Transcript::proof_data); - serialize_to_buffer(conversion_input, Transcript::proof_data); - serialize_to_buffer(conversion_num_limbs, Transcript::proof_data); - serialize_to_buffer(conversion_radix, Transcript::proof_data); - serialize_to_buffer(conversion_sel_to_radix_le, Transcript::proof_data); - serialize_to_buffer(gas_da_gas_fixed_table, Transcript::proof_data); - serialize_to_buffer(gas_l2_gas_fixed_table, Transcript::proof_data); - serialize_to_buffer(gas_sel_gas_cost, Transcript::proof_data); - serialize_to_buffer(keccakf1600_clk, Transcript::proof_data); - serialize_to_buffer(keccakf1600_input, Transcript::proof_data); - serialize_to_buffer(keccakf1600_output, Transcript::proof_data); - serialize_to_buffer(keccakf1600_sel_keccakf1600, Transcript::proof_data); - serialize_to_buffer(kernel_emit_l2_to_l1_msg_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_emit_note_hash_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_emit_nullifier_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_emit_unencrypted_log_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_in_offset, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_out_offset, Transcript::proof_data); - serialize_to_buffer(kernel_l1_to_l2_msg_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_note_hash_exist_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_nullifier_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_nullifier_non_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_q_public_input_kernel_add_to_table, Transcript::proof_data); - serialize_to_buffer(kernel_q_public_input_kernel_out_add_to_table, Transcript::proof_data); - serialize_to_buffer(kernel_side_effect_counter, Transcript::proof_data); - serialize_to_buffer(kernel_sload_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_sstore_write_offset, Transcript::proof_data); - serialize_to_buffer(main_abs_da_rem_gas_hi, Transcript::proof_data); - serialize_to_buffer(main_abs_da_rem_gas_lo, Transcript::proof_data); - serialize_to_buffer(main_abs_l2_rem_gas_hi, Transcript::proof_data); - serialize_to_buffer(main_abs_l2_rem_gas_lo, Transcript::proof_data); - serialize_to_buffer(main_alu_in_tag, Transcript::proof_data); - serialize_to_buffer(main_bin_op_id, Transcript::proof_data); - serialize_to_buffer(main_call_ptr, Transcript::proof_data); - serialize_to_buffer(main_da_gas_op_cost, Transcript::proof_data); - serialize_to_buffer(main_da_gas_remaining, Transcript::proof_data); - serialize_to_buffer(main_da_out_of_gas, Transcript::proof_data); - serialize_to_buffer(main_ia, Transcript::proof_data); - serialize_to_buffer(main_ib, Transcript::proof_data); - serialize_to_buffer(main_ic, Transcript::proof_data); - serialize_to_buffer(main_id, Transcript::proof_data); - serialize_to_buffer(main_id_zero, Transcript::proof_data); - serialize_to_buffer(main_ind_addr_a, Transcript::proof_data); - serialize_to_buffer(main_ind_addr_b, Transcript::proof_data); - serialize_to_buffer(main_ind_addr_c, Transcript::proof_data); - serialize_to_buffer(main_ind_addr_d, Transcript::proof_data); - serialize_to_buffer(main_internal_return_ptr, Transcript::proof_data); - serialize_to_buffer(main_inv, Transcript::proof_data); - serialize_to_buffer(main_l2_gas_op_cost, Transcript::proof_data); - serialize_to_buffer(main_l2_gas_remaining, Transcript::proof_data); - serialize_to_buffer(main_l2_out_of_gas, Transcript::proof_data); - serialize_to_buffer(main_mem_addr_a, Transcript::proof_data); - serialize_to_buffer(main_mem_addr_b, Transcript::proof_data); - serialize_to_buffer(main_mem_addr_c, Transcript::proof_data); - serialize_to_buffer(main_mem_addr_d, Transcript::proof_data); - serialize_to_buffer(main_op_err, Transcript::proof_data); - serialize_to_buffer(main_opcode_val, Transcript::proof_data); - serialize_to_buffer(main_pc, Transcript::proof_data); - serialize_to_buffer(main_r_in_tag, Transcript::proof_data); - serialize_to_buffer(main_rwa, Transcript::proof_data); - serialize_to_buffer(main_rwb, Transcript::proof_data); - serialize_to_buffer(main_rwc, Transcript::proof_data); - serialize_to_buffer(main_rwd, Transcript::proof_data); - serialize_to_buffer(main_sel_alu, Transcript::proof_data); - serialize_to_buffer(main_sel_bin, Transcript::proof_data); - serialize_to_buffer(main_sel_calldata, Transcript::proof_data); - serialize_to_buffer(main_sel_cd_cpy_gadget, Transcript::proof_data); - serialize_to_buffer(main_sel_gas_accounting_active, Transcript::proof_data); - serialize_to_buffer(main_sel_last, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_a, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_activate_gas, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_b, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_c, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_d, Transcript::proof_data); - serialize_to_buffer(main_sel_mov_ia_to_ic, Transcript::proof_data); - serialize_to_buffer(main_sel_mov_ib_to_ic, Transcript::proof_data); - serialize_to_buffer(main_sel_op_add, Transcript::proof_data); - serialize_to_buffer(main_sel_op_address, Transcript::proof_data); - serialize_to_buffer(main_sel_op_and, Transcript::proof_data); - serialize_to_buffer(main_sel_op_block_number, Transcript::proof_data); - serialize_to_buffer(main_sel_op_calldata_copy, Transcript::proof_data); - serialize_to_buffer(main_sel_op_cast, Transcript::proof_data); - serialize_to_buffer(main_sel_op_chain_id, Transcript::proof_data); - serialize_to_buffer(main_sel_op_cmov, Transcript::proof_data); - serialize_to_buffer(main_sel_op_coinbase, Transcript::proof_data); - serialize_to_buffer(main_sel_op_dagasleft, Transcript::proof_data); - serialize_to_buffer(main_sel_op_div, Transcript::proof_data); - serialize_to_buffer(main_sel_op_emit_l2_to_l1_msg, Transcript::proof_data); - serialize_to_buffer(main_sel_op_emit_note_hash, Transcript::proof_data); - serialize_to_buffer(main_sel_op_emit_nullifier, Transcript::proof_data); - serialize_to_buffer(main_sel_op_emit_unencrypted_log, Transcript::proof_data); - serialize_to_buffer(main_sel_op_eq, Transcript::proof_data); - serialize_to_buffer(main_sel_op_external_call, Transcript::proof_data); - serialize_to_buffer(main_sel_op_fdiv, Transcript::proof_data); - serialize_to_buffer(main_sel_op_fee_per_da_gas, Transcript::proof_data); - serialize_to_buffer(main_sel_op_fee_per_l2_gas, Transcript::proof_data); - serialize_to_buffer(main_sel_op_function_selector, Transcript::proof_data); - serialize_to_buffer(main_sel_op_get_contract_instance, Transcript::proof_data); - serialize_to_buffer(main_sel_op_halt, Transcript::proof_data); - serialize_to_buffer(main_sel_op_internal_call, Transcript::proof_data); - serialize_to_buffer(main_sel_op_internal_return, Transcript::proof_data); - serialize_to_buffer(main_sel_op_jump, Transcript::proof_data); - serialize_to_buffer(main_sel_op_jumpi, Transcript::proof_data); - serialize_to_buffer(main_sel_op_keccak, Transcript::proof_data); - serialize_to_buffer(main_sel_op_l1_to_l2_msg_exists, Transcript::proof_data); - serialize_to_buffer(main_sel_op_l2gasleft, Transcript::proof_data); - serialize_to_buffer(main_sel_op_lt, Transcript::proof_data); - serialize_to_buffer(main_sel_op_lte, Transcript::proof_data); - serialize_to_buffer(main_sel_op_mov, Transcript::proof_data); - serialize_to_buffer(main_sel_op_mul, Transcript::proof_data); - serialize_to_buffer(main_sel_op_not, Transcript::proof_data); - serialize_to_buffer(main_sel_op_note_hash_exists, Transcript::proof_data); - serialize_to_buffer(main_sel_op_nullifier_exists, Transcript::proof_data); - serialize_to_buffer(main_sel_op_or, Transcript::proof_data); - serialize_to_buffer(main_sel_op_pedersen, Transcript::proof_data); - serialize_to_buffer(main_sel_op_poseidon2, Transcript::proof_data); - serialize_to_buffer(main_sel_op_radix_le, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sender, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sha256, Transcript::proof_data); - serialize_to_buffer(main_sel_op_shl, Transcript::proof_data); - serialize_to_buffer(main_sel_op_shr, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sload, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sstore, Transcript::proof_data); - serialize_to_buffer(main_sel_op_storage_address, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sub, Transcript::proof_data); - serialize_to_buffer(main_sel_op_timestamp, Transcript::proof_data); - serialize_to_buffer(main_sel_op_transaction_fee, Transcript::proof_data); - serialize_to_buffer(main_sel_op_version, Transcript::proof_data); - serialize_to_buffer(main_sel_op_xor, Transcript::proof_data); - serialize_to_buffer(main_sel_q_kernel_lookup, Transcript::proof_data); - serialize_to_buffer(main_sel_q_kernel_output_lookup, Transcript::proof_data); - serialize_to_buffer(main_sel_resolve_ind_addr_a, Transcript::proof_data); - serialize_to_buffer(main_sel_resolve_ind_addr_b, Transcript::proof_data); - serialize_to_buffer(main_sel_resolve_ind_addr_c, Transcript::proof_data); - serialize_to_buffer(main_sel_resolve_ind_addr_d, Transcript::proof_data); - serialize_to_buffer(main_sel_rng_16, Transcript::proof_data); - serialize_to_buffer(main_sel_rng_8, Transcript::proof_data); - serialize_to_buffer(main_space_id, Transcript::proof_data); - serialize_to_buffer(main_tag_err, Transcript::proof_data); - serialize_to_buffer(main_w_in_tag, Transcript::proof_data); - serialize_to_buffer(mem_addr, Transcript::proof_data); - serialize_to_buffer(mem_clk, Transcript::proof_data); - serialize_to_buffer(mem_diff_hi, Transcript::proof_data); - serialize_to_buffer(mem_diff_lo, Transcript::proof_data); - serialize_to_buffer(mem_diff_mid, Transcript::proof_data); - serialize_to_buffer(mem_glob_addr, Transcript::proof_data); - serialize_to_buffer(mem_last, Transcript::proof_data); - serialize_to_buffer(mem_lastAccess, Transcript::proof_data); - serialize_to_buffer(mem_one_min_inv, Transcript::proof_data); - serialize_to_buffer(mem_r_in_tag, Transcript::proof_data); - serialize_to_buffer(mem_rw, Transcript::proof_data); - serialize_to_buffer(mem_sel_mem, Transcript::proof_data); - serialize_to_buffer(mem_sel_mov_ia_to_ic, Transcript::proof_data); - serialize_to_buffer(mem_sel_mov_ib_to_ic, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_a, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_b, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_c, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_cd_cpy, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_cmov, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_d, Transcript::proof_data); - serialize_to_buffer(mem_sel_resolve_ind_addr_a, Transcript::proof_data); - serialize_to_buffer(mem_sel_resolve_ind_addr_b, Transcript::proof_data); - serialize_to_buffer(mem_sel_resolve_ind_addr_c, Transcript::proof_data); - serialize_to_buffer(mem_sel_resolve_ind_addr_d, Transcript::proof_data); - serialize_to_buffer(mem_sel_rng_chk, Transcript::proof_data); - serialize_to_buffer(mem_skip_check_tag, Transcript::proof_data); - serialize_to_buffer(mem_space_id, Transcript::proof_data); - serialize_to_buffer(mem_tag, Transcript::proof_data); - serialize_to_buffer(mem_tag_err, Transcript::proof_data); - serialize_to_buffer(mem_tsp, Transcript::proof_data); - serialize_to_buffer(mem_val, Transcript::proof_data); - serialize_to_buffer(mem_w_in_tag, Transcript::proof_data); - serialize_to_buffer(pedersen_clk, Transcript::proof_data); - serialize_to_buffer(pedersen_input, Transcript::proof_data); - serialize_to_buffer(pedersen_output, Transcript::proof_data); - serialize_to_buffer(pedersen_sel_pedersen, Transcript::proof_data); - serialize_to_buffer(poseidon2_clk, Transcript::proof_data); - serialize_to_buffer(poseidon2_input, Transcript::proof_data); - serialize_to_buffer(poseidon2_output, Transcript::proof_data); - serialize_to_buffer(poseidon2_sel_poseidon_perm, Transcript::proof_data); - serialize_to_buffer(powers_power_of_2, Transcript::proof_data); - serialize_to_buffer(sha256_clk, Transcript::proof_data); - serialize_to_buffer(sha256_input, Transcript::proof_data); - serialize_to_buffer(sha256_output, Transcript::proof_data); - serialize_to_buffer(sha256_sel_sha256_compression, Transcript::proof_data); - serialize_to_buffer(sha256_state, Transcript::proof_data); - serialize_to_buffer(slice_addr, Transcript::proof_data); - serialize_to_buffer(slice_cd_offset, Transcript::proof_data); - serialize_to_buffer(slice_clk, Transcript::proof_data); - serialize_to_buffer(slice_cnt, Transcript::proof_data); - serialize_to_buffer(slice_one_min_inv, Transcript::proof_data); - serialize_to_buffer(slice_sel_cd_cpy, Transcript::proof_data); - serialize_to_buffer(slice_sel_start_cd_cpy, Transcript::proof_data); - serialize_to_buffer(slice_space_id, Transcript::proof_data); - serialize_to_buffer(slice_val, Transcript::proof_data); - serialize_to_buffer(perm_cd_mem, Transcript::proof_data); - serialize_to_buffer(perm_main_alu, Transcript::proof_data); - serialize_to_buffer(perm_main_bin, Transcript::proof_data); - serialize_to_buffer(perm_main_conv, Transcript::proof_data); - serialize_to_buffer(perm_main_pos2_perm, Transcript::proof_data); - serialize_to_buffer(perm_main_pedersen, Transcript::proof_data); - serialize_to_buffer(perm_main_cd_copy, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_a, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_b, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_c, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_d, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_ind_addr_a, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_ind_addr_b, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_ind_addr_c, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_ind_addr_d, Transcript::proof_data); - serialize_to_buffer(lookup_byte_lengths, Transcript::proof_data); - serialize_to_buffer(lookup_byte_operations, Transcript::proof_data); - serialize_to_buffer(lookup_cd_value, Transcript::proof_data); - serialize_to_buffer(lookup_opcode_gas, Transcript::proof_data); - serialize_to_buffer(range_check_l2_gas_hi, Transcript::proof_data); - serialize_to_buffer(range_check_l2_gas_lo, Transcript::proof_data); - serialize_to_buffer(range_check_da_gas_hi, Transcript::proof_data); - serialize_to_buffer(range_check_da_gas_lo, Transcript::proof_data); - serialize_to_buffer(kernel_output_lookup, Transcript::proof_data); - serialize_to_buffer(lookup_into_kernel, Transcript::proof_data); - serialize_to_buffer(incl_main_tag_err, Transcript::proof_data); - serialize_to_buffer(incl_mem_tag_err, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_lo, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_mid, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_hi, Transcript::proof_data); - serialize_to_buffer(lookup_pow_2_0, Transcript::proof_data); - serialize_to_buffer(lookup_pow_2_1, Transcript::proof_data); - serialize_to_buffer(lookup_u8_0, Transcript::proof_data); - serialize_to_buffer(lookup_u8_1, Transcript::proof_data); - serialize_to_buffer(lookup_u16_0, Transcript::proof_data); - serialize_to_buffer(lookup_u16_1, Transcript::proof_data); - serialize_to_buffer(lookup_u16_2, Transcript::proof_data); - serialize_to_buffer(lookup_u16_3, Transcript::proof_data); - serialize_to_buffer(lookup_u16_4, Transcript::proof_data); - serialize_to_buffer(lookup_u16_5, Transcript::proof_data); - serialize_to_buffer(lookup_u16_6, Transcript::proof_data); - serialize_to_buffer(lookup_u16_7, Transcript::proof_data); - serialize_to_buffer(lookup_u16_8, Transcript::proof_data); - serialize_to_buffer(lookup_u16_9, Transcript::proof_data); - serialize_to_buffer(lookup_u16_10, Transcript::proof_data); - serialize_to_buffer(lookup_u16_11, Transcript::proof_data); - serialize_to_buffer(lookup_u16_12, Transcript::proof_data); - serialize_to_buffer(lookup_u16_13, Transcript::proof_data); - serialize_to_buffer(lookup_u16_14, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_0, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_1, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_2, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_3, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_4, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_5, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_6, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_7, Transcript::proof_data); - serialize_to_buffer(lookup_byte_lengths_counts, Transcript::proof_data); - serialize_to_buffer(lookup_byte_operations_counts, Transcript::proof_data); - serialize_to_buffer(lookup_cd_value_counts, Transcript::proof_data); - serialize_to_buffer(lookup_opcode_gas_counts, Transcript::proof_data); - serialize_to_buffer(range_check_l2_gas_hi_counts, Transcript::proof_data); - serialize_to_buffer(range_check_l2_gas_lo_counts, Transcript::proof_data); - serialize_to_buffer(range_check_da_gas_hi_counts, Transcript::proof_data); - serialize_to_buffer(range_check_da_gas_lo_counts, Transcript::proof_data); - serialize_to_buffer(kernel_output_lookup_counts, Transcript::proof_data); - serialize_to_buffer(lookup_into_kernel_counts, Transcript::proof_data); - serialize_to_buffer(incl_main_tag_err_counts, Transcript::proof_data); - serialize_to_buffer(incl_mem_tag_err_counts, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_lo_counts, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_mid_counts, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_hi_counts, Transcript::proof_data); - serialize_to_buffer(lookup_pow_2_0_counts, Transcript::proof_data); - serialize_to_buffer(lookup_pow_2_1_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u8_0_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u8_1_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_0_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_1_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_2_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_3_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_4_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_5_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_6_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_7_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_8_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_9_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_10_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_11_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_12_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_13_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_14_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_0_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_1_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_2_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_3_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_4_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_5_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_6_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_7_counts, Transcript::proof_data); - ->>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) for (size_t i = 0; i < log_n; ++i) { serialize_to_buffer(sumcheck_univariates[i], Transcript::proof_data); } diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.hpp index 6499381c181..f6a06beafa8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.hpp @@ -182,6 +182,8 @@ template struct AvmFullRow { FF main_rwd{}; FF main_sel_alu{}; FF main_sel_bin{}; + FF main_sel_calldata{}; + FF main_sel_cd_cpy_gadget{}; FF main_sel_gas_accounting_active{}; FF main_sel_last{}; FF main_sel_mem_op_a{}; @@ -195,6 +197,7 @@ template struct AvmFullRow { FF main_sel_op_address{}; FF main_sel_op_and{}; FF main_sel_op_block_number{}; + FF main_sel_op_calldata_copy{}; FF main_sel_op_cast{}; FF main_sel_op_chain_id{}; FF main_sel_op_cmov{}; @@ -271,6 +274,7 @@ template struct AvmFullRow { FF mem_sel_op_a{}; FF mem_sel_op_b{}; FF mem_sel_op_c{}; + FF mem_sel_op_cd_cpy{}; FF mem_sel_op_cmov{}; FF mem_sel_op_d{}; FF mem_sel_resolve_ind_addr_a{}; @@ -299,11 +303,22 @@ template struct AvmFullRow { FF sha256_output{}; FF sha256_sel_sha256_compression{}; FF sha256_state{}; + FF slice_addr{}; + FF slice_cd_offset{}; + FF slice_clk{}; + FF slice_cnt{}; + FF slice_one_min_inv{}; + FF slice_sel_cd_cpy{}; + FF slice_sel_start_cd_cpy{}; + FF slice_space_id{}; + FF slice_val{}; + FF perm_cd_mem{}; FF perm_main_alu{}; FF perm_main_bin{}; FF perm_main_conv{}; FF perm_main_pos2_perm{}; FF perm_main_pedersen{}; + FF perm_main_cd_copy{}; FF perm_main_mem_a{}; FF perm_main_mem_b{}; FF perm_main_mem_c{}; @@ -314,6 +329,7 @@ template struct AvmFullRow { FF perm_main_mem_ind_addr_d{}; FF lookup_byte_lengths{}; FF lookup_byte_operations{}; + FF lookup_cd_value{}; FF lookup_opcode_gas{}; FF range_check_l2_gas_hi{}; FF range_check_l2_gas_lo{}; @@ -355,6 +371,7 @@ template struct AvmFullRow { FF lookup_div_u16_7{}; FF lookup_byte_lengths_counts{}; FF lookup_byte_operations_counts{}; + FF lookup_cd_value_counts{}; FF lookup_opcode_gas_counts{}; FF range_check_l2_gas_hi_counts{}; FF range_check_l2_gas_lo_counts{}; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp index 54470c49aa1..23762777a9f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp @@ -96,7 +96,6 @@ void AvmProver::execute_log_derivative_inverse_round() compute_logderivative_rel(relation_parameters, prover_polynomials, key->circuit_size); // Commit to all logderivative inverse polynomials -<<<<<<< HEAD for (auto [commitment, key_poly] : zip_view(witness_commitments.get_derived(), key->get_derived())) { commitment = commitment_key->commit(key_poly); } @@ -105,128 +104,6 @@ void AvmProver::execute_log_derivative_inverse_round() for (auto [label, commitment] : zip_view(commitment_labels.get_derived(), witness_commitments.get_derived())) { transcript->send_to_verifier(label, commitment); } -======= - witness_commitments.perm_cd_mem = commitment_key->commit(key->perm_cd_mem); - witness_commitments.perm_main_alu = commitment_key->commit(key->perm_main_alu); - witness_commitments.perm_main_bin = commitment_key->commit(key->perm_main_bin); - witness_commitments.perm_main_conv = commitment_key->commit(key->perm_main_conv); - witness_commitments.perm_main_pos2_perm = commitment_key->commit(key->perm_main_pos2_perm); - witness_commitments.perm_main_pedersen = commitment_key->commit(key->perm_main_pedersen); - witness_commitments.perm_main_cd_copy = commitment_key->commit(key->perm_main_cd_copy); - witness_commitments.perm_main_mem_a = commitment_key->commit(key->perm_main_mem_a); - witness_commitments.perm_main_mem_b = commitment_key->commit(key->perm_main_mem_b); - witness_commitments.perm_main_mem_c = commitment_key->commit(key->perm_main_mem_c); - witness_commitments.perm_main_mem_d = commitment_key->commit(key->perm_main_mem_d); - witness_commitments.perm_main_mem_ind_addr_a = commitment_key->commit(key->perm_main_mem_ind_addr_a); - witness_commitments.perm_main_mem_ind_addr_b = commitment_key->commit(key->perm_main_mem_ind_addr_b); - witness_commitments.perm_main_mem_ind_addr_c = commitment_key->commit(key->perm_main_mem_ind_addr_c); - witness_commitments.perm_main_mem_ind_addr_d = commitment_key->commit(key->perm_main_mem_ind_addr_d); - witness_commitments.lookup_byte_lengths = commitment_key->commit(key->lookup_byte_lengths); - witness_commitments.lookup_byte_operations = commitment_key->commit(key->lookup_byte_operations); - witness_commitments.lookup_cd_value = commitment_key->commit(key->lookup_cd_value); - witness_commitments.lookup_opcode_gas = commitment_key->commit(key->lookup_opcode_gas); - witness_commitments.range_check_l2_gas_hi = commitment_key->commit(key->range_check_l2_gas_hi); - witness_commitments.range_check_l2_gas_lo = commitment_key->commit(key->range_check_l2_gas_lo); - witness_commitments.range_check_da_gas_hi = commitment_key->commit(key->range_check_da_gas_hi); - witness_commitments.range_check_da_gas_lo = commitment_key->commit(key->range_check_da_gas_lo); - witness_commitments.kernel_output_lookup = commitment_key->commit(key->kernel_output_lookup); - witness_commitments.lookup_into_kernel = commitment_key->commit(key->lookup_into_kernel); - witness_commitments.incl_main_tag_err = commitment_key->commit(key->incl_main_tag_err); - witness_commitments.incl_mem_tag_err = commitment_key->commit(key->incl_mem_tag_err); - witness_commitments.lookup_mem_rng_chk_lo = commitment_key->commit(key->lookup_mem_rng_chk_lo); - witness_commitments.lookup_mem_rng_chk_mid = commitment_key->commit(key->lookup_mem_rng_chk_mid); - witness_commitments.lookup_mem_rng_chk_hi = commitment_key->commit(key->lookup_mem_rng_chk_hi); - witness_commitments.lookup_pow_2_0 = commitment_key->commit(key->lookup_pow_2_0); - witness_commitments.lookup_pow_2_1 = commitment_key->commit(key->lookup_pow_2_1); - witness_commitments.lookup_u8_0 = commitment_key->commit(key->lookup_u8_0); - witness_commitments.lookup_u8_1 = commitment_key->commit(key->lookup_u8_1); - witness_commitments.lookup_u16_0 = commitment_key->commit(key->lookup_u16_0); - witness_commitments.lookup_u16_1 = commitment_key->commit(key->lookup_u16_1); - witness_commitments.lookup_u16_2 = commitment_key->commit(key->lookup_u16_2); - witness_commitments.lookup_u16_3 = commitment_key->commit(key->lookup_u16_3); - witness_commitments.lookup_u16_4 = commitment_key->commit(key->lookup_u16_4); - witness_commitments.lookup_u16_5 = commitment_key->commit(key->lookup_u16_5); - witness_commitments.lookup_u16_6 = commitment_key->commit(key->lookup_u16_6); - witness_commitments.lookup_u16_7 = commitment_key->commit(key->lookup_u16_7); - witness_commitments.lookup_u16_8 = commitment_key->commit(key->lookup_u16_8); - witness_commitments.lookup_u16_9 = commitment_key->commit(key->lookup_u16_9); - witness_commitments.lookup_u16_10 = commitment_key->commit(key->lookup_u16_10); - witness_commitments.lookup_u16_11 = commitment_key->commit(key->lookup_u16_11); - witness_commitments.lookup_u16_12 = commitment_key->commit(key->lookup_u16_12); - witness_commitments.lookup_u16_13 = commitment_key->commit(key->lookup_u16_13); - witness_commitments.lookup_u16_14 = commitment_key->commit(key->lookup_u16_14); - witness_commitments.lookup_div_u16_0 = commitment_key->commit(key->lookup_div_u16_0); - witness_commitments.lookup_div_u16_1 = commitment_key->commit(key->lookup_div_u16_1); - witness_commitments.lookup_div_u16_2 = commitment_key->commit(key->lookup_div_u16_2); - witness_commitments.lookup_div_u16_3 = commitment_key->commit(key->lookup_div_u16_3); - witness_commitments.lookup_div_u16_4 = commitment_key->commit(key->lookup_div_u16_4); - witness_commitments.lookup_div_u16_5 = commitment_key->commit(key->lookup_div_u16_5); - witness_commitments.lookup_div_u16_6 = commitment_key->commit(key->lookup_div_u16_6); - witness_commitments.lookup_div_u16_7 = commitment_key->commit(key->lookup_div_u16_7); - - // Send all commitments to the verifier - transcript->send_to_verifier(commitment_labels.perm_cd_mem, witness_commitments.perm_cd_mem); - transcript->send_to_verifier(commitment_labels.perm_main_alu, witness_commitments.perm_main_alu); - transcript->send_to_verifier(commitment_labels.perm_main_bin, witness_commitments.perm_main_bin); - transcript->send_to_verifier(commitment_labels.perm_main_conv, witness_commitments.perm_main_conv); - transcript->send_to_verifier(commitment_labels.perm_main_pos2_perm, witness_commitments.perm_main_pos2_perm); - transcript->send_to_verifier(commitment_labels.perm_main_pedersen, witness_commitments.perm_main_pedersen); - transcript->send_to_verifier(commitment_labels.perm_main_cd_copy, witness_commitments.perm_main_cd_copy); - transcript->send_to_verifier(commitment_labels.perm_main_mem_a, witness_commitments.perm_main_mem_a); - transcript->send_to_verifier(commitment_labels.perm_main_mem_b, witness_commitments.perm_main_mem_b); - transcript->send_to_verifier(commitment_labels.perm_main_mem_c, witness_commitments.perm_main_mem_c); - transcript->send_to_verifier(commitment_labels.perm_main_mem_d, witness_commitments.perm_main_mem_d); - transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_a, - witness_commitments.perm_main_mem_ind_addr_a); - transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_b, - witness_commitments.perm_main_mem_ind_addr_b); - transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_c, - witness_commitments.perm_main_mem_ind_addr_c); - transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_d, - witness_commitments.perm_main_mem_ind_addr_d); - transcript->send_to_verifier(commitment_labels.lookup_byte_lengths, witness_commitments.lookup_byte_lengths); - transcript->send_to_verifier(commitment_labels.lookup_byte_operations, witness_commitments.lookup_byte_operations); - transcript->send_to_verifier(commitment_labels.lookup_cd_value, witness_commitments.lookup_cd_value); - transcript->send_to_verifier(commitment_labels.lookup_opcode_gas, witness_commitments.lookup_opcode_gas); - transcript->send_to_verifier(commitment_labels.range_check_l2_gas_hi, witness_commitments.range_check_l2_gas_hi); - transcript->send_to_verifier(commitment_labels.range_check_l2_gas_lo, witness_commitments.range_check_l2_gas_lo); - transcript->send_to_verifier(commitment_labels.range_check_da_gas_hi, witness_commitments.range_check_da_gas_hi); - transcript->send_to_verifier(commitment_labels.range_check_da_gas_lo, witness_commitments.range_check_da_gas_lo); - transcript->send_to_verifier(commitment_labels.kernel_output_lookup, witness_commitments.kernel_output_lookup); - transcript->send_to_verifier(commitment_labels.lookup_into_kernel, witness_commitments.lookup_into_kernel); - transcript->send_to_verifier(commitment_labels.incl_main_tag_err, witness_commitments.incl_main_tag_err); - transcript->send_to_verifier(commitment_labels.incl_mem_tag_err, witness_commitments.incl_mem_tag_err); - transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_lo, witness_commitments.lookup_mem_rng_chk_lo); - transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_mid, witness_commitments.lookup_mem_rng_chk_mid); - transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_hi, witness_commitments.lookup_mem_rng_chk_hi); - transcript->send_to_verifier(commitment_labels.lookup_pow_2_0, witness_commitments.lookup_pow_2_0); - transcript->send_to_verifier(commitment_labels.lookup_pow_2_1, witness_commitments.lookup_pow_2_1); - transcript->send_to_verifier(commitment_labels.lookup_u8_0, witness_commitments.lookup_u8_0); - transcript->send_to_verifier(commitment_labels.lookup_u8_1, witness_commitments.lookup_u8_1); - transcript->send_to_verifier(commitment_labels.lookup_u16_0, witness_commitments.lookup_u16_0); - transcript->send_to_verifier(commitment_labels.lookup_u16_1, witness_commitments.lookup_u16_1); - transcript->send_to_verifier(commitment_labels.lookup_u16_2, witness_commitments.lookup_u16_2); - transcript->send_to_verifier(commitment_labels.lookup_u16_3, witness_commitments.lookup_u16_3); - transcript->send_to_verifier(commitment_labels.lookup_u16_4, witness_commitments.lookup_u16_4); - transcript->send_to_verifier(commitment_labels.lookup_u16_5, witness_commitments.lookup_u16_5); - transcript->send_to_verifier(commitment_labels.lookup_u16_6, witness_commitments.lookup_u16_6); - transcript->send_to_verifier(commitment_labels.lookup_u16_7, witness_commitments.lookup_u16_7); - transcript->send_to_verifier(commitment_labels.lookup_u16_8, witness_commitments.lookup_u16_8); - transcript->send_to_verifier(commitment_labels.lookup_u16_9, witness_commitments.lookup_u16_9); - transcript->send_to_verifier(commitment_labels.lookup_u16_10, witness_commitments.lookup_u16_10); - transcript->send_to_verifier(commitment_labels.lookup_u16_11, witness_commitments.lookup_u16_11); - transcript->send_to_verifier(commitment_labels.lookup_u16_12, witness_commitments.lookup_u16_12); - transcript->send_to_verifier(commitment_labels.lookup_u16_13, witness_commitments.lookup_u16_13); - transcript->send_to_verifier(commitment_labels.lookup_u16_14, witness_commitments.lookup_u16_14); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_0, witness_commitments.lookup_div_u16_0); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_1, witness_commitments.lookup_div_u16_1); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_2, witness_commitments.lookup_div_u16_2); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_3, witness_commitments.lookup_div_u16_3); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_4, witness_commitments.lookup_div_u16_4); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_5, witness_commitments.lookup_div_u16_5); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_6, witness_commitments.lookup_div_u16_6); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_7, witness_commitments.lookup_div_u16_7); ->>>>>>> 09f5db990d (7211: PIL relations for calldatacopy slice memory gadget) } /** From 820993216859293d4caf847397b1fc217d95e16c Mon Sep 17 00:00:00 2001 From: jeanmon Date: Mon, 8 Jul 2024 09:59:12 +0000 Subject: [PATCH 08/12] 7381: add returndata public column --- barretenberg/cpp/pil/avm/main.pil | 1 + .../relations/generated/avm/declare_views.hpp | 1 + .../vm/avm_trace/avm_execution.cpp | 17 +- .../barretenberg/vm/avm_trace/avm_helper.cpp | 16 +- .../barretenberg/vm/avm_trace/avm_helper.hpp | 10 +- .../barretenberg/vm/avm_trace/avm_trace.cpp | 14 +- .../barretenberg/vm/avm_trace/avm_trace.hpp | 1 + .../vm/generated/avm_circuit_builder.cpp | 2 + .../vm/generated/avm_circuit_builder.hpp | 420 +++++- .../barretenberg/vm/generated/avm_flavor.hpp | 1238 ++++++++++++++++- .../vm/generated/avm_verifier.cpp | 4 + .../vm/tests/avm_arithmetic.test.cpp | 39 +- .../vm/tests/avm_bitwise.test.cpp | 10 +- .../barretenberg/vm/tests/avm_cast.test.cpp | 2 +- .../vm/tests/avm_control_flow.test.cpp | 2 +- .../vm/tests/avm_execution.test.cpp | 26 +- .../vm/tests/avm_indirect_mem.test.cpp | 2 +- .../vm/tests/avm_mem_opcodes.test.cpp | 2 +- .../barretenberg/vm/tests/avm_memory.test.cpp | 2 +- .../barretenberg/vm/tests/avm_slice.test.cpp | 4 +- .../barretenberg/vm/tests/helpers.test.cpp | 7 +- .../barretenberg/vm/tests/helpers.test.hpp | 1 + 22 files changed, 1755 insertions(+), 66 deletions(-) diff --git a/barretenberg/cpp/pil/avm/main.pil b/barretenberg/cpp/pil/avm/main.pil index 353fedab47f..c2c025f5609 100644 --- a/barretenberg/cpp/pil/avm/main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -22,6 +22,7 @@ namespace main(256); //===== PUBLIC COLUMNS========================================================= pol public calldata; pol commit sel_calldata; // Selector used for lookup in calldata. TODO: Might be removed or made constant. + pol public returndata; //===== KERNEL INPUTS ========================================================= // Kernel lookup selector opcodes diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp index 7dedfa78eaa..9719b9d1f46 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -10,6 +10,7 @@ [[maybe_unused]] auto kernel_kernel_side_effect_out = View(new_term.kernel_kernel_side_effect_out); \ [[maybe_unused]] auto kernel_kernel_metadata_out = View(new_term.kernel_kernel_metadata_out); \ [[maybe_unused]] auto main_calldata = View(new_term.main_calldata); \ + [[maybe_unused]] auto main_returndata = View(new_term.main_returndata); \ [[maybe_unused]] auto alu_a_hi = View(new_term.alu_a_hi); \ [[maybe_unused]] auto alu_a_lo = View(new_term.alu_a_lo); \ [[maybe_unused]] auto alu_b_hi = View(new_term.alu_b_hi); \ diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp index 8ba8765aa5c..44b58039567 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp @@ -78,10 +78,12 @@ std::tuple Execution::prove(std::vector public_inputs_vec; std::vector calldata; + std::vector returndata; std::vector raw_proof; // This can be made nicer using BB's serialize::read, probably. const auto public_inputs_offset = proof.begin(); const auto calldata_size_offset = public_inputs_offset + PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH; const auto calldata_offset = calldata_size_offset + 1; - const auto raw_proof_offset = calldata_offset + static_cast(uint64_t(*calldata_size_offset)); + const auto returndata_size_offset = calldata_offset + static_cast(uint64_t(*calldata_size_offset)); + const auto returndata_offset = returndata_size_offset + 1; + const auto raw_proof_offset = returndata_offset + static_cast(uint64_t(*returndata_size_offset)); std::copy(public_inputs_offset, calldata_size_offset, std::back_inserter(public_inputs_vec)); - std::copy(calldata_offset, raw_proof_offset, std::back_inserter(calldata)); + std::copy(calldata_offset, returndata_size_offset, std::back_inserter(calldata)); + std::copy(returndata_offset, raw_proof_offset, std::back_inserter(returndata)); std::copy(raw_proof_offset, proof.end(), std::back_inserter(raw_proof)); VmPublicInputs public_inputs = convert_public_inputs(public_inputs_vec); - std::vector> public_inputs_columns = copy_public_inputs_columns(public_inputs, calldata); + std::vector> public_inputs_columns = + copy_public_inputs_columns(public_inputs, calldata, returndata); return verifier.verify_proof(raw_proof, public_inputs_columns); } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp index 99c3d10cac4..bd39e41442b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp @@ -136,7 +136,8 @@ bool is_operand_indirect(uint8_t ind_value, uint8_t operand_idx) } std::vector> copy_public_inputs_columns(VmPublicInputs const& public_inputs, - std::vector const& calldata) + std::vector const& calldata, + std::vector const& returndata) { // We convert to a vector as the pil generated verifier is generic and unaware of the KERNEL_INPUTS_LENGTH // For each of the public input vectors @@ -155,11 +156,14 @@ std::vector> copy_public_inputs_columns(VmPublicInputs const& pu assert(public_inputs_kernel_side_effect_outputs.size() == KERNEL_OUTPUTS_LENGTH); assert(public_inputs_kernel_metadata_outputs.size() == KERNEL_OUTPUTS_LENGTH); - return { std::move(public_inputs_kernel_inputs), - std::move(public_inputs_kernel_value_outputs), - std::move(public_inputs_kernel_side_effect_outputs), - std::move(public_inputs_kernel_metadata_outputs), - calldata }; + return { + std::move(public_inputs_kernel_inputs), + std::move(public_inputs_kernel_value_outputs), + std::move(public_inputs_kernel_side_effect_outputs), + std::move(public_inputs_kernel_metadata_outputs), + calldata, + returndata, + }; } } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.hpp index d982ee258a9..aadc0dba117 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.hpp @@ -13,10 +13,12 @@ void dump_trace_as_csv(const std::vector& trace, const std::filesystem::pat bool is_operand_indirect(uint8_t ind_value, uint8_t operand_idx); // Copy Public Input Columns -// There are 4 public input columns, one for inputs, and 3 for the kernel outputs {value, side effect counter, metadata} -// The verifier is generic, and so accepts vectors of these values rather than the fixed length arrays that are used -// during circuit building. This method copies each array into a vector to be used by the verifier. +// There are 5 public input columns, one for inputs, one for returndata and 3 for the kernel outputs +// {value, side effect counter, metadata}. The verifier is generic, and so accepts vectors of these values +// rather than the fixed length arrays that are used during circuit building. This method copies each array +// into a vector to be used by the verifier. std::vector> copy_public_inputs_columns(VmPublicInputs const& public_inputs, - std::vector const& calldata); + std::vector const& calldata, + std::vector const& returndata); } // namespace bb::avm_trace \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp index a03ad1ba28a..f483ccb4663 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -2789,7 +2789,6 @@ std::vector AvmTraceBuilder::op_return(uint8_t indirect, uint32_t ret_offset // In indirect mode, ret_offset is first resolved by the first indirect load. uint32_t pos = 0; - std::vector returnMem; uint32_t direct_ret_offset = ret_offset; // Will be overwritten in indirect mode. while (pos < ret_size) { @@ -2821,7 +2820,7 @@ std::vector AvmTraceBuilder::op_return(uint8_t indirect, uint32_t ret_offset tag_match = tag_match && read_a.tag_match; FF ia = read_a.val; - returnMem.push_back(ia); + returndata.push_back(ia); if (ret_size - pos > 1) { mem_op_b = 1; @@ -2832,7 +2831,7 @@ std::vector AvmTraceBuilder::op_return(uint8_t indirect, uint32_t ret_offset call_ptr, clk, IntermRegister::IB, mem_addr_b, AvmMemoryTag::FF, AvmMemoryTag::FF); tag_match = tag_match && read_b.tag_match; ib = read_b.val; - returnMem.push_back(ib); + returndata.push_back(ib); } if (ret_size - pos > 2) { @@ -2844,7 +2843,7 @@ std::vector AvmTraceBuilder::op_return(uint8_t indirect, uint32_t ret_offset call_ptr, clk, IntermRegister::IC, mem_addr_c, AvmMemoryTag::FF, AvmMemoryTag::FF); tag_match = tag_match && read_c.tag_match; ic = read_c.val; - returnMem.push_back(ic); + returndata.push_back(ic); } // Constrain gas cost on the first row @@ -2883,7 +2882,7 @@ std::vector AvmTraceBuilder::op_return(uint8_t indirect, uint32_t ret_offset } } pc = UINT32_MAX; // This ensures that no subsequent opcode will be executed. - return returnMem; + return returndata; } std::vector AvmTraceBuilder::op_revert(uint8_t indirect, uint32_t ret_offset, uint32_t ret_size) @@ -4615,6 +4614,11 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c main_trace.at(cd_offset).lookup_cd_value_counts = count; } + // returndata column inclusion + for (size_t i = 0; i < returndata.size(); i++) { + main_trace.at(i).main_returndata = returndata.at(i); + } + // Get tag_err counts from the mem_trace_builder if (range_check_required) { finalise_mem_trace_lookup_counts(); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp index 376bc7071dc..5ec74970703 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp @@ -189,6 +189,7 @@ class AvmTraceBuilder { AvmSliceTraceBuilder slice_trace_builder; std::vector calldata{}; + std::vector returndata{}; Row create_kernel_lookup_opcode( uint8_t indirect, uint32_t dst_offset, uint32_t selector, FF value, AvmMemoryTag w_tag); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp index edc9470914e..1ceffbfc758 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp @@ -24,6 +24,7 @@ template std::vector AvmFullRow::names() "kernel_kernel_side_effect_out", "kernel_kernel_metadata_out", "main_calldata", + "main_returndata", "alu_a_hi", "alu_a_lo", "alu_b_hi", @@ -432,6 +433,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.kernel_kernel_side_effect_out) // << "," << field_to_string(row.kernel_kernel_metadata_out) // << "," << field_to_string(row.main_calldata) // + << "," << field_to_string(row.main_returndata) // << "," << field_to_string(row.alu_a_hi) // << "," << field_to_string(row.alu_a_lo) // << "," << field_to_string(row.alu_b_hi) // diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index b30ff790970..db13e65d442 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -19,6 +19,421 @@ namespace bb { +<<<<<<< HEAD +======= +template struct AvmFullRow { + FF main_clk{}; + FF main_sel_first{}; + FF kernel_kernel_inputs{}; + FF kernel_kernel_value_out{}; + FF kernel_kernel_side_effect_out{}; + FF kernel_kernel_metadata_out{}; + FF main_calldata{}; + FF main_returndata{}; + FF alu_a_hi{}; + FF alu_a_lo{}; + FF alu_b_hi{}; + FF alu_b_lo{}; + FF alu_borrow{}; + FF alu_cf{}; + FF alu_clk{}; + FF alu_cmp_rng_ctr{}; + FF alu_div_u16_r0{}; + FF alu_div_u16_r1{}; + FF alu_div_u16_r2{}; + FF alu_div_u16_r3{}; + FF alu_div_u16_r4{}; + FF alu_div_u16_r5{}; + FF alu_div_u16_r6{}; + FF alu_div_u16_r7{}; + FF alu_divisor_hi{}; + FF alu_divisor_lo{}; + FF alu_ff_tag{}; + FF alu_ia{}; + FF alu_ib{}; + FF alu_ic{}; + FF alu_in_tag{}; + FF alu_op_add{}; + FF alu_op_cast{}; + FF alu_op_cast_prev{}; + FF alu_op_div{}; + FF alu_op_div_a_lt_b{}; + FF alu_op_div_std{}; + FF alu_op_eq{}; + FF alu_op_eq_diff_inv{}; + FF alu_op_lt{}; + FF alu_op_lte{}; + FF alu_op_mul{}; + FF alu_op_not{}; + FF alu_op_shl{}; + FF alu_op_shr{}; + FF alu_op_sub{}; + FF alu_p_a_borrow{}; + FF alu_p_b_borrow{}; + FF alu_p_sub_a_hi{}; + FF alu_p_sub_a_lo{}; + FF alu_p_sub_b_hi{}; + FF alu_p_sub_b_lo{}; + FF alu_partial_prod_hi{}; + FF alu_partial_prod_lo{}; + FF alu_quotient_hi{}; + FF alu_quotient_lo{}; + FF alu_remainder{}; + FF alu_res_hi{}; + FF alu_res_lo{}; + FF alu_sel_alu{}; + FF alu_sel_cmp{}; + FF alu_sel_div_rng_chk{}; + FF alu_sel_rng_chk{}; + FF alu_sel_rng_chk_lookup{}; + FF alu_sel_shift_which{}; + FF alu_shift_lt_bit_len{}; + FF alu_t_sub_s_bits{}; + FF alu_two_pow_s{}; + FF alu_two_pow_t_sub_s{}; + FF alu_u128_tag{}; + FF alu_u16_r0{}; + FF alu_u16_r1{}; + FF alu_u16_r10{}; + FF alu_u16_r11{}; + FF alu_u16_r12{}; + FF alu_u16_r13{}; + FF alu_u16_r14{}; + FF alu_u16_r2{}; + FF alu_u16_r3{}; + FF alu_u16_r4{}; + FF alu_u16_r5{}; + FF alu_u16_r6{}; + FF alu_u16_r7{}; + FF alu_u16_r8{}; + FF alu_u16_r9{}; + FF alu_u16_tag{}; + FF alu_u32_tag{}; + FF alu_u64_tag{}; + FF alu_u8_r0{}; + FF alu_u8_r1{}; + FF alu_u8_tag{}; + FF binary_acc_ia{}; + FF binary_acc_ib{}; + FF binary_acc_ic{}; + FF binary_clk{}; + FF binary_ia_bytes{}; + FF binary_ib_bytes{}; + FF binary_ic_bytes{}; + FF binary_in_tag{}; + FF binary_mem_tag_ctr{}; + FF binary_mem_tag_ctr_inv{}; + FF binary_op_id{}; + FF binary_sel_bin{}; + FF binary_start{}; + FF byte_lookup_sel_bin{}; + FF byte_lookup_table_byte_lengths{}; + FF byte_lookup_table_in_tags{}; + FF byte_lookup_table_input_a{}; + FF byte_lookup_table_input_b{}; + FF byte_lookup_table_op_id{}; + FF byte_lookup_table_output{}; + FF conversion_clk{}; + FF conversion_input{}; + FF conversion_num_limbs{}; + FF conversion_radix{}; + FF conversion_sel_to_radix_le{}; + FF gas_da_gas_fixed_table{}; + FF gas_l2_gas_fixed_table{}; + FF gas_sel_gas_cost{}; + FF keccakf1600_clk{}; + FF keccakf1600_input{}; + FF keccakf1600_output{}; + FF keccakf1600_sel_keccakf1600{}; + FF kernel_emit_l2_to_l1_msg_write_offset{}; + FF kernel_emit_note_hash_write_offset{}; + FF kernel_emit_nullifier_write_offset{}; + FF kernel_emit_unencrypted_log_write_offset{}; + FF kernel_kernel_in_offset{}; + FF kernel_kernel_out_offset{}; + FF kernel_l1_to_l2_msg_exists_write_offset{}; + FF kernel_note_hash_exist_write_offset{}; + FF kernel_nullifier_exists_write_offset{}; + FF kernel_nullifier_non_exists_write_offset{}; + FF kernel_q_public_input_kernel_add_to_table{}; + FF kernel_q_public_input_kernel_out_add_to_table{}; + FF kernel_side_effect_counter{}; + FF kernel_sload_write_offset{}; + FF kernel_sstore_write_offset{}; + FF main_abs_da_rem_gas_hi{}; + FF main_abs_da_rem_gas_lo{}; + FF main_abs_l2_rem_gas_hi{}; + FF main_abs_l2_rem_gas_lo{}; + FF main_alu_in_tag{}; + FF main_bin_op_id{}; + FF main_call_ptr{}; + FF main_da_gas_op_cost{}; + FF main_da_gas_remaining{}; + FF main_da_out_of_gas{}; + FF main_ia{}; + FF main_ib{}; + FF main_ic{}; + FF main_id{}; + FF main_id_zero{}; + FF main_ind_addr_a{}; + FF main_ind_addr_b{}; + FF main_ind_addr_c{}; + FF main_ind_addr_d{}; + FF main_internal_return_ptr{}; + FF main_inv{}; + FF main_l2_gas_op_cost{}; + FF main_l2_gas_remaining{}; + FF main_l2_out_of_gas{}; + FF main_mem_addr_a{}; + FF main_mem_addr_b{}; + FF main_mem_addr_c{}; + FF main_mem_addr_d{}; + FF main_op_err{}; + FF main_opcode_val{}; + FF main_pc{}; + FF main_r_in_tag{}; + FF main_rwa{}; + FF main_rwb{}; + FF main_rwc{}; + FF main_rwd{}; + FF main_sel_alu{}; + FF main_sel_bin{}; + FF main_sel_calldata{}; + FF main_sel_cd_cpy_gadget{}; + FF main_sel_gas_accounting_active{}; + FF main_sel_last{}; + FF main_sel_mem_op_a{}; + FF main_sel_mem_op_activate_gas{}; + FF main_sel_mem_op_b{}; + FF main_sel_mem_op_c{}; + FF main_sel_mem_op_d{}; + FF main_sel_mov_ia_to_ic{}; + FF main_sel_mov_ib_to_ic{}; + FF main_sel_op_add{}; + FF main_sel_op_address{}; + FF main_sel_op_and{}; + FF main_sel_op_block_number{}; + 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_coinbase{}; + FF main_sel_op_dagasleft{}; + FF main_sel_op_div{}; + FF main_sel_op_emit_l2_to_l1_msg{}; + FF main_sel_op_emit_note_hash{}; + FF main_sel_op_emit_nullifier{}; + FF main_sel_op_emit_unencrypted_log{}; + FF main_sel_op_eq{}; + FF main_sel_op_external_call{}; + FF main_sel_op_fdiv{}; + FF main_sel_op_fee_per_da_gas{}; + FF main_sel_op_fee_per_l2_gas{}; + FF main_sel_op_function_selector{}; + FF main_sel_op_get_contract_instance{}; + FF main_sel_op_halt{}; + FF main_sel_op_internal_call{}; + FF main_sel_op_internal_return{}; + FF main_sel_op_jump{}; + FF main_sel_op_jumpi{}; + FF main_sel_op_keccak{}; + FF main_sel_op_l1_to_l2_msg_exists{}; + FF main_sel_op_l2gasleft{}; + FF main_sel_op_lt{}; + FF main_sel_op_lte{}; + FF main_sel_op_mov{}; + FF main_sel_op_mul{}; + FF main_sel_op_not{}; + FF main_sel_op_note_hash_exists{}; + FF main_sel_op_nullifier_exists{}; + FF main_sel_op_or{}; + FF main_sel_op_pedersen{}; + FF main_sel_op_poseidon2{}; + FF main_sel_op_radix_le{}; + FF main_sel_op_sender{}; + FF main_sel_op_sha256{}; + FF main_sel_op_shl{}; + FF main_sel_op_shr{}; + FF main_sel_op_sload{}; + FF main_sel_op_sstore{}; + FF main_sel_op_storage_address{}; + FF main_sel_op_sub{}; + FF main_sel_op_timestamp{}; + FF main_sel_op_transaction_fee{}; + FF main_sel_op_version{}; + FF main_sel_op_xor{}; + FF main_sel_q_kernel_lookup{}; + FF main_sel_q_kernel_output_lookup{}; + FF main_sel_resolve_ind_addr_a{}; + FF main_sel_resolve_ind_addr_b{}; + FF main_sel_resolve_ind_addr_c{}; + FF main_sel_resolve_ind_addr_d{}; + FF main_sel_rng_16{}; + FF main_sel_rng_8{}; + FF main_space_id{}; + FF main_tag_err{}; + FF main_w_in_tag{}; + FF mem_addr{}; + FF mem_clk{}; + FF mem_diff_hi{}; + FF mem_diff_lo{}; + FF mem_diff_mid{}; + FF mem_glob_addr{}; + FF mem_last{}; + FF mem_lastAccess{}; + FF mem_one_min_inv{}; + FF mem_r_in_tag{}; + FF mem_rw{}; + FF mem_sel_mem{}; + FF mem_sel_mov_ia_to_ic{}; + FF mem_sel_mov_ib_to_ic{}; + FF mem_sel_op_a{}; + FF mem_sel_op_b{}; + FF mem_sel_op_c{}; + FF mem_sel_op_cd_cpy{}; + FF mem_sel_op_cmov{}; + FF mem_sel_op_d{}; + FF mem_sel_resolve_ind_addr_a{}; + FF mem_sel_resolve_ind_addr_b{}; + FF mem_sel_resolve_ind_addr_c{}; + FF mem_sel_resolve_ind_addr_d{}; + FF mem_sel_rng_chk{}; + FF mem_skip_check_tag{}; + FF mem_space_id{}; + FF mem_tag{}; + FF mem_tag_err{}; + FF mem_tsp{}; + FF mem_val{}; + FF mem_w_in_tag{}; + FF pedersen_clk{}; + FF pedersen_input{}; + FF pedersen_output{}; + FF pedersen_sel_pedersen{}; + FF poseidon2_clk{}; + FF poseidon2_input{}; + FF poseidon2_output{}; + FF poseidon2_sel_poseidon_perm{}; + FF powers_power_of_2{}; + FF sha256_clk{}; + FF sha256_input{}; + FF sha256_output{}; + FF sha256_sel_sha256_compression{}; + FF sha256_state{}; + FF slice_addr{}; + FF slice_cd_offset{}; + FF slice_clk{}; + FF slice_cnt{}; + FF slice_one_min_inv{}; + FF slice_sel_cd_cpy{}; + FF slice_sel_start_cd_cpy{}; + FF slice_space_id{}; + FF slice_val{}; + FF perm_cd_mem{}; + FF perm_main_alu{}; + FF perm_main_bin{}; + FF perm_main_conv{}; + FF perm_main_pos2_perm{}; + FF perm_main_pedersen{}; + FF perm_main_cd_copy{}; + FF perm_main_mem_a{}; + FF perm_main_mem_b{}; + FF perm_main_mem_c{}; + FF perm_main_mem_d{}; + FF perm_main_mem_ind_addr_a{}; + FF perm_main_mem_ind_addr_b{}; + FF perm_main_mem_ind_addr_c{}; + FF perm_main_mem_ind_addr_d{}; + FF lookup_byte_lengths{}; + FF lookup_byte_operations{}; + FF lookup_cd_value{}; + FF lookup_opcode_gas{}; + FF range_check_l2_gas_hi{}; + FF range_check_l2_gas_lo{}; + FF range_check_da_gas_hi{}; + FF range_check_da_gas_lo{}; + FF kernel_output_lookup{}; + FF lookup_into_kernel{}; + FF incl_main_tag_err{}; + FF incl_mem_tag_err{}; + FF lookup_mem_rng_chk_lo{}; + FF lookup_mem_rng_chk_mid{}; + FF lookup_mem_rng_chk_hi{}; + FF lookup_pow_2_0{}; + FF lookup_pow_2_1{}; + FF lookup_u8_0{}; + FF lookup_u8_1{}; + FF lookup_u16_0{}; + FF lookup_u16_1{}; + FF lookup_u16_2{}; + FF lookup_u16_3{}; + FF lookup_u16_4{}; + FF lookup_u16_5{}; + FF lookup_u16_6{}; + FF lookup_u16_7{}; + FF lookup_u16_8{}; + FF lookup_u16_9{}; + FF lookup_u16_10{}; + FF lookup_u16_11{}; + FF lookup_u16_12{}; + FF lookup_u16_13{}; + FF lookup_u16_14{}; + FF lookup_div_u16_0{}; + FF lookup_div_u16_1{}; + FF lookup_div_u16_2{}; + FF lookup_div_u16_3{}; + FF lookup_div_u16_4{}; + FF lookup_div_u16_5{}; + FF lookup_div_u16_6{}; + FF lookup_div_u16_7{}; + FF lookup_byte_lengths_counts{}; + FF lookup_byte_operations_counts{}; + FF lookup_cd_value_counts{}; + FF lookup_opcode_gas_counts{}; + FF range_check_l2_gas_hi_counts{}; + FF range_check_l2_gas_lo_counts{}; + FF range_check_da_gas_hi_counts{}; + FF range_check_da_gas_lo_counts{}; + FF kernel_output_lookup_counts{}; + FF lookup_into_kernel_counts{}; + FF incl_main_tag_err_counts{}; + FF incl_mem_tag_err_counts{}; + FF lookup_mem_rng_chk_lo_counts{}; + FF lookup_mem_rng_chk_mid_counts{}; + FF lookup_mem_rng_chk_hi_counts{}; + FF lookup_pow_2_0_counts{}; + FF lookup_pow_2_1_counts{}; + FF lookup_u8_0_counts{}; + FF lookup_u8_1_counts{}; + FF lookup_u16_0_counts{}; + FF lookup_u16_1_counts{}; + FF lookup_u16_2_counts{}; + FF lookup_u16_3_counts{}; + FF lookup_u16_4_counts{}; + FF lookup_u16_5_counts{}; + FF lookup_u16_6_counts{}; + FF lookup_u16_7_counts{}; + FF lookup_u16_8_counts{}; + FF lookup_u16_9_counts{}; + FF lookup_u16_10_counts{}; + FF lookup_u16_11_counts{}; + FF lookup_u16_12_counts{}; + FF lookup_u16_13_counts{}; + FF lookup_u16_14_counts{}; + FF lookup_div_u16_0_counts{}; + FF lookup_div_u16_1_counts{}; + FF lookup_div_u16_2_counts{}; + FF lookup_div_u16_3_counts{}; + FF lookup_div_u16_4_counts{}; + FF lookup_div_u16_5_counts{}; + FF lookup_div_u16_6_counts{}; + FF lookup_div_u16_7_counts{}; + + [[maybe_unused]] static std::vector names(); +}; + +template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); + +>>>>>>> b9f802b1e7 (7381: add returndata public column) class AvmCircuitBuilder { public: using Flavor = bb::AvmFlavor; @@ -29,8 +444,8 @@ class AvmCircuitBuilder { using Polynomial = Flavor::Polynomial; using ProverPolynomials = Flavor::ProverPolynomials; - static constexpr size_t num_fixed_columns = 404; - static constexpr size_t num_polys = 404 + 68; + static constexpr size_t num_fixed_columns = 405; + static constexpr size_t num_polys = 405 + 68; std::vector rows; void set_trace(std::vector&& trace) { rows = std::move(trace); } @@ -53,6 +468,7 @@ class AvmCircuitBuilder { polys.kernel_kernel_side_effect_out[i] = rows[i].kernel_kernel_side_effect_out; polys.kernel_kernel_metadata_out[i] = rows[i].kernel_kernel_metadata_out; polys.main_calldata[i] = rows[i].main_calldata; + polys.main_returndata[i] = rows[i].main_returndata; polys.alu_a_hi[i] = rows[i].alu_a_hi; polys.alu_a_lo[i] = rows[i].alu_a_lo; polys.alu_b_hi[i] = rows[i].alu_b_hi; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index 67bebdf2d51..16a391870f2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -111,11 +111,11 @@ class AvmFlavor { using RelationSeparator = AvmFlavorSettings::RelationSeparator; static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 2; - static constexpr size_t NUM_WITNESS_ENTITIES = 402; + static constexpr size_t NUM_WITNESS_ENTITIES = 403; 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 = 472; + static constexpr size_t NUM_ALL_ENTITIES = 473; using MainRelations = std::tuple< // Relations @@ -232,6 +232,7 @@ class AvmFlavor { kernel_kernel_side_effect_out, kernel_kernel_metadata_out, main_calldata, + main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, @@ -2347,6 +2348,7 @@ class AvmFlavor { Base::kernel_kernel_side_effect_out = "KERNEL_KERNEL_SIDE_EFFECT_OUT"; Base::kernel_kernel_metadata_out = "KERNEL_KERNEL_METADATA_OUT"; Base::main_calldata = "MAIN_CALLDATA"; + Base::main_returndata = "MAIN_RETURNDATA"; Base::alu_a_hi = "ALU_A_HI"; Base::alu_a_lo = "ALU_A_LO"; Base::alu_b_hi = "ALU_B_HI"; @@ -2763,7 +2765,413 @@ class AvmFlavor { public: uint32_t circuit_size; +<<<<<<< HEAD std::array commitments; +======= + Commitment kernel_kernel_inputs; + Commitment kernel_kernel_value_out; + Commitment kernel_kernel_side_effect_out; + Commitment kernel_kernel_metadata_out; + Commitment main_calldata; + Commitment main_returndata; + Commitment alu_a_hi; + Commitment alu_a_lo; + Commitment alu_b_hi; + Commitment alu_b_lo; + Commitment alu_borrow; + Commitment alu_cf; + Commitment alu_clk; + Commitment alu_cmp_rng_ctr; + Commitment alu_div_u16_r0; + Commitment alu_div_u16_r1; + Commitment alu_div_u16_r2; + Commitment alu_div_u16_r3; + Commitment alu_div_u16_r4; + Commitment alu_div_u16_r5; + Commitment alu_div_u16_r6; + Commitment alu_div_u16_r7; + Commitment alu_divisor_hi; + Commitment alu_divisor_lo; + Commitment alu_ff_tag; + Commitment alu_ia; + Commitment alu_ib; + Commitment alu_ic; + Commitment alu_in_tag; + Commitment alu_op_add; + Commitment alu_op_cast; + Commitment alu_op_cast_prev; + Commitment alu_op_div; + Commitment alu_op_div_a_lt_b; + Commitment alu_op_div_std; + Commitment alu_op_eq; + Commitment alu_op_eq_diff_inv; + Commitment alu_op_lt; + Commitment alu_op_lte; + Commitment alu_op_mul; + Commitment alu_op_not; + Commitment alu_op_shl; + Commitment alu_op_shr; + Commitment alu_op_sub; + Commitment alu_p_a_borrow; + Commitment alu_p_b_borrow; + Commitment alu_p_sub_a_hi; + Commitment alu_p_sub_a_lo; + Commitment alu_p_sub_b_hi; + Commitment alu_p_sub_b_lo; + Commitment alu_partial_prod_hi; + Commitment alu_partial_prod_lo; + Commitment alu_quotient_hi; + Commitment alu_quotient_lo; + Commitment alu_remainder; + Commitment alu_res_hi; + Commitment alu_res_lo; + Commitment alu_sel_alu; + Commitment alu_sel_cmp; + Commitment alu_sel_div_rng_chk; + Commitment alu_sel_rng_chk; + Commitment alu_sel_rng_chk_lookup; + Commitment alu_sel_shift_which; + Commitment alu_shift_lt_bit_len; + Commitment alu_t_sub_s_bits; + Commitment alu_two_pow_s; + Commitment alu_two_pow_t_sub_s; + Commitment alu_u128_tag; + Commitment alu_u16_r0; + Commitment alu_u16_r1; + Commitment alu_u16_r10; + Commitment alu_u16_r11; + Commitment alu_u16_r12; + Commitment alu_u16_r13; + Commitment alu_u16_r14; + Commitment alu_u16_r2; + Commitment alu_u16_r3; + Commitment alu_u16_r4; + Commitment alu_u16_r5; + Commitment alu_u16_r6; + Commitment alu_u16_r7; + Commitment alu_u16_r8; + Commitment alu_u16_r9; + Commitment alu_u16_tag; + Commitment alu_u32_tag; + Commitment alu_u64_tag; + Commitment alu_u8_r0; + Commitment alu_u8_r1; + Commitment alu_u8_tag; + Commitment binary_acc_ia; + Commitment binary_acc_ib; + Commitment binary_acc_ic; + Commitment binary_clk; + Commitment binary_ia_bytes; + Commitment binary_ib_bytes; + Commitment binary_ic_bytes; + Commitment binary_in_tag; + Commitment binary_mem_tag_ctr; + Commitment binary_mem_tag_ctr_inv; + Commitment binary_op_id; + Commitment binary_sel_bin; + Commitment binary_start; + Commitment byte_lookup_sel_bin; + Commitment byte_lookup_table_byte_lengths; + Commitment byte_lookup_table_in_tags; + Commitment byte_lookup_table_input_a; + Commitment byte_lookup_table_input_b; + Commitment byte_lookup_table_op_id; + Commitment byte_lookup_table_output; + Commitment conversion_clk; + Commitment conversion_input; + Commitment conversion_num_limbs; + Commitment conversion_radix; + Commitment conversion_sel_to_radix_le; + Commitment gas_da_gas_fixed_table; + Commitment gas_l2_gas_fixed_table; + Commitment gas_sel_gas_cost; + Commitment keccakf1600_clk; + Commitment keccakf1600_input; + Commitment keccakf1600_output; + Commitment keccakf1600_sel_keccakf1600; + Commitment kernel_emit_l2_to_l1_msg_write_offset; + Commitment kernel_emit_note_hash_write_offset; + Commitment kernel_emit_nullifier_write_offset; + Commitment kernel_emit_unencrypted_log_write_offset; + Commitment kernel_kernel_in_offset; + Commitment kernel_kernel_out_offset; + Commitment kernel_l1_to_l2_msg_exists_write_offset; + Commitment kernel_note_hash_exist_write_offset; + Commitment kernel_nullifier_exists_write_offset; + Commitment kernel_nullifier_non_exists_write_offset; + Commitment kernel_q_public_input_kernel_add_to_table; + Commitment kernel_q_public_input_kernel_out_add_to_table; + Commitment kernel_side_effect_counter; + Commitment kernel_sload_write_offset; + Commitment kernel_sstore_write_offset; + Commitment main_abs_da_rem_gas_hi; + Commitment main_abs_da_rem_gas_lo; + Commitment main_abs_l2_rem_gas_hi; + Commitment main_abs_l2_rem_gas_lo; + Commitment main_alu_in_tag; + Commitment main_bin_op_id; + Commitment main_call_ptr; + Commitment main_da_gas_op_cost; + Commitment main_da_gas_remaining; + Commitment main_da_out_of_gas; + Commitment main_ia; + Commitment main_ib; + Commitment main_ic; + Commitment main_id; + Commitment main_id_zero; + Commitment main_ind_addr_a; + Commitment main_ind_addr_b; + Commitment main_ind_addr_c; + Commitment main_ind_addr_d; + Commitment main_internal_return_ptr; + Commitment main_inv; + Commitment main_l2_gas_op_cost; + Commitment main_l2_gas_remaining; + Commitment main_l2_out_of_gas; + Commitment main_mem_addr_a; + Commitment main_mem_addr_b; + Commitment main_mem_addr_c; + Commitment main_mem_addr_d; + Commitment main_op_err; + Commitment main_opcode_val; + Commitment main_pc; + Commitment main_r_in_tag; + Commitment main_rwa; + Commitment main_rwb; + Commitment main_rwc; + Commitment main_rwd; + Commitment main_sel_alu; + Commitment main_sel_bin; + Commitment main_sel_calldata; + Commitment main_sel_cd_cpy_gadget; + Commitment main_sel_gas_accounting_active; + Commitment main_sel_last; + Commitment main_sel_mem_op_a; + Commitment main_sel_mem_op_activate_gas; + Commitment main_sel_mem_op_b; + Commitment main_sel_mem_op_c; + Commitment main_sel_mem_op_d; + Commitment main_sel_mov_ia_to_ic; + Commitment main_sel_mov_ib_to_ic; + Commitment main_sel_op_add; + Commitment main_sel_op_address; + Commitment main_sel_op_and; + Commitment main_sel_op_block_number; + Commitment main_sel_op_calldata_copy; + Commitment main_sel_op_cast; + Commitment main_sel_op_chain_id; + Commitment main_sel_op_cmov; + Commitment main_sel_op_coinbase; + Commitment main_sel_op_dagasleft; + Commitment main_sel_op_div; + Commitment main_sel_op_emit_l2_to_l1_msg; + Commitment main_sel_op_emit_note_hash; + Commitment main_sel_op_emit_nullifier; + Commitment main_sel_op_emit_unencrypted_log; + Commitment main_sel_op_eq; + Commitment main_sel_op_external_call; + Commitment main_sel_op_fdiv; + Commitment main_sel_op_fee_per_da_gas; + Commitment main_sel_op_fee_per_l2_gas; + Commitment main_sel_op_function_selector; + Commitment main_sel_op_get_contract_instance; + Commitment main_sel_op_halt; + Commitment main_sel_op_internal_call; + Commitment main_sel_op_internal_return; + Commitment main_sel_op_jump; + Commitment main_sel_op_jumpi; + Commitment main_sel_op_keccak; + Commitment main_sel_op_l1_to_l2_msg_exists; + Commitment main_sel_op_l2gasleft; + Commitment main_sel_op_lt; + Commitment main_sel_op_lte; + Commitment main_sel_op_mov; + Commitment main_sel_op_mul; + Commitment main_sel_op_not; + Commitment main_sel_op_note_hash_exists; + Commitment main_sel_op_nullifier_exists; + Commitment main_sel_op_or; + Commitment main_sel_op_pedersen; + Commitment main_sel_op_poseidon2; + Commitment main_sel_op_radix_le; + Commitment main_sel_op_sender; + Commitment main_sel_op_sha256; + Commitment main_sel_op_shl; + Commitment main_sel_op_shr; + Commitment main_sel_op_sload; + Commitment main_sel_op_sstore; + Commitment main_sel_op_storage_address; + Commitment main_sel_op_sub; + Commitment main_sel_op_timestamp; + Commitment main_sel_op_transaction_fee; + Commitment main_sel_op_version; + Commitment main_sel_op_xor; + Commitment main_sel_q_kernel_lookup; + Commitment main_sel_q_kernel_output_lookup; + Commitment main_sel_resolve_ind_addr_a; + Commitment main_sel_resolve_ind_addr_b; + Commitment main_sel_resolve_ind_addr_c; + Commitment main_sel_resolve_ind_addr_d; + Commitment main_sel_rng_16; + Commitment main_sel_rng_8; + Commitment main_space_id; + Commitment main_tag_err; + Commitment main_w_in_tag; + Commitment mem_addr; + Commitment mem_clk; + Commitment mem_diff_hi; + Commitment mem_diff_lo; + Commitment mem_diff_mid; + Commitment mem_glob_addr; + Commitment mem_last; + Commitment mem_lastAccess; + Commitment mem_one_min_inv; + Commitment mem_r_in_tag; + Commitment mem_rw; + Commitment mem_sel_mem; + Commitment mem_sel_mov_ia_to_ic; + Commitment mem_sel_mov_ib_to_ic; + Commitment mem_sel_op_a; + Commitment mem_sel_op_b; + Commitment mem_sel_op_c; + Commitment mem_sel_op_cd_cpy; + Commitment mem_sel_op_cmov; + Commitment mem_sel_op_d; + Commitment mem_sel_resolve_ind_addr_a; + Commitment mem_sel_resolve_ind_addr_b; + Commitment mem_sel_resolve_ind_addr_c; + Commitment mem_sel_resolve_ind_addr_d; + Commitment mem_sel_rng_chk; + Commitment mem_skip_check_tag; + Commitment mem_space_id; + Commitment mem_tag; + Commitment mem_tag_err; + Commitment mem_tsp; + Commitment mem_val; + Commitment mem_w_in_tag; + Commitment pedersen_clk; + Commitment pedersen_input; + Commitment pedersen_output; + Commitment pedersen_sel_pedersen; + Commitment poseidon2_clk; + Commitment poseidon2_input; + Commitment poseidon2_output; + Commitment poseidon2_sel_poseidon_perm; + Commitment powers_power_of_2; + Commitment sha256_clk; + Commitment sha256_input; + Commitment sha256_output; + Commitment sha256_sel_sha256_compression; + Commitment sha256_state; + Commitment slice_addr; + Commitment slice_cd_offset; + Commitment slice_clk; + Commitment slice_cnt; + Commitment slice_one_min_inv; + Commitment slice_sel_cd_cpy; + Commitment slice_sel_start_cd_cpy; + Commitment slice_space_id; + Commitment slice_val; + Commitment perm_cd_mem; + Commitment perm_main_alu; + Commitment perm_main_bin; + Commitment perm_main_conv; + Commitment perm_main_pos2_perm; + Commitment perm_main_pedersen; + Commitment perm_main_cd_copy; + Commitment perm_main_mem_a; + Commitment perm_main_mem_b; + Commitment perm_main_mem_c; + Commitment perm_main_mem_d; + Commitment perm_main_mem_ind_addr_a; + Commitment perm_main_mem_ind_addr_b; + Commitment perm_main_mem_ind_addr_c; + Commitment perm_main_mem_ind_addr_d; + Commitment lookup_byte_lengths; + Commitment lookup_byte_operations; + Commitment lookup_cd_value; + Commitment lookup_opcode_gas; + Commitment range_check_l2_gas_hi; + Commitment range_check_l2_gas_lo; + Commitment range_check_da_gas_hi; + Commitment range_check_da_gas_lo; + Commitment kernel_output_lookup; + Commitment lookup_into_kernel; + Commitment incl_main_tag_err; + Commitment incl_mem_tag_err; + Commitment lookup_mem_rng_chk_lo; + Commitment lookup_mem_rng_chk_mid; + Commitment lookup_mem_rng_chk_hi; + Commitment lookup_pow_2_0; + Commitment lookup_pow_2_1; + Commitment lookup_u8_0; + Commitment lookup_u8_1; + Commitment lookup_u16_0; + Commitment lookup_u16_1; + Commitment lookup_u16_2; + Commitment lookup_u16_3; + Commitment lookup_u16_4; + Commitment lookup_u16_5; + Commitment lookup_u16_6; + Commitment lookup_u16_7; + Commitment lookup_u16_8; + Commitment lookup_u16_9; + Commitment lookup_u16_10; + Commitment lookup_u16_11; + Commitment lookup_u16_12; + Commitment lookup_u16_13; + Commitment lookup_u16_14; + Commitment lookup_div_u16_0; + Commitment lookup_div_u16_1; + Commitment lookup_div_u16_2; + Commitment lookup_div_u16_3; + Commitment lookup_div_u16_4; + Commitment lookup_div_u16_5; + Commitment lookup_div_u16_6; + Commitment lookup_div_u16_7; + Commitment lookup_byte_lengths_counts; + Commitment lookup_byte_operations_counts; + Commitment lookup_cd_value_counts; + Commitment lookup_opcode_gas_counts; + Commitment range_check_l2_gas_hi_counts; + Commitment range_check_l2_gas_lo_counts; + Commitment range_check_da_gas_hi_counts; + Commitment range_check_da_gas_lo_counts; + Commitment kernel_output_lookup_counts; + Commitment lookup_into_kernel_counts; + Commitment incl_main_tag_err_counts; + Commitment incl_mem_tag_err_counts; + Commitment lookup_mem_rng_chk_lo_counts; + Commitment lookup_mem_rng_chk_mid_counts; + Commitment lookup_mem_rng_chk_hi_counts; + Commitment lookup_pow_2_0_counts; + Commitment lookup_pow_2_1_counts; + Commitment lookup_u8_0_counts; + Commitment lookup_u8_1_counts; + Commitment lookup_u16_0_counts; + Commitment lookup_u16_1_counts; + Commitment lookup_u16_2_counts; + Commitment lookup_u16_3_counts; + Commitment lookup_u16_4_counts; + Commitment lookup_u16_5_counts; + Commitment lookup_u16_6_counts; + Commitment lookup_u16_7_counts; + Commitment lookup_u16_8_counts; + Commitment lookup_u16_9_counts; + Commitment lookup_u16_10_counts; + Commitment lookup_u16_11_counts; + Commitment lookup_u16_12_counts; + Commitment lookup_u16_13_counts; + Commitment lookup_u16_14_counts; + Commitment lookup_div_u16_0_counts; + Commitment lookup_div_u16_1_counts; + Commitment lookup_div_u16_2_counts; + Commitment lookup_div_u16_3_counts; + Commitment lookup_div_u16_4_counts; + Commitment lookup_div_u16_5_counts; + Commitment lookup_div_u16_6_counts; + Commitment lookup_div_u16_7_counts; +>>>>>>> b9f802b1e7 (7381: add returndata public column) std::vector> sumcheck_univariates; std::array sumcheck_evaluations; @@ -2783,9 +3191,428 @@ class AvmFlavor { circuit_size = deserialize_from_buffer(proof_data, num_frs_read); size_t log_n = numeric::get_msb(circuit_size); +<<<<<<< HEAD for (auto& commitment : commitments) { commitment = deserialize_from_buffer(proof_data, num_frs_read); } +======= + kernel_kernel_inputs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_value_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_side_effect_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_metadata_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_returndata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_cf = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_cmp_rng_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_divisor_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_divisor_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ff_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_cast_prev = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div_a_lt_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div_std = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_eq_diff_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_a_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_b_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_partial_prod_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_partial_prod_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_quotient_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_quotient_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_remainder = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_res_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_res_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_cmp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_div_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_rng_chk_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_sel_shift_which = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_shift_lt_bit_len = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_t_sub_s_bits = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_two_pow_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_two_pow_t_sub_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u128_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u32_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u64_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_mem_tag_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_mem_tag_ctr_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_in_tags = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_input_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_input_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_num_limbs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_radix = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_sel_to_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_da_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_l2_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_sel_gas_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_sel_keccakf1600 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_l2_to_l1_msg_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_note_hash_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_nullifier_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_unencrypted_log_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_in_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_out_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_l1_to_l2_msg_exists_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_note_hash_exist_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_nullifier_exists_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_nullifier_non_exists_write_offset = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_q_public_input_kernel_add_to_table = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_q_public_input_kernel_out_add_to_table = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_side_effect_counter = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_sload_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_sstore_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_da_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_da_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_l2_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_l2_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_bin_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_call_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_gas_op_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_id_zero = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_internal_return_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_gas_op_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_op_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_opcode_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_pc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwa = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwb = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_cd_cpy_gadget = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_gas_accounting_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_activate_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mem_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mov_ia_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mov_ib_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_and = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_block_number = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_calldata_copy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_chain_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_coinbase = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_dagasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_l2_to_l1_msg = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_note_hash = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_nullifier = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_unencrypted_log = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_external_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fdiv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fee_per_da_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fee_per_l2_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_function_selector = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_get_contract_instance = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_halt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_internal_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_internal_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_jump = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_jumpi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_keccak = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_l1_to_l2_msg_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_l2gasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_note_hash_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_nullifier_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_or = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_poseidon2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sender = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sha256 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sload = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sstore = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_storage_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_timestamp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_transaction_fee = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_version = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_xor = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_q_kernel_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_q_kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_glob_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_lastAccess = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_rw = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_mov_ia_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_mov_ib_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_skip_check_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tsp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_sel_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_sel_poseidon_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + powers_power_of_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_sel_sha256_compression = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_state = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_cd_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_cnt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_start_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_cd_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_conv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_pos2_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_cd_copy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_mem_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_byte_operations = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_cd_value = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_opcode_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_l2_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_l2_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_da_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_da_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_into_kernel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + incl_main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + incl_mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_pow_2_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_pow_2_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u8_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u8_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_byte_lengths_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_byte_operations_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_cd_value_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_opcode_gas_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_l2_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_l2_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_da_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + range_check_da_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_output_lookup_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_into_kernel_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + incl_main_tag_err_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + incl_mem_tag_err_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_mid_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_mem_rng_chk_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_pow_2_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_pow_2_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u8_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u8_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_2_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_3_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_4_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_5_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_6_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_7_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_8_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_9_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_10_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_11_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_12_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_13_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_u16_14_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_2_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_3_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_4_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_5_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_6_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_div_u16_7_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + +>>>>>>> b9f802b1e7 (7381: add returndata public column) for (size_t i = 0; i < log_n; ++i) { sumcheck_univariates.emplace_back( deserialize_from_buffer>(Transcript::proof_data, @@ -2808,9 +3635,416 @@ class AvmFlavor { serialize_to_buffer(circuit_size, Transcript::proof_data); +<<<<<<< HEAD for (const auto& commitment : commitments) { serialize_to_buffer(commitment, Transcript::proof_data); } +======= + serialize_to_buffer(kernel_kernel_inputs, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_value_out, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_side_effect_out, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_metadata_out, Transcript::proof_data); + serialize_to_buffer(main_calldata, Transcript::proof_data); + serialize_to_buffer(main_returndata, Transcript::proof_data); + serialize_to_buffer(alu_a_hi, Transcript::proof_data); + serialize_to_buffer(alu_a_lo, Transcript::proof_data); + serialize_to_buffer(alu_b_hi, Transcript::proof_data); + serialize_to_buffer(alu_b_lo, Transcript::proof_data); + serialize_to_buffer(alu_borrow, Transcript::proof_data); + serialize_to_buffer(alu_cf, Transcript::proof_data); + serialize_to_buffer(alu_clk, Transcript::proof_data); + serialize_to_buffer(alu_cmp_rng_ctr, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r0, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r1, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r2, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r3, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r4, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r5, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r6, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r7, Transcript::proof_data); + serialize_to_buffer(alu_divisor_hi, Transcript::proof_data); + serialize_to_buffer(alu_divisor_lo, Transcript::proof_data); + serialize_to_buffer(alu_ff_tag, Transcript::proof_data); + serialize_to_buffer(alu_ia, Transcript::proof_data); + serialize_to_buffer(alu_ib, Transcript::proof_data); + serialize_to_buffer(alu_ic, Transcript::proof_data); + serialize_to_buffer(alu_in_tag, Transcript::proof_data); + serialize_to_buffer(alu_op_add, Transcript::proof_data); + serialize_to_buffer(alu_op_cast, Transcript::proof_data); + serialize_to_buffer(alu_op_cast_prev, Transcript::proof_data); + serialize_to_buffer(alu_op_div, Transcript::proof_data); + serialize_to_buffer(alu_op_div_a_lt_b, Transcript::proof_data); + serialize_to_buffer(alu_op_div_std, Transcript::proof_data); + serialize_to_buffer(alu_op_eq, Transcript::proof_data); + serialize_to_buffer(alu_op_eq_diff_inv, Transcript::proof_data); + serialize_to_buffer(alu_op_lt, Transcript::proof_data); + serialize_to_buffer(alu_op_lte, Transcript::proof_data); + serialize_to_buffer(alu_op_mul, Transcript::proof_data); + serialize_to_buffer(alu_op_not, Transcript::proof_data); + serialize_to_buffer(alu_op_shl, Transcript::proof_data); + serialize_to_buffer(alu_op_shr, Transcript::proof_data); + serialize_to_buffer(alu_op_sub, Transcript::proof_data); + serialize_to_buffer(alu_p_a_borrow, Transcript::proof_data); + serialize_to_buffer(alu_p_b_borrow, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_a_hi, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_a_lo, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_b_hi, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_b_lo, Transcript::proof_data); + serialize_to_buffer(alu_partial_prod_hi, Transcript::proof_data); + serialize_to_buffer(alu_partial_prod_lo, Transcript::proof_data); + serialize_to_buffer(alu_quotient_hi, Transcript::proof_data); + serialize_to_buffer(alu_quotient_lo, Transcript::proof_data); + serialize_to_buffer(alu_remainder, Transcript::proof_data); + serialize_to_buffer(alu_res_hi, Transcript::proof_data); + serialize_to_buffer(alu_res_lo, Transcript::proof_data); + serialize_to_buffer(alu_sel_alu, Transcript::proof_data); + serialize_to_buffer(alu_sel_cmp, Transcript::proof_data); + serialize_to_buffer(alu_sel_div_rng_chk, Transcript::proof_data); + serialize_to_buffer(alu_sel_rng_chk, Transcript::proof_data); + serialize_to_buffer(alu_sel_rng_chk_lookup, Transcript::proof_data); + serialize_to_buffer(alu_sel_shift_which, Transcript::proof_data); + serialize_to_buffer(alu_shift_lt_bit_len, Transcript::proof_data); + serialize_to_buffer(alu_t_sub_s_bits, Transcript::proof_data); + serialize_to_buffer(alu_two_pow_s, Transcript::proof_data); + serialize_to_buffer(alu_two_pow_t_sub_s, Transcript::proof_data); + serialize_to_buffer(alu_u128_tag, Transcript::proof_data); + serialize_to_buffer(alu_u16_r0, Transcript::proof_data); + serialize_to_buffer(alu_u16_r1, Transcript::proof_data); + serialize_to_buffer(alu_u16_r10, Transcript::proof_data); + serialize_to_buffer(alu_u16_r11, Transcript::proof_data); + serialize_to_buffer(alu_u16_r12, Transcript::proof_data); + serialize_to_buffer(alu_u16_r13, Transcript::proof_data); + serialize_to_buffer(alu_u16_r14, Transcript::proof_data); + serialize_to_buffer(alu_u16_r2, Transcript::proof_data); + serialize_to_buffer(alu_u16_r3, Transcript::proof_data); + serialize_to_buffer(alu_u16_r4, Transcript::proof_data); + serialize_to_buffer(alu_u16_r5, Transcript::proof_data); + serialize_to_buffer(alu_u16_r6, Transcript::proof_data); + serialize_to_buffer(alu_u16_r7, Transcript::proof_data); + serialize_to_buffer(alu_u16_r8, Transcript::proof_data); + serialize_to_buffer(alu_u16_r9, Transcript::proof_data); + serialize_to_buffer(alu_u16_tag, Transcript::proof_data); + serialize_to_buffer(alu_u32_tag, Transcript::proof_data); + serialize_to_buffer(alu_u64_tag, Transcript::proof_data); + serialize_to_buffer(alu_u8_r0, Transcript::proof_data); + serialize_to_buffer(alu_u8_r1, Transcript::proof_data); + serialize_to_buffer(alu_u8_tag, Transcript::proof_data); + serialize_to_buffer(binary_acc_ia, Transcript::proof_data); + serialize_to_buffer(binary_acc_ib, Transcript::proof_data); + serialize_to_buffer(binary_acc_ic, Transcript::proof_data); + serialize_to_buffer(binary_clk, Transcript::proof_data); + serialize_to_buffer(binary_ia_bytes, Transcript::proof_data); + serialize_to_buffer(binary_ib_bytes, Transcript::proof_data); + serialize_to_buffer(binary_ic_bytes, Transcript::proof_data); + serialize_to_buffer(binary_in_tag, Transcript::proof_data); + serialize_to_buffer(binary_mem_tag_ctr, Transcript::proof_data); + serialize_to_buffer(binary_mem_tag_ctr_inv, Transcript::proof_data); + serialize_to_buffer(binary_op_id, Transcript::proof_data); + serialize_to_buffer(binary_sel_bin, Transcript::proof_data); + serialize_to_buffer(binary_start, Transcript::proof_data); + serialize_to_buffer(byte_lookup_sel_bin, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_byte_lengths, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_in_tags, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_input_a, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_input_b, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_op_id, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_output, Transcript::proof_data); + serialize_to_buffer(conversion_clk, Transcript::proof_data); + serialize_to_buffer(conversion_input, Transcript::proof_data); + serialize_to_buffer(conversion_num_limbs, Transcript::proof_data); + serialize_to_buffer(conversion_radix, Transcript::proof_data); + serialize_to_buffer(conversion_sel_to_radix_le, Transcript::proof_data); + serialize_to_buffer(gas_da_gas_fixed_table, Transcript::proof_data); + serialize_to_buffer(gas_l2_gas_fixed_table, Transcript::proof_data); + serialize_to_buffer(gas_sel_gas_cost, Transcript::proof_data); + serialize_to_buffer(keccakf1600_clk, Transcript::proof_data); + serialize_to_buffer(keccakf1600_input, Transcript::proof_data); + serialize_to_buffer(keccakf1600_output, Transcript::proof_data); + serialize_to_buffer(keccakf1600_sel_keccakf1600, Transcript::proof_data); + serialize_to_buffer(kernel_emit_l2_to_l1_msg_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_note_hash_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_nullifier_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_unencrypted_log_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_in_offset, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_out_offset, Transcript::proof_data); + serialize_to_buffer(kernel_l1_to_l2_msg_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_note_hash_exist_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_nullifier_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_nullifier_non_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_q_public_input_kernel_add_to_table, Transcript::proof_data); + serialize_to_buffer(kernel_q_public_input_kernel_out_add_to_table, Transcript::proof_data); + serialize_to_buffer(kernel_side_effect_counter, Transcript::proof_data); + serialize_to_buffer(kernel_sload_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_sstore_write_offset, Transcript::proof_data); + serialize_to_buffer(main_abs_da_rem_gas_hi, Transcript::proof_data); + serialize_to_buffer(main_abs_da_rem_gas_lo, Transcript::proof_data); + serialize_to_buffer(main_abs_l2_rem_gas_hi, Transcript::proof_data); + serialize_to_buffer(main_abs_l2_rem_gas_lo, Transcript::proof_data); + serialize_to_buffer(main_alu_in_tag, Transcript::proof_data); + serialize_to_buffer(main_bin_op_id, Transcript::proof_data); + serialize_to_buffer(main_call_ptr, Transcript::proof_data); + serialize_to_buffer(main_da_gas_op_cost, Transcript::proof_data); + serialize_to_buffer(main_da_gas_remaining, Transcript::proof_data); + serialize_to_buffer(main_da_out_of_gas, Transcript::proof_data); + serialize_to_buffer(main_ia, Transcript::proof_data); + serialize_to_buffer(main_ib, Transcript::proof_data); + serialize_to_buffer(main_ic, Transcript::proof_data); + serialize_to_buffer(main_id, Transcript::proof_data); + serialize_to_buffer(main_id_zero, Transcript::proof_data); + serialize_to_buffer(main_ind_addr_a, Transcript::proof_data); + serialize_to_buffer(main_ind_addr_b, Transcript::proof_data); + serialize_to_buffer(main_ind_addr_c, Transcript::proof_data); + serialize_to_buffer(main_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(main_internal_return_ptr, Transcript::proof_data); + serialize_to_buffer(main_inv, Transcript::proof_data); + serialize_to_buffer(main_l2_gas_op_cost, Transcript::proof_data); + serialize_to_buffer(main_l2_gas_remaining, Transcript::proof_data); + serialize_to_buffer(main_l2_out_of_gas, Transcript::proof_data); + serialize_to_buffer(main_mem_addr_a, Transcript::proof_data); + serialize_to_buffer(main_mem_addr_b, Transcript::proof_data); + serialize_to_buffer(main_mem_addr_c, Transcript::proof_data); + serialize_to_buffer(main_mem_addr_d, Transcript::proof_data); + serialize_to_buffer(main_op_err, Transcript::proof_data); + serialize_to_buffer(main_opcode_val, Transcript::proof_data); + serialize_to_buffer(main_pc, Transcript::proof_data); + serialize_to_buffer(main_r_in_tag, Transcript::proof_data); + serialize_to_buffer(main_rwa, Transcript::proof_data); + serialize_to_buffer(main_rwb, Transcript::proof_data); + serialize_to_buffer(main_rwc, Transcript::proof_data); + serialize_to_buffer(main_rwd, Transcript::proof_data); + serialize_to_buffer(main_sel_alu, Transcript::proof_data); + serialize_to_buffer(main_sel_bin, Transcript::proof_data); + serialize_to_buffer(main_sel_calldata, Transcript::proof_data); + serialize_to_buffer(main_sel_cd_cpy_gadget, Transcript::proof_data); + serialize_to_buffer(main_sel_gas_accounting_active, Transcript::proof_data); + serialize_to_buffer(main_sel_last, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_a, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_activate_gas, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_b, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_c, Transcript::proof_data); + serialize_to_buffer(main_sel_mem_op_d, Transcript::proof_data); + serialize_to_buffer(main_sel_mov_ia_to_ic, Transcript::proof_data); + serialize_to_buffer(main_sel_mov_ib_to_ic, Transcript::proof_data); + serialize_to_buffer(main_sel_op_add, Transcript::proof_data); + serialize_to_buffer(main_sel_op_address, Transcript::proof_data); + serialize_to_buffer(main_sel_op_and, Transcript::proof_data); + serialize_to_buffer(main_sel_op_block_number, Transcript::proof_data); + serialize_to_buffer(main_sel_op_calldata_copy, Transcript::proof_data); + serialize_to_buffer(main_sel_op_cast, Transcript::proof_data); + serialize_to_buffer(main_sel_op_chain_id, Transcript::proof_data); + serialize_to_buffer(main_sel_op_cmov, Transcript::proof_data); + serialize_to_buffer(main_sel_op_coinbase, Transcript::proof_data); + serialize_to_buffer(main_sel_op_dagasleft, Transcript::proof_data); + serialize_to_buffer(main_sel_op_div, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_l2_to_l1_msg, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_note_hash, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_nullifier, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_unencrypted_log, Transcript::proof_data); + serialize_to_buffer(main_sel_op_eq, Transcript::proof_data); + serialize_to_buffer(main_sel_op_external_call, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fdiv, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fee_per_da_gas, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fee_per_l2_gas, Transcript::proof_data); + serialize_to_buffer(main_sel_op_function_selector, Transcript::proof_data); + serialize_to_buffer(main_sel_op_get_contract_instance, Transcript::proof_data); + serialize_to_buffer(main_sel_op_halt, Transcript::proof_data); + serialize_to_buffer(main_sel_op_internal_call, Transcript::proof_data); + serialize_to_buffer(main_sel_op_internal_return, Transcript::proof_data); + serialize_to_buffer(main_sel_op_jump, Transcript::proof_data); + serialize_to_buffer(main_sel_op_jumpi, Transcript::proof_data); + serialize_to_buffer(main_sel_op_keccak, Transcript::proof_data); + serialize_to_buffer(main_sel_op_l1_to_l2_msg_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_l2gasleft, Transcript::proof_data); + serialize_to_buffer(main_sel_op_lt, Transcript::proof_data); + serialize_to_buffer(main_sel_op_lte, Transcript::proof_data); + serialize_to_buffer(main_sel_op_mov, Transcript::proof_data); + serialize_to_buffer(main_sel_op_mul, Transcript::proof_data); + serialize_to_buffer(main_sel_op_not, Transcript::proof_data); + serialize_to_buffer(main_sel_op_note_hash_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_nullifier_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_or, Transcript::proof_data); + serialize_to_buffer(main_sel_op_pedersen, Transcript::proof_data); + serialize_to_buffer(main_sel_op_poseidon2, Transcript::proof_data); + serialize_to_buffer(main_sel_op_radix_le, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sender, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sha256, Transcript::proof_data); + serialize_to_buffer(main_sel_op_shl, Transcript::proof_data); + serialize_to_buffer(main_sel_op_shr, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sload, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sstore, Transcript::proof_data); + serialize_to_buffer(main_sel_op_storage_address, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sub, Transcript::proof_data); + serialize_to_buffer(main_sel_op_timestamp, Transcript::proof_data); + serialize_to_buffer(main_sel_op_transaction_fee, Transcript::proof_data); + serialize_to_buffer(main_sel_op_version, Transcript::proof_data); + serialize_to_buffer(main_sel_op_xor, Transcript::proof_data); + serialize_to_buffer(main_sel_q_kernel_lookup, Transcript::proof_data); + serialize_to_buffer(main_sel_q_kernel_output_lookup, Transcript::proof_data); + serialize_to_buffer(main_sel_resolve_ind_addr_a, Transcript::proof_data); + serialize_to_buffer(main_sel_resolve_ind_addr_b, Transcript::proof_data); + serialize_to_buffer(main_sel_resolve_ind_addr_c, Transcript::proof_data); + serialize_to_buffer(main_sel_resolve_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(main_sel_rng_16, Transcript::proof_data); + serialize_to_buffer(main_sel_rng_8, Transcript::proof_data); + serialize_to_buffer(main_space_id, Transcript::proof_data); + serialize_to_buffer(main_tag_err, Transcript::proof_data); + serialize_to_buffer(main_w_in_tag, Transcript::proof_data); + serialize_to_buffer(mem_addr, Transcript::proof_data); + serialize_to_buffer(mem_clk, Transcript::proof_data); + serialize_to_buffer(mem_diff_hi, Transcript::proof_data); + serialize_to_buffer(mem_diff_lo, Transcript::proof_data); + serialize_to_buffer(mem_diff_mid, Transcript::proof_data); + serialize_to_buffer(mem_glob_addr, Transcript::proof_data); + serialize_to_buffer(mem_last, Transcript::proof_data); + serialize_to_buffer(mem_lastAccess, Transcript::proof_data); + serialize_to_buffer(mem_one_min_inv, Transcript::proof_data); + serialize_to_buffer(mem_r_in_tag, Transcript::proof_data); + serialize_to_buffer(mem_rw, Transcript::proof_data); + serialize_to_buffer(mem_sel_mem, Transcript::proof_data); + serialize_to_buffer(mem_sel_mov_ia_to_ic, Transcript::proof_data); + serialize_to_buffer(mem_sel_mov_ib_to_ic, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_a, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_b, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_c, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_cd_cpy, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_cmov, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_d, Transcript::proof_data); + serialize_to_buffer(mem_sel_resolve_ind_addr_a, Transcript::proof_data); + serialize_to_buffer(mem_sel_resolve_ind_addr_b, Transcript::proof_data); + serialize_to_buffer(mem_sel_resolve_ind_addr_c, Transcript::proof_data); + serialize_to_buffer(mem_sel_resolve_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(mem_sel_rng_chk, Transcript::proof_data); + serialize_to_buffer(mem_skip_check_tag, Transcript::proof_data); + serialize_to_buffer(mem_space_id, Transcript::proof_data); + serialize_to_buffer(mem_tag, Transcript::proof_data); + serialize_to_buffer(mem_tag_err, Transcript::proof_data); + serialize_to_buffer(mem_tsp, Transcript::proof_data); + serialize_to_buffer(mem_val, Transcript::proof_data); + serialize_to_buffer(mem_w_in_tag, Transcript::proof_data); + serialize_to_buffer(pedersen_clk, Transcript::proof_data); + serialize_to_buffer(pedersen_input, Transcript::proof_data); + serialize_to_buffer(pedersen_output, Transcript::proof_data); + serialize_to_buffer(pedersen_sel_pedersen, Transcript::proof_data); + serialize_to_buffer(poseidon2_clk, Transcript::proof_data); + serialize_to_buffer(poseidon2_input, Transcript::proof_data); + serialize_to_buffer(poseidon2_output, Transcript::proof_data); + serialize_to_buffer(poseidon2_sel_poseidon_perm, Transcript::proof_data); + serialize_to_buffer(powers_power_of_2, Transcript::proof_data); + serialize_to_buffer(sha256_clk, Transcript::proof_data); + serialize_to_buffer(sha256_input, Transcript::proof_data); + serialize_to_buffer(sha256_output, Transcript::proof_data); + serialize_to_buffer(sha256_sel_sha256_compression, Transcript::proof_data); + serialize_to_buffer(sha256_state, Transcript::proof_data); + serialize_to_buffer(slice_addr, Transcript::proof_data); + serialize_to_buffer(slice_cd_offset, Transcript::proof_data); + serialize_to_buffer(slice_clk, Transcript::proof_data); + serialize_to_buffer(slice_cnt, Transcript::proof_data); + serialize_to_buffer(slice_one_min_inv, Transcript::proof_data); + serialize_to_buffer(slice_sel_cd_cpy, Transcript::proof_data); + serialize_to_buffer(slice_sel_start_cd_cpy, Transcript::proof_data); + serialize_to_buffer(slice_space_id, Transcript::proof_data); + serialize_to_buffer(slice_val, Transcript::proof_data); + serialize_to_buffer(perm_cd_mem, Transcript::proof_data); + serialize_to_buffer(perm_main_alu, Transcript::proof_data); + serialize_to_buffer(perm_main_bin, Transcript::proof_data); + serialize_to_buffer(perm_main_conv, Transcript::proof_data); + serialize_to_buffer(perm_main_pos2_perm, Transcript::proof_data); + serialize_to_buffer(perm_main_pedersen, Transcript::proof_data); + serialize_to_buffer(perm_main_cd_copy, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_a, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_b, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_c, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_d, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_ind_addr_a, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_ind_addr_b, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_ind_addr_c, Transcript::proof_data); + serialize_to_buffer(perm_main_mem_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(lookup_byte_lengths, Transcript::proof_data); + serialize_to_buffer(lookup_byte_operations, Transcript::proof_data); + serialize_to_buffer(lookup_cd_value, Transcript::proof_data); + serialize_to_buffer(lookup_opcode_gas, Transcript::proof_data); + serialize_to_buffer(range_check_l2_gas_hi, Transcript::proof_data); + serialize_to_buffer(range_check_l2_gas_lo, Transcript::proof_data); + serialize_to_buffer(range_check_da_gas_hi, Transcript::proof_data); + serialize_to_buffer(range_check_da_gas_lo, Transcript::proof_data); + serialize_to_buffer(kernel_output_lookup, Transcript::proof_data); + serialize_to_buffer(lookup_into_kernel, Transcript::proof_data); + serialize_to_buffer(incl_main_tag_err, Transcript::proof_data); + serialize_to_buffer(incl_mem_tag_err, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_lo, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_mid, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_hi, Transcript::proof_data); + serialize_to_buffer(lookup_pow_2_0, Transcript::proof_data); + serialize_to_buffer(lookup_pow_2_1, Transcript::proof_data); + serialize_to_buffer(lookup_u8_0, Transcript::proof_data); + serialize_to_buffer(lookup_u8_1, Transcript::proof_data); + serialize_to_buffer(lookup_u16_0, Transcript::proof_data); + serialize_to_buffer(lookup_u16_1, Transcript::proof_data); + serialize_to_buffer(lookup_u16_2, Transcript::proof_data); + serialize_to_buffer(lookup_u16_3, Transcript::proof_data); + serialize_to_buffer(lookup_u16_4, Transcript::proof_data); + serialize_to_buffer(lookup_u16_5, Transcript::proof_data); + serialize_to_buffer(lookup_u16_6, Transcript::proof_data); + serialize_to_buffer(lookup_u16_7, Transcript::proof_data); + serialize_to_buffer(lookup_u16_8, Transcript::proof_data); + serialize_to_buffer(lookup_u16_9, Transcript::proof_data); + serialize_to_buffer(lookup_u16_10, Transcript::proof_data); + serialize_to_buffer(lookup_u16_11, Transcript::proof_data); + serialize_to_buffer(lookup_u16_12, Transcript::proof_data); + serialize_to_buffer(lookup_u16_13, Transcript::proof_data); + serialize_to_buffer(lookup_u16_14, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_0, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_1, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_2, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_3, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_4, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_5, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_6, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_7, Transcript::proof_data); + serialize_to_buffer(lookup_byte_lengths_counts, Transcript::proof_data); + serialize_to_buffer(lookup_byte_operations_counts, Transcript::proof_data); + serialize_to_buffer(lookup_cd_value_counts, Transcript::proof_data); + serialize_to_buffer(lookup_opcode_gas_counts, Transcript::proof_data); + serialize_to_buffer(range_check_l2_gas_hi_counts, Transcript::proof_data); + serialize_to_buffer(range_check_l2_gas_lo_counts, Transcript::proof_data); + serialize_to_buffer(range_check_da_gas_hi_counts, Transcript::proof_data); + serialize_to_buffer(range_check_da_gas_lo_counts, Transcript::proof_data); + serialize_to_buffer(kernel_output_lookup_counts, Transcript::proof_data); + serialize_to_buffer(lookup_into_kernel_counts, Transcript::proof_data); + serialize_to_buffer(incl_main_tag_err_counts, Transcript::proof_data); + serialize_to_buffer(incl_mem_tag_err_counts, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_lo_counts, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_mid_counts, Transcript::proof_data); + serialize_to_buffer(lookup_mem_rng_chk_hi_counts, Transcript::proof_data); + serialize_to_buffer(lookup_pow_2_0_counts, Transcript::proof_data); + serialize_to_buffer(lookup_pow_2_1_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u8_0_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u8_1_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_0_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_1_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_2_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_3_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_4_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_5_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_6_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_7_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_8_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_9_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_10_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_11_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_12_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_13_counts, Transcript::proof_data); + serialize_to_buffer(lookup_u16_14_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_0_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_1_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_2_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_3_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_4_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_5_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_6_counts, Transcript::proof_data); + serialize_to_buffer(lookup_div_u16_7_counts, Transcript::proof_data); + +>>>>>>> b9f802b1e7 (7381: add returndata public column) for (size_t i = 0; i < log_n; ++i) { serialize_to_buffer(sumcheck_univariates[i], Transcript::proof_data); } diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp index 1e9486fe734..d7de8af6662 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp @@ -216,6 +216,10 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vector const returndata = { 37, 4, 11, 0, 41 }; + + validate_trace(std::move(trace), public_inputs, calldata, returndata, true); } // Test on basic subtraction over finite field type. @@ -409,6 +411,7 @@ TEST_F(AvmArithmeticTestsFF, subtraction) EXPECT_EQ(alu_row.alu_cf, FF(0)); EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); + std::vector const returndata = { 8, 9, 17 }; validate_trace(std::move(trace), public_inputs, calldata); } @@ -431,7 +434,8 @@ TEST_F(AvmArithmeticTestsFF, multiplication) EXPECT_EQ(alu_row.alu_cf, FF(0)); EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); - validate_trace(std::move(trace), public_inputs, calldata); + std::vector const returndata = { 5, 100, 20 }; + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Test on multiplication by zero over finite field type. @@ -453,7 +457,8 @@ TEST_F(AvmArithmeticTestsFF, multiplicationByZero) EXPECT_EQ(alu_row.alu_cf, FF(0)); EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); - validate_trace(std::move(trace), public_inputs, calldata); + std::vector const returndata = { 127, 0, 0 }; + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Test on basic division over finite field type. @@ -478,7 +483,8 @@ TEST_F(AvmArithmeticTestsFF, fDivision) EXPECT_EQ(row->main_sel_mem_op_c, FF(1)); EXPECT_EQ(row->main_rwc, FF(1)); - validate_trace(std::move(trace), public_inputs, calldata); + std::vector const returndata = { 15, 315, 0 }; + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Test on division with zero numerator over finite field type. @@ -503,7 +509,8 @@ TEST_F(AvmArithmeticTestsFF, fDivisionNumeratorZero) EXPECT_EQ(row->main_sel_mem_op_c, FF(1)); EXPECT_EQ(row->main_rwc, FF(1)); - validate_trace(std::move(trace), public_inputs, calldata); + std::vector const returndata = { 0, 0, 0 }; + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Test on division by zero over finite field type. @@ -579,7 +586,7 @@ TEST_F(AvmArithmeticTestsFF, mixedOperationsWithError) trace_builder.halt(); auto trace = trace_builder.finalize(); - validate_trace(std::move(trace), public_inputs, calldata, true); + validate_trace(std::move(trace), public_inputs, calldata, {}, true); } // Test of equality on FF elements @@ -587,10 +594,10 @@ TEST_F(AvmArithmeticTestsFF, equality) { // Pick a field-sized number FF elem = FF::modulus - FF(1); - std::vector const calldata = { elem, elem, 1 }; + std::vector const calldata = { elem, elem }; gen_trace_builder(calldata); - trace_builder.op_calldata_copy(0, 0, 3, 0); - trace_builder.op_eq(0, 0, 1, 2, AvmMemoryTag::FF); // Memory Layout [q - 1, q -1, 1,0..] + trace_builder.op_calldata_copy(0, 0, 2, 0); + trace_builder.op_eq(0, 0, 1, 2, AvmMemoryTag::FF); // Memory Layout [q - 1, q - 1, 1, 0..] trace_builder.op_return(0, 0, 3); auto trace = trace_builder.finalize(); @@ -599,17 +606,19 @@ TEST_F(AvmArithmeticTestsFF, equality) EXPECT_EQ(alu_row.alu_ff_tag, FF(1)); EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0)); // Expect 0 as inv of (q-1) - (q-1) - validate_trace(std::move(trace), public_inputs, calldata); + + std::vector const returndata = { elem, elem, 1 }; + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Test correct non-equality of FF elements TEST_F(AvmArithmeticTestsFF, nonEquality) { FF elem = FF::modulus - FF(1); - std::vector const calldata = { elem, elem + FF(1), 0 }; + std::vector const calldata = { elem, elem + FF(1) }; gen_trace_builder(calldata); - trace_builder.op_calldata_copy(0, 0, 3, 0); - trace_builder.op_eq(0, 0, 1, 2, AvmMemoryTag::FF); // Memory Layout [q - 1, q, 1,0..] + trace_builder.op_calldata_copy(0, 0, 2, 0); + trace_builder.op_eq(0, 0, 1, 2, AvmMemoryTag::FF); // Memory Layout [q - 1, q, 0, 0..] trace_builder.op_return(0, 0, 0); auto trace = trace_builder.finalize(); @@ -618,7 +627,9 @@ TEST_F(AvmArithmeticTestsFF, nonEquality) EXPECT_EQ(alu_row.alu_ff_tag, FF(1)); EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(-1).invert()); - validate_trace(std::move(trace), public_inputs, calldata); + + std::vector const returndata = { elem, 0, 0 }; + validate_trace(std::move(trace), public_inputs, calldata, returndata); } TEST_P(AvmArithmeticTestsDiv, division) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp index e70b50106af..55bafff7034 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp @@ -492,7 +492,7 @@ TEST_P(AvmBitwiseTestsAnd, AllAndTest) auto trace = trace_builder.finalize(); common_validate_bit_op(trace, 0, a, b, output, FF(0), FF(1), FF(2), mem_tag); - validate_trace(std::move(trace), public_inputs, {}, true); + validate_trace(std::move(trace), public_inputs, {}, { output }, true); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, AvmBitwiseTestsAnd, @@ -509,7 +509,7 @@ TEST_P(AvmBitwiseTestsOr, AllOrTest) auto trace = trace_builder.finalize(); common_validate_bit_op(trace, 1, a, b, output, FF(0), FF(1), FF(2), mem_tag); - validate_trace(std::move(trace), public_inputs); + validate_trace(std::move(trace), public_inputs, {}, { output }); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, AvmBitwiseTestsOr, @@ -526,7 +526,7 @@ TEST_P(AvmBitwiseTestsXor, AllXorTest) auto trace = trace_builder.finalize(); common_validate_bit_op(trace, 2, a, b, output, FF(0), FF(1), FF(2), mem_tag); - validate_trace(std::move(trace), public_inputs); + validate_trace(std::move(trace), public_inputs, {}, { output }); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, @@ -543,7 +543,7 @@ TEST_P(AvmBitwiseTestsShr, AllShrTest) trace_builder.op_return(0, 2, 1); auto trace = trace_builder.finalize(); common_validate_shift_op(trace, a, b, output, FF(0), FF(1), FF(2), mem_tag, true); - validate_trace(std::move(trace), public_inputs); + validate_trace(std::move(trace), public_inputs, {}, { output }); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, @@ -561,7 +561,7 @@ TEST_P(AvmBitwiseTestsShl, AllShlTest) auto trace = trace_builder.finalize(); common_validate_shift_op(trace, a, b, output, FF(0), FF(1), FF(2), mem_tag, false); - validate_trace(std::move(trace), public_inputs); + validate_trace(std::move(trace), public_inputs, {}, { output }); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp index de12256404a..28055ca5f09 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp @@ -114,7 +114,7 @@ class AvmCastTests : public ::testing::Test { // We still want the ability to enable proving through the environment variable and therefore we do not pass // the boolean variable force_proof to validate_trace second argument. if (force_proof) { - validate_trace(std::move(trace), public_inputs, calldata, true); + validate_trace(std::move(trace), public_inputs, calldata, {}, true); } else { validate_trace(std::move(trace), public_inputs, calldata); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp index f961e542cb4..453d6443233 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp @@ -87,7 +87,7 @@ TEST_F(AvmControlFlowTests, simpleCall) EXPECT_EQ(halt_row->main_pc, FF(CALL_PC)); EXPECT_EQ(halt_row->main_internal_return_ptr, FF(1)); } - validate_trace(std::move(trace), public_inputs, {}, true); + validate_trace(std::move(trace), public_inputs, {}, {}, true); } TEST_F(AvmControlFlowTests, simpleJump) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp index 24829d562f4..98591c27945 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp @@ -100,7 +100,7 @@ TEST_F(AvmExecutionTests, basicAddReturn) ElementsAre(VariantWith(0), VariantWith(0), VariantWith(0))))); auto trace = gen_trace_from_instr(instructions); - validate_trace(std::move(trace), public_inputs, {}, true); + validate_trace(std::move(trace), public_inputs, {}, {}, true); } // Positive test for SET and SUB opcodes @@ -165,7 +165,7 @@ TEST_F(AvmExecutionTests, setAndSubOpcodes) // Find the first row enabling the subtraction selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == 1; }); EXPECT_EQ(row->main_ic, 10000); // 47123 - 37123 = 10000 - validate_trace(std::move(trace), public_inputs, {}, true); + validate_trace(std::move(trace), public_inputs, {}, {}, true); } // Positive test for multiple MUL opcodes @@ -805,7 +805,7 @@ TEST_F(AvmExecutionTests, toRadixLeOpcode) } EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace), public_inputs, { FF::modulus - FF(1) }); + validate_trace(std::move(trace), public_inputs, { FF::modulus - FF(1) }, returndata); } // // Positive test with SHA256COMPRESSION. @@ -873,7 +873,7 @@ TEST_F(AvmExecutionTests, sha256CompressionOpcode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace), public_inputs, calldata); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Positive test with SHA256 @@ -941,7 +941,7 @@ TEST_F(AvmExecutionTests, sha256Opcode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace), public_inputs); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Positive test with POSEIDON2_PERM. @@ -992,7 +992,7 @@ TEST_F(AvmExecutionTests, poseidon2PermutationOpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace), public_inputs, calldata); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Positive test with Keccakf1600. @@ -1066,7 +1066,7 @@ TEST_F(AvmExecutionTests, keccakf1600OpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace), public_inputs); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Positive test with Keccak. @@ -1124,7 +1124,7 @@ TEST_F(AvmExecutionTests, keccakOpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace), public_inputs); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Positive test with Pedersen. @@ -1177,7 +1177,7 @@ TEST_F(AvmExecutionTests, pedersenHashOpCode) EXPECT_EQ(returndata[0], expected_output); - validate_trace(std::move(trace), public_inputs, calldata); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // // Positive test with EmbeddedCurveAdd @@ -1239,7 +1239,7 @@ TEST_F(AvmExecutionTests, embeddedCurveAddOpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace), public_inputs, calldata); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Positive test with MSM @@ -1316,7 +1316,7 @@ TEST_F(AvmExecutionTests, msmOpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace), public_inputs, calldata); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Positive test for Kernel Input opcodes @@ -2229,7 +2229,7 @@ TEST_F(AvmExecutionTests, opCallOpcodes) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); EXPECT_EQ(returndata, std::vector({ 9, 8, 1 })); // The 1 represents the success - validate_trace(std::move(trace), public_inputs, calldata); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } TEST_F(AvmExecutionTests, opGetContractInstanceOpcodes) @@ -2268,7 +2268,7 @@ TEST_F(AvmExecutionTests, opGetContractInstanceOpcodes) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); EXPECT_EQ(returndata, std::vector({ 1, 2, 3, 4, 5, 6 })); // The first one represents true - validate_trace(std::move(trace), public_inputs, calldata); + validate_trace(std::move(trace), public_inputs, calldata, returndata); } // Negative test detecting an invalid opcode byte. TEST_F(AvmExecutionTests, invalidOpcode) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp index 47e82b75102..bf61c566d18 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp @@ -68,7 +68,7 @@ TEST_F(AvmIndirectMemTests, allIndirectAdd) EXPECT_EQ(row->main_sel_mem_op_b, FF(1)); EXPECT_EQ(row->main_sel_mem_op_c, FF(1)); - validate_trace(std::move(trace), public_inputs, {}, true); + validate_trace(std::move(trace), public_inputs, {}, {}, true); } // Testing a subtraction operation with direct input operands a, b, and an indirect diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp index c7c8a21c794..1a6ca8a1380 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp @@ -400,7 +400,7 @@ TEST_F(AvmMemOpcodeTests, indirectMovInvalidAddressTag) MEM_ROW_FIELD_EQ(r_in_tag, static_cast(AvmMemoryTag::U32)), MEM_ROW_FIELD_EQ(sel_resolve_ind_addr_c, 1))); - validate_trace(std::move(trace), public_inputs, {}, true); + validate_trace(std::move(trace), public_inputs, {}, {}, true); } /****************************************************************************** diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp index 05a02bb3862..5708e65c00b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp @@ -77,7 +77,7 @@ TEST_F(AvmMemoryTests, mismatchedTagAddOperation) EXPECT_EQ(row->mem_r_in_tag, FF(static_cast(AvmMemoryTag::U8))); EXPECT_EQ(row->mem_tag, FF(static_cast(AvmMemoryTag::FF))); - validate_trace(std::move(trace), public_inputs, calldata, true); + validate_trace(std::move(trace), public_inputs, calldata, {}, true); } // Testing an equality operation with a mismatched memory tag. diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp index ed8c9a95d84..1813b74792e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp @@ -109,7 +109,7 @@ class AvmSliceTests : public ::testing::Test { SLICE_ROW_FIELD_EQ(sel_start_cd_cpy, 0))); if (proof_verif) { - validate_trace(std::move(trace), public_inputs, calldata, true); + validate_trace(std::move(trace), public_inputs, calldata, {}, true); } else { validate_trace(std::move(trace), public_inputs, calldata); } @@ -315,7 +315,7 @@ TEST_F(AvmSliceNegativeTests, wrongCDValueInCalldataVerifier) trace_builder.op_return(0, 0, 0); trace = trace_builder.finalize(); - validate_trace(std::move(trace), public_inputs, { 2, 3, 4, 5, 7 }, true, true); + validate_trace(std::move(trace), public_inputs, { 2, 3, 4, 5, 7 }, {}, true, true); } TEST_F(AvmSliceNegativeTests, disableMemWriteEntry) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp index 5ffab2c65e2..283d08e7c3e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp @@ -25,18 +25,19 @@ std::vector gen_three_op_params(std::vector opera */ void validate_trace_check_circuit(std::vector&& trace) { - validate_trace(std::move(trace), {}, {}, false); + validate_trace(std::move(trace), {}, {}, {}, false); }; /** * @brief Helper routine which checks the circuit constraints and depending on - * the boolean with_proof value performs a proof generation and verification. + * the boolean with_proof value performs a proof generation and verification. * * @param trace The execution trace */ void validate_trace(std::vector&& trace, VmPublicInputs const& public_inputs, std::vector const& calldata, + std::vector const& returndata, bool with_proof, bool expect_proof_failure) { @@ -52,7 +53,7 @@ void validate_trace(std::vector&& trace, AvmVerifier verifier = composer.create_verifier(circuit_builder); std::vector> public_inputs_as_vec = - bb::avm_trace::copy_public_inputs_columns(public_inputs, calldata); + bb::avm_trace::copy_public_inputs_columns(public_inputs, calldata, returndata); bool verified = verifier.verify_proof(proof, { public_inputs_as_vec }); diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp index dc7982fe6ae..2a64252f9d8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp @@ -32,6 +32,7 @@ void validate_trace_check_circuit(std::vector&& trace); void validate_trace(std::vector&& trace, VmPublicInputs const& public_inputs = {}, std::vector const& calldata = {}, + std::vector const& returndata = {}, bool with_proof = bb::avm_trace::ENABLE_PROVING, bool expect_proof_failure = false); void mutate_ic_in_trace(std::vector& trace, From 29d7fd59a0812c2d78e911c991f3e46a98df0c44 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 10 Jul 2024 10:20:00 +0000 Subject: [PATCH 09/12] 7381: witness generation for RETURN opcode gadget --- .../cpp/pil/avm/gadgets/mem_slice.pil | 62 ++- barretenberg/cpp/pil/avm/main.pil | 15 +- barretenberg/cpp/pil/avm/mem.pil | 21 +- .../relations/generated/avm/declare_views.hpp | 27 +- .../generated/avm/lookup_cd_value.hpp | 4 +- .../generated/avm/lookup_ret_value.hpp | 170 ++++++++ .../relations/generated/avm/main.hpp | 409 ++++++++++-------- .../relations/generated/avm/mem.hpp | 15 +- .../relations/generated/avm/mem_slice.hpp | 71 ++- .../generated/avm/perm_main_cd_copy.hpp | 14 +- .../generated/avm/perm_main_return.hpp | 106 +++++ .../generated/avm/perm_main_slice.hpp | 114 +++++ .../generated/avm/perm_return_mem.hpp | 102 +++++ .../generated/avm/perm_slice_mem.hpp | 106 +++++ .../barretenberg/vm/avm_trace/avm_helper.cpp | 25 +- .../vm/avm_trace/avm_mem_trace.cpp | 35 +- .../vm/avm_trace/avm_mem_trace.hpp | 5 +- .../barretenberg/vm/avm_trace/avm_trace.cpp | 152 +++---- .../vm/avm_trace/gadgets/avm_slice_trace.cpp | 58 ++- .../vm/avm_trace/gadgets/avm_slice_trace.hpp | 36 +- .../vm/generated/avm_circuit_builder.cpp | 36 +- .../vm/generated/avm_circuit_builder.hpp | 58 ++- .../barretenberg/vm/generated/avm_flavor.hpp | 314 ++++++++++++-- .../barretenberg/vm/generated/avm_prover.cpp | 125 ++++++ .../vm/generated/avm_verifier.cpp | 8 +- .../barretenberg/vm/tests/avm_slice.test.cpp | 41 +- 26 files changed, 1636 insertions(+), 493 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_ret_value.hpp create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_return.hpp create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_slice.hpp create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_return_mem.hpp create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_slice_mem.hpp diff --git a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil index 463e9815fc7..2c85484d0ed 100644 --- a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil +++ b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil @@ -4,36 +4,64 @@ namespace slice(256); pol commit clk; - pol commit sel_start_cd_cpy; // Selector to indicate the start of calldatacopy. Used in permutation with the main trace. + pol commit sel_start; // Selector to indicate the start of calldatacopy/return. Used in permutation with the main trace. pol commit sel_cd_cpy; // Selector for any row involved in a callatacopy operation. + pol commit sel_return; // Selector for any row involved in a return operation. + pol commit sel_mem_active; // Selector for any row involved in a memory operation pol commit cnt; // Decreasing counter to track the number of memory operations. pol commit space_id; // Copied from main trace. pol commit addr; // Address pertaining to the memory operation. pol commit val; // Value pertaining to the memory operation. - pol commit cd_offset; // Offset of the calldata element. It is used to get the correct value from calldata. + pol commit col_offset; // Offset of the public column element. It is used to get the correct value from calldata/returndata. pol commit one_min_inv; // Helper column to assert zero/non-zero equality of cnt; - sel_cd_cpy * (1 - sel_cd_cpy) = 0; - // TODO: might not be required - sel_start_cd_cpy * (1 - sel_start_cd_cpy) = 0; + // We use a counter corresponding to the number of memory operations. The counter + // is initialized by copying the size argument from the main trace. The counter column + // is shared for CALLDATACOPY and RETURN opcodes. The counter is decreased until + // it reaches the value zero. Each row with a non-zero counter corresponds to + // a memory operation. The following relations ensure that exactly one operation + // selector sel_cd_cpy/sel_return is activated per row with a non-zero counter and + // that within a given operation the pertaining selector is enabled. (One prevents + // to activate sel_return during a callatacopy operation and vice-versa.) - // Show that cnt != 0 <==> sel_cd_cpy == 1 + sel_mem_active = sel_cd_cpy + sel_return; + + // Instruction decomposition guarantees that sel_cd_cpy and sel_return are mutually exclusive on + // the first row of the calldatcopy/return operation. + + // Show that cnt != 0 <==> sel_mem_active == 1 // one_min_inv == 1 - cnt^(-1) if cnt != 0 else == 0 #[SLICE_CNT_ZERO_TEST1] - cnt * (1 - one_min_inv) - sel_cd_cpy = 0; + cnt * (1 - one_min_inv) - sel_mem_active = 0; #[SLICE_CNT_ZERO_TEST2] - (1 - sel_cd_cpy) * one_min_inv = 0; + (1 - sel_mem_active) * one_min_inv = 0; #[SLICE_CNT_DECREMENT] - sel_cd_cpy * (cnt - 1 - cnt') = 0; + sel_mem_active * (cnt - 1 - cnt') = 0; + #[ADDR_INCREMENT] + sel_mem_active * (addr + 1 - addr') = 0; + #[COL_OFFSET_INCREMENT] + sel_mem_active * (col_offset + 1 - col_offset') = 0; + #[SAME_CLK] + sel_mem_active * (clk - clk') = 0; + #[SAME_SPACE_ID] + sel_mem_active * (space_id - space_id') = 0; + #[SAME_SEL_RETURN] + sel_mem_active * sel_mem_active' * (sel_return - sel_return') = 0; + #[SAME_SEL_CD_CPY] + sel_mem_active * sel_mem_active' * (sel_cd_cpy - sel_cd_cpy') = 0; - #[ADDR_CNT_INCREMENT] - sel_cd_cpy * (addr + 1 - addr') = 0; - #[CD_OFFSET_INCREMENT] - sel_cd_cpy * (cd_offset + 1 - cd_offset') = 0; - #[LOOKUP_CD_VALUE] - sel_cd_cpy {cd_offset, val} in main.sel_calldata {main.clk, main.calldata}; + sel_cd_cpy {col_offset, val} in main.sel_calldata {main.clk, main.calldata}; + + #[PERM_SLICE_MEM] + sel_mem_active {clk, space_id, addr, val, sel_cd_cpy} + is + mem.sel_op_slice {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw}; + + // Caution: sel_op_slice disables the tag check during a read. This is required for the RETURN opcode + // but could have bad consequences if one adds additional "read" operations as part of this gadget. + // In such a case, we have to disable tag check specifically for RETURN opcode. - #[PERM_CD_MEM] - sel_cd_cpy {clk, space_id, addr, val} is mem.sel_op_cd_cpy {mem.clk, mem.space_id, mem.addr, mem.val}; + #[LOOKUP_RET_VALUE] + sel_return {col_offset, val} in main.sel_returndata {main.clk, main.returndata}; \ No newline at end of file diff --git a/barretenberg/cpp/pil/avm/main.pil b/barretenberg/cpp/pil/avm/main.pil index c2c025f5609..c498e242b81 100644 --- a/barretenberg/cpp/pil/avm/main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -23,6 +23,7 @@ namespace main(256); pol public calldata; pol commit sel_calldata; // Selector used for lookup in calldata. TODO: Might be removed or made constant. pol public returndata; + pol commit sel_returndata; // Selector used for lookup in returndata. TODO: Might be removed or made constant. //===== KERNEL INPUTS ========================================================= // Kernel lookup selector opcodes @@ -144,6 +145,7 @@ namespace main(256); //===== Memory Slice Gadget Selectors ========================================= pol commit sel_op_calldata_copy; + pol commit sel_op_external_return; //===== Fix Range Checks Selectors============================================= // We re-use the clk column for the lookup values of 8-bit resp. 16-bit range check. @@ -328,6 +330,7 @@ namespace main(256); sel_op_external_call * (1 - sel_op_external_call) = 0; sel_op_calldata_copy * (1 - sel_op_calldata_copy) = 0; + sel_op_external_return * (1 - sel_op_external_return) = 0; // Might be removed if derived from opcode based on a lookup of constants sel_op_mov * ( 1 - sel_op_mov) = 0; @@ -481,7 +484,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; pol SEL_ALL_MEMORY = sel_op_cmov + sel_op_mov; - pol SEL_ALL_MEM_SLICE = sel_op_calldata_copy; + pol SEL_ALL_MEM_SLICE = sel_op_calldata_copy + sel_op_external_return; pol OPCODE_SELECTORS = sel_op_fdiv + SEL_ALU_ALL + SEL_ALL_BINARY + SEL_ALL_MEMORY + SEL_ALL_GADGET + KERNEL_INPUT_SELECTORS + KERNEL_OUTPUT_SELECTORS + SEL_ALL_LEFTGAS + SEL_ALL_MEM_SLICE; @@ -666,10 +669,10 @@ namespace main(256); KERNEL_OUTPUT_SELECTORS * (kernel.side_effect_counter' - (kernel.side_effect_counter + 1)) = 0; //===== Memory Slice Constraints ============================================ - pol commit sel_cd_cpy_gadget; // Selector to activate the calldatacopy operation in the gadget (#[PERM_MAIN_CD_COPY]). + pol commit sel_slice_gadget; // Selector to activate a slice gadget operation in the gadget (#[PERM_MAIN_SLICE]). // Activate only if tag_err is disabled - sel_cd_cpy_gadget = sel_op_calldata_copy * (1 - tag_err); + sel_slice_gadget = (sel_op_calldata_copy + sel_op_external_return) * (1 - tag_err); //====== Inter-table Constraints ============================================ @@ -739,10 +742,10 @@ namespace main(256); is pedersen.sel_pedersen {pedersen.clk, pedersen.input}; - #[PERM_MAIN_CD_COPY] - sel_cd_cpy_gadget {ia, ib, mem_addr_c} + #[PERM_MAIN_SLICE] + sel_slice_gadget {clk, space_id, ia, ib, mem_addr_c, sel_op_calldata_copy, sel_op_external_return} is - slice.sel_start_cd_cpy {slice.cd_offset, slice.cnt, slice.addr}; + 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} diff --git a/barretenberg/cpp/pil/avm/mem.pil b/barretenberg/cpp/pil/avm/mem.pil index 400723d1529..781d2891add 100644 --- a/barretenberg/cpp/pil/avm/mem.pil +++ b/barretenberg/cpp/pil/avm/mem.pil @@ -32,8 +32,8 @@ namespace mem(256); pol commit sel_resolve_ind_addr_c; pol commit sel_resolve_ind_addr_d; - // Selector for calldata_copy memory operations triggered from memory slice gadget. - pol commit sel_op_cd_cpy; + // 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) // Boolean constraint is performed in main trace. @@ -60,7 +60,7 @@ namespace mem(256); sel_op_b * (1 - sel_op_b) = 0; sel_op_c * (1 - sel_op_c) = 0; sel_op_d * (1 - sel_op_d) = 0; - sel_op_cd_cpy * (1 - sel_op_cd_cpy) = 0; + sel_op_slice * (1 - sel_op_slice) = 0; sel_resolve_ind_addr_a * (1 - sel_resolve_ind_addr_a) = 0; sel_resolve_ind_addr_b * (1 - sel_resolve_ind_addr_b) = 0; sel_resolve_ind_addr_c * (1 - sel_resolve_ind_addr_c) = 0; @@ -72,7 +72,7 @@ namespace mem(256); // Definition of sel_mem sel_mem = sel_op_a + sel_op_b + sel_op_c + sel_op_d + sel_resolve_ind_addr_a + sel_resolve_ind_addr_b + sel_resolve_ind_addr_c + sel_resolve_ind_addr_d - + sel_op_cd_cpy; + + sel_op_slice; // Maximum one memory operation enabled per row sel_mem * (sel_mem - 1) = 0; // TODO: might be infered by the main trace @@ -107,7 +107,8 @@ namespace mem(256); // Calldata_copy memory slice operations will have a sub_clk value of 8 as rw == 1 which is outside of the range of // indirect memory operations. This is crucial as a main trace entry for calldata_copy triggers an indirect memory // load operation for intermediate register c. The write slice memory operations will have the same sub_clk which in - // this particular case is not a problem as all addresses are different. + // this particular case is not a problem as all addresses are different. Similarly return memory slice operations + // will have a sub_clk value of 4. #[TIMESTAMP] tsp = NUM_SUB_CLK * clk + SUB_CLK; @@ -165,9 +166,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 + // Skip check tag enabled for some MOV/CMOV 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)); + 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; // Memory tag consistency check for load operations, i.e., rw == 0. // We want to prove that r_in_tag == tag <==> tag_err == 0 @@ -218,9 +219,9 @@ namespace mem(256); sel_resolve_ind_addr_c * rw = 0; sel_resolve_ind_addr_d * rw = 0; - //====== CALLDATACOPY specific constraints ================================== - sel_op_cd_cpy * (rw - 1) = 0; - sel_op_cd_cpy * (w_in_tag - 6) = 0; // Only write elements of type FF + //====== CALLDATACOPY/RETURN specific constraints ================================== + sel_op_slice * (w_in_tag - 6) = 0; // Only write elements of type FF + sel_op_slice * (r_in_tag - 6) = 0; // Only read elements of type FF //====== MOV/CMOV Opcode Tag Constraint ===================================== // The following constraint ensures that the r_in_tag is set to tag for diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp index 9719b9d1f46..86c0513eeeb 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -186,7 +186,6 @@ [[maybe_unused]] auto main_sel_alu = View(new_term.main_sel_alu); \ [[maybe_unused]] auto main_sel_bin = View(new_term.main_sel_bin); \ [[maybe_unused]] auto main_sel_calldata = View(new_term.main_sel_calldata); \ - [[maybe_unused]] auto main_sel_cd_cpy_gadget = View(new_term.main_sel_cd_cpy_gadget); \ [[maybe_unused]] auto main_sel_gas_accounting_active = View(new_term.main_sel_gas_accounting_active); \ [[maybe_unused]] auto main_sel_last = View(new_term.main_sel_last); \ [[maybe_unused]] auto main_sel_mem_op_a = View(new_term.main_sel_mem_op_a); \ @@ -213,6 +212,7 @@ [[maybe_unused]] auto main_sel_op_emit_unencrypted_log = View(new_term.main_sel_op_emit_unencrypted_log); \ [[maybe_unused]] auto main_sel_op_eq = View(new_term.main_sel_op_eq); \ [[maybe_unused]] auto main_sel_op_external_call = View(new_term.main_sel_op_external_call); \ + [[maybe_unused]] auto main_sel_op_external_return = View(new_term.main_sel_op_external_return); \ [[maybe_unused]] auto main_sel_op_fdiv = View(new_term.main_sel_op_fdiv); \ [[maybe_unused]] auto main_sel_op_fee_per_da_gas = View(new_term.main_sel_op_fee_per_da_gas); \ [[maybe_unused]] auto main_sel_op_fee_per_l2_gas = View(new_term.main_sel_op_fee_per_l2_gas); \ @@ -255,8 +255,10 @@ [[maybe_unused]] auto main_sel_resolve_ind_addr_b = View(new_term.main_sel_resolve_ind_addr_b); \ [[maybe_unused]] auto main_sel_resolve_ind_addr_c = View(new_term.main_sel_resolve_ind_addr_c); \ [[maybe_unused]] auto main_sel_resolve_ind_addr_d = View(new_term.main_sel_resolve_ind_addr_d); \ + [[maybe_unused]] auto main_sel_returndata = View(new_term.main_sel_returndata); \ [[maybe_unused]] auto main_sel_rng_16 = View(new_term.main_sel_rng_16); \ [[maybe_unused]] auto main_sel_rng_8 = View(new_term.main_sel_rng_8); \ + [[maybe_unused]] auto main_sel_slice_gadget = View(new_term.main_sel_slice_gadget); \ [[maybe_unused]] auto main_space_id = View(new_term.main_space_id); \ [[maybe_unused]] auto main_tag_err = View(new_term.main_tag_err); \ [[maybe_unused]] auto main_w_in_tag = View(new_term.main_w_in_tag); \ @@ -277,9 +279,9 @@ [[maybe_unused]] auto mem_sel_op_a = View(new_term.mem_sel_op_a); \ [[maybe_unused]] auto mem_sel_op_b = View(new_term.mem_sel_op_b); \ [[maybe_unused]] auto mem_sel_op_c = View(new_term.mem_sel_op_c); \ - [[maybe_unused]] auto mem_sel_op_cd_cpy = View(new_term.mem_sel_op_cd_cpy); \ [[maybe_unused]] auto mem_sel_op_cmov = View(new_term.mem_sel_op_cmov); \ [[maybe_unused]] auto mem_sel_op_d = View(new_term.mem_sel_op_d); \ + [[maybe_unused]] auto mem_sel_op_slice = View(new_term.mem_sel_op_slice); \ [[maybe_unused]] auto mem_sel_resolve_ind_addr_a = View(new_term.mem_sel_resolve_ind_addr_a); \ [[maybe_unused]] auto mem_sel_resolve_ind_addr_b = View(new_term.mem_sel_resolve_ind_addr_b); \ [[maybe_unused]] auto mem_sel_resolve_ind_addr_c = View(new_term.mem_sel_resolve_ind_addr_c); \ @@ -307,21 +309,23 @@ [[maybe_unused]] auto sha256_sel_sha256_compression = View(new_term.sha256_sel_sha256_compression); \ [[maybe_unused]] auto sha256_state = View(new_term.sha256_state); \ [[maybe_unused]] auto slice_addr = View(new_term.slice_addr); \ - [[maybe_unused]] auto slice_cd_offset = View(new_term.slice_cd_offset); \ [[maybe_unused]] auto slice_clk = View(new_term.slice_clk); \ [[maybe_unused]] auto slice_cnt = View(new_term.slice_cnt); \ + [[maybe_unused]] auto slice_col_offset = View(new_term.slice_col_offset); \ [[maybe_unused]] auto slice_one_min_inv = View(new_term.slice_one_min_inv); \ [[maybe_unused]] auto slice_sel_cd_cpy = View(new_term.slice_sel_cd_cpy); \ - [[maybe_unused]] auto slice_sel_start_cd_cpy = View(new_term.slice_sel_start_cd_cpy); \ + [[maybe_unused]] auto slice_sel_mem_active = View(new_term.slice_sel_mem_active); \ + [[maybe_unused]] auto slice_sel_return = View(new_term.slice_sel_return); \ + [[maybe_unused]] auto slice_sel_start = View(new_term.slice_sel_start); \ [[maybe_unused]] auto slice_space_id = View(new_term.slice_space_id); \ [[maybe_unused]] auto slice_val = View(new_term.slice_val); \ - [[maybe_unused]] auto perm_cd_mem = View(new_term.perm_cd_mem); \ + [[maybe_unused]] auto perm_slice_mem = View(new_term.perm_slice_mem); \ [[maybe_unused]] auto perm_main_alu = View(new_term.perm_main_alu); \ [[maybe_unused]] auto perm_main_bin = View(new_term.perm_main_bin); \ [[maybe_unused]] auto perm_main_conv = View(new_term.perm_main_conv); \ [[maybe_unused]] auto perm_main_pos2_perm = View(new_term.perm_main_pos2_perm); \ [[maybe_unused]] auto perm_main_pedersen = View(new_term.perm_main_pedersen); \ - [[maybe_unused]] auto perm_main_cd_copy = View(new_term.perm_main_cd_copy); \ + [[maybe_unused]] auto perm_main_slice = View(new_term.perm_main_slice); \ [[maybe_unused]] auto perm_main_mem_a = View(new_term.perm_main_mem_a); \ [[maybe_unused]] auto perm_main_mem_b = View(new_term.perm_main_mem_b); \ [[maybe_unused]] auto perm_main_mem_c = View(new_term.perm_main_mem_c); \ @@ -333,6 +337,7 @@ [[maybe_unused]] auto lookup_byte_lengths = View(new_term.lookup_byte_lengths); \ [[maybe_unused]] auto lookup_byte_operations = View(new_term.lookup_byte_operations); \ [[maybe_unused]] auto lookup_cd_value = View(new_term.lookup_cd_value); \ + [[maybe_unused]] auto lookup_ret_value = View(new_term.lookup_ret_value); \ [[maybe_unused]] auto lookup_opcode_gas = View(new_term.lookup_opcode_gas); \ [[maybe_unused]] auto range_check_l2_gas_hi = View(new_term.range_check_l2_gas_hi); \ [[maybe_unused]] auto range_check_l2_gas_lo = View(new_term.range_check_l2_gas_lo); \ @@ -375,6 +380,7 @@ [[maybe_unused]] auto lookup_byte_lengths_counts = View(new_term.lookup_byte_lengths_counts); \ [[maybe_unused]] auto lookup_byte_operations_counts = View(new_term.lookup_byte_operations_counts); \ [[maybe_unused]] auto lookup_cd_value_counts = View(new_term.lookup_cd_value_counts); \ + [[maybe_unused]] auto lookup_ret_value_counts = View(new_term.lookup_ret_value_counts); \ [[maybe_unused]] auto lookup_opcode_gas_counts = View(new_term.lookup_opcode_gas_counts); \ [[maybe_unused]] auto range_check_l2_gas_hi_counts = View(new_term.range_check_l2_gas_hi_counts); \ [[maybe_unused]] auto range_check_l2_gas_lo_counts = View(new_term.range_check_l2_gas_lo_counts); \ @@ -488,5 +494,10 @@ [[maybe_unused]] auto mem_tsp_shift = View(new_term.mem_tsp_shift); \ [[maybe_unused]] auto mem_val_shift = View(new_term.mem_val_shift); \ [[maybe_unused]] auto slice_addr_shift = View(new_term.slice_addr_shift); \ - [[maybe_unused]] auto slice_cd_offset_shift = View(new_term.slice_cd_offset_shift); \ - [[maybe_unused]] auto slice_cnt_shift = View(new_term.slice_cnt_shift); + [[maybe_unused]] auto slice_clk_shift = View(new_term.slice_clk_shift); \ + [[maybe_unused]] auto slice_cnt_shift = View(new_term.slice_cnt_shift); \ + [[maybe_unused]] auto slice_col_offset_shift = View(new_term.slice_col_offset_shift); \ + [[maybe_unused]] auto slice_sel_cd_cpy_shift = View(new_term.slice_sel_cd_cpy_shift); \ + [[maybe_unused]] auto slice_sel_mem_active_shift = View(new_term.slice_sel_mem_active_shift); \ + [[maybe_unused]] auto slice_sel_return_shift = View(new_term.slice_sel_return_shift); \ + [[maybe_unused]] auto slice_space_id_shift = View(new_term.slice_space_id_shift); diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp index a7fb1382dcc..86247444cf0 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_cd_value.hpp @@ -38,7 +38,7 @@ class lookup_cd_value_lookup_settings { in.lookup_cd_value_counts, in.slice_sel_cd_cpy, in.main_sel_calldata, - in.slice_cd_offset, + in.slice_col_offset, in.slice_val, in.main_clk, in.main_calldata); @@ -50,7 +50,7 @@ class lookup_cd_value_lookup_settings { in.lookup_cd_value_counts, in.slice_sel_cd_cpy, in.main_sel_calldata, - in.slice_cd_offset, + in.slice_col_offset, in.slice_val, in.main_clk, in.main_calldata); diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_ret_value.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_ret_value.hpp new file mode 100644 index 00000000000..a671965300d --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_ret_value.hpp @@ -0,0 +1,170 @@ + + +#pragma once + +#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" + +#include +#include + +namespace bb { + +/** + * @brief This class contains an example of how to set LookupSettings classes used by the + * GenericLookupRelationImpl class to specify a scaled lookup + * + * @details To create your own lookup: + * 1) Create a copy of this class and rename it + * 2) Update all the values with the ones needed for your lookup + * 3) Update "DECLARE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS" and "DEFINE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS" to + * include the new settings + * 4) Add the relation with the chosen settings to Relations in the flavor (for example,"` + * using Relations = std::tuple>;)` + * + */ +class lookup_ret_value_lookup_settings { + public: + /** + * @brief The number of read terms (how many lookups we perform) in each row + * + */ + static constexpr size_t READ_TERMS = 1; + /** + * @brief The number of write terms (how many additions to the lookup table we make) in each row + * + */ + static constexpr size_t WRITE_TERMS = 1; + + /** + * @brief The type of READ_TERM used for each read index (basic and scaled) + * + */ + static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; + + /** + * @brief They type of WRITE_TERM used for each write index + * + */ + static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; + + /** + * @brief How many values represent a single lookup object. This value is used by the automatic read term + * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a + * basic tuple + * + */ + static constexpr size_t LOOKUP_TUPLE_SIZE = 2; + + /** + * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed + * + */ + static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; + + /** + * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read + * terms, but will cause compilation error if not defined + * + */ + static constexpr size_t READ_TERM_DEGREE = 0; + + /** + * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write + * term, but will cause compilation error if not defined + * + */ + + static constexpr size_t WRITE_TERM_DEGREE = 0; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. + * Otherwise the value needs to be set to zero. + * + * @details If this is true then the lookup takes place in this row + * + */ + + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) + { + return (in.slice_sel_return == 1 || in.main_sel_returndata == 1); + } + + /** + * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this + * row + * + * @tparam Accumulator Type specified by the lookup relation + * @tparam AllEntities Values/Univariates of all entities row + * @param in Value/Univariate of all entities at row/edge + * @return Accumulator + */ + + template + static inline auto compute_inverse_exists(const AllEntities& in) + { + using View = typename Accumulator::View; + const auto is_operation = View(in.slice_sel_return); + const auto is_table_entry = View(in.main_sel_returndata); + return (is_operation + is_table_entry - is_operation * is_table_entry); + } + + /** + * @brief Get all the entities for the lookup when need to update them + * + * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is + description for the current case: + The entities are returned as a tuple of references in the following order (this is for ): + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up + * - READ_TERMS entities/polynomials that enable individual lookup operations + * - The entity/polynomial that enables adding an entry to the lookup table in this row + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term + (scaled tuple) + * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table + * + * @return All the entities needed for the lookup + */ + + template static inline auto get_const_entities(const AllEntities& in) + { + + return std::forward_as_tuple(in.lookup_ret_value, + in.lookup_ret_value_counts, + in.slice_sel_return, + in.main_sel_returndata, + in.slice_col_offset, + in.slice_val, + in.main_clk, + in.main_returndata); + } + + /** + * @brief Get all the entities for the lookup when we only need to read them + * @details Same as in get_const_entities, but nonconst + * + * @return All the entities needed for the lookup + */ + + template static inline auto get_nonconst_entities(AllEntities& in) + { + + return std::forward_as_tuple(in.lookup_ret_value, + in.lookup_ret_value_counts, + in.slice_sel_return, + in.main_sel_returndata, + in.slice_col_offset, + in.slice_val, + in.main_clk, + in.main_returndata); + } +}; + +template using lookup_ret_value_relation = GenericLookupRelation; +template using lookup_ret_value = GenericLookup; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp index 82289efd5b2..a678bd9386d 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp @@ -56,7 +56,6 @@ template struct MainRow { FF main_rwd{}; FF main_sel_alu{}; FF main_sel_bin{}; - FF main_sel_cd_cpy_gadget{}; FF main_sel_first{}; FF main_sel_gas_accounting_active{}; FF main_sel_mem_op_a{}; @@ -83,6 +82,7 @@ template struct MainRow { FF main_sel_op_emit_unencrypted_log{}; FF main_sel_op_eq{}; FF main_sel_op_external_call{}; + FF main_sel_op_external_return{}; FF main_sel_op_fdiv{}; FF main_sel_op_fee_per_da_gas{}; FF main_sel_op_fee_per_l2_gas{}; @@ -125,6 +125,7 @@ template struct MainRow { FF main_sel_resolve_ind_addr_b{}; FF main_sel_resolve_ind_addr_c{}; FF main_sel_resolve_ind_addr_d{}; + FF main_sel_slice_gadget{}; FF main_space_id{}; FF main_tag_err{}; FF main_w_in_tag{}; @@ -141,99 +142,99 @@ inline std::string get_relation_label_main(int index) return "L2_GAS_INACTIVE"; case 5: return "DA_GAS_INACTIVE"; - case 76: - return "OUTPUT_U8"; case 77: - return "SUBOP_FDIV"; + return "OUTPUT_U8"; case 78: - return "SUBOP_FDIV_ZERO_ERR1"; + return "SUBOP_FDIV"; case 79: - return "SUBOP_FDIV_ZERO_ERR2"; + return "SUBOP_FDIV_ZERO_ERR1"; case 80: - return "SUBOP_FDIV_R_IN_TAG_FF"; + return "SUBOP_FDIV_ZERO_ERR2"; case 81: - return "SUBOP_FDIV_W_IN_TAG_FF"; + return "SUBOP_FDIV_R_IN_TAG_FF"; case 82: - return "SUBOP_ERROR_RELEVANT_OP"; + return "SUBOP_FDIV_W_IN_TAG_FF"; case 83: - return "KERNEL_INPUT_ACTIVE_CHECK"; + return "SUBOP_ERROR_RELEVANT_OP"; case 84: - return "KERNEL_OUTPUT_ACTIVE_CHECK"; + return "KERNEL_INPUT_ACTIVE_CHECK"; case 85: - return "PC_JUMP"; + return "KERNEL_OUTPUT_ACTIVE_CHECK"; case 86: - return "PC_JUMPI"; + return "PC_JUMP"; case 87: + return "PC_JUMPI"; + case 88: return "RETURN_POINTER_INCREMENT"; - case 93: + case 94: return "RETURN_POINTER_DECREMENT"; - case 99: - return "PC_INCREMENT"; case 100: - return "INTERNAL_RETURN_POINTER_CONSISTENCY"; + return "PC_INCREMENT"; case 101: - return "SPACE_ID_INTERNAL"; + return "INTERNAL_RETURN_POINTER_CONSISTENCY"; case 102: - return "SPACE_ID_STANDARD_OPCODES"; + return "SPACE_ID_INTERNAL"; case 103: - return "CMOV_CONDITION_RES_1"; + return "SPACE_ID_STANDARD_OPCODES"; case 104: + return "CMOV_CONDITION_RES_1"; + case 105: return "CMOV_CONDITION_RES_2"; - case 107: - return "MOV_SAME_VALUE_A"; case 108: - return "MOV_SAME_VALUE_B"; + return "MOV_SAME_VALUE_A"; case 109: + return "MOV_SAME_VALUE_B"; + case 110: return "MOV_MAIN_SAME_TAG"; - case 113: - return "L2GASLEFT"; case 114: - return "DAGASLEFT"; + return "L2GASLEFT"; case 115: - return "ADDRESS_KERNEL"; + return "DAGASLEFT"; case 116: - return "STORAGE_ADDRESS_KERNEL"; + return "ADDRESS_KERNEL"; case 117: - return "SENDER_KERNEL"; + return "STORAGE_ADDRESS_KERNEL"; case 118: - return "FUNCTION_SELECTOR_KERNEL"; + return "SENDER_KERNEL"; case 119: - return "FEE_TRANSACTION_FEE_KERNEL"; + return "FUNCTION_SELECTOR_KERNEL"; case 120: - return "CHAIN_ID_KERNEL"; + return "FEE_TRANSACTION_FEE_KERNEL"; case 121: - return "VERSION_KERNEL"; + return "CHAIN_ID_KERNEL"; case 122: - return "BLOCK_NUMBER_KERNEL"; + return "VERSION_KERNEL"; case 123: - return "TIMESTAMP_KERNEL"; + return "BLOCK_NUMBER_KERNEL"; case 124: - return "COINBASE_KERNEL"; + return "TIMESTAMP_KERNEL"; case 125: - return "FEE_DA_GAS_KERNEL"; + return "COINBASE_KERNEL"; case 126: - return "FEE_L2_GAS_KERNEL"; + return "FEE_DA_GAS_KERNEL"; case 127: + return "FEE_L2_GAS_KERNEL"; + case 128: return "NOTE_HASH_KERNEL_OUTPUT"; - case 129: + case 130: return "EMIT_NOTE_HASH_KERNEL_OUTPUT"; - case 131: + case 132: return "NULLIFIER_EXISTS_KERNEL_OUTPUT"; - case 134: + case 135: return "EMIT_NULLIFIER_KERNEL_OUTPUT"; - case 136: + case 137: return "L1_TO_L2_MSG_EXISTS_KERNEL_OUTPUT"; - case 138: + case 139: return "EMIT_UNENCRYPTED_LOG_KERNEL_OUTPUT"; - case 140: + case 141: return "EMIT_L2_TO_L1_MSGS_KERNEL_OUTPUT"; - case 142: + case 143: return "SLOAD_KERNEL_OUTPUT"; - case 144: + case 145: return "SSTORE_KERNEL_OUTPUT"; - case 148: - return "BIN_SEL_1"; case 149: + return "BIN_SEL_1"; + case 150: return "BIN_SEL_2"; } return std::to_string(index); @@ -243,12 +244,12 @@ template class mainImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { - 3, 3, 3, 3, 3, 3, 5, 5, 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, 3, 3, 4, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2 + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { + 3, 3, 3, 3, 3, 3, 5, 5, 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, 3, 3, 4, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2 }; template @@ -681,174 +682,181 @@ template class mainImpl { // Contribution 59 { Avm_DECLARE_VIEWS(59); - auto tmp = (main_sel_op_mov * (-main_sel_op_mov + FF(1))); + auto tmp = (main_sel_op_external_return * (-main_sel_op_external_return + FF(1))); tmp *= scaling_factor; std::get<59>(evals) += tmp; } // Contribution 60 { Avm_DECLARE_VIEWS(60); - auto tmp = (main_sel_op_cmov * (-main_sel_op_cmov + FF(1))); + auto tmp = (main_sel_op_mov * (-main_sel_op_mov + FF(1))); tmp *= scaling_factor; std::get<60>(evals) += tmp; } // Contribution 61 { Avm_DECLARE_VIEWS(61); - auto tmp = (main_op_err * (-main_op_err + FF(1))); + auto tmp = (main_sel_op_cmov * (-main_sel_op_cmov + FF(1))); tmp *= scaling_factor; std::get<61>(evals) += tmp; } // Contribution 62 { Avm_DECLARE_VIEWS(62); - auto tmp = (main_tag_err * (-main_tag_err + FF(1))); + auto tmp = (main_op_err * (-main_op_err + FF(1))); tmp *= scaling_factor; std::get<62>(evals) += tmp; } // Contribution 63 { Avm_DECLARE_VIEWS(63); - auto tmp = (main_id_zero * (-main_id_zero + FF(1))); + auto tmp = (main_tag_err * (-main_tag_err + FF(1))); tmp *= scaling_factor; std::get<63>(evals) += tmp; } // Contribution 64 { Avm_DECLARE_VIEWS(64); - auto tmp = (main_sel_mem_op_a * (-main_sel_mem_op_a + FF(1))); + auto tmp = (main_id_zero * (-main_id_zero + FF(1))); tmp *= scaling_factor; std::get<64>(evals) += tmp; } // Contribution 65 { Avm_DECLARE_VIEWS(65); - auto tmp = (main_sel_mem_op_b * (-main_sel_mem_op_b + FF(1))); + auto tmp = (main_sel_mem_op_a * (-main_sel_mem_op_a + FF(1))); tmp *= scaling_factor; std::get<65>(evals) += tmp; } // Contribution 66 { Avm_DECLARE_VIEWS(66); - auto tmp = (main_sel_mem_op_c * (-main_sel_mem_op_c + FF(1))); + auto tmp = (main_sel_mem_op_b * (-main_sel_mem_op_b + FF(1))); tmp *= scaling_factor; std::get<66>(evals) += tmp; } // Contribution 67 { Avm_DECLARE_VIEWS(67); - auto tmp = (main_sel_mem_op_d * (-main_sel_mem_op_d + FF(1))); + auto tmp = (main_sel_mem_op_c * (-main_sel_mem_op_c + FF(1))); tmp *= scaling_factor; std::get<67>(evals) += tmp; } // Contribution 68 { Avm_DECLARE_VIEWS(68); - auto tmp = (main_rwa * (-main_rwa + FF(1))); + auto tmp = (main_sel_mem_op_d * (-main_sel_mem_op_d + FF(1))); tmp *= scaling_factor; std::get<68>(evals) += tmp; } // Contribution 69 { Avm_DECLARE_VIEWS(69); - auto tmp = (main_rwb * (-main_rwb + FF(1))); + auto tmp = (main_rwa * (-main_rwa + FF(1))); tmp *= scaling_factor; std::get<69>(evals) += tmp; } // Contribution 70 { Avm_DECLARE_VIEWS(70); - auto tmp = (main_rwc * (-main_rwc + FF(1))); + auto tmp = (main_rwb * (-main_rwb + FF(1))); tmp *= scaling_factor; std::get<70>(evals) += tmp; } // Contribution 71 { Avm_DECLARE_VIEWS(71); - auto tmp = (main_rwd * (-main_rwd + FF(1))); + auto tmp = (main_rwc * (-main_rwc + FF(1))); tmp *= scaling_factor; std::get<71>(evals) += tmp; } // Contribution 72 { Avm_DECLARE_VIEWS(72); - auto tmp = (main_sel_resolve_ind_addr_a * (-main_sel_resolve_ind_addr_a + FF(1))); + auto tmp = (main_rwd * (-main_rwd + FF(1))); tmp *= scaling_factor; std::get<72>(evals) += tmp; } // Contribution 73 { Avm_DECLARE_VIEWS(73); - auto tmp = (main_sel_resolve_ind_addr_b * (-main_sel_resolve_ind_addr_b + FF(1))); + auto tmp = (main_sel_resolve_ind_addr_a * (-main_sel_resolve_ind_addr_a + FF(1))); tmp *= scaling_factor; std::get<73>(evals) += tmp; } // Contribution 74 { Avm_DECLARE_VIEWS(74); - auto tmp = (main_sel_resolve_ind_addr_c * (-main_sel_resolve_ind_addr_c + FF(1))); + auto tmp = (main_sel_resolve_ind_addr_b * (-main_sel_resolve_ind_addr_b + FF(1))); tmp *= scaling_factor; std::get<74>(evals) += tmp; } // Contribution 75 { Avm_DECLARE_VIEWS(75); - auto tmp = (main_sel_resolve_ind_addr_d * (-main_sel_resolve_ind_addr_d + FF(1))); + auto tmp = (main_sel_resolve_ind_addr_c * (-main_sel_resolve_ind_addr_c + FF(1))); tmp *= scaling_factor; std::get<75>(evals) += tmp; } // Contribution 76 { Avm_DECLARE_VIEWS(76); - auto tmp = (((main_sel_op_eq + main_sel_op_lte) + main_sel_op_lt) * (main_w_in_tag - FF(1))); + auto tmp = (main_sel_resolve_ind_addr_d * (-main_sel_resolve_ind_addr_d + FF(1))); tmp *= scaling_factor; std::get<76>(evals) += tmp; } // Contribution 77 { Avm_DECLARE_VIEWS(77); - auto tmp = ((main_sel_op_fdiv * (-main_op_err + FF(1))) * ((main_ic * main_ib) - main_ia)); + auto tmp = (((main_sel_op_eq + main_sel_op_lte) + main_sel_op_lt) * (main_w_in_tag - FF(1))); tmp *= scaling_factor; std::get<77>(evals) += tmp; } // Contribution 78 { Avm_DECLARE_VIEWS(78); - auto tmp = ((main_sel_op_fdiv + main_sel_op_div) * (((main_ib * main_inv) - FF(1)) + main_op_err)); + auto tmp = ((main_sel_op_fdiv * (-main_op_err + FF(1))) * ((main_ic * main_ib) - main_ia)); tmp *= scaling_factor; std::get<78>(evals) += tmp; } // Contribution 79 { Avm_DECLARE_VIEWS(79); - auto tmp = (((main_sel_op_fdiv + main_sel_op_div) * main_op_err) * (-main_inv + FF(1))); + auto tmp = ((main_sel_op_fdiv + main_sel_op_div) * (((main_ib * main_inv) - FF(1)) + main_op_err)); tmp *= scaling_factor; std::get<79>(evals) += tmp; } // Contribution 80 { Avm_DECLARE_VIEWS(80); - auto tmp = (main_sel_op_fdiv * (main_r_in_tag - FF(6))); + auto tmp = (((main_sel_op_fdiv + main_sel_op_div) * main_op_err) * (-main_inv + FF(1))); tmp *= scaling_factor; std::get<80>(evals) += tmp; } // Contribution 81 { Avm_DECLARE_VIEWS(81); - auto tmp = (main_sel_op_fdiv * (main_w_in_tag - FF(6))); + auto tmp = (main_sel_op_fdiv * (main_r_in_tag - FF(6))); tmp *= scaling_factor; std::get<81>(evals) += tmp; } // Contribution 82 { Avm_DECLARE_VIEWS(82); - auto tmp = (main_op_err * ((main_sel_op_fdiv + main_sel_op_div) - FF(1))); + auto tmp = (main_sel_op_fdiv * (main_w_in_tag - FF(6))); tmp *= scaling_factor; std::get<82>(evals) += tmp; } // Contribution 83 { Avm_DECLARE_VIEWS(83); + auto tmp = (main_op_err * ((main_sel_op_fdiv + main_sel_op_div) - FF(1))); + tmp *= scaling_factor; + std::get<83>(evals) += tmp; + } + // Contribution 84 + { + Avm_DECLARE_VIEWS(84); auto tmp = ((((((((((((main_sel_op_address + main_sel_op_storage_address) + main_sel_op_sender) + main_sel_op_function_selector) + main_sel_op_transaction_fee) + @@ -861,11 +869,11 @@ template class mainImpl { main_sel_op_fee_per_da_gas) * (-main_sel_q_kernel_lookup + FF(1))); tmp *= scaling_factor; - std::get<83>(evals) += tmp; + std::get<84>(evals) += tmp; } - // Contribution 84 + // Contribution 85 { - Avm_DECLARE_VIEWS(84); + Avm_DECLARE_VIEWS(85); auto tmp = (((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + main_sel_op_emit_nullifier) + @@ -874,105 +882,105 @@ template class mainImpl { main_sel_op_emit_l2_to_l1_msg) * (-main_sel_q_kernel_output_lookup + FF(1))); tmp *= scaling_factor; - std::get<84>(evals) += tmp; - } - // Contribution 85 - { - Avm_DECLARE_VIEWS(85); - auto tmp = (main_sel_op_jump * (main_pc_shift - main_ia)); - tmp *= scaling_factor; std::get<85>(evals) += tmp; } // Contribution 86 { Avm_DECLARE_VIEWS(86); - auto tmp = (main_sel_op_jumpi * (((-main_id_zero + FF(1)) * (main_pc_shift - main_ia)) + - (main_id_zero * ((main_pc_shift - main_pc) - FF(1))))); + auto tmp = (main_sel_op_jump * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<86>(evals) += tmp; } // Contribution 87 { Avm_DECLARE_VIEWS(87); - auto tmp = - (main_sel_op_internal_call * (main_internal_return_ptr_shift - (main_internal_return_ptr + FF(1)))); + auto tmp = (main_sel_op_jumpi * (((-main_id_zero + FF(1)) * (main_pc_shift - main_ia)) + + (main_id_zero * ((main_pc_shift - main_pc) - FF(1))))); tmp *= scaling_factor; std::get<87>(evals) += tmp; } // Contribution 88 { Avm_DECLARE_VIEWS(88); - auto tmp = (main_sel_op_internal_call * (main_internal_return_ptr - main_mem_addr_b)); + auto tmp = + (main_sel_op_internal_call * (main_internal_return_ptr_shift - (main_internal_return_ptr + FF(1)))); tmp *= scaling_factor; std::get<88>(evals) += tmp; } // Contribution 89 { Avm_DECLARE_VIEWS(89); - auto tmp = (main_sel_op_internal_call * (main_pc_shift - main_ia)); + auto tmp = (main_sel_op_internal_call * (main_internal_return_ptr - main_mem_addr_b)); tmp *= scaling_factor; std::get<89>(evals) += tmp; } // Contribution 90 { Avm_DECLARE_VIEWS(90); - auto tmp = (main_sel_op_internal_call * ((main_pc + FF(1)) - main_ib)); + auto tmp = (main_sel_op_internal_call * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<90>(evals) += tmp; } // Contribution 91 { Avm_DECLARE_VIEWS(91); - auto tmp = (main_sel_op_internal_call * (main_rwb - FF(1))); + auto tmp = (main_sel_op_internal_call * ((main_pc + FF(1)) - main_ib)); tmp *= scaling_factor; std::get<91>(evals) += tmp; } // Contribution 92 { Avm_DECLARE_VIEWS(92); - auto tmp = (main_sel_op_internal_call * (main_sel_mem_op_b - FF(1))); + auto tmp = (main_sel_op_internal_call * (main_rwb - FF(1))); tmp *= scaling_factor; std::get<92>(evals) += tmp; } // Contribution 93 { Avm_DECLARE_VIEWS(93); - auto tmp = - (main_sel_op_internal_return * (main_internal_return_ptr_shift - (main_internal_return_ptr - FF(1)))); + auto tmp = (main_sel_op_internal_call * (main_sel_mem_op_b - FF(1))); tmp *= scaling_factor; std::get<93>(evals) += tmp; } // Contribution 94 { Avm_DECLARE_VIEWS(94); - auto tmp = (main_sel_op_internal_return * ((main_internal_return_ptr - FF(1)) - main_mem_addr_a)); + auto tmp = + (main_sel_op_internal_return * (main_internal_return_ptr_shift - (main_internal_return_ptr - FF(1)))); tmp *= scaling_factor; std::get<94>(evals) += tmp; } // Contribution 95 { Avm_DECLARE_VIEWS(95); - auto tmp = (main_sel_op_internal_return * (main_pc_shift - main_ia)); + auto tmp = (main_sel_op_internal_return * ((main_internal_return_ptr - FF(1)) - main_mem_addr_a)); tmp *= scaling_factor; std::get<95>(evals) += tmp; } // Contribution 96 { Avm_DECLARE_VIEWS(96); - auto tmp = (main_sel_op_internal_return * main_rwa); + auto tmp = (main_sel_op_internal_return * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<96>(evals) += tmp; } // Contribution 97 { Avm_DECLARE_VIEWS(97); - auto tmp = (main_sel_op_internal_return * (main_sel_mem_op_a - FF(1))); + auto tmp = (main_sel_op_internal_return * main_rwa); tmp *= scaling_factor; std::get<97>(evals) += tmp; } // Contribution 98 { Avm_DECLARE_VIEWS(98); + auto tmp = (main_sel_op_internal_return * (main_sel_mem_op_a - FF(1))); + tmp *= scaling_factor; + std::get<98>(evals) += tmp; + } + // Contribution 99 + { + Avm_DECLARE_VIEWS(99); auto tmp = (((((main_sel_gas_accounting_active - ((((((((main_sel_op_fdiv + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + @@ -1005,18 +1013,18 @@ template class mainImpl { main_sel_op_emit_unencrypted_log) + main_sel_op_emit_l2_to_l1_msg)) + (main_sel_op_dagasleft + main_sel_op_l2gasleft)) + - main_sel_op_calldata_copy)) - + (main_sel_op_calldata_copy + main_sel_op_external_return))) - (((main_sel_op_jump + main_sel_op_jumpi) + main_sel_op_internal_call) + main_sel_op_internal_return)) - main_sel_op_sload) - main_sel_op_sstore) - main_sel_mem_op_activate_gas); tmp *= scaling_factor; - std::get<98>(evals) += tmp; + std::get<99>(evals) += tmp; } - // Contribution 99 + // Contribution 100 { - Avm_DECLARE_VIEWS(99); + Avm_DECLARE_VIEWS(100); auto tmp = ((((-main_sel_first + FF(1)) * (-main_sel_op_halt + FF(1))) * ((((((((main_sel_op_fdiv + @@ -1048,31 +1056,31 @@ template class mainImpl { main_sel_op_emit_unencrypted_log) + main_sel_op_emit_l2_to_l1_msg)) + (main_sel_op_dagasleft + main_sel_op_l2gasleft)) + - main_sel_op_calldata_copy)) * + (main_sel_op_calldata_copy + main_sel_op_external_return))) * (main_pc_shift - (main_pc + FF(1)))); tmp *= scaling_factor; - std::get<99>(evals) += tmp; + std::get<100>(evals) += tmp; } - // Contribution 100 + // Contribution 101 { - Avm_DECLARE_VIEWS(100); + Avm_DECLARE_VIEWS(101); auto tmp = ((-(((main_sel_first + main_sel_op_internal_call) + main_sel_op_internal_return) + main_sel_op_halt) + FF(1)) * (main_internal_return_ptr_shift - main_internal_return_ptr)); tmp *= scaling_factor; - std::get<100>(evals) += tmp; + std::get<101>(evals) += tmp; } - // Contribution 101 + // Contribution 102 { - Avm_DECLARE_VIEWS(101); + Avm_DECLARE_VIEWS(102); auto tmp = ((main_sel_op_internal_call + main_sel_op_internal_return) * (main_space_id - FF(255))); tmp *= scaling_factor; - std::get<101>(evals) += tmp; + std::get<102>(evals) += tmp; } - // Contribution 102 + // Contribution 103 { - Avm_DECLARE_VIEWS(102); + Avm_DECLARE_VIEWS(103); auto tmp = (((((((((main_sel_op_fdiv + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + @@ -1103,63 +1111,63 @@ template class mainImpl { main_sel_op_emit_unencrypted_log) + main_sel_op_emit_l2_to_l1_msg)) + (main_sel_op_dagasleft + main_sel_op_l2gasleft)) + - main_sel_op_calldata_copy) * + (main_sel_op_calldata_copy + main_sel_op_external_return)) * (main_call_ptr - main_space_id)); tmp *= scaling_factor; - std::get<102>(evals) += tmp; - } - // Contribution 103 - { - Avm_DECLARE_VIEWS(103); - auto tmp = ((main_sel_op_cmov + main_sel_op_jumpi) * (((main_id * main_inv) - FF(1)) + main_id_zero)); - tmp *= scaling_factor; std::get<103>(evals) += tmp; } // Contribution 104 { Avm_DECLARE_VIEWS(104); - auto tmp = (((main_sel_op_cmov + main_sel_op_jumpi) * main_id_zero) * (-main_inv + FF(1))); + auto tmp = ((main_sel_op_cmov + main_sel_op_jumpi) * (((main_id * main_inv) - FF(1)) + main_id_zero)); tmp *= scaling_factor; std::get<104>(evals) += tmp; } // Contribution 105 { Avm_DECLARE_VIEWS(105); - auto tmp = (main_sel_mov_ia_to_ic - (main_sel_op_mov + (main_sel_op_cmov * (-main_id_zero + FF(1))))); + auto tmp = (((main_sel_op_cmov + main_sel_op_jumpi) * main_id_zero) * (-main_inv + FF(1))); tmp *= scaling_factor; std::get<105>(evals) += tmp; } // Contribution 106 { Avm_DECLARE_VIEWS(106); - auto tmp = (main_sel_mov_ib_to_ic - (main_sel_op_cmov * main_id_zero)); + auto tmp = (main_sel_mov_ia_to_ic - (main_sel_op_mov + (main_sel_op_cmov * (-main_id_zero + FF(1))))); tmp *= scaling_factor; std::get<106>(evals) += tmp; } // Contribution 107 { Avm_DECLARE_VIEWS(107); - auto tmp = (main_sel_mov_ia_to_ic * (main_ia - main_ic)); + auto tmp = (main_sel_mov_ib_to_ic - (main_sel_op_cmov * main_id_zero)); tmp *= scaling_factor; std::get<107>(evals) += tmp; } // Contribution 108 { Avm_DECLARE_VIEWS(108); - auto tmp = (main_sel_mov_ib_to_ic * (main_ib - main_ic)); + auto tmp = (main_sel_mov_ia_to_ic * (main_ia - main_ic)); tmp *= scaling_factor; std::get<108>(evals) += tmp; } // Contribution 109 { Avm_DECLARE_VIEWS(109); - auto tmp = ((main_sel_op_mov + main_sel_op_cmov) * (main_r_in_tag - main_w_in_tag)); + auto tmp = (main_sel_mov_ib_to_ic * (main_ib - main_ic)); tmp *= scaling_factor; std::get<109>(evals) += tmp; } // Contribution 110 { Avm_DECLARE_VIEWS(110); + auto tmp = ((main_sel_op_mov + main_sel_op_cmov) * (main_r_in_tag - main_w_in_tag)); + tmp *= scaling_factor; + std::get<110>(evals) += tmp; + } + // Contribution 111 + { + Avm_DECLARE_VIEWS(111); auto tmp = (main_sel_alu - ((((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + main_sel_op_not) + @@ -1172,11 +1180,11 @@ template class mainImpl { (-main_tag_err + FF(1))) * (-main_op_err + FF(1)))); tmp *= scaling_factor; - std::get<110>(evals) += tmp; + std::get<111>(evals) += tmp; } - // Contribution 111 + // Contribution 112 { - Avm_DECLARE_VIEWS(111); + Avm_DECLARE_VIEWS(112); auto tmp = ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + main_sel_op_not) + main_sel_op_eq) + @@ -1186,258 +1194,290 @@ template class mainImpl { main_sel_op_shl) * (main_alu_in_tag - main_r_in_tag)); tmp *= scaling_factor; - std::get<111>(evals) += tmp; - } - // Contribution 112 - { - Avm_DECLARE_VIEWS(112); - auto tmp = (main_sel_op_cast * (main_alu_in_tag - main_w_in_tag)); - tmp *= scaling_factor; std::get<112>(evals) += tmp; } // Contribution 113 { Avm_DECLARE_VIEWS(113); - auto tmp = (main_sel_op_l2gasleft * (main_ia - main_l2_gas_remaining_shift)); + auto tmp = (main_sel_op_cast * (main_alu_in_tag - main_w_in_tag)); tmp *= scaling_factor; std::get<113>(evals) += tmp; } // Contribution 114 { Avm_DECLARE_VIEWS(114); - auto tmp = (main_sel_op_dagasleft * (main_ia - main_da_gas_remaining_shift)); + auto tmp = (main_sel_op_l2gasleft * (main_ia - main_l2_gas_remaining_shift)); tmp *= scaling_factor; std::get<114>(evals) += tmp; } // Contribution 115 { Avm_DECLARE_VIEWS(115); - auto tmp = (main_sel_op_address * (kernel_kernel_in_offset - FF(1))); + auto tmp = (main_sel_op_dagasleft * (main_ia - main_da_gas_remaining_shift)); tmp *= scaling_factor; std::get<115>(evals) += tmp; } // Contribution 116 { Avm_DECLARE_VIEWS(116); - auto tmp = (main_sel_op_storage_address * (kernel_kernel_in_offset - FF(1))); + auto tmp = (main_sel_op_address * (kernel_kernel_in_offset - FF(1))); tmp *= scaling_factor; std::get<116>(evals) += tmp; } // Contribution 117 { Avm_DECLARE_VIEWS(117); - auto tmp = (main_sel_op_sender * kernel_kernel_in_offset); + auto tmp = (main_sel_op_storage_address * (kernel_kernel_in_offset - FF(1))); tmp *= scaling_factor; std::get<117>(evals) += tmp; } // Contribution 118 { Avm_DECLARE_VIEWS(118); - auto tmp = (main_sel_op_function_selector * (kernel_kernel_in_offset - FF(2))); + auto tmp = (main_sel_op_sender * kernel_kernel_in_offset); tmp *= scaling_factor; std::get<118>(evals) += tmp; } // Contribution 119 { Avm_DECLARE_VIEWS(119); +<<<<<<< HEAD auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(39))); +======= + auto tmp = (main_sel_op_function_selector * (kernel_kernel_in_offset - FF(2))); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<119>(evals) += tmp; } // Contribution 120 { Avm_DECLARE_VIEWS(120); +<<<<<<< HEAD auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(28))); +======= + auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(40))); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<120>(evals) += tmp; } // Contribution 121 { Avm_DECLARE_VIEWS(121); +<<<<<<< HEAD auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(29))); +======= + auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(29))); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<121>(evals) += tmp; } // Contribution 122 { Avm_DECLARE_VIEWS(122); +<<<<<<< HEAD auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(30))); +======= + auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(30))); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<122>(evals) += tmp; } // Contribution 123 { Avm_DECLARE_VIEWS(123); +<<<<<<< HEAD auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(31))); +======= + auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(31))); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<123>(evals) += tmp; } // Contribution 124 { Avm_DECLARE_VIEWS(124); +<<<<<<< HEAD auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(32))); +======= + auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(32))); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<124>(evals) += tmp; } // Contribution 125 { Avm_DECLARE_VIEWS(125); +<<<<<<< HEAD auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(34))); +======= + auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(33))); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<125>(evals) += tmp; } // Contribution 126 { Avm_DECLARE_VIEWS(126); +<<<<<<< HEAD auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(35))); +======= + auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(35))); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<126>(evals) += tmp; } // Contribution 127 { Avm_DECLARE_VIEWS(127); - auto tmp = (main_sel_op_note_hash_exists * - (kernel_kernel_out_offset - (kernel_note_hash_exist_write_offset + FF(0)))); + auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(36))); tmp *= scaling_factor; std::get<127>(evals) += tmp; } // Contribution 128 { Avm_DECLARE_VIEWS(128); - auto tmp = (main_sel_first * kernel_note_hash_exist_write_offset); + auto tmp = (main_sel_op_note_hash_exists * + (kernel_kernel_out_offset - (kernel_note_hash_exist_write_offset + FF(0)))); tmp *= scaling_factor; std::get<128>(evals) += tmp; } // Contribution 129 { Avm_DECLARE_VIEWS(129); - auto tmp = (main_sel_op_emit_note_hash * - (kernel_kernel_out_offset - (kernel_emit_note_hash_write_offset + FF(128)))); + auto tmp = (main_sel_first * kernel_note_hash_exist_write_offset); tmp *= scaling_factor; std::get<129>(evals) += tmp; } // Contribution 130 { Avm_DECLARE_VIEWS(130); - auto tmp = (main_sel_first * kernel_emit_note_hash_write_offset); + auto tmp = (main_sel_op_emit_note_hash * + (kernel_kernel_out_offset - (kernel_emit_note_hash_write_offset + FF(128)))); tmp *= scaling_factor; std::get<130>(evals) += tmp; } // Contribution 131 { Avm_DECLARE_VIEWS(131); - auto tmp = (main_sel_op_nullifier_exists * - (kernel_kernel_out_offset - - ((main_ib * (kernel_nullifier_exists_write_offset + FF(16))) + - ((-main_ib + FF(1)) * (kernel_nullifier_non_exists_write_offset + FF(32)))))); + auto tmp = (main_sel_first * kernel_emit_note_hash_write_offset); tmp *= scaling_factor; std::get<131>(evals) += tmp; } // Contribution 132 { Avm_DECLARE_VIEWS(132); - auto tmp = (main_sel_first * kernel_nullifier_exists_write_offset); + auto tmp = (main_sel_op_nullifier_exists * + (kernel_kernel_out_offset - + ((main_ib * (kernel_nullifier_exists_write_offset + FF(16))) + + ((-main_ib + FF(1)) * (kernel_nullifier_non_exists_write_offset + FF(32)))))); tmp *= scaling_factor; std::get<132>(evals) += tmp; } // Contribution 133 { Avm_DECLARE_VIEWS(133); - auto tmp = (main_sel_first * kernel_nullifier_non_exists_write_offset); + auto tmp = (main_sel_first * kernel_nullifier_exists_write_offset); tmp *= scaling_factor; std::get<133>(evals) += tmp; } // Contribution 134 { Avm_DECLARE_VIEWS(134); - auto tmp = (main_sel_op_emit_nullifier * - (kernel_kernel_out_offset - (kernel_emit_nullifier_write_offset + FF(144)))); + auto tmp = (main_sel_first * kernel_nullifier_non_exists_write_offset); tmp *= scaling_factor; std::get<134>(evals) += tmp; } // Contribution 135 { Avm_DECLARE_VIEWS(135); - auto tmp = (main_sel_first * kernel_emit_nullifier_write_offset); + auto tmp = (main_sel_op_emit_nullifier * + (kernel_kernel_out_offset - (kernel_emit_nullifier_write_offset + FF(144)))); tmp *= scaling_factor; std::get<135>(evals) += tmp; } // Contribution 136 { Avm_DECLARE_VIEWS(136); - auto tmp = (main_sel_op_l1_to_l2_msg_exists * - (kernel_kernel_out_offset - (kernel_l1_to_l2_msg_exists_write_offset + FF(48)))); + auto tmp = (main_sel_first * kernel_emit_nullifier_write_offset); tmp *= scaling_factor; std::get<136>(evals) += tmp; } // Contribution 137 { Avm_DECLARE_VIEWS(137); - auto tmp = (main_sel_first * kernel_l1_to_l2_msg_exists_write_offset); + auto tmp = (main_sel_op_l1_to_l2_msg_exists * + (kernel_kernel_out_offset - (kernel_l1_to_l2_msg_exists_write_offset + FF(48)))); tmp *= scaling_factor; std::get<137>(evals) += tmp; } // Contribution 138 { Avm_DECLARE_VIEWS(138); - auto tmp = (main_sel_op_emit_unencrypted_log * - (kernel_kernel_out_offset - (kernel_emit_unencrypted_log_write_offset + FF(162)))); + auto tmp = (main_sel_first * kernel_l1_to_l2_msg_exists_write_offset); tmp *= scaling_factor; std::get<138>(evals) += tmp; } // Contribution 139 { Avm_DECLARE_VIEWS(139); - auto tmp = (main_sel_first * kernel_emit_unencrypted_log_write_offset); + auto tmp = (main_sel_op_emit_unencrypted_log * + (kernel_kernel_out_offset - (kernel_emit_unencrypted_log_write_offset + FF(162)))); tmp *= scaling_factor; std::get<139>(evals) += tmp; } // Contribution 140 { Avm_DECLARE_VIEWS(140); - auto tmp = (main_sel_op_emit_l2_to_l1_msg * - (kernel_kernel_out_offset - (kernel_emit_l2_to_l1_msg_write_offset + FF(160)))); + auto tmp = (main_sel_first * kernel_emit_unencrypted_log_write_offset); tmp *= scaling_factor; std::get<140>(evals) += tmp; } // Contribution 141 { Avm_DECLARE_VIEWS(141); - auto tmp = (main_sel_first * kernel_emit_l2_to_l1_msg_write_offset); + auto tmp = (main_sel_op_emit_l2_to_l1_msg * + (kernel_kernel_out_offset - (kernel_emit_l2_to_l1_msg_write_offset + FF(160)))); tmp *= scaling_factor; std::get<141>(evals) += tmp; } // Contribution 142 { Avm_DECLARE_VIEWS(142); - auto tmp = (main_sel_op_sload * (kernel_kernel_out_offset - (kernel_sload_write_offset + FF(96)))); + auto tmp = (main_sel_first * kernel_emit_l2_to_l1_msg_write_offset); tmp *= scaling_factor; std::get<142>(evals) += tmp; } // Contribution 143 { Avm_DECLARE_VIEWS(143); - auto tmp = (main_sel_first * kernel_sload_write_offset); + auto tmp = (main_sel_op_sload * (kernel_kernel_out_offset - (kernel_sload_write_offset + FF(96)))); tmp *= scaling_factor; std::get<143>(evals) += tmp; } // Contribution 144 { Avm_DECLARE_VIEWS(144); - auto tmp = (main_sel_op_sstore * (kernel_kernel_out_offset - (kernel_sstore_write_offset + FF(64)))); + auto tmp = (main_sel_first * kernel_sload_write_offset); tmp *= scaling_factor; std::get<144>(evals) += tmp; } // Contribution 145 { Avm_DECLARE_VIEWS(145); - auto tmp = (main_sel_first * kernel_sstore_write_offset); + auto tmp = (main_sel_op_sstore * (kernel_kernel_out_offset - (kernel_sstore_write_offset + FF(64)))); tmp *= scaling_factor; std::get<145>(evals) += tmp; } // Contribution 146 { Avm_DECLARE_VIEWS(146); + auto tmp = (main_sel_first * kernel_sstore_write_offset); + tmp *= scaling_factor; + std::get<146>(evals) += tmp; + } + // Contribution 147 + { + Avm_DECLARE_VIEWS(147); auto tmp = (((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + main_sel_op_emit_nullifier) + @@ -1446,29 +1486,30 @@ template class mainImpl { main_sel_op_emit_l2_to_l1_msg) * (kernel_side_effect_counter_shift - (kernel_side_effect_counter + FF(1)))); tmp *= scaling_factor; - std::get<146>(evals) += tmp; - } - // Contribution 147 - { - Avm_DECLARE_VIEWS(147); - auto tmp = (main_sel_cd_cpy_gadget - (main_sel_op_calldata_copy * (-main_tag_err + FF(1)))); - tmp *= scaling_factor; std::get<147>(evals) += tmp; } // Contribution 148 { Avm_DECLARE_VIEWS(148); - auto tmp = (main_bin_op_id - (main_sel_op_or + (main_sel_op_xor * FF(2)))); + auto tmp = (main_sel_slice_gadget - + ((main_sel_op_calldata_copy + main_sel_op_external_return) * (-main_tag_err + FF(1)))); tmp *= scaling_factor; std::get<148>(evals) += tmp; } // Contribution 149 { Avm_DECLARE_VIEWS(149); - auto tmp = (main_sel_bin - ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)); + auto tmp = (main_bin_op_id - (main_sel_op_or + (main_sel_op_xor * FF(2)))); tmp *= scaling_factor; std::get<149>(evals) += tmp; } + // Contribution 150 + { + Avm_DECLARE_VIEWS(150); + auto tmp = (main_sel_bin - ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)); + tmp *= scaling_factor; + std::get<150>(evals) += tmp; + } } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp index 2bfe89dd24e..31eba07d6ae 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp @@ -28,9 +28,9 @@ template struct MemRow { FF mem_sel_op_a{}; FF mem_sel_op_b{}; FF mem_sel_op_c{}; - FF mem_sel_op_cd_cpy{}; FF mem_sel_op_cmov{}; FF mem_sel_op_d{}; + FF mem_sel_op_slice{}; FF mem_sel_resolve_ind_addr_a{}; FF mem_sel_resolve_ind_addr_b{}; FF mem_sel_resolve_ind_addr_c{}; @@ -162,7 +162,7 @@ template class memImpl { // Contribution 8 { Avm_DECLARE_VIEWS(8); - auto tmp = (mem_sel_op_cd_cpy * (-mem_sel_op_cd_cpy + FF(1))); + auto tmp = (mem_sel_op_slice * (-mem_sel_op_slice + FF(1))); tmp *= scaling_factor; std::get<8>(evals) += tmp; } @@ -203,7 +203,7 @@ template class memImpl { mem_sel_resolve_ind_addr_b) + mem_sel_resolve_ind_addr_c) + mem_sel_resolve_ind_addr_d) + - mem_sel_op_cd_cpy)); + mem_sel_op_slice)); tmp *= scaling_factor; std::get<13>(evals) += tmp; } @@ -317,8 +317,9 @@ template class memImpl { { Avm_DECLARE_VIEWS(27); auto tmp = (mem_skip_check_tag - - (mem_sel_op_cmov * ((mem_sel_op_d + (mem_sel_op_a * (-mem_sel_mov_ia_to_ic + FF(1)))) + - (mem_sel_op_b * (-mem_sel_mov_ib_to_ic + FF(1)))))); + ((mem_sel_op_cmov * ((mem_sel_op_d + (mem_sel_op_a * (-mem_sel_mov_ia_to_ic + FF(1)))) + + (mem_sel_op_b * (-mem_sel_mov_ib_to_ic + FF(1))))) + + mem_sel_op_slice)); tmp *= scaling_factor; std::get<27>(evals) += tmp; } @@ -417,14 +418,14 @@ template class memImpl { // Contribution 41 { Avm_DECLARE_VIEWS(41); - auto tmp = (mem_sel_op_cd_cpy * (mem_rw - FF(1))); + auto tmp = (mem_sel_op_slice * (mem_w_in_tag - FF(6))); tmp *= scaling_factor; std::get<41>(evals) += tmp; } // Contribution 42 { Avm_DECLARE_VIEWS(42); - auto tmp = (mem_sel_op_cd_cpy * (mem_w_in_tag - FF(6))); + auto tmp = (mem_sel_op_slice * (mem_r_in_tag - FF(6))); tmp *= scaling_factor; std::get<42>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp index a5ab245a42a..5bb7e7ff8f2 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp @@ -9,28 +9,44 @@ namespace bb::Avm_vm { template struct MemSliceRow { FF slice_addr{}; FF slice_addr_shift{}; - FF slice_cd_offset{}; - FF slice_cd_offset_shift{}; + FF slice_clk{}; + FF slice_clk_shift{}; FF slice_cnt{}; FF slice_cnt_shift{}; + FF slice_col_offset{}; + FF slice_col_offset_shift{}; FF slice_one_min_inv{}; FF slice_sel_cd_cpy{}; - FF slice_sel_start_cd_cpy{}; + FF slice_sel_cd_cpy_shift{}; + FF slice_sel_mem_active{}; + FF slice_sel_mem_active_shift{}; + FF slice_sel_return{}; + FF slice_sel_return_shift{}; + FF slice_space_id{}; + FF slice_space_id_shift{}; }; inline std::string get_relation_label_mem_slice(int index) { switch (index) { - case 2: + case 1: return "SLICE_CNT_ZERO_TEST1"; - case 3: + case 2: return "SLICE_CNT_ZERO_TEST2"; - case 4: + case 3: return "SLICE_CNT_DECREMENT"; + case 4: + return "ADDR_INCREMENT"; case 5: - return "ADDR_CNT_INCREMENT"; + return "COL_OFFSET_INCREMENT"; case 6: - return "CD_OFFSET_INCREMENT"; + return "SAME_CLK"; + case 7: + return "SAME_SPACE_ID"; + case 8: + return "SAME_SEL_RETURN"; + case 9: + return "SAME_SEL_CD_CPY"; } return std::to_string(index); } @@ -39,7 +55,7 @@ template class mem_sliceImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 3 }; + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 2, 3, 3, 3, 3, 3, 3, 3, 4, 4 }; template void static accumulate(ContainerOverSubrelations& evals, @@ -50,52 +66,75 @@ template class mem_sliceImpl { // Contribution 0 { Avm_DECLARE_VIEWS(0); - auto tmp = (slice_sel_cd_cpy * (-slice_sel_cd_cpy + FF(1))); + auto tmp = (slice_sel_mem_active - (slice_sel_cd_cpy + slice_sel_return)); tmp *= scaling_factor; std::get<0>(evals) += tmp; } // Contribution 1 { Avm_DECLARE_VIEWS(1); - auto tmp = (slice_sel_start_cd_cpy * (-slice_sel_start_cd_cpy + FF(1))); + auto tmp = ((slice_cnt * (-slice_one_min_inv + FF(1))) - slice_sel_mem_active); tmp *= scaling_factor; std::get<1>(evals) += tmp; } // Contribution 2 { Avm_DECLARE_VIEWS(2); - auto tmp = ((slice_cnt * (-slice_one_min_inv + FF(1))) - slice_sel_cd_cpy); + auto tmp = ((-slice_sel_mem_active + FF(1)) * slice_one_min_inv); tmp *= scaling_factor; std::get<2>(evals) += tmp; } // Contribution 3 { Avm_DECLARE_VIEWS(3); - auto tmp = ((-slice_sel_cd_cpy + FF(1)) * slice_one_min_inv); + auto tmp = (slice_sel_mem_active * ((slice_cnt - FF(1)) - slice_cnt_shift)); tmp *= scaling_factor; std::get<3>(evals) += tmp; } // Contribution 4 { Avm_DECLARE_VIEWS(4); - auto tmp = (slice_sel_cd_cpy * ((slice_cnt - FF(1)) - slice_cnt_shift)); + auto tmp = (slice_sel_mem_active * ((slice_addr + FF(1)) - slice_addr_shift)); tmp *= scaling_factor; std::get<4>(evals) += tmp; } // Contribution 5 { Avm_DECLARE_VIEWS(5); - auto tmp = (slice_sel_cd_cpy * ((slice_addr + FF(1)) - slice_addr_shift)); + auto tmp = (slice_sel_mem_active * ((slice_col_offset + FF(1)) - slice_col_offset_shift)); tmp *= scaling_factor; std::get<5>(evals) += tmp; } // Contribution 6 { Avm_DECLARE_VIEWS(6); - auto tmp = (slice_sel_cd_cpy * ((slice_cd_offset + FF(1)) - slice_cd_offset_shift)); + auto tmp = (slice_sel_mem_active * (slice_clk - slice_clk_shift)); tmp *= scaling_factor; std::get<6>(evals) += tmp; } + // Contribution 7 + { + Avm_DECLARE_VIEWS(7); + auto tmp = (slice_sel_mem_active * (slice_space_id - slice_space_id_shift)); + tmp *= scaling_factor; + std::get<7>(evals) += tmp; + } + // Contribution 8 + { + Avm_DECLARE_VIEWS(8); + auto tmp = + ((slice_sel_mem_active * slice_sel_mem_active_shift) * (slice_sel_return - slice_sel_return_shift)); + tmp *= scaling_factor; + std::get<8>(evals) += tmp; + } + // Contribution 9 + { + Avm_DECLARE_VIEWS(9); + auto tmp = + ((slice_sel_mem_active * slice_sel_mem_active_shift) * (slice_sel_cd_cpy - slice_sel_cd_cpy_shift)); + tmp *= scaling_factor; + std::get<9>(evals) += tmp; + } } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp index 60111a5c2cd..fa58cde51ec 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_cd_copy.hpp @@ -10,7 +10,7 @@ namespace bb { class perm_main_cd_copy_permutation_settings { public: // This constant defines how many columns are bundled together to form each set. - constexpr static size_t COLUMNS_PER_SET = 3; + constexpr static size_t COLUMNS_PER_SET = 5; template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { @@ -23,10 +23,14 @@ class perm_main_cd_copy_permutation_settings { in.main_sel_cd_cpy_gadget, in.main_sel_cd_cpy_gadget, in.slice_sel_start_cd_cpy, + in.main_clk, + in.main_space_id, in.main_ia, in.main_ib, in.main_mem_addr_c, - in.slice_cd_offset, + in.slice_clk, + in.slice_space_id, + in.slice_col_offset, in.slice_cnt, in.slice_addr); } @@ -37,10 +41,14 @@ class perm_main_cd_copy_permutation_settings { in.main_sel_cd_cpy_gadget, in.main_sel_cd_cpy_gadget, in.slice_sel_start_cd_cpy, + in.main_clk, + in.main_space_id, in.main_ia, in.main_ib, in.main_mem_addr_c, - in.slice_cd_offset, + in.slice_clk, + in.slice_space_id, + in.slice_col_offset, in.slice_cnt, in.slice_addr); } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_return.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_return.hpp new file mode 100644 index 00000000000..7a9ab3ad5d3 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_return.hpp @@ -0,0 +1,106 @@ + + +#pragma once + +#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" + +#include +#include + +namespace bb { + +class perm_main_return_permutation_settings { + public: + // This constant defines how many columns are bundled together to form each set. + constexpr static size_t COLUMNS_PER_SET = 5; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) + { + return (in.main_sel_return_gadget == 1 || in.slice_sel_start_return == 1); + } + + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_const_entities(const AllEntities& in) + { + + return std::forward_as_tuple(in.perm_main_return, + in.main_sel_return_gadget, + in.main_sel_return_gadget, + in.slice_sel_start_return, + in.main_clk, + in.main_space_id, + in.main_ia, + in.main_ib, + in.main_mem_addr_c, + in.slice_clk, + in.slice_space_id, + in.slice_col_offset, + in.slice_cnt, + in.slice_addr); + } + + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_nonconst_entities(AllEntities& in) + { + + return std::forward_as_tuple(in.perm_main_return, + in.main_sel_return_gadget, + in.main_sel_return_gadget, + in.slice_sel_start_return, + in.main_clk, + in.main_space_id, + in.main_ia, + in.main_ib, + in.main_mem_addr_c, + in.slice_clk, + in.slice_space_id, + in.slice_col_offset, + in.slice_cnt, + in.slice_addr); + } +}; + +template +using perm_main_return_relation = GenericPermutationRelation; +template using perm_main_return = GenericPermutation; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_slice.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_slice.hpp new file mode 100644 index 00000000000..a083af609ec --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_slice.hpp @@ -0,0 +1,114 @@ + + +#pragma once + +#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" + +#include +#include + +namespace bb { + +class perm_main_slice_permutation_settings { + public: + // This constant defines how many columns are bundled together to form each set. + constexpr static size_t COLUMNS_PER_SET = 7; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) + { + return (in.main_sel_slice_gadget == 1 || in.slice_sel_start == 1); + } + + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_const_entities(const AllEntities& in) + { + + return std::forward_as_tuple(in.perm_main_slice, + in.main_sel_slice_gadget, + in.main_sel_slice_gadget, + in.slice_sel_start, + in.main_clk, + in.main_space_id, + in.main_ia, + in.main_ib, + in.main_mem_addr_c, + in.main_sel_op_calldata_copy, + in.main_sel_op_external_return, + in.slice_clk, + in.slice_space_id, + in.slice_col_offset, + in.slice_cnt, + in.slice_addr, + in.slice_sel_cd_cpy, + in.slice_sel_return); + } + + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_nonconst_entities(AllEntities& in) + { + + return std::forward_as_tuple(in.perm_main_slice, + in.main_sel_slice_gadget, + in.main_sel_slice_gadget, + in.slice_sel_start, + in.main_clk, + in.main_space_id, + in.main_ia, + in.main_ib, + in.main_mem_addr_c, + in.main_sel_op_calldata_copy, + in.main_sel_op_external_return, + in.slice_clk, + in.slice_space_id, + in.slice_col_offset, + in.slice_cnt, + in.slice_addr, + in.slice_sel_cd_cpy, + in.slice_sel_return); + } +}; + +template +using perm_main_slice_relation = GenericPermutationRelation; +template using perm_main_slice = GenericPermutation; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_return_mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_return_mem.hpp new file mode 100644 index 00000000000..8b9c5f5ec1e --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_return_mem.hpp @@ -0,0 +1,102 @@ + + +#pragma once + +#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" + +#include +#include + +namespace bb { + +class perm_return_mem_permutation_settings { + public: + // This constant defines how many columns are bundled together to form each set. + constexpr static size_t COLUMNS_PER_SET = 4; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) + { + return (in.slice_sel_return == 1 || in.mem_sel_op_return == 1); + } + + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_const_entities(const AllEntities& in) + { + + return std::forward_as_tuple(in.perm_return_mem, + in.slice_sel_return, + in.slice_sel_return, + in.mem_sel_op_return, + in.slice_clk, + in.slice_space_id, + in.slice_addr, + in.slice_val, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); + } + + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_nonconst_entities(AllEntities& in) + { + + return std::forward_as_tuple(in.perm_return_mem, + in.slice_sel_return, + in.slice_sel_return, + in.mem_sel_op_return, + in.slice_clk, + in.slice_space_id, + in.slice_addr, + in.slice_val, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); + } +}; + +template +using perm_return_mem_relation = GenericPermutationRelation; +template using perm_return_mem = GenericPermutation; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_slice_mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_slice_mem.hpp new file mode 100644 index 00000000000..b44fbce1b7b --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_slice_mem.hpp @@ -0,0 +1,106 @@ + + +#pragma once + +#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" + +#include +#include + +namespace bb { + +class perm_slice_mem_permutation_settings { + public: + // This constant defines how many columns are bundled together to form each set. + constexpr static size_t COLUMNS_PER_SET = 5; + + /** + * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the + * value needs to be set to zero. + * + * @details If this is true then permutation takes place in this row + */ + + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) + { + return (in.slice_sel_mem_active == 1 || in.mem_sel_op_slice == 1); + } + + /** + * @brief Get all the entities for the permutation when we don't need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_const_entities(const AllEntities& in) + { + + return std::forward_as_tuple(in.perm_slice_mem, + in.slice_sel_mem_active, + in.slice_sel_mem_active, + in.mem_sel_op_slice, + in.slice_clk, + in.slice_space_id, + in.slice_addr, + in.slice_val, + in.slice_sel_cd_cpy, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw); + } + + /** + * @brief Get all the entities for the permutation when need to update them + * + * @details The entities are returned as a tuple of references in the following order: + * - The entity/polynomial used to store the product of the inverse values + * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of + * the inverse polynomial + * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum + * subrelation + * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum + * subrelation + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) + * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) + * + * @return All the entities needed for the permutation + */ + + template static inline auto get_nonconst_entities(AllEntities& in) + { + + return std::forward_as_tuple(in.perm_slice_mem, + in.slice_sel_mem_active, + in.slice_sel_mem_active, + in.mem_sel_op_slice, + in.slice_clk, + in.slice_space_id, + in.slice_addr, + in.slice_val, + in.slice_sel_cd_cpy, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw); + } +}; + +template +using perm_slice_mem_relation = GenericPermutationRelation; +template using perm_slice_mem = GenericPermutation; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp index bd39e41442b..82b730ad017 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp @@ -18,7 +18,6 @@ void log_avm_trace([[maybe_unused]] std::vector const& trace, [[maybe_unused]] size_t end, [[maybe_unused]] bool enable_selectors) { - /* info("Built circuit with ", trace.size(), " rows"); for (size_t i = beg; i < end; i++) { @@ -41,7 +40,6 @@ void log_avm_trace([[maybe_unused]] std::vector const& trace, info("m_lastAccess: ", trace.at(i).mem_lastAccess); info("m_last: ", trace.at(i).mem_last); - info("m_val_shift: ", trace.at(i).mem_val_shift); info("=======CONTROL_FLOW==================================================================="); info("pc: ", trace.at(i).main_pc); @@ -67,29 +65,31 @@ void log_avm_trace([[maybe_unused]] std::vector const& trace, info("last: ", trace.at(i).main_sel_last); info("=======MEM_OP_A======================================================================"); - info("mem_op_a: ", trace.at(i).main_mem_op_a); - info("mem_idx_a: ", trace.at(i).main_mem_idx_a); + info("mem_op_a: ", trace.at(i).main_sel_mem_op_a); + info("mem_addr_a: ", trace.at(i).main_mem_addr_a); info("rwa: ", trace.at(i).main_rwa); info("=======MEM_OP_B======================================================================"); - info("mem_op_b: ", trace.at(i).main_mem_op_b); - info("mem_idx_b: ", trace.at(i).main_mem_idx_b); + info("mem_op_b: ", trace.at(i).main_sel_mem_op_b); + info("mem_addr_b: ", trace.at(i).main_mem_addr_b); info("rwb: ", trace.at(i).main_rwb); info("=======MEM_OP_C======================================================================"); - info("mem_op_c: ", trace.at(i).main_mem_op_c); - info("mem_idx_c: ", trace.at(i).main_mem_idx_c); + info("mem_op_c: ", trace.at(i).main_sel_mem_op_c); + info("mem_addr_c: ", trace.at(i).main_mem_addr_c); info("rwc: ", trace.at(i).main_rwc); + + info("=======MEM_DIFF======================================================================"); info("diff_hi: ", trace.at(i).mem_diff_hi); info("diff_mid: ", trace.at(i).mem_diff_mid); info("diff_lo: ", trace.at(i).mem_diff_lo); info("=======GAS ACCOUNTING================================================================"); - info("opcode active: ", trace.at(i).main_gas_cost_active); + info("opcode active: ", trace.at(i).main_sel_mem_op_activate_gas); info("l2_gas_remaining: ", trace.at(i).main_l2_gas_remaining); info("da_gas_remaining: ", trace.at(i).main_da_gas_remaining); - info("l2_gas_op: ", trace.at(i).main_l2_gas_op); - info("da_gas_op: ", trace.at(i).main_da_gas_op); + info("l2_gas_op_cost: ", trace.at(i).main_l2_gas_op_cost); + info("da_gas_op_cost: ", trace.at(i).main_da_gas_op_cost); info("l2_out_of_gas: ", trace.at(i).main_l2_out_of_gas); info("da_out_of_gas: ", trace.at(i).main_da_out_of_gas); info("abs_l2_hi_rem_gas: ", trace.at(i).main_abs_l2_rem_gas_hi); @@ -104,11 +104,10 @@ void log_avm_trace([[maybe_unused]] std::vector const& trace, info("sel_op_mul: ", trace.at(i).main_sel_op_mul); info("sel_op_eq: ", trace.at(i).main_sel_op_eq); info("sel_op_not: ", trace.at(i).main_sel_op_not); - info("sel_op_sel_alu: ", trace.at(i).main_alu_sel); + info("sel_sel_alu: ", trace.at(i).main_sel_alu); } info("\n"); } - */ } void dump_trace_as_csv(std::vector const& trace, std::filesystem::path const& filename) diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp index ecbe7b6c82a..e75aa34d2fd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.cpp @@ -60,7 +60,7 @@ void AvmMemTraceBuilder::insert_in_mem_trace(uint8_t space_id, AvmMemoryTag r_in_tag, AvmMemoryTag w_in_tag, bool m_rw, - bool m_sel_op_cd_cpy) + bool m_sel_op_slice) { mem_trace.emplace_back(MemoryTraceEntry{ .m_space_id = space_id, .m_clk = m_clk, @@ -71,7 +71,7 @@ void AvmMemTraceBuilder::insert_in_mem_trace(uint8_t space_id, .r_in_tag = r_in_tag, .w_in_tag = w_in_tag, .m_rw = m_rw, - .m_sel_op_cd_cpy = m_sel_op_cd_cpy }); + .m_sel_op_slice = m_sel_op_slice }); } // Memory operations need to be performed before the addition of the corresponding row in @@ -494,13 +494,42 @@ void AvmMemTraceBuilder::write_calldata_copy(std::vector const& calldata, addr, val, AvmMemoryTag::FF, - AvmMemoryTag::U0, + AvmMemoryTag::FF, AvmMemoryTag::FF, true, true); } } +std::vector AvmMemTraceBuilder::read_return_opcode(uint32_t clk, + uint8_t space_id, + uint32_t direct_ret_offset, + uint32_t ret_size) +{ + std::vector returndata; + for (uint32_t i = 0; i < ret_size; i++) { + auto addr = direct_ret_offset + i; + auto& mem_space = memory.at(space_id); + FF val = mem_space.contains(addr) ? mem_space.at(addr).val : 0; + AvmMemoryTag tag = mem_space.contains(addr) ? mem_space.at(addr).tag : AvmMemoryTag::U0; + + // No tag checking is performed for RETURN opcode. + insert_in_mem_trace(space_id, + clk, + SUB_CLK_LOAD_A, // Specific re-use of this value for return read slice. + addr, + val, + tag, + AvmMemoryTag::FF, + AvmMemoryTag::FF, + false, + true); + + returndata.push_back(val); + } + return returndata; +} + bool AvmMemTraceBuilder::MemoryTraceEntry::operator<(const AvmMemTraceBuilder::MemoryTraceEntry& other) const { if (m_space_id < other.m_space_id) { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp index 23e8799f3c1..6f8af5a60e2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp @@ -43,7 +43,7 @@ class AvmMemTraceBuilder { bool m_sel_mov_ib_to_ic = false; bool m_sel_cmov = false; bool m_tag_err_count_relevant = false; - bool m_sel_op_cd_cpy = false; + bool m_sel_op_slice = false; /** * @brief A comparator on MemoryTraceEntry to be used by sorting algorithm. We sort first by @@ -95,6 +95,7 @@ class AvmMemTraceBuilder { uint32_t cd_offset, uint32_t copy_size, uint32_t direct_dst_offset); + std::vector read_return_opcode(uint32_t clk, uint8_t space_id, uint32_t direct_ret_offset, uint32_t ret_size); private: std::vector mem_trace; // Entries will be sorted by m_clk, m_sub_clk after finalize(). @@ -111,7 +112,7 @@ class AvmMemTraceBuilder { AvmMemoryTag r_in_tag, AvmMemoryTag w_in_tag, bool m_rw, - bool m_sel_op_cd_cpy = false); + bool m_sel_op_slice = false); void load_mismatch_tag_in_mem_trace(uint8_t space_id, uint32_t m_clk, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp index f483ccb4663..eee16a419a1 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -1676,9 +1676,10 @@ void AvmTraceBuilder::op_calldata_copy(uint8_t indirect, uint32_t cd_offset, uin .main_internal_return_ptr = FF(internal_return_ptr), .main_mem_addr_c = direct_dst_offset, .main_pc = pc++, - .main_sel_cd_cpy_gadget = static_cast(tag_match), + .main_r_in_tag = static_cast(AvmMemoryTag::FF), .main_sel_op_calldata_copy = 1, .main_sel_resolve_ind_addr_c = static_cast(indirect_flag), + .main_sel_slice_gadget = static_cast(tag_match), .main_tag_err = static_cast(!tag_match), .main_w_in_tag = static_cast(AvmMemoryTag::FF), }); @@ -2780,107 +2781,50 @@ std::vector AvmTraceBuilder::op_return(uint8_t indirect, uint32_t ret_offset return {}; } - // We parallelize loading memory operations in chunk of 3, i.e., 1 per intermediate register. - // The variable pos is an index pointing to the first storing operation (pertaining to intermediate - // register Ia) relative to ret_offset: - // ret_offset + pos: Ia memory load operation - // ret_offset + pos + 1: Ib memory load operation - // ret_offset + pos + 2: Ic memory load operation - // In indirect mode, ret_offset is first resolved by the first indirect load. + auto clk = static_cast(main_trace.size()) + 1; - uint32_t pos = 0; uint32_t direct_ret_offset = ret_offset; // Will be overwritten in indirect mode. - while (pos < ret_size) { - FF ib(0); - FF ic(0); - uint32_t mem_op_b(0); - uint32_t mem_op_c(0); - uint32_t mem_addr_b(0); - uint32_t mem_addr_c(0); - auto clk = static_cast(main_trace.size()) + 1; - - uint32_t mem_op_a(1); - bool indirect_flag = false; - bool tag_match = true; - - if (pos == 0 && is_operand_indirect(indirect, 0)) { - indirect_flag = true; - auto ind_read = mem_trace_builder.indirect_read_and_load_from_memory( - call_ptr, clk, IndirectRegister::IND_A, ret_offset); - direct_ret_offset = uint32_t(ind_read.val); - tag_match = ind_read.tag_match; - } - - uint32_t mem_addr_a = direct_ret_offset + pos; - - // Reading and loading to Ia - auto read_a = mem_trace_builder.read_and_load_from_memory( - call_ptr, clk, IntermRegister::IA, mem_addr_a, AvmMemoryTag::FF, AvmMemoryTag::FF); - tag_match = tag_match && read_a.tag_match; - - FF ia = read_a.val; - returndata.push_back(ia); - - if (ret_size - pos > 1) { - mem_op_b = 1; - mem_addr_b = direct_ret_offset + pos + 1; + bool indirect_flag = false; + bool tag_match = true; - // Reading and loading to Ib - auto read_b = mem_trace_builder.read_and_load_from_memory( - call_ptr, clk, IntermRegister::IB, mem_addr_b, AvmMemoryTag::FF, AvmMemoryTag::FF); - tag_match = tag_match && read_b.tag_match; - ib = read_b.val; - returndata.push_back(ib); - } + // The only memory operation performed from the main trace is a possible indirect load for resolving the + // direct destination offset stored in main_mem_addr_c. + // All the other memory operations are triggered by the slice gadget. - if (ret_size - pos > 2) { - mem_op_c = 1; - mem_addr_c = direct_ret_offset + pos + 2; + if (is_operand_indirect(indirect, 0)) { + indirect_flag = true; + auto ind_read = + mem_trace_builder.indirect_read_and_load_from_memory(call_ptr, clk, IndirectRegister::IND_C, ret_offset); + direct_ret_offset = uint32_t(ind_read.val); + tag_match = ind_read.tag_match; + } - // Reading and loading to Ic - auto read_c = mem_trace_builder.read_and_load_from_memory( - call_ptr, clk, IntermRegister::IC, mem_addr_c, AvmMemoryTag::FF, AvmMemoryTag::FF); - tag_match = tag_match && read_c.tag_match; - ic = read_c.val; - returndata.push_back(ic); - } + if (tag_match) { + returndata = mem_trace_builder.read_return_opcode(clk, call_ptr, direct_ret_offset, ret_size); + slice_trace_builder.create_return_slice(returndata, clk, call_ptr, direct_ret_offset, ret_size); + } - // Constrain gas cost on the first row - if (pos == 0) { - gas_trace_builder.constrain_gas_lookup(clk, OpCode::RETURN); - } + // Constrain gas cost + gas_trace_builder.constrain_gas_lookup(clk, OpCode::RETURN); - main_trace.push_back(Row{ - .main_clk = clk, - .main_call_ptr = call_ptr, - .main_ia = ia, - .main_ib = ib, - .main_ic = ic, - .main_ind_addr_a = indirect_flag ? FF(ret_offset) : FF(0), - .main_internal_return_ptr = FF(internal_return_ptr), - .main_mem_addr_a = FF(mem_addr_a), - .main_mem_addr_b = FF(mem_addr_b), - .main_mem_addr_c = FF(mem_addr_c), - .main_pc = FF(pc), - .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .main_sel_mem_op_a = FF(mem_op_a), - .main_sel_mem_op_activate_gas = FF(static_cast( - pos == 0)), // TODO: remove in the long term. This activate gas only for the first row. - .main_sel_mem_op_b = FF(mem_op_b), - .main_sel_mem_op_c = FF(mem_op_c), - .main_sel_op_halt = FF(1), - .main_sel_resolve_ind_addr_a = FF(static_cast(indirect_flag)), - .main_tag_err = FF(static_cast(!tag_match)), - .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), - }); + main_trace.push_back(Row{ + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ib = ret_size, + .main_ind_addr_c = indirect_flag ? ret_offset : 0, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_addr_c = direct_ret_offset, + .main_pc = pc, + .main_r_in_tag = static_cast(AvmMemoryTag::FF), + .main_sel_op_external_return = 1, + .main_sel_op_halt = 1, + .main_sel_resolve_ind_addr_c = static_cast(indirect_flag), + .main_sel_slice_gadget = static_cast(tag_match), + .main_tag_err = static_cast(!tag_match), + .main_w_in_tag = static_cast(AvmMemoryTag::FF), + }); - if (ret_size - pos > 2) { // Guard to prevent overflow if ret_size is close to uint32_t maximum value. - pos += 3; - } else { - pos = ret_size; - } - } pc = UINT32_MAX; // This ensures that no subsequent opcode will be executed. return returndata; } @@ -3869,12 +3813,12 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c 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_cd_cpy = FF(static_cast(src.m_sel_op_cd_cpy)); + 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)); - // Calldatacopy memory operations are handled differently and are activated by m_sel_op_cd. - if (!src.m_sel_op_cd_cpy) { + // Calldatacopy/return memory operations are handled differently and are activated by m_sel_op_slice. + if (!src.m_sel_op_slice) { switch (src.m_sub_clk) { case AvmMemTraceBuilder::SUB_CLK_LOAD_A: case AvmMemTraceBuilder::SUB_CLK_STORE_A: @@ -3909,9 +3853,11 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c } } - if (src.m_sel_cmov) { - dest.mem_skip_check_tag = 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); + 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 (i + 1 < mem_trace_size) { @@ -4614,9 +4560,15 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c main_trace.at(cd_offset).lookup_cd_value_counts = count; } - // returndata column inclusion + // returndata column inclusion and selector for (size_t i = 0; i < returndata.size(); i++) { main_trace.at(i).main_returndata = returndata.at(i); + main_trace.at(i).main_sel_returndata = 1; + } + + // returndata loookup counts for return operations + for (auto const& [cd_offset, count] : slice_trace_builder.ret_lookup_counts) { + main_trace.at(cd_offset).lookup_ret_value_counts = count; } // Get tag_err counts from the mem_trace_builder diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp index ebbbb0b2446..5a71af4bf30 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.cpp @@ -9,6 +9,7 @@ void AvmSliceTraceBuilder::reset() { slice_trace.clear(); cd_lookup_counts.clear(); + ret_lookup_counts.clear(); } std::vector AvmSliceTraceBuilder::finalize() @@ -19,30 +20,55 @@ std::vector AvmSliceTraceBuilder::finaliz void AvmSliceTraceBuilder::create_calldata_copy_slice(std::vector const& calldata, uint32_t clk, uint8_t space_id, - uint32_t cd_offset, + uint32_t col_offset, uint32_t copy_size, uint32_t direct_dst_offset) +{ + create_slice(calldata, clk, space_id, col_offset, copy_size, direct_dst_offset, true); +} + +void AvmSliceTraceBuilder::create_return_slice( + std::vector const& returndata, uint32_t clk, uint8_t space_id, uint32_t direct_ret_offset, uint32_t ret_size) +{ + create_slice(returndata, clk, space_id, 0, ret_size, direct_ret_offset, false); +} + +void AvmSliceTraceBuilder::create_slice(std::vector const& col_data, + uint32_t clk, + uint8_t space_id, + uint32_t col_offset, + uint32_t copy_size, + uint32_t addr, + bool rw) { for (uint32_t i = 0; i < copy_size; i++) { - slice_trace.push_back({ .clk = clk, - .space_id = space_id, - .addr_ff = FF(direct_dst_offset + i), - .val = calldata.at(cd_offset + i), - .cd_offset = cd_offset + i, - .cnt = copy_size - i, - .one_min_inv = FF(1) - FF(copy_size - i).invert(), - .sel_start_cd_cpy = i == 0, - .sel_cd_cpy = true }); - cd_lookup_counts[cd_offset + i]++; + slice_trace.push_back({ + .clk = clk, + .space_id = space_id, + .addr_ff = FF(addr + i), + .val = col_data.at(col_offset + i), + .col_offset = col_offset + i, + .cnt = copy_size - i, + .one_min_inv = FF(1) - FF(copy_size - i).invert(), + .sel_start = i == 0, + .sel_cd_cpy = rw, + .sel_return = !rw, + }); + + rw ? cd_lookup_counts[col_offset + i]++ : ret_lookup_counts[col_offset + i]++; } - // Last extra row for a calldatacopy operation. cnt is zero and we have to add extra dummy - // values for addr and cd_offset to satisfy the constraints: #[ADDR_CNT_INCREMENT] and #[CD_OFFSET_INCREMENT] + // Last extra row for a slice operation. cnt is zero and we have to add extra dummy + // values for addr and col_offset to satisfy the constraints: #[ADDR_INCREMENT] and #[COL_OFFSET_INCREMENT] // Alternatively, we would have to increase the degree of these two relations. // Note that addr = 2^32 would be a valid value here, therefore we do not wrap modulo 2^32. - // cd_offset is fine as the circuit trace cannot reach a size of 2^32. - slice_trace.emplace_back( - SliceTraceEntry{ .addr_ff = FF(direct_dst_offset + copy_size - 1) + 1, .cd_offset = cd_offset + copy_size }); + // col_offset is fine as the circuit trace cannot reach a size of 2^32. + slice_trace.emplace_back(SliceTraceEntry{ + .clk = clk, + .space_id = space_id, + .addr_ff = FF(addr + copy_size - 1) + 1, + .col_offset = col_offset + copy_size, + }); } } // namespace bb::avm_trace \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp index ddc7809fb57..b67666881b3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_slice_trace.hpp @@ -9,22 +9,24 @@ namespace bb::avm_trace { class AvmSliceTraceBuilder { public: - // Keeps track of the number of times a calldata value is copied. - // cd_offset -> count + // Keeps track of the number of times a calldata/returndata value is copied. + // column offset -> count std::unordered_map cd_lookup_counts; + std::unordered_map ret_lookup_counts; struct SliceTraceEntry { uint32_t clk = 0; uint8_t space_id = 0; - FF addr_ff = 0; // Should normally be uint32_t but the last witness addr of a calldatacopy operation row might - // be FF(2^32). + FF addr_ff = 0; // Should normally be uint32_t but the last witness addr of a calldatacopy/return operation + // row might be FF(2^32). FF val{}; - uint32_t cd_offset = 0; + uint32_t col_offset = 0; uint32_t cnt = 0; FF one_min_inv{}; - bool sel_start_cd_cpy = false; + bool sel_start = false; bool sel_cd_cpy = false; + bool sel_return = false; }; AvmSliceTraceBuilder() = default; @@ -35,12 +37,24 @@ class AvmSliceTraceBuilder { void create_calldata_copy_slice(std::vector const& calldata, uint32_t clk, uint8_t space_id, - uint32_t cd_offset, + uint32_t col_offset, uint32_t copy_size, uint32_t direct_dst_offset); + void create_return_slice(std::vector const& returndata, + uint32_t clk, + uint8_t space_id, + uint32_t direct_ret_offset, + uint32_t ret_size); private: std::vector slice_trace; + void create_slice(std::vector const& col_data, + uint32_t clk, + uint8_t space_id, + uint32_t col_offset, + uint32_t copy_size, + uint32_t addr, + bool rw); }; template void merge_into(DestRow& dest, AvmSliceTraceBuilder::SliceTraceEntry const& src) @@ -49,11 +63,13 @@ template void merge_into(DestRow& dest, AvmSliceTraceBuilder: dest.slice_space_id = src.space_id; dest.slice_addr = src.addr_ff; dest.slice_val = src.val; - dest.slice_cd_offset = src.cd_offset; + dest.slice_col_offset = src.col_offset; dest.slice_cnt = src.cnt; dest.slice_one_min_inv = src.one_min_inv; - dest.slice_sel_start_cd_cpy = src.sel_start_cd_cpy; - dest.slice_sel_cd_cpy = src.sel_cd_cpy; + dest.slice_sel_start = static_cast(src.sel_start); + dest.slice_sel_cd_cpy = static_cast(src.sel_cd_cpy); + dest.slice_sel_return = static_cast(src.sel_return); + dest.slice_sel_mem_active = static_cast(src.sel_return || src.sel_cd_cpy); } } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp index 1ceffbfc758..f39307155a5 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp @@ -194,7 +194,6 @@ template std::vector AvmFullRow::names() "main_sel_alu", "main_sel_bin", "main_sel_calldata", - "main_sel_cd_cpy_gadget", "main_sel_gas_accounting_active", "main_sel_last", "main_sel_mem_op_a", @@ -221,6 +220,7 @@ template std::vector AvmFullRow::names() "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", @@ -263,8 +263,10 @@ template std::vector AvmFullRow::names() "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", @@ -285,9 +287,9 @@ template std::vector AvmFullRow::names() "mem_sel_op_a", "mem_sel_op_b", "mem_sel_op_c", - "mem_sel_op_cd_cpy", "mem_sel_op_cmov", "mem_sel_op_d", + "mem_sel_op_slice", "mem_sel_resolve_ind_addr_a", "mem_sel_resolve_ind_addr_b", "mem_sel_resolve_ind_addr_c", @@ -315,21 +317,23 @@ template std::vector AvmFullRow::names() "sha256_sel_sha256_compression", "sha256_state", "slice_addr", - "slice_cd_offset", "slice_clk", "slice_cnt", + "slice_col_offset", "slice_one_min_inv", "slice_sel_cd_cpy", - "slice_sel_start_cd_cpy", + "slice_sel_mem_active", + "slice_sel_return", + "slice_sel_start", "slice_space_id", "slice_val", - "perm_cd_mem", + "perm_slice_mem", "perm_main_alu", "perm_main_bin", "perm_main_conv", "perm_main_pos2_perm", "perm_main_pedersen", - "perm_main_cd_copy", + "perm_main_slice", "perm_main_mem_a", "perm_main_mem_b", "perm_main_mem_c", @@ -341,6 +345,7 @@ template std::vector AvmFullRow::names() "lookup_byte_lengths", "lookup_byte_operations", "lookup_cd_value", + "lookup_ret_value", "lookup_opcode_gas", "range_check_l2_gas_hi", "range_check_l2_gas_lo", @@ -383,6 +388,7 @@ template std::vector AvmFullRow::names() "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", @@ -603,7 +609,6 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_sel_alu) // << "," << field_to_string(row.main_sel_bin) // << "," << field_to_string(row.main_sel_calldata) // - << "," << field_to_string(row.main_sel_cd_cpy_gadget) // << "," << field_to_string(row.main_sel_gas_accounting_active) // << "," << field_to_string(row.main_sel_last) // << "," << field_to_string(row.main_sel_mem_op_a) // @@ -630,6 +635,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_sel_op_emit_unencrypted_log) // << "," << field_to_string(row.main_sel_op_eq) // << "," << field_to_string(row.main_sel_op_external_call) // + << "," << field_to_string(row.main_sel_op_external_return) // << "," << field_to_string(row.main_sel_op_fdiv) // << "," << field_to_string(row.main_sel_op_fee_per_da_gas) // << "," << field_to_string(row.main_sel_op_fee_per_l2_gas) // @@ -672,8 +678,10 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_sel_resolve_ind_addr_b) // << "," << field_to_string(row.main_sel_resolve_ind_addr_c) // << "," << field_to_string(row.main_sel_resolve_ind_addr_d) // + << "," << field_to_string(row.main_sel_returndata) // << "," << field_to_string(row.main_sel_rng_16) // << "," << field_to_string(row.main_sel_rng_8) // + << "," << field_to_string(row.main_sel_slice_gadget) // << "," << field_to_string(row.main_space_id) // << "," << field_to_string(row.main_tag_err) // << "," << field_to_string(row.main_w_in_tag) // @@ -694,9 +702,9 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.mem_sel_op_a) // << "," << field_to_string(row.mem_sel_op_b) // << "," << field_to_string(row.mem_sel_op_c) // - << "," << field_to_string(row.mem_sel_op_cd_cpy) // << "," << field_to_string(row.mem_sel_op_cmov) // << "," << field_to_string(row.mem_sel_op_d) // + << "," << field_to_string(row.mem_sel_op_slice) // << "," << field_to_string(row.mem_sel_resolve_ind_addr_a) // << "," << field_to_string(row.mem_sel_resolve_ind_addr_b) // << "," << field_to_string(row.mem_sel_resolve_ind_addr_c) // @@ -724,21 +732,23 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.sha256_sel_sha256_compression) // << "," << field_to_string(row.sha256_state) // << "," << field_to_string(row.slice_addr) // - << "," << field_to_string(row.slice_cd_offset) // << "," << field_to_string(row.slice_clk) // << "," << field_to_string(row.slice_cnt) // + << "," << field_to_string(row.slice_col_offset) // << "," << field_to_string(row.slice_one_min_inv) // << "," << field_to_string(row.slice_sel_cd_cpy) // - << "," << field_to_string(row.slice_sel_start_cd_cpy) // + << "," << field_to_string(row.slice_sel_mem_active) // + << "," << field_to_string(row.slice_sel_return) // + << "," << field_to_string(row.slice_sel_start) // << "," << field_to_string(row.slice_space_id) // << "," << field_to_string(row.slice_val) // - << "," << field_to_string(row.perm_cd_mem) // + << "," << field_to_string(row.perm_slice_mem) // << "," << field_to_string(row.perm_main_alu) // << "," << field_to_string(row.perm_main_bin) // << "," << field_to_string(row.perm_main_conv) // << "," << field_to_string(row.perm_main_pos2_perm) // << "," << field_to_string(row.perm_main_pedersen) // - << "," << field_to_string(row.perm_main_cd_copy) // + << "," << field_to_string(row.perm_main_slice) // << "," << field_to_string(row.perm_main_mem_a) // << "," << field_to_string(row.perm_main_mem_b) // << "," << field_to_string(row.perm_main_mem_c) // @@ -750,6 +760,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.lookup_byte_lengths) // << "," << field_to_string(row.lookup_byte_operations) // << "," << field_to_string(row.lookup_cd_value) // + << "," << field_to_string(row.lookup_ret_value) // << "," << field_to_string(row.lookup_opcode_gas) // << "," << field_to_string(row.range_check_l2_gas_hi) // << "," << field_to_string(row.range_check_l2_gas_lo) // @@ -792,6 +803,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.lookup_byte_lengths_counts) // << "," << field_to_string(row.lookup_byte_operations_counts) // << "," << field_to_string(row.lookup_cd_value_counts) // + << "," << field_to_string(row.lookup_ret_value_counts) // << "," << field_to_string(row.lookup_opcode_gas_counts) // << "," << field_to_string(row.range_check_l2_gas_hi_counts) // << "," << field_to_string(row.range_check_l2_gas_lo_counts) // diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index db13e65d442..56bfe24a6dc 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -199,7 +199,6 @@ template struct AvmFullRow { FF main_sel_alu{}; FF main_sel_bin{}; FF main_sel_calldata{}; - FF main_sel_cd_cpy_gadget{}; FF main_sel_gas_accounting_active{}; FF main_sel_last{}; FF main_sel_mem_op_a{}; @@ -226,6 +225,7 @@ template struct AvmFullRow { FF main_sel_op_emit_unencrypted_log{}; FF main_sel_op_eq{}; FF main_sel_op_external_call{}; + FF main_sel_op_external_return{}; FF main_sel_op_fdiv{}; FF main_sel_op_fee_per_da_gas{}; FF main_sel_op_fee_per_l2_gas{}; @@ -268,8 +268,10 @@ template struct AvmFullRow { FF main_sel_resolve_ind_addr_b{}; FF main_sel_resolve_ind_addr_c{}; FF main_sel_resolve_ind_addr_d{}; + FF main_sel_returndata{}; FF main_sel_rng_16{}; FF main_sel_rng_8{}; + FF main_sel_slice_gadget{}; FF main_space_id{}; FF main_tag_err{}; FF main_w_in_tag{}; @@ -290,9 +292,9 @@ template struct AvmFullRow { FF mem_sel_op_a{}; FF mem_sel_op_b{}; FF mem_sel_op_c{}; - FF mem_sel_op_cd_cpy{}; FF mem_sel_op_cmov{}; FF mem_sel_op_d{}; + FF mem_sel_op_slice{}; FF mem_sel_resolve_ind_addr_a{}; FF mem_sel_resolve_ind_addr_b{}; FF mem_sel_resolve_ind_addr_c{}; @@ -320,21 +322,23 @@ template struct AvmFullRow { FF sha256_sel_sha256_compression{}; FF sha256_state{}; FF slice_addr{}; - FF slice_cd_offset{}; FF slice_clk{}; FF slice_cnt{}; + FF slice_col_offset{}; FF slice_one_min_inv{}; FF slice_sel_cd_cpy{}; - FF slice_sel_start_cd_cpy{}; + FF slice_sel_mem_active{}; + FF slice_sel_return{}; + FF slice_sel_start{}; FF slice_space_id{}; FF slice_val{}; - FF perm_cd_mem{}; + FF perm_slice_mem{}; FF perm_main_alu{}; FF perm_main_bin{}; FF perm_main_conv{}; FF perm_main_pos2_perm{}; FF perm_main_pedersen{}; - FF perm_main_cd_copy{}; + FF perm_main_slice{}; FF perm_main_mem_a{}; FF perm_main_mem_b{}; FF perm_main_mem_c{}; @@ -346,6 +350,7 @@ template struct AvmFullRow { FF lookup_byte_lengths{}; FF lookup_byte_operations{}; FF lookup_cd_value{}; + FF lookup_ret_value{}; FF lookup_opcode_gas{}; FF range_check_l2_gas_hi{}; FF range_check_l2_gas_lo{}; @@ -388,6 +393,7 @@ template struct AvmFullRow { FF lookup_byte_lengths_counts{}; FF lookup_byte_operations_counts{}; FF lookup_cd_value_counts{}; + FF lookup_ret_value_counts{}; FF lookup_opcode_gas_counts{}; FF range_check_l2_gas_hi_counts{}; FF range_check_l2_gas_lo_counts{}; @@ -444,8 +450,8 @@ class AvmCircuitBuilder { using Polynomial = Flavor::Polynomial; using ProverPolynomials = Flavor::ProverPolynomials; - static constexpr size_t num_fixed_columns = 405; - static constexpr size_t num_polys = 405 + 68; + static constexpr size_t num_fixed_columns = 411; + static constexpr size_t num_polys = 411 + 73; std::vector rows; void set_trace(std::vector&& trace) { rows = std::move(trace); } @@ -639,7 +645,6 @@ class AvmCircuitBuilder { polys.main_sel_alu[i] = rows[i].main_sel_alu; polys.main_sel_bin[i] = rows[i].main_sel_bin; polys.main_sel_calldata[i] = rows[i].main_sel_calldata; - polys.main_sel_cd_cpy_gadget[i] = rows[i].main_sel_cd_cpy_gadget; polys.main_sel_gas_accounting_active[i] = rows[i].main_sel_gas_accounting_active; polys.main_sel_last[i] = rows[i].main_sel_last; polys.main_sel_mem_op_a[i] = rows[i].main_sel_mem_op_a; @@ -666,6 +671,7 @@ class AvmCircuitBuilder { polys.main_sel_op_emit_unencrypted_log[i] = rows[i].main_sel_op_emit_unencrypted_log; polys.main_sel_op_eq[i] = rows[i].main_sel_op_eq; polys.main_sel_op_external_call[i] = rows[i].main_sel_op_external_call; + polys.main_sel_op_external_return[i] = rows[i].main_sel_op_external_return; polys.main_sel_op_fdiv[i] = rows[i].main_sel_op_fdiv; polys.main_sel_op_fee_per_da_gas[i] = rows[i].main_sel_op_fee_per_da_gas; polys.main_sel_op_fee_per_l2_gas[i] = rows[i].main_sel_op_fee_per_l2_gas; @@ -708,8 +714,10 @@ class AvmCircuitBuilder { polys.main_sel_resolve_ind_addr_b[i] = rows[i].main_sel_resolve_ind_addr_b; polys.main_sel_resolve_ind_addr_c[i] = rows[i].main_sel_resolve_ind_addr_c; polys.main_sel_resolve_ind_addr_d[i] = rows[i].main_sel_resolve_ind_addr_d; + polys.main_sel_returndata[i] = rows[i].main_sel_returndata; polys.main_sel_rng_16[i] = rows[i].main_sel_rng_16; polys.main_sel_rng_8[i] = rows[i].main_sel_rng_8; + polys.main_sel_slice_gadget[i] = rows[i].main_sel_slice_gadget; polys.main_space_id[i] = rows[i].main_space_id; polys.main_tag_err[i] = rows[i].main_tag_err; polys.main_w_in_tag[i] = rows[i].main_w_in_tag; @@ -730,9 +738,9 @@ class AvmCircuitBuilder { polys.mem_sel_op_a[i] = rows[i].mem_sel_op_a; polys.mem_sel_op_b[i] = rows[i].mem_sel_op_b; polys.mem_sel_op_c[i] = rows[i].mem_sel_op_c; - polys.mem_sel_op_cd_cpy[i] = rows[i].mem_sel_op_cd_cpy; polys.mem_sel_op_cmov[i] = rows[i].mem_sel_op_cmov; polys.mem_sel_op_d[i] = rows[i].mem_sel_op_d; + polys.mem_sel_op_slice[i] = rows[i].mem_sel_op_slice; polys.mem_sel_resolve_ind_addr_a[i] = rows[i].mem_sel_resolve_ind_addr_a; polys.mem_sel_resolve_ind_addr_b[i] = rows[i].mem_sel_resolve_ind_addr_b; polys.mem_sel_resolve_ind_addr_c[i] = rows[i].mem_sel_resolve_ind_addr_c; @@ -760,17 +768,20 @@ class AvmCircuitBuilder { polys.sha256_sel_sha256_compression[i] = rows[i].sha256_sel_sha256_compression; polys.sha256_state[i] = rows[i].sha256_state; polys.slice_addr[i] = rows[i].slice_addr; - polys.slice_cd_offset[i] = rows[i].slice_cd_offset; polys.slice_clk[i] = rows[i].slice_clk; polys.slice_cnt[i] = rows[i].slice_cnt; + polys.slice_col_offset[i] = rows[i].slice_col_offset; polys.slice_one_min_inv[i] = rows[i].slice_one_min_inv; polys.slice_sel_cd_cpy[i] = rows[i].slice_sel_cd_cpy; - polys.slice_sel_start_cd_cpy[i] = rows[i].slice_sel_start_cd_cpy; + polys.slice_sel_mem_active[i] = rows[i].slice_sel_mem_active; + polys.slice_sel_return[i] = rows[i].slice_sel_return; + polys.slice_sel_start[i] = rows[i].slice_sel_start; polys.slice_space_id[i] = rows[i].slice_space_id; polys.slice_val[i] = rows[i].slice_val; polys.lookup_byte_lengths_counts[i] = rows[i].lookup_byte_lengths_counts; polys.lookup_byte_operations_counts[i] = rows[i].lookup_byte_operations_counts; polys.lookup_cd_value_counts[i] = rows[i].lookup_cd_value_counts; + polys.lookup_ret_value_counts[i] = rows[i].lookup_ret_value_counts; polys.lookup_opcode_gas_counts[i] = rows[i].lookup_opcode_gas_counts; polys.range_check_l2_gas_hi_counts[i] = rows[i].range_check_l2_gas_hi_counts; polys.range_check_l2_gas_lo_counts[i] = rows[i].range_check_l2_gas_lo_counts; @@ -884,8 +895,13 @@ class AvmCircuitBuilder { polys.mem_tsp_shift = Polynomial(polys.mem_tsp.shifted()); polys.mem_val_shift = Polynomial(polys.mem_val.shifted()); polys.slice_addr_shift = Polynomial(polys.slice_addr.shifted()); - polys.slice_cd_offset_shift = Polynomial(polys.slice_cd_offset.shifted()); + polys.slice_clk_shift = Polynomial(polys.slice_clk.shifted()); polys.slice_cnt_shift = Polynomial(polys.slice_cnt.shifted()); + polys.slice_col_offset_shift = Polynomial(polys.slice_col_offset.shifted()); + polys.slice_sel_cd_cpy_shift = Polynomial(polys.slice_sel_cd_cpy.shifted()); + polys.slice_sel_mem_active_shift = Polynomial(polys.slice_sel_mem_active.shifted()); + polys.slice_sel_return_shift = Polynomial(polys.slice_sel_return.shifted()); + polys.slice_space_id_shift = Polynomial(polys.slice_space_id.shifted()); return polys; } @@ -1007,8 +1023,8 @@ class AvmCircuitBuilder { }; // Check lookups - auto perm_cd_mem = [=]() { - return evaluate_logderivative.template operator()>("PERM_CD_MEM"); + auto perm_slice_mem = [=]() { + return evaluate_logderivative.template operator()>("PERM_SLICE_MEM"); }; auto perm_main_alu = [=]() { return evaluate_logderivative.template operator()>("PERM_MAIN_ALU"); @@ -1025,8 +1041,8 @@ class AvmCircuitBuilder { auto perm_main_pedersen = [=]() { return evaluate_logderivative.template operator()>("PERM_MAIN_PEDERSEN"); }; - auto perm_main_cd_copy = [=]() { - return evaluate_logderivative.template operator()>("PERM_MAIN_CD_COPY"); + auto perm_main_slice = [=]() { + return evaluate_logderivative.template operator()>("PERM_MAIN_SLICE"); }; auto perm_main_mem_a = [=]() { return evaluate_logderivative.template operator()>("PERM_MAIN_MEM_A"); @@ -1066,6 +1082,9 @@ class AvmCircuitBuilder { auto lookup_cd_value = [=]() { return evaluate_logderivative.template operator()>("LOOKUP_CD_VALUE"); }; + auto lookup_ret_value = [=]() { + return evaluate_logderivative.template operator()>("LOOKUP_RET_VALUE"); + }; auto lookup_opcode_gas = [=]() { return evaluate_logderivative.template operator()>("LOOKUP_OPCODE_GAS"); }; @@ -1208,13 +1227,13 @@ class AvmCircuitBuilder { relation_futures.emplace_back(std::async(std::launch::async, poseidon2)); relation_futures.emplace_back(std::async(std::launch::async, powers)); relation_futures.emplace_back(std::async(std::launch::async, sha256)); - relation_futures.emplace_back(std::async(std::launch::async, perm_cd_mem)); + relation_futures.emplace_back(std::async(std::launch::async, perm_slice_mem)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_alu)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_bin)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_conv)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_pos2_perm)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_pedersen)); - relation_futures.emplace_back(std::async(std::launch::async, perm_main_cd_copy)); + relation_futures.emplace_back(std::async(std::launch::async, perm_main_slice)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_mem_a)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_mem_b)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_mem_c)); @@ -1226,6 +1245,7 @@ class AvmCircuitBuilder { relation_futures.emplace_back(std::async(std::launch::async, lookup_byte_lengths)); relation_futures.emplace_back(std::async(std::launch::async, lookup_byte_operations)); relation_futures.emplace_back(std::async(std::launch::async, lookup_cd_value)); + relation_futures.emplace_back(std::async(std::launch::async, lookup_ret_value)); relation_futures.emplace_back(std::async(std::launch::async, lookup_opcode_gas)); relation_futures.emplace_back(std::async(std::launch::async, range_check_l2_gas_hi)); relation_futures.emplace_back(std::async(std::launch::async, range_check_l2_gas_lo)); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index 16a391870f2..bea05c76539 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -51,6 +51,7 @@ #include "barretenberg/relations/generated/avm/lookup_opcode_gas.hpp" #include "barretenberg/relations/generated/avm/lookup_pow_2_0.hpp" #include "barretenberg/relations/generated/avm/lookup_pow_2_1.hpp" +#include "barretenberg/relations/generated/avm/lookup_ret_value.hpp" #include "barretenberg/relations/generated/avm/lookup_u16_0.hpp" #include "barretenberg/relations/generated/avm/lookup_u16_1.hpp" #include "barretenberg/relations/generated/avm/lookup_u16_10.hpp" @@ -68,10 +69,8 @@ #include "barretenberg/relations/generated/avm/lookup_u16_9.hpp" #include "barretenberg/relations/generated/avm/lookup_u8_0.hpp" #include "barretenberg/relations/generated/avm/lookup_u8_1.hpp" -#include "barretenberg/relations/generated/avm/perm_cd_mem.hpp" #include "barretenberg/relations/generated/avm/perm_main_alu.hpp" #include "barretenberg/relations/generated/avm/perm_main_bin.hpp" -#include "barretenberg/relations/generated/avm/perm_main_cd_copy.hpp" #include "barretenberg/relations/generated/avm/perm_main_conv.hpp" #include "barretenberg/relations/generated/avm/perm_main_mem_a.hpp" #include "barretenberg/relations/generated/avm/perm_main_mem_b.hpp" @@ -83,6 +82,8 @@ #include "barretenberg/relations/generated/avm/perm_main_mem_ind_addr_d.hpp" #include "barretenberg/relations/generated/avm/perm_main_pedersen.hpp" #include "barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp" +#include "barretenberg/relations/generated/avm/perm_main_slice.hpp" +#include "barretenberg/relations/generated/avm/perm_slice_mem.hpp" #include "barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp" #include "barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp" #include "barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp" @@ -111,11 +112,11 @@ class AvmFlavor { using RelationSeparator = AvmFlavorSettings::RelationSeparator; static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 2; - static constexpr size_t NUM_WITNESS_ENTITIES = 403; + static constexpr size_t NUM_WITNESS_ENTITIES = 409; 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 = 473; + static constexpr size_t NUM_ALL_ENTITIES = 484; using MainRelations = std::tuple< // Relations @@ -135,13 +136,13 @@ class AvmFlavor { using LookupRelations = std::tuple< // Lookups - perm_cd_mem_relation, + perm_slice_mem_relation, perm_main_alu_relation, perm_main_bin_relation, perm_main_conv_relation, perm_main_pos2_perm_relation, perm_main_pedersen_relation, - perm_main_cd_copy_relation, + perm_main_slice_relation, perm_main_mem_a_relation, perm_main_mem_b_relation, perm_main_mem_c_relation, @@ -153,6 +154,7 @@ class AvmFlavor { lookup_byte_lengths_relation, lookup_byte_operations_relation, lookup_cd_value_relation, + lookup_ret_value_relation, lookup_opcode_gas_relation, range_check_l2_gas_hi_relation, range_check_l2_gas_lo_relation, @@ -402,7 +404,6 @@ class AvmFlavor { main_sel_alu, main_sel_bin, main_sel_calldata, - main_sel_cd_cpy_gadget, main_sel_gas_accounting_active, main_sel_last, main_sel_mem_op_a, @@ -429,6 +430,7 @@ class AvmFlavor { 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, @@ -471,8 +473,10 @@ class AvmFlavor { 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, @@ -493,9 +497,9 @@ class AvmFlavor { mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, - mem_sel_op_cd_cpy, mem_sel_op_cmov, mem_sel_op_d, + mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, @@ -523,17 +527,20 @@ class AvmFlavor { sha256_sel_sha256_compression, sha256_state, slice_addr, - slice_cd_offset, slice_clk, slice_cnt, + slice_col_offset, slice_one_min_inv, slice_sel_cd_cpy, - slice_sel_start_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, @@ -578,13 +585,13 @@ class AvmFlavor { template class DerivedWitnessEntities { public: DEFINE_FLAVOR_MEMBERS(DataType, - perm_cd_mem, + perm_slice_mem, perm_main_alu, perm_main_bin, perm_main_conv, perm_main_pos2_perm, perm_main_pedersen, - perm_main_cd_copy, + perm_main_slice, perm_main_mem_a, perm_main_mem_b, perm_main_mem_c, @@ -596,6 +603,7 @@ class AvmFlavor { lookup_byte_lengths, lookup_byte_operations, lookup_cd_value, + lookup_ret_value, lookup_opcode_gas, range_check_l2_gas_hi, range_check_l2_gas_lo, @@ -706,8 +714,13 @@ class AvmFlavor { mem_tsp_shift, mem_val_shift, slice_addr_shift, - slice_cd_offset_shift, - slice_cnt_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_space_id_shift) }; template @@ -779,8 +792,13 @@ class AvmFlavor { entities.mem_tsp, entities.mem_val, entities.slice_addr, - entities.slice_cd_offset, - entities.slice_cnt }; + entities.slice_clk, + entities.slice_cnt, + entities.slice_col_offset, + entities.slice_sel_cd_cpy, + entities.slice_sel_mem_active, + entities.slice_sel_return, + entities.slice_space_id }; } template @@ -883,9 +901,197 @@ class AvmFlavor { mem_tsp, mem_val, slice_addr, - slice_cd_offset, - slice_cnt }; + slice_clk, + slice_cnt, + slice_col_offset, + slice_sel_cd_cpy, + slice_sel_mem_active, + slice_sel_return, + slice_space_id }; } +<<<<<<< HEAD +======= + + void compute_logderivative_inverses(const RelationParameters& relation_parameters) + { + ProverPolynomials prover_polynomials = ProverPolynomials(*this); + + AVM_TRACK_TIME("compute_logderivative_inverse/perm_slice_mem_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_alu_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_bin_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_conv_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_pos2_perm_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_pedersen_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_slice_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_a_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_b_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_c_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_d_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_a_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_b_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_c_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_d_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_byte_lengths_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_byte_operations_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_cd_value_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_ret_value_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_opcode_gas_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/range_check_l2_gas_hi_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/range_check_l2_gas_lo_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/range_check_da_gas_hi_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/range_check_da_gas_lo_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/kernel_output_lookup_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_into_kernel_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/incl_main_tag_err_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/incl_mem_tag_err_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_lo_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_mid_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_hi_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_pow_2_0_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_pow_2_1_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u8_0_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u8_1_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_0_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_1_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_2_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_3_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_4_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_5_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_6_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_7_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_8_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_9_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_10_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_11_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_12_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_13_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_14_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_0_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_1_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_2_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_3_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_4_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_5_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_6_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_7_ms", + (bb::compute_logderivative_inverse>( + prover_polynomials, relation_parameters, this->circuit_size))); + } +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) }; using VerificationKey = VerificationKey_, VerifierCommitmentKey>; @@ -2518,7 +2724,6 @@ class AvmFlavor { Base::main_sel_alu = "MAIN_SEL_ALU"; Base::main_sel_bin = "MAIN_SEL_BIN"; Base::main_sel_calldata = "MAIN_SEL_CALLDATA"; - Base::main_sel_cd_cpy_gadget = "MAIN_SEL_CD_CPY_GADGET"; Base::main_sel_gas_accounting_active = "MAIN_SEL_GAS_ACCOUNTING_ACTIVE"; Base::main_sel_last = "MAIN_SEL_LAST"; Base::main_sel_mem_op_a = "MAIN_SEL_MEM_OP_A"; @@ -2545,6 +2750,7 @@ class AvmFlavor { Base::main_sel_op_emit_unencrypted_log = "MAIN_SEL_OP_EMIT_UNENCRYPTED_LOG"; Base::main_sel_op_eq = "MAIN_SEL_OP_EQ"; Base::main_sel_op_external_call = "MAIN_SEL_OP_EXTERNAL_CALL"; + Base::main_sel_op_external_return = "MAIN_SEL_OP_EXTERNAL_RETURN"; Base::main_sel_op_fdiv = "MAIN_SEL_OP_FDIV"; Base::main_sel_op_fee_per_da_gas = "MAIN_SEL_OP_FEE_PER_DA_GAS"; Base::main_sel_op_fee_per_l2_gas = "MAIN_SEL_OP_FEE_PER_L2_GAS"; @@ -2587,8 +2793,10 @@ class AvmFlavor { Base::main_sel_resolve_ind_addr_b = "MAIN_SEL_RESOLVE_IND_ADDR_B"; Base::main_sel_resolve_ind_addr_c = "MAIN_SEL_RESOLVE_IND_ADDR_C"; Base::main_sel_resolve_ind_addr_d = "MAIN_SEL_RESOLVE_IND_ADDR_D"; + Base::main_sel_returndata = "MAIN_SEL_RETURNDATA"; Base::main_sel_rng_16 = "MAIN_SEL_RNG_16"; Base::main_sel_rng_8 = "MAIN_SEL_RNG_8"; + Base::main_sel_slice_gadget = "MAIN_SEL_SLICE_GADGET"; Base::main_space_id = "MAIN_SPACE_ID"; Base::main_tag_err = "MAIN_TAG_ERR"; Base::main_w_in_tag = "MAIN_W_IN_TAG"; @@ -2609,9 +2817,9 @@ class AvmFlavor { 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_cd_cpy = "MEM_SEL_OP_CD_CPY"; Base::mem_sel_op_cmov = "MEM_SEL_OP_CMOV"; Base::mem_sel_op_d = "MEM_SEL_OP_D"; + Base::mem_sel_op_slice = "MEM_SEL_OP_SLICE"; Base::mem_sel_resolve_ind_addr_a = "MEM_SEL_RESOLVE_IND_ADDR_A"; Base::mem_sel_resolve_ind_addr_b = "MEM_SEL_RESOLVE_IND_ADDR_B"; Base::mem_sel_resolve_ind_addr_c = "MEM_SEL_RESOLVE_IND_ADDR_C"; @@ -2639,21 +2847,23 @@ class AvmFlavor { Base::sha256_sel_sha256_compression = "SHA256_SEL_SHA256_COMPRESSION"; Base::sha256_state = "SHA256_STATE"; Base::slice_addr = "SLICE_ADDR"; - Base::slice_cd_offset = "SLICE_CD_OFFSET"; Base::slice_clk = "SLICE_CLK"; Base::slice_cnt = "SLICE_CNT"; + Base::slice_col_offset = "SLICE_COL_OFFSET"; Base::slice_one_min_inv = "SLICE_ONE_MIN_INV"; Base::slice_sel_cd_cpy = "SLICE_SEL_CD_CPY"; - Base::slice_sel_start_cd_cpy = "SLICE_SEL_START_CD_CPY"; + Base::slice_sel_mem_active = "SLICE_SEL_MEM_ACTIVE"; + Base::slice_sel_return = "SLICE_SEL_RETURN"; + Base::slice_sel_start = "SLICE_SEL_START"; Base::slice_space_id = "SLICE_SPACE_ID"; Base::slice_val = "SLICE_VAL"; - Base::perm_cd_mem = "PERM_CD_MEM"; + Base::perm_slice_mem = "PERM_SLICE_MEM"; Base::perm_main_alu = "PERM_MAIN_ALU"; Base::perm_main_bin = "PERM_MAIN_BIN"; Base::perm_main_conv = "PERM_MAIN_CONV"; Base::perm_main_pos2_perm = "PERM_MAIN_POS2_PERM"; Base::perm_main_pedersen = "PERM_MAIN_PEDERSEN"; - Base::perm_main_cd_copy = "PERM_MAIN_CD_COPY"; + Base::perm_main_slice = "PERM_MAIN_SLICE"; Base::perm_main_mem_a = "PERM_MAIN_MEM_A"; Base::perm_main_mem_b = "PERM_MAIN_MEM_B"; Base::perm_main_mem_c = "PERM_MAIN_MEM_C"; @@ -2665,6 +2875,7 @@ class AvmFlavor { Base::lookup_byte_lengths = "LOOKUP_BYTE_LENGTHS"; Base::lookup_byte_operations = "LOOKUP_BYTE_OPERATIONS"; Base::lookup_cd_value = "LOOKUP_CD_VALUE"; + Base::lookup_ret_value = "LOOKUP_RET_VALUE"; Base::lookup_opcode_gas = "LOOKUP_OPCODE_GAS"; Base::range_check_l2_gas_hi = "RANGE_CHECK_L2_GAS_HI"; Base::range_check_l2_gas_lo = "RANGE_CHECK_L2_GAS_LO"; @@ -2707,6 +2918,7 @@ class AvmFlavor { Base::lookup_byte_lengths_counts = "LOOKUP_BYTE_LENGTHS_COUNTS"; Base::lookup_byte_operations_counts = "LOOKUP_BYTE_OPERATIONS_COUNTS"; Base::lookup_cd_value_counts = "LOOKUP_CD_VALUE_COUNTS"; + Base::lookup_ret_value_counts = "LOOKUP_RET_VALUE_COUNTS"; Base::lookup_opcode_gas_counts = "LOOKUP_OPCODE_GAS_COUNTS"; Base::range_check_l2_gas_hi_counts = "RANGE_CHECK_L2_GAS_HI_COUNTS"; Base::range_check_l2_gas_lo_counts = "RANGE_CHECK_L2_GAS_LO_COUNTS"; @@ -2943,7 +3155,6 @@ class AvmFlavor { Commitment main_sel_alu; Commitment main_sel_bin; Commitment main_sel_calldata; - Commitment main_sel_cd_cpy_gadget; Commitment main_sel_gas_accounting_active; Commitment main_sel_last; Commitment main_sel_mem_op_a; @@ -2970,6 +3181,7 @@ class AvmFlavor { Commitment main_sel_op_emit_unencrypted_log; Commitment main_sel_op_eq; Commitment main_sel_op_external_call; + Commitment main_sel_op_external_return; Commitment main_sel_op_fdiv; Commitment main_sel_op_fee_per_da_gas; Commitment main_sel_op_fee_per_l2_gas; @@ -3012,8 +3224,10 @@ class AvmFlavor { Commitment main_sel_resolve_ind_addr_b; Commitment main_sel_resolve_ind_addr_c; Commitment main_sel_resolve_ind_addr_d; + Commitment main_sel_returndata; Commitment main_sel_rng_16; Commitment main_sel_rng_8; + Commitment main_sel_slice_gadget; Commitment main_space_id; Commitment main_tag_err; Commitment main_w_in_tag; @@ -3034,9 +3248,9 @@ class AvmFlavor { Commitment mem_sel_op_a; Commitment mem_sel_op_b; Commitment mem_sel_op_c; - Commitment mem_sel_op_cd_cpy; Commitment mem_sel_op_cmov; Commitment mem_sel_op_d; + Commitment mem_sel_op_slice; Commitment mem_sel_resolve_ind_addr_a; Commitment mem_sel_resolve_ind_addr_b; Commitment mem_sel_resolve_ind_addr_c; @@ -3064,21 +3278,23 @@ class AvmFlavor { Commitment sha256_sel_sha256_compression; Commitment sha256_state; Commitment slice_addr; - Commitment slice_cd_offset; Commitment slice_clk; Commitment slice_cnt; + Commitment slice_col_offset; Commitment slice_one_min_inv; Commitment slice_sel_cd_cpy; - Commitment slice_sel_start_cd_cpy; + Commitment slice_sel_mem_active; + Commitment slice_sel_return; + Commitment slice_sel_start; Commitment slice_space_id; Commitment slice_val; - Commitment perm_cd_mem; + Commitment perm_slice_mem; Commitment perm_main_alu; Commitment perm_main_bin; Commitment perm_main_conv; Commitment perm_main_pos2_perm; Commitment perm_main_pedersen; - Commitment perm_main_cd_copy; + Commitment perm_main_slice; Commitment perm_main_mem_a; Commitment perm_main_mem_b; Commitment perm_main_mem_c; @@ -3090,6 +3306,7 @@ class AvmFlavor { Commitment lookup_byte_lengths; Commitment lookup_byte_operations; Commitment lookup_cd_value; + Commitment lookup_ret_value; Commitment lookup_opcode_gas; Commitment range_check_l2_gas_hi; Commitment range_check_l2_gas_lo; @@ -3132,6 +3349,7 @@ class AvmFlavor { Commitment lookup_byte_lengths_counts; Commitment lookup_byte_operations_counts; Commitment lookup_cd_value_counts; + Commitment lookup_ret_value_counts; Commitment lookup_opcode_gas_counts; Commitment range_check_l2_gas_hi_counts; Commitment range_check_l2_gas_lo_counts; @@ -3381,7 +3599,6 @@ class AvmFlavor { main_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_cd_cpy_gadget = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_gas_accounting_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3409,6 +3626,7 @@ class AvmFlavor { deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_op_external_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_external_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_op_fdiv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_op_fee_per_da_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_op_fee_per_l2_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3452,8 +3670,10 @@ class AvmFlavor { main_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_returndata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_slice_gadget = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3474,9 +3694,9 @@ class AvmFlavor { mem_sel_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_op_slice = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); mem_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3504,21 +3724,23 @@ class AvmFlavor { sha256_sel_sha256_compression = deserialize_from_buffer(Transcript::proof_data, num_frs_read); sha256_state = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_cd_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_cnt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_col_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_sel_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_start_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_mem_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + slice_sel_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); slice_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_cd_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_slice_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_conv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_pos2_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_cd_copy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + perm_main_slice = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_mem_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_mem_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_mem_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3530,6 +3752,7 @@ class AvmFlavor { lookup_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); lookup_byte_operations = deserialize_from_buffer(Transcript::proof_data, num_frs_read); lookup_cd_value = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_ret_value = deserialize_from_buffer(Transcript::proof_data, num_frs_read); lookup_opcode_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); range_check_l2_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); range_check_l2_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3572,6 +3795,7 @@ class AvmFlavor { lookup_byte_lengths_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); lookup_byte_operations_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); lookup_cd_value_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + lookup_ret_value_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); lookup_opcode_gas_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); range_check_l2_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); range_check_l2_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3815,7 +4039,6 @@ class AvmFlavor { serialize_to_buffer(main_sel_alu, Transcript::proof_data); serialize_to_buffer(main_sel_bin, Transcript::proof_data); serialize_to_buffer(main_sel_calldata, Transcript::proof_data); - serialize_to_buffer(main_sel_cd_cpy_gadget, Transcript::proof_data); serialize_to_buffer(main_sel_gas_accounting_active, Transcript::proof_data); serialize_to_buffer(main_sel_last, Transcript::proof_data); serialize_to_buffer(main_sel_mem_op_a, Transcript::proof_data); @@ -3842,6 +4065,7 @@ class AvmFlavor { serialize_to_buffer(main_sel_op_emit_unencrypted_log, Transcript::proof_data); serialize_to_buffer(main_sel_op_eq, Transcript::proof_data); serialize_to_buffer(main_sel_op_external_call, Transcript::proof_data); + serialize_to_buffer(main_sel_op_external_return, Transcript::proof_data); serialize_to_buffer(main_sel_op_fdiv, Transcript::proof_data); serialize_to_buffer(main_sel_op_fee_per_da_gas, Transcript::proof_data); serialize_to_buffer(main_sel_op_fee_per_l2_gas, Transcript::proof_data); @@ -3884,8 +4108,10 @@ class AvmFlavor { serialize_to_buffer(main_sel_resolve_ind_addr_b, Transcript::proof_data); serialize_to_buffer(main_sel_resolve_ind_addr_c, Transcript::proof_data); serialize_to_buffer(main_sel_resolve_ind_addr_d, Transcript::proof_data); + serialize_to_buffer(main_sel_returndata, Transcript::proof_data); serialize_to_buffer(main_sel_rng_16, Transcript::proof_data); serialize_to_buffer(main_sel_rng_8, Transcript::proof_data); + serialize_to_buffer(main_sel_slice_gadget, Transcript::proof_data); serialize_to_buffer(main_space_id, Transcript::proof_data); serialize_to_buffer(main_tag_err, Transcript::proof_data); serialize_to_buffer(main_w_in_tag, Transcript::proof_data); @@ -3906,9 +4132,9 @@ class AvmFlavor { serialize_to_buffer(mem_sel_op_a, Transcript::proof_data); serialize_to_buffer(mem_sel_op_b, Transcript::proof_data); serialize_to_buffer(mem_sel_op_c, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_cd_cpy, Transcript::proof_data); serialize_to_buffer(mem_sel_op_cmov, Transcript::proof_data); serialize_to_buffer(mem_sel_op_d, Transcript::proof_data); + serialize_to_buffer(mem_sel_op_slice, Transcript::proof_data); serialize_to_buffer(mem_sel_resolve_ind_addr_a, Transcript::proof_data); serialize_to_buffer(mem_sel_resolve_ind_addr_b, Transcript::proof_data); serialize_to_buffer(mem_sel_resolve_ind_addr_c, Transcript::proof_data); @@ -3936,21 +4162,23 @@ class AvmFlavor { serialize_to_buffer(sha256_sel_sha256_compression, Transcript::proof_data); serialize_to_buffer(sha256_state, Transcript::proof_data); serialize_to_buffer(slice_addr, Transcript::proof_data); - serialize_to_buffer(slice_cd_offset, Transcript::proof_data); serialize_to_buffer(slice_clk, Transcript::proof_data); serialize_to_buffer(slice_cnt, Transcript::proof_data); + serialize_to_buffer(slice_col_offset, Transcript::proof_data); serialize_to_buffer(slice_one_min_inv, Transcript::proof_data); serialize_to_buffer(slice_sel_cd_cpy, Transcript::proof_data); - serialize_to_buffer(slice_sel_start_cd_cpy, Transcript::proof_data); + serialize_to_buffer(slice_sel_mem_active, Transcript::proof_data); + serialize_to_buffer(slice_sel_return, Transcript::proof_data); + serialize_to_buffer(slice_sel_start, Transcript::proof_data); serialize_to_buffer(slice_space_id, Transcript::proof_data); serialize_to_buffer(slice_val, Transcript::proof_data); - serialize_to_buffer(perm_cd_mem, Transcript::proof_data); + serialize_to_buffer(perm_slice_mem, Transcript::proof_data); serialize_to_buffer(perm_main_alu, Transcript::proof_data); serialize_to_buffer(perm_main_bin, Transcript::proof_data); serialize_to_buffer(perm_main_conv, Transcript::proof_data); serialize_to_buffer(perm_main_pos2_perm, Transcript::proof_data); serialize_to_buffer(perm_main_pedersen, Transcript::proof_data); - serialize_to_buffer(perm_main_cd_copy, Transcript::proof_data); + serialize_to_buffer(perm_main_slice, Transcript::proof_data); serialize_to_buffer(perm_main_mem_a, Transcript::proof_data); serialize_to_buffer(perm_main_mem_b, Transcript::proof_data); serialize_to_buffer(perm_main_mem_c, Transcript::proof_data); @@ -3962,6 +4190,7 @@ class AvmFlavor { serialize_to_buffer(lookup_byte_lengths, Transcript::proof_data); serialize_to_buffer(lookup_byte_operations, Transcript::proof_data); serialize_to_buffer(lookup_cd_value, Transcript::proof_data); + serialize_to_buffer(lookup_ret_value, Transcript::proof_data); serialize_to_buffer(lookup_opcode_gas, Transcript::proof_data); serialize_to_buffer(range_check_l2_gas_hi, Transcript::proof_data); serialize_to_buffer(range_check_l2_gas_lo, Transcript::proof_data); @@ -4004,6 +4233,7 @@ class AvmFlavor { serialize_to_buffer(lookup_byte_lengths_counts, Transcript::proof_data); serialize_to_buffer(lookup_byte_operations_counts, Transcript::proof_data); serialize_to_buffer(lookup_cd_value_counts, Transcript::proof_data); + serialize_to_buffer(lookup_ret_value_counts, Transcript::proof_data); serialize_to_buffer(lookup_opcode_gas_counts, Transcript::proof_data); serialize_to_buffer(range_check_l2_gas_hi_counts, Transcript::proof_data); serialize_to_buffer(range_check_l2_gas_lo_counts, Transcript::proof_data); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp index 23762777a9f..5143cf36963 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp @@ -96,6 +96,7 @@ void AvmProver::execute_log_derivative_inverse_round() compute_logderivative_rel(relation_parameters, prover_polynomials, key->circuit_size); // Commit to all logderivative inverse polynomials +<<<<<<< HEAD for (auto [commitment, key_poly] : zip_view(witness_commitments.get_derived(), key->get_derived())) { commitment = commitment_key->commit(key_poly); } @@ -104,6 +105,130 @@ void AvmProver::execute_log_derivative_inverse_round() for (auto [label, commitment] : zip_view(commitment_labels.get_derived(), witness_commitments.get_derived())) { transcript->send_to_verifier(label, commitment); } +======= + witness_commitments.perm_slice_mem = commitment_key->commit(key->perm_slice_mem); + witness_commitments.perm_main_alu = commitment_key->commit(key->perm_main_alu); + witness_commitments.perm_main_bin = commitment_key->commit(key->perm_main_bin); + witness_commitments.perm_main_conv = commitment_key->commit(key->perm_main_conv); + witness_commitments.perm_main_pos2_perm = commitment_key->commit(key->perm_main_pos2_perm); + witness_commitments.perm_main_pedersen = commitment_key->commit(key->perm_main_pedersen); + witness_commitments.perm_main_slice = commitment_key->commit(key->perm_main_slice); + witness_commitments.perm_main_mem_a = commitment_key->commit(key->perm_main_mem_a); + witness_commitments.perm_main_mem_b = commitment_key->commit(key->perm_main_mem_b); + witness_commitments.perm_main_mem_c = commitment_key->commit(key->perm_main_mem_c); + witness_commitments.perm_main_mem_d = commitment_key->commit(key->perm_main_mem_d); + witness_commitments.perm_main_mem_ind_addr_a = commitment_key->commit(key->perm_main_mem_ind_addr_a); + witness_commitments.perm_main_mem_ind_addr_b = commitment_key->commit(key->perm_main_mem_ind_addr_b); + witness_commitments.perm_main_mem_ind_addr_c = commitment_key->commit(key->perm_main_mem_ind_addr_c); + witness_commitments.perm_main_mem_ind_addr_d = commitment_key->commit(key->perm_main_mem_ind_addr_d); + witness_commitments.lookup_byte_lengths = commitment_key->commit(key->lookup_byte_lengths); + witness_commitments.lookup_byte_operations = commitment_key->commit(key->lookup_byte_operations); + witness_commitments.lookup_cd_value = commitment_key->commit(key->lookup_cd_value); + witness_commitments.lookup_ret_value = commitment_key->commit(key->lookup_ret_value); + witness_commitments.lookup_opcode_gas = commitment_key->commit(key->lookup_opcode_gas); + witness_commitments.range_check_l2_gas_hi = commitment_key->commit(key->range_check_l2_gas_hi); + witness_commitments.range_check_l2_gas_lo = commitment_key->commit(key->range_check_l2_gas_lo); + witness_commitments.range_check_da_gas_hi = commitment_key->commit(key->range_check_da_gas_hi); + witness_commitments.range_check_da_gas_lo = commitment_key->commit(key->range_check_da_gas_lo); + witness_commitments.kernel_output_lookup = commitment_key->commit(key->kernel_output_lookup); + witness_commitments.lookup_into_kernel = commitment_key->commit(key->lookup_into_kernel); + witness_commitments.incl_main_tag_err = commitment_key->commit(key->incl_main_tag_err); + witness_commitments.incl_mem_tag_err = commitment_key->commit(key->incl_mem_tag_err); + witness_commitments.lookup_mem_rng_chk_lo = commitment_key->commit(key->lookup_mem_rng_chk_lo); + witness_commitments.lookup_mem_rng_chk_mid = commitment_key->commit(key->lookup_mem_rng_chk_mid); + witness_commitments.lookup_mem_rng_chk_hi = commitment_key->commit(key->lookup_mem_rng_chk_hi); + witness_commitments.lookup_pow_2_0 = commitment_key->commit(key->lookup_pow_2_0); + witness_commitments.lookup_pow_2_1 = commitment_key->commit(key->lookup_pow_2_1); + witness_commitments.lookup_u8_0 = commitment_key->commit(key->lookup_u8_0); + witness_commitments.lookup_u8_1 = commitment_key->commit(key->lookup_u8_1); + witness_commitments.lookup_u16_0 = commitment_key->commit(key->lookup_u16_0); + witness_commitments.lookup_u16_1 = commitment_key->commit(key->lookup_u16_1); + witness_commitments.lookup_u16_2 = commitment_key->commit(key->lookup_u16_2); + witness_commitments.lookup_u16_3 = commitment_key->commit(key->lookup_u16_3); + witness_commitments.lookup_u16_4 = commitment_key->commit(key->lookup_u16_4); + witness_commitments.lookup_u16_5 = commitment_key->commit(key->lookup_u16_5); + witness_commitments.lookup_u16_6 = commitment_key->commit(key->lookup_u16_6); + witness_commitments.lookup_u16_7 = commitment_key->commit(key->lookup_u16_7); + witness_commitments.lookup_u16_8 = commitment_key->commit(key->lookup_u16_8); + witness_commitments.lookup_u16_9 = commitment_key->commit(key->lookup_u16_9); + witness_commitments.lookup_u16_10 = commitment_key->commit(key->lookup_u16_10); + witness_commitments.lookup_u16_11 = commitment_key->commit(key->lookup_u16_11); + witness_commitments.lookup_u16_12 = commitment_key->commit(key->lookup_u16_12); + witness_commitments.lookup_u16_13 = commitment_key->commit(key->lookup_u16_13); + witness_commitments.lookup_u16_14 = commitment_key->commit(key->lookup_u16_14); + witness_commitments.lookup_div_u16_0 = commitment_key->commit(key->lookup_div_u16_0); + witness_commitments.lookup_div_u16_1 = commitment_key->commit(key->lookup_div_u16_1); + witness_commitments.lookup_div_u16_2 = commitment_key->commit(key->lookup_div_u16_2); + witness_commitments.lookup_div_u16_3 = commitment_key->commit(key->lookup_div_u16_3); + witness_commitments.lookup_div_u16_4 = commitment_key->commit(key->lookup_div_u16_4); + witness_commitments.lookup_div_u16_5 = commitment_key->commit(key->lookup_div_u16_5); + witness_commitments.lookup_div_u16_6 = commitment_key->commit(key->lookup_div_u16_6); + witness_commitments.lookup_div_u16_7 = commitment_key->commit(key->lookup_div_u16_7); + + // Send all commitments to the verifier + transcript->send_to_verifier(commitment_labels.perm_slice_mem, witness_commitments.perm_slice_mem); + transcript->send_to_verifier(commitment_labels.perm_main_alu, witness_commitments.perm_main_alu); + transcript->send_to_verifier(commitment_labels.perm_main_bin, witness_commitments.perm_main_bin); + transcript->send_to_verifier(commitment_labels.perm_main_conv, witness_commitments.perm_main_conv); + transcript->send_to_verifier(commitment_labels.perm_main_pos2_perm, witness_commitments.perm_main_pos2_perm); + transcript->send_to_verifier(commitment_labels.perm_main_pedersen, witness_commitments.perm_main_pedersen); + transcript->send_to_verifier(commitment_labels.perm_main_slice, witness_commitments.perm_main_slice); + transcript->send_to_verifier(commitment_labels.perm_main_mem_a, witness_commitments.perm_main_mem_a); + transcript->send_to_verifier(commitment_labels.perm_main_mem_b, witness_commitments.perm_main_mem_b); + transcript->send_to_verifier(commitment_labels.perm_main_mem_c, witness_commitments.perm_main_mem_c); + transcript->send_to_verifier(commitment_labels.perm_main_mem_d, witness_commitments.perm_main_mem_d); + transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_a, + witness_commitments.perm_main_mem_ind_addr_a); + transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_b, + witness_commitments.perm_main_mem_ind_addr_b); + transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_c, + witness_commitments.perm_main_mem_ind_addr_c); + transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_d, + witness_commitments.perm_main_mem_ind_addr_d); + transcript->send_to_verifier(commitment_labels.lookup_byte_lengths, witness_commitments.lookup_byte_lengths); + transcript->send_to_verifier(commitment_labels.lookup_byte_operations, witness_commitments.lookup_byte_operations); + transcript->send_to_verifier(commitment_labels.lookup_cd_value, witness_commitments.lookup_cd_value); + transcript->send_to_verifier(commitment_labels.lookup_ret_value, witness_commitments.lookup_ret_value); + transcript->send_to_verifier(commitment_labels.lookup_opcode_gas, witness_commitments.lookup_opcode_gas); + transcript->send_to_verifier(commitment_labels.range_check_l2_gas_hi, witness_commitments.range_check_l2_gas_hi); + transcript->send_to_verifier(commitment_labels.range_check_l2_gas_lo, witness_commitments.range_check_l2_gas_lo); + transcript->send_to_verifier(commitment_labels.range_check_da_gas_hi, witness_commitments.range_check_da_gas_hi); + transcript->send_to_verifier(commitment_labels.range_check_da_gas_lo, witness_commitments.range_check_da_gas_lo); + transcript->send_to_verifier(commitment_labels.kernel_output_lookup, witness_commitments.kernel_output_lookup); + transcript->send_to_verifier(commitment_labels.lookup_into_kernel, witness_commitments.lookup_into_kernel); + transcript->send_to_verifier(commitment_labels.incl_main_tag_err, witness_commitments.incl_main_tag_err); + transcript->send_to_verifier(commitment_labels.incl_mem_tag_err, witness_commitments.incl_mem_tag_err); + transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_lo, witness_commitments.lookup_mem_rng_chk_lo); + transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_mid, witness_commitments.lookup_mem_rng_chk_mid); + transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_hi, witness_commitments.lookup_mem_rng_chk_hi); + transcript->send_to_verifier(commitment_labels.lookup_pow_2_0, witness_commitments.lookup_pow_2_0); + transcript->send_to_verifier(commitment_labels.lookup_pow_2_1, witness_commitments.lookup_pow_2_1); + transcript->send_to_verifier(commitment_labels.lookup_u8_0, witness_commitments.lookup_u8_0); + transcript->send_to_verifier(commitment_labels.lookup_u8_1, witness_commitments.lookup_u8_1); + transcript->send_to_verifier(commitment_labels.lookup_u16_0, witness_commitments.lookup_u16_0); + transcript->send_to_verifier(commitment_labels.lookup_u16_1, witness_commitments.lookup_u16_1); + transcript->send_to_verifier(commitment_labels.lookup_u16_2, witness_commitments.lookup_u16_2); + transcript->send_to_verifier(commitment_labels.lookup_u16_3, witness_commitments.lookup_u16_3); + transcript->send_to_verifier(commitment_labels.lookup_u16_4, witness_commitments.lookup_u16_4); + transcript->send_to_verifier(commitment_labels.lookup_u16_5, witness_commitments.lookup_u16_5); + transcript->send_to_verifier(commitment_labels.lookup_u16_6, witness_commitments.lookup_u16_6); + transcript->send_to_verifier(commitment_labels.lookup_u16_7, witness_commitments.lookup_u16_7); + transcript->send_to_verifier(commitment_labels.lookup_u16_8, witness_commitments.lookup_u16_8); + transcript->send_to_verifier(commitment_labels.lookup_u16_9, witness_commitments.lookup_u16_9); + transcript->send_to_verifier(commitment_labels.lookup_u16_10, witness_commitments.lookup_u16_10); + transcript->send_to_verifier(commitment_labels.lookup_u16_11, witness_commitments.lookup_u16_11); + transcript->send_to_verifier(commitment_labels.lookup_u16_12, witness_commitments.lookup_u16_12); + transcript->send_to_verifier(commitment_labels.lookup_u16_13, witness_commitments.lookup_u16_13); + transcript->send_to_verifier(commitment_labels.lookup_u16_14, witness_commitments.lookup_u16_14); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_0, witness_commitments.lookup_div_u16_0); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_1, witness_commitments.lookup_div_u16_1); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_2, witness_commitments.lookup_div_u16_2); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_3, witness_commitments.lookup_div_u16_3); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_4, witness_commitments.lookup_div_u16_4); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_5, witness_commitments.lookup_div_u16_5); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_6, witness_commitments.lookup_div_u16_6); + transcript->send_to_verifier(commitment_labels.lookup_div_u16_7, witness_commitments.lookup_div_u16_7); +>>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) } /** diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp index d7de8af6662..a795633e1e3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp @@ -79,7 +79,7 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vectortemplate receive_from_prover(commitment_labels.perm_cd_mem); + commitments.perm_slice_mem = transcript->template receive_from_prover(commitment_labels.perm_slice_mem); commitments.perm_main_alu = transcript->template receive_from_prover(commitment_labels.perm_main_alu); commitments.perm_main_bin = transcript->template receive_from_prover(commitment_labels.perm_main_bin); commitments.perm_main_conv = transcript->template receive_from_prover(commitment_labels.perm_main_conv); @@ -87,8 +87,8 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vectortemplate receive_from_prover(commitment_labels.perm_main_pos2_perm); commitments.perm_main_pedersen = transcript->template receive_from_prover(commitment_labels.perm_main_pedersen); - commitments.perm_main_cd_copy = - transcript->template receive_from_prover(commitment_labels.perm_main_cd_copy); + commitments.perm_main_slice = + transcript->template receive_from_prover(commitment_labels.perm_main_slice); commitments.perm_main_mem_a = transcript->template receive_from_prover(commitment_labels.perm_main_mem_a); commitments.perm_main_mem_b = @@ -111,6 +111,8 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vectortemplate receive_from_prover(commitment_labels.lookup_byte_operations); commitments.lookup_cd_value = transcript->template receive_from_prover(commitment_labels.lookup_cd_value); + commitments.lookup_ret_value = + transcript->template receive_from_prover(commitment_labels.lookup_ret_value); commitments.lookup_opcode_gas = transcript->template receive_from_prover(commitment_labels.lookup_opcode_gas); commitments.range_check_l2_gas_hi = diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp index 1813b74792e..8f581c51a52 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_slice.test.cpp @@ -30,21 +30,21 @@ class AvmSliceTests : public ::testing::Test { } void gen_single_calldata_copy( - bool indirect, uint32_t cd_size, uint32_t cd_offset, uint32_t copy_size, uint32_t dst_offset) + bool indirect, uint32_t cd_size, uint32_t col_offset, uint32_t copy_size, uint32_t dst_offset) { - ASSERT_LE(cd_offset + copy_size, cd_size); + ASSERT_LE(col_offset + copy_size, cd_size); std::vector calldata; for (size_t i = 0; i < cd_size; i++) { calldata.emplace_back(i * i); } gen_trace_builder(calldata); - trace_builder.op_calldata_copy(static_cast(indirect), cd_offset, copy_size, dst_offset); + trace_builder.op_calldata_copy(static_cast(indirect), col_offset, copy_size, dst_offset); trace_builder.op_return(0, 0, 0); trace = trace_builder.finalize(); } - void validate_single_calldata_copy_trace(uint32_t cd_offset, + void validate_single_calldata_copy_trace(uint32_t col_offset, uint32_t copy_size, uint32_t dst_offset, bool proof_verif = false) @@ -58,7 +58,7 @@ class AvmSliceTests : public ::testing::Test { // Memory trace view pertaining to the calldata_copy operation. auto clk = row->main_clk; auto mem_view = std::views::filter(trace, [clk](Row r) { - return r.mem_clk == clk && r.mem_rw == 1 && r.mem_sel_op_cd_cpy == 1 && + return r.mem_clk == clk && r.mem_rw == 1 && r.mem_sel_op_slice == 1 && r.mem_tag == static_cast(AvmMemoryTag::FF); }); @@ -66,11 +66,11 @@ class AvmSliceTests : public ::testing::Test { size_t count = 0; for (auto const& mem_row : mem_view) { EXPECT_THAT(mem_row, - AllOf(MEM_ROW_FIELD_EQ(val, (cd_offset + count) * (cd_offset + count)), + AllOf(MEM_ROW_FIELD_EQ(val, (col_offset + count) * (col_offset + count)), MEM_ROW_FIELD_EQ(addr, dst_offset + count), MEM_ROW_FIELD_EQ(tag, static_cast(AvmMemoryTag::FF)), MEM_ROW_FIELD_EQ(w_in_tag, static_cast(AvmMemoryTag::FF)), - MEM_ROW_FIELD_EQ(r_in_tag, static_cast(AvmMemoryTag::U0)), + MEM_ROW_FIELD_EQ(r_in_tag, static_cast(AvmMemoryTag::FF)), MEM_ROW_FIELD_EQ(tag_err, 0))); count++; } @@ -81,32 +81,32 @@ class AvmSliceTests : public ::testing::Test { auto slice_view = std::views::filter(trace, [clk](Row r) { return r.slice_clk == clk && r.slice_sel_cd_cpy == 1; }); - FF last_clk = 0; + FF last_row_idx = 0; // Check that the slice trace is as expected. count = 0; for (auto const& slice_row : slice_view) { EXPECT_THAT(slice_row, - AllOf(SLICE_ROW_FIELD_EQ(val, (cd_offset + count) * (cd_offset + count)), + AllOf(SLICE_ROW_FIELD_EQ(val, (col_offset + count) * (col_offset + count)), SLICE_ROW_FIELD_EQ(addr, dst_offset + count), - SLICE_ROW_FIELD_EQ(cd_offset, cd_offset + count), + SLICE_ROW_FIELD_EQ(col_offset, col_offset + count), SLICE_ROW_FIELD_EQ(cnt, copy_size - count), - SLICE_ROW_FIELD_EQ(sel_start_cd_cpy, static_cast(count == 0)))); + SLICE_ROW_FIELD_EQ(sel_start, static_cast(count == 0)))); count++; if (count == copy_size) { - last_clk = slice_row.main_clk; + last_row_idx = slice_row.main_clk; } } // Check that the extra final row is well-formed. - EXPECT_THAT(trace.at(static_cast(last_clk + 1)), + EXPECT_THAT(trace.at(static_cast(last_row_idx + 1)), AllOf(SLICE_ROW_FIELD_EQ(addr, FF(dst_offset) + FF(copy_size)), - SLICE_ROW_FIELD_EQ(cd_offset, cd_offset + copy_size), + SLICE_ROW_FIELD_EQ(col_offset, col_offset + copy_size), SLICE_ROW_FIELD_EQ(cnt, 0), - SLICE_ROW_FIELD_EQ(clk, 0), + SLICE_ROW_FIELD_EQ(clk, clk), SLICE_ROW_FIELD_EQ(sel_cd_cpy, 0), - SLICE_ROW_FIELD_EQ(sel_start_cd_cpy, 0))); + SLICE_ROW_FIELD_EQ(sel_start, 0))); if (proof_verif) { validate_trace(std::move(trace), public_inputs, calldata, {}, true); @@ -249,7 +249,7 @@ TEST_F(AvmSliceTests, indirectFailedResolution) auto slice_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.slice_sel_cd_cpy == 1; }); EXPECT_EQ(slice_row, trace.end()); - auto count = std::ranges::count_if(trace.begin(), trace.end(), [](Row r) { return r.mem_sel_op_cd_cpy == 1; }); + auto count = std::ranges::count_if(trace.begin(), trace.end(), [](Row r) { return r.mem_sel_op_slice == 1; }); // Check that MEM trace does not contain any entry related to calldata_copy write. EXPECT_EQ(count, 0); @@ -295,7 +295,7 @@ TEST_F(AvmSliceNegativeTests, wrongCDValueInMemory) trace.begin(), trace.end(), [clk, addr](Row r) { return r.mem_clk == clk && r.mem_addr == addr; }); mem_row->mem_val = 98; - EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_CD_MEM"); + EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_SLICE_MEM"); } TEST_F(AvmSliceNegativeTests, wrongCDValueInCalldataColumn) @@ -323,14 +323,15 @@ TEST_F(AvmSliceNegativeTests, disableMemWriteEntry) gen_single_calldata_copy(false, 10, 0, 10, 0); // Multiple adjustements to get valid MEM trace. - trace.at(10).mem_sel_op_cd_cpy = 0; + trace.at(10).mem_sel_op_slice = 0; + trace.at(10).mem_skip_check_tag = 0; trace.at(10).mem_sel_mem = 0; trace.at(9).mem_last = 1; trace.at(10).mem_last = 0; trace.at(10).mem_tsp = 12; trace.at(9).mem_sel_rng_chk = 0; - EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_CD_MEM"); + EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_SLICE_MEM"); } } // namespace tests_avm From 26ea2600cf91046ef949277bd7b6e94f75fbd893 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 10 Jul 2024 11:08:48 +0000 Subject: [PATCH 10/12] 7381: fixes after rebase --- .../generated/avm/lookup_ret_value.hpp | 115 +- .../relations/generated/avm/main.hpp | 48 +- .../generated/avm/perm_main_slice.hpp | 52 +- .../generated/avm/perm_slice_mem.hpp | 52 +- .../vm/generated/avm_circuit_builder.hpp | 421 ----- .../barretenberg/vm/generated/avm_flavor.hpp | 1433 ----------------- .../vm/generated/avm_full_row.cpp | 38 +- .../vm/generated/avm_full_row.hpp | 19 +- .../barretenberg/vm/generated/avm_prover.cpp | 125 -- 9 files changed, 63 insertions(+), 2240 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_ret_value.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_ret_value.hpp index a671965300d..7e341860cb9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_ret_value.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_ret_value.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" @@ -9,97 +7,22 @@ namespace bb { -/** - * @brief This class contains an example of how to set LookupSettings classes used by the - * GenericLookupRelationImpl class to specify a scaled lookup - * - * @details To create your own lookup: - * 1) Create a copy of this class and rename it - * 2) Update all the values with the ones needed for your lookup - * 3) Update "DECLARE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS" and "DEFINE_LOOKUP_IMPLEMENTATIONS_FOR_ALL_SETTINGS" to - * include the new settings - * 4) Add the relation with the chosen settings to Relations in the flavor (for example,"` - * using Relations = std::tuple>;)` - * - */ class lookup_ret_value_lookup_settings { public: - /** - * @brief The number of read terms (how many lookups we perform) in each row - * - */ static constexpr size_t READ_TERMS = 1; - /** - * @brief The number of write terms (how many additions to the lookup table we make) in each row - * - */ static constexpr size_t WRITE_TERMS = 1; - - /** - * @brief The type of READ_TERM used for each read index (basic and scaled) - * - */ static constexpr size_t READ_TERM_TYPES[READ_TERMS] = { 0 }; - - /** - * @brief They type of WRITE_TERM used for each write index - * - */ static constexpr size_t WRITE_TERM_TYPES[WRITE_TERMS] = { 0 }; - - /** - * @brief How many values represent a single lookup object. This value is used by the automatic read term - * implementation in the relation in case the lookup is a basic or scaled tuple and in the write term if it's a - * basic tuple - * - */ static constexpr size_t LOOKUP_TUPLE_SIZE = 2; - - /** - * @brief The polynomial degree of the relation telling us if the inverse polynomial value needs to be computed - * - */ static constexpr size_t INVERSE_EXISTS_POLYNOMIAL_DEGREE = 4; - - /** - * @brief The degree of the read term if implemented arbitrarily. This value is not used by basic and scaled read - * terms, but will cause compilation error if not defined - * - */ static constexpr size_t READ_TERM_DEGREE = 0; - - /** - * @brief The degree of the write term if implemented arbitrarily. This value is not used by the basic write - * term, but will cause compilation error if not defined - * - */ - static constexpr size_t WRITE_TERM_DEGREE = 0; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial exists at this index. - * Otherwise the value needs to be set to zero. - * - * @details If this is true then the lookup takes place in this row - * - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.slice_sel_return == 1 || in.main_sel_returndata == 1); } - /** - * @brief Subprocedure for computing the value deciding if the inverse polynomial value needs to be checked in this - * row - * - * @tparam Accumulator Type specified by the lookup relation - * @tparam AllEntities Values/Univariates of all entities row - * @param in Value/Univariate of all entities at row/edge - * @return Accumulator - */ - template static inline auto compute_inverse_exists(const AllEntities& in) { @@ -109,30 +32,8 @@ class lookup_ret_value_lookup_settings { return (is_operation + is_table_entry - is_operation * is_table_entry); } - /** - * @brief Get all the entities for the lookup when need to update them - * - * @details The generic structure of this tuple is described in ./generic_lookup_relation.hpp . The following is - description for the current case: - The entities are returned as a tuple of references in the following order (this is for ): - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that specifies how many times the lookup table entry at this row has been looked up - * - READ_TERMS entities/polynomials that enable individual lookup operations - * - The entity/polynomial that enables adding an entry to the lookup table in this row - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the basic tuple being looked up as the first read term - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the previous accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the shifts in the second read term (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing the current accumulators in the second read term - (scaled tuple) - * - LOOKUP_TUPLE_SIZE entities/polynomials representing basic tuples added to the table - * - * @return All the entities needed for the lookup - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_ret_value, in.lookup_ret_value_counts, in.slice_sel_return, @@ -143,16 +44,8 @@ class lookup_ret_value_lookup_settings { in.main_returndata); } - /** - * @brief Get all the entities for the lookup when we only need to read them - * @details Same as in get_const_entities, but nonconst - * - * @return All the entities needed for the lookup - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.lookup_ret_value, in.lookup_ret_value_counts, in.slice_sel_return, @@ -164,7 +57,11 @@ class lookup_ret_value_lookup_settings { } }; -template using lookup_ret_value_relation = GenericLookupRelation; +template +class lookup_ret_value_relation : public GenericLookupRelation { + public: + static constexpr const char* NAME = "lookup_ret_value"; +}; template using lookup_ret_value = GenericLookup; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp index a678bd9386d..65065fe1f2d 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp @@ -1241,95 +1241,63 @@ template class mainImpl { // Contribution 119 { Avm_DECLARE_VIEWS(119); -<<<<<<< HEAD - auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(39))); -======= auto tmp = (main_sel_op_function_selector * (kernel_kernel_in_offset - FF(2))); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) tmp *= scaling_factor; std::get<119>(evals) += tmp; } // Contribution 120 { Avm_DECLARE_VIEWS(120); -<<<<<<< HEAD - auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(28))); -======= - auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(40))); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) + auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(39))); tmp *= scaling_factor; std::get<120>(evals) += tmp; } // Contribution 121 { Avm_DECLARE_VIEWS(121); -<<<<<<< HEAD - auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(29))); -======= - auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(29))); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) + auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(28))); tmp *= scaling_factor; std::get<121>(evals) += tmp; } // Contribution 122 { Avm_DECLARE_VIEWS(122); -<<<<<<< HEAD - auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(30))); -======= - auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(30))); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) + auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(29))); tmp *= scaling_factor; std::get<122>(evals) += tmp; } // Contribution 123 { Avm_DECLARE_VIEWS(123); -<<<<<<< HEAD - auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(31))); -======= - auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(31))); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) + auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(30))); tmp *= scaling_factor; std::get<123>(evals) += tmp; } // Contribution 124 { Avm_DECLARE_VIEWS(124); -<<<<<<< HEAD - auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(32))); -======= - auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(32))); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) + auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(31))); tmp *= scaling_factor; std::get<124>(evals) += tmp; } // Contribution 125 { Avm_DECLARE_VIEWS(125); -<<<<<<< HEAD - auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(34))); -======= - auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(33))); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) + auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(32))); tmp *= scaling_factor; std::get<125>(evals) += tmp; } // Contribution 126 { Avm_DECLARE_VIEWS(126); -<<<<<<< HEAD - auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(35))); -======= - auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(35))); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) + auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(34))); tmp *= scaling_factor; std::get<126>(evals) += tmp; } // Contribution 127 { Avm_DECLARE_VIEWS(127); - auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(36))); + auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(35))); tmp *= scaling_factor; std::get<127>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_slice.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_slice.hpp index a083af609ec..6297b546d91 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_slice.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_slice.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_main_slice_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 7; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_sel_slice_gadget == 1 || in.slice_sel_start == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_main_slice, in.main_sel_slice_gadget, in.main_sel_slice_gadget, @@ -66,26 +39,8 @@ class perm_main_slice_permutation_settings { in.slice_sel_return); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_main_slice, in.main_sel_slice_gadget, in.main_sel_slice_gadget, @@ -108,7 +63,10 @@ class perm_main_slice_permutation_settings { }; template -using perm_main_slice_relation = GenericPermutationRelation; +class perm_main_slice_relation : public GenericPermutationRelation { + public: + static constexpr const char* NAME = "perm_main_slice"; +}; template using perm_main_slice = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_slice_mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_slice_mem.hpp index b44fbce1b7b..e0b871a779b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_slice_mem.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_slice_mem.hpp @@ -1,5 +1,3 @@ - - #pragma once #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" @@ -14,38 +12,13 @@ class perm_slice_mem_permutation_settings { // This constant defines how many columns are bundled together to form each set. constexpr static size_t COLUMNS_PER_SET = 5; - /** - * @brief If this method returns true on a row of values, then the inverse polynomial at this index. Otherwise the - * value needs to be set to zero. - * - * @details If this is true then permutation takes place in this row - */ - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.slice_sel_mem_active == 1 || in.mem_sel_op_slice == 1); } - /** - * @brief Get all the entities for the permutation when we don't need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.perm_slice_mem, in.slice_sel_mem_active, in.slice_sel_mem_active, @@ -62,26 +35,8 @@ class perm_slice_mem_permutation_settings { in.mem_rw); } - /** - * @brief Get all the entities for the permutation when need to update them - * - * @details The entities are returned as a tuple of references in the following order: - * - The entity/polynomial used to store the product of the inverse values - * - The entity/polynomial that switches on the subrelation of the permutation relation that ensures correctness of - * the inverse polynomial - * - The entity/polynomial that enables adding a tuple-generated value from the first set to the logderivative sum - * subrelation - * - The entity/polynomial that enables adding a tuple-generated value from the second set to the logderivative sum - * subrelation - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the first set (N.B. ORDER IS IMPORTANT!) - * - A sequence of COLUMNS_PER_SET entities/polynomials that represent the second set (N.B. ORDER IS IMPORTANT!) - * - * @return All the entities needed for the permutation - */ - template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.perm_slice_mem, in.slice_sel_mem_active, in.slice_sel_mem_active, @@ -100,7 +55,10 @@ class perm_slice_mem_permutation_settings { }; template -using perm_slice_mem_relation = GenericPermutationRelation; +class perm_slice_mem_relation : public GenericPermutationRelation { + public: + static constexpr const char* NAME = "perm_slice_mem"; +}; template using perm_slice_mem = GenericPermutation; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index 56bfe24a6dc..3fd2448cd4e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -19,427 +19,6 @@ namespace bb { -<<<<<<< HEAD -======= -template struct AvmFullRow { - FF main_clk{}; - FF main_sel_first{}; - FF kernel_kernel_inputs{}; - FF kernel_kernel_value_out{}; - FF kernel_kernel_side_effect_out{}; - FF kernel_kernel_metadata_out{}; - FF main_calldata{}; - FF main_returndata{}; - FF alu_a_hi{}; - FF alu_a_lo{}; - FF alu_b_hi{}; - FF alu_b_lo{}; - FF alu_borrow{}; - FF alu_cf{}; - FF alu_clk{}; - FF alu_cmp_rng_ctr{}; - FF alu_div_u16_r0{}; - FF alu_div_u16_r1{}; - FF alu_div_u16_r2{}; - FF alu_div_u16_r3{}; - FF alu_div_u16_r4{}; - FF alu_div_u16_r5{}; - FF alu_div_u16_r6{}; - FF alu_div_u16_r7{}; - FF alu_divisor_hi{}; - FF alu_divisor_lo{}; - FF alu_ff_tag{}; - FF alu_ia{}; - FF alu_ib{}; - FF alu_ic{}; - FF alu_in_tag{}; - FF alu_op_add{}; - FF alu_op_cast{}; - FF alu_op_cast_prev{}; - FF alu_op_div{}; - FF alu_op_div_a_lt_b{}; - FF alu_op_div_std{}; - FF alu_op_eq{}; - FF alu_op_eq_diff_inv{}; - FF alu_op_lt{}; - FF alu_op_lte{}; - FF alu_op_mul{}; - FF alu_op_not{}; - FF alu_op_shl{}; - FF alu_op_shr{}; - FF alu_op_sub{}; - FF alu_p_a_borrow{}; - FF alu_p_b_borrow{}; - FF alu_p_sub_a_hi{}; - FF alu_p_sub_a_lo{}; - FF alu_p_sub_b_hi{}; - FF alu_p_sub_b_lo{}; - FF alu_partial_prod_hi{}; - FF alu_partial_prod_lo{}; - FF alu_quotient_hi{}; - FF alu_quotient_lo{}; - FF alu_remainder{}; - FF alu_res_hi{}; - FF alu_res_lo{}; - FF alu_sel_alu{}; - FF alu_sel_cmp{}; - FF alu_sel_div_rng_chk{}; - FF alu_sel_rng_chk{}; - FF alu_sel_rng_chk_lookup{}; - FF alu_sel_shift_which{}; - FF alu_shift_lt_bit_len{}; - FF alu_t_sub_s_bits{}; - FF alu_two_pow_s{}; - FF alu_two_pow_t_sub_s{}; - FF alu_u128_tag{}; - FF alu_u16_r0{}; - FF alu_u16_r1{}; - FF alu_u16_r10{}; - FF alu_u16_r11{}; - FF alu_u16_r12{}; - FF alu_u16_r13{}; - FF alu_u16_r14{}; - FF alu_u16_r2{}; - FF alu_u16_r3{}; - FF alu_u16_r4{}; - FF alu_u16_r5{}; - FF alu_u16_r6{}; - FF alu_u16_r7{}; - FF alu_u16_r8{}; - FF alu_u16_r9{}; - FF alu_u16_tag{}; - FF alu_u32_tag{}; - FF alu_u64_tag{}; - FF alu_u8_r0{}; - FF alu_u8_r1{}; - FF alu_u8_tag{}; - FF binary_acc_ia{}; - FF binary_acc_ib{}; - FF binary_acc_ic{}; - FF binary_clk{}; - FF binary_ia_bytes{}; - FF binary_ib_bytes{}; - FF binary_ic_bytes{}; - FF binary_in_tag{}; - FF binary_mem_tag_ctr{}; - FF binary_mem_tag_ctr_inv{}; - FF binary_op_id{}; - FF binary_sel_bin{}; - FF binary_start{}; - FF byte_lookup_sel_bin{}; - FF byte_lookup_table_byte_lengths{}; - FF byte_lookup_table_in_tags{}; - FF byte_lookup_table_input_a{}; - FF byte_lookup_table_input_b{}; - FF byte_lookup_table_op_id{}; - FF byte_lookup_table_output{}; - FF conversion_clk{}; - FF conversion_input{}; - FF conversion_num_limbs{}; - FF conversion_radix{}; - FF conversion_sel_to_radix_le{}; - FF gas_da_gas_fixed_table{}; - FF gas_l2_gas_fixed_table{}; - FF gas_sel_gas_cost{}; - FF keccakf1600_clk{}; - FF keccakf1600_input{}; - FF keccakf1600_output{}; - FF keccakf1600_sel_keccakf1600{}; - FF kernel_emit_l2_to_l1_msg_write_offset{}; - FF kernel_emit_note_hash_write_offset{}; - FF kernel_emit_nullifier_write_offset{}; - FF kernel_emit_unencrypted_log_write_offset{}; - FF kernel_kernel_in_offset{}; - FF kernel_kernel_out_offset{}; - FF kernel_l1_to_l2_msg_exists_write_offset{}; - FF kernel_note_hash_exist_write_offset{}; - FF kernel_nullifier_exists_write_offset{}; - FF kernel_nullifier_non_exists_write_offset{}; - FF kernel_q_public_input_kernel_add_to_table{}; - FF kernel_q_public_input_kernel_out_add_to_table{}; - FF kernel_side_effect_counter{}; - FF kernel_sload_write_offset{}; - FF kernel_sstore_write_offset{}; - FF main_abs_da_rem_gas_hi{}; - FF main_abs_da_rem_gas_lo{}; - FF main_abs_l2_rem_gas_hi{}; - FF main_abs_l2_rem_gas_lo{}; - FF main_alu_in_tag{}; - FF main_bin_op_id{}; - FF main_call_ptr{}; - FF main_da_gas_op_cost{}; - FF main_da_gas_remaining{}; - FF main_da_out_of_gas{}; - FF main_ia{}; - FF main_ib{}; - FF main_ic{}; - FF main_id{}; - FF main_id_zero{}; - FF main_ind_addr_a{}; - FF main_ind_addr_b{}; - FF main_ind_addr_c{}; - FF main_ind_addr_d{}; - FF main_internal_return_ptr{}; - FF main_inv{}; - FF main_l2_gas_op_cost{}; - FF main_l2_gas_remaining{}; - FF main_l2_out_of_gas{}; - FF main_mem_addr_a{}; - FF main_mem_addr_b{}; - FF main_mem_addr_c{}; - FF main_mem_addr_d{}; - FF main_op_err{}; - FF main_opcode_val{}; - FF main_pc{}; - FF main_r_in_tag{}; - FF main_rwa{}; - FF main_rwb{}; - FF main_rwc{}; - FF main_rwd{}; - FF main_sel_alu{}; - FF main_sel_bin{}; - FF main_sel_calldata{}; - FF main_sel_gas_accounting_active{}; - FF main_sel_last{}; - FF main_sel_mem_op_a{}; - FF main_sel_mem_op_activate_gas{}; - FF main_sel_mem_op_b{}; - FF main_sel_mem_op_c{}; - FF main_sel_mem_op_d{}; - FF main_sel_mov_ia_to_ic{}; - FF main_sel_mov_ib_to_ic{}; - FF main_sel_op_add{}; - FF main_sel_op_address{}; - FF main_sel_op_and{}; - FF main_sel_op_block_number{}; - 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_coinbase{}; - FF main_sel_op_dagasleft{}; - FF main_sel_op_div{}; - FF main_sel_op_emit_l2_to_l1_msg{}; - FF main_sel_op_emit_note_hash{}; - FF main_sel_op_emit_nullifier{}; - FF main_sel_op_emit_unencrypted_log{}; - FF main_sel_op_eq{}; - FF main_sel_op_external_call{}; - FF main_sel_op_external_return{}; - FF main_sel_op_fdiv{}; - FF main_sel_op_fee_per_da_gas{}; - FF main_sel_op_fee_per_l2_gas{}; - FF main_sel_op_function_selector{}; - FF main_sel_op_get_contract_instance{}; - FF main_sel_op_halt{}; - FF main_sel_op_internal_call{}; - FF main_sel_op_internal_return{}; - FF main_sel_op_jump{}; - FF main_sel_op_jumpi{}; - FF main_sel_op_keccak{}; - FF main_sel_op_l1_to_l2_msg_exists{}; - FF main_sel_op_l2gasleft{}; - FF main_sel_op_lt{}; - FF main_sel_op_lte{}; - FF main_sel_op_mov{}; - FF main_sel_op_mul{}; - FF main_sel_op_not{}; - FF main_sel_op_note_hash_exists{}; - FF main_sel_op_nullifier_exists{}; - FF main_sel_op_or{}; - FF main_sel_op_pedersen{}; - FF main_sel_op_poseidon2{}; - FF main_sel_op_radix_le{}; - FF main_sel_op_sender{}; - FF main_sel_op_sha256{}; - FF main_sel_op_shl{}; - FF main_sel_op_shr{}; - FF main_sel_op_sload{}; - FF main_sel_op_sstore{}; - FF main_sel_op_storage_address{}; - FF main_sel_op_sub{}; - FF main_sel_op_timestamp{}; - FF main_sel_op_transaction_fee{}; - FF main_sel_op_version{}; - FF main_sel_op_xor{}; - FF main_sel_q_kernel_lookup{}; - FF main_sel_q_kernel_output_lookup{}; - FF main_sel_resolve_ind_addr_a{}; - FF main_sel_resolve_ind_addr_b{}; - FF main_sel_resolve_ind_addr_c{}; - FF main_sel_resolve_ind_addr_d{}; - FF main_sel_returndata{}; - FF main_sel_rng_16{}; - FF main_sel_rng_8{}; - FF main_sel_slice_gadget{}; - FF main_space_id{}; - FF main_tag_err{}; - FF main_w_in_tag{}; - FF mem_addr{}; - FF mem_clk{}; - FF mem_diff_hi{}; - FF mem_diff_lo{}; - FF mem_diff_mid{}; - FF mem_glob_addr{}; - FF mem_last{}; - FF mem_lastAccess{}; - FF mem_one_min_inv{}; - FF mem_r_in_tag{}; - FF mem_rw{}; - FF mem_sel_mem{}; - FF mem_sel_mov_ia_to_ic{}; - FF mem_sel_mov_ib_to_ic{}; - 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_slice{}; - FF mem_sel_resolve_ind_addr_a{}; - FF mem_sel_resolve_ind_addr_b{}; - FF mem_sel_resolve_ind_addr_c{}; - FF mem_sel_resolve_ind_addr_d{}; - FF mem_sel_rng_chk{}; - FF mem_skip_check_tag{}; - FF mem_space_id{}; - FF mem_tag{}; - FF mem_tag_err{}; - FF mem_tsp{}; - FF mem_val{}; - FF mem_w_in_tag{}; - FF pedersen_clk{}; - FF pedersen_input{}; - FF pedersen_output{}; - FF pedersen_sel_pedersen{}; - FF poseidon2_clk{}; - FF poseidon2_input{}; - FF poseidon2_output{}; - FF poseidon2_sel_poseidon_perm{}; - FF powers_power_of_2{}; - FF sha256_clk{}; - FF sha256_input{}; - FF sha256_output{}; - FF sha256_sel_sha256_compression{}; - FF sha256_state{}; - FF slice_addr{}; - FF slice_clk{}; - FF slice_cnt{}; - FF slice_col_offset{}; - FF slice_one_min_inv{}; - FF slice_sel_cd_cpy{}; - FF slice_sel_mem_active{}; - FF slice_sel_return{}; - FF slice_sel_start{}; - FF slice_space_id{}; - FF slice_val{}; - FF perm_slice_mem{}; - FF perm_main_alu{}; - FF perm_main_bin{}; - FF perm_main_conv{}; - FF perm_main_pos2_perm{}; - FF perm_main_pedersen{}; - FF perm_main_slice{}; - FF perm_main_mem_a{}; - FF perm_main_mem_b{}; - FF perm_main_mem_c{}; - FF perm_main_mem_d{}; - FF perm_main_mem_ind_addr_a{}; - FF perm_main_mem_ind_addr_b{}; - FF perm_main_mem_ind_addr_c{}; - FF perm_main_mem_ind_addr_d{}; - FF lookup_byte_lengths{}; - FF lookup_byte_operations{}; - FF lookup_cd_value{}; - FF lookup_ret_value{}; - FF lookup_opcode_gas{}; - FF range_check_l2_gas_hi{}; - FF range_check_l2_gas_lo{}; - FF range_check_da_gas_hi{}; - FF range_check_da_gas_lo{}; - FF kernel_output_lookup{}; - FF lookup_into_kernel{}; - FF incl_main_tag_err{}; - FF incl_mem_tag_err{}; - FF lookup_mem_rng_chk_lo{}; - FF lookup_mem_rng_chk_mid{}; - FF lookup_mem_rng_chk_hi{}; - FF lookup_pow_2_0{}; - FF lookup_pow_2_1{}; - FF lookup_u8_0{}; - FF lookup_u8_1{}; - FF lookup_u16_0{}; - FF lookup_u16_1{}; - FF lookup_u16_2{}; - FF lookup_u16_3{}; - FF lookup_u16_4{}; - FF lookup_u16_5{}; - FF lookup_u16_6{}; - FF lookup_u16_7{}; - FF lookup_u16_8{}; - FF lookup_u16_9{}; - FF lookup_u16_10{}; - FF lookup_u16_11{}; - FF lookup_u16_12{}; - FF lookup_u16_13{}; - FF lookup_u16_14{}; - FF lookup_div_u16_0{}; - FF lookup_div_u16_1{}; - FF lookup_div_u16_2{}; - FF lookup_div_u16_3{}; - FF lookup_div_u16_4{}; - FF lookup_div_u16_5{}; - FF lookup_div_u16_6{}; - FF lookup_div_u16_7{}; - FF lookup_byte_lengths_counts{}; - FF lookup_byte_operations_counts{}; - FF lookup_cd_value_counts{}; - FF lookup_ret_value_counts{}; - FF lookup_opcode_gas_counts{}; - FF range_check_l2_gas_hi_counts{}; - FF range_check_l2_gas_lo_counts{}; - FF range_check_da_gas_hi_counts{}; - FF range_check_da_gas_lo_counts{}; - FF kernel_output_lookup_counts{}; - FF lookup_into_kernel_counts{}; - FF incl_main_tag_err_counts{}; - FF incl_mem_tag_err_counts{}; - FF lookup_mem_rng_chk_lo_counts{}; - FF lookup_mem_rng_chk_mid_counts{}; - FF lookup_mem_rng_chk_hi_counts{}; - FF lookup_pow_2_0_counts{}; - FF lookup_pow_2_1_counts{}; - FF lookup_u8_0_counts{}; - FF lookup_u8_1_counts{}; - FF lookup_u16_0_counts{}; - FF lookup_u16_1_counts{}; - FF lookup_u16_2_counts{}; - FF lookup_u16_3_counts{}; - FF lookup_u16_4_counts{}; - FF lookup_u16_5_counts{}; - FF lookup_u16_6_counts{}; - FF lookup_u16_7_counts{}; - FF lookup_u16_8_counts{}; - FF lookup_u16_9_counts{}; - FF lookup_u16_10_counts{}; - FF lookup_u16_11_counts{}; - FF lookup_u16_12_counts{}; - FF lookup_u16_13_counts{}; - FF lookup_u16_14_counts{}; - FF lookup_div_u16_0_counts{}; - FF lookup_div_u16_1_counts{}; - FF lookup_div_u16_2_counts{}; - FF lookup_div_u16_3_counts{}; - FF lookup_div_u16_4_counts{}; - FF lookup_div_u16_5_counts{}; - FF lookup_div_u16_6_counts{}; - FF lookup_div_u16_7_counts{}; - - [[maybe_unused]] static std::vector names(); -}; - -template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); - ->>>>>>> b9f802b1e7 (7381: add returndata public column) class AvmCircuitBuilder { public: using Flavor = bb::AvmFlavor; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index bea05c76539..682ef3d1cd9 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -909,189 +909,6 @@ class AvmFlavor { slice_sel_return, slice_space_id }; } -<<<<<<< HEAD -======= - - void compute_logderivative_inverses(const RelationParameters& relation_parameters) - { - ProverPolynomials prover_polynomials = ProverPolynomials(*this); - - AVM_TRACK_TIME("compute_logderivative_inverse/perm_slice_mem_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_alu_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_bin_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_conv_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_pos2_perm_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_pedersen_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_slice_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_a_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_b_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_c_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_d_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_a_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_b_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_c_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/perm_main_mem_ind_addr_d_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_byte_lengths_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_byte_operations_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_cd_value_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_ret_value_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_opcode_gas_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/range_check_l2_gas_hi_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/range_check_l2_gas_lo_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/range_check_da_gas_hi_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/range_check_da_gas_lo_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/kernel_output_lookup_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_into_kernel_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/incl_main_tag_err_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/incl_mem_tag_err_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_lo_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_mid_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_mem_rng_chk_hi_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_pow_2_0_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_pow_2_1_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u8_0_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u8_1_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_0_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_1_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_2_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_3_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_4_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_5_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_6_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_7_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_8_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_9_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_10_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_11_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_12_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_13_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_u16_14_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_0_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_1_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_2_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_3_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_4_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_5_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_6_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - AVM_TRACK_TIME("compute_logderivative_inverse/lookup_div_u16_7_ms", - (bb::compute_logderivative_inverse>( - prover_polynomials, relation_parameters, this->circuit_size))); - } ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) }; using VerificationKey = VerificationKey_, VerifierCommitmentKey>; @@ -2977,419 +2794,7 @@ class AvmFlavor { public: uint32_t circuit_size; -<<<<<<< HEAD std::array commitments; -======= - Commitment kernel_kernel_inputs; - Commitment kernel_kernel_value_out; - Commitment kernel_kernel_side_effect_out; - Commitment kernel_kernel_metadata_out; - Commitment main_calldata; - Commitment main_returndata; - Commitment alu_a_hi; - Commitment alu_a_lo; - Commitment alu_b_hi; - Commitment alu_b_lo; - Commitment alu_borrow; - Commitment alu_cf; - Commitment alu_clk; - Commitment alu_cmp_rng_ctr; - Commitment alu_div_u16_r0; - Commitment alu_div_u16_r1; - Commitment alu_div_u16_r2; - Commitment alu_div_u16_r3; - Commitment alu_div_u16_r4; - Commitment alu_div_u16_r5; - Commitment alu_div_u16_r6; - Commitment alu_div_u16_r7; - Commitment alu_divisor_hi; - Commitment alu_divisor_lo; - Commitment alu_ff_tag; - Commitment alu_ia; - Commitment alu_ib; - Commitment alu_ic; - Commitment alu_in_tag; - Commitment alu_op_add; - Commitment alu_op_cast; - Commitment alu_op_cast_prev; - Commitment alu_op_div; - Commitment alu_op_div_a_lt_b; - Commitment alu_op_div_std; - Commitment alu_op_eq; - Commitment alu_op_eq_diff_inv; - Commitment alu_op_lt; - Commitment alu_op_lte; - Commitment alu_op_mul; - Commitment alu_op_not; - Commitment alu_op_shl; - Commitment alu_op_shr; - Commitment alu_op_sub; - Commitment alu_p_a_borrow; - Commitment alu_p_b_borrow; - Commitment alu_p_sub_a_hi; - Commitment alu_p_sub_a_lo; - Commitment alu_p_sub_b_hi; - Commitment alu_p_sub_b_lo; - Commitment alu_partial_prod_hi; - Commitment alu_partial_prod_lo; - Commitment alu_quotient_hi; - Commitment alu_quotient_lo; - Commitment alu_remainder; - Commitment alu_res_hi; - Commitment alu_res_lo; - Commitment alu_sel_alu; - Commitment alu_sel_cmp; - Commitment alu_sel_div_rng_chk; - Commitment alu_sel_rng_chk; - Commitment alu_sel_rng_chk_lookup; - Commitment alu_sel_shift_which; - Commitment alu_shift_lt_bit_len; - Commitment alu_t_sub_s_bits; - Commitment alu_two_pow_s; - Commitment alu_two_pow_t_sub_s; - Commitment alu_u128_tag; - Commitment alu_u16_r0; - Commitment alu_u16_r1; - Commitment alu_u16_r10; - Commitment alu_u16_r11; - Commitment alu_u16_r12; - Commitment alu_u16_r13; - Commitment alu_u16_r14; - Commitment alu_u16_r2; - Commitment alu_u16_r3; - Commitment alu_u16_r4; - Commitment alu_u16_r5; - Commitment alu_u16_r6; - Commitment alu_u16_r7; - Commitment alu_u16_r8; - Commitment alu_u16_r9; - Commitment alu_u16_tag; - Commitment alu_u32_tag; - Commitment alu_u64_tag; - Commitment alu_u8_r0; - Commitment alu_u8_r1; - Commitment alu_u8_tag; - Commitment binary_acc_ia; - Commitment binary_acc_ib; - Commitment binary_acc_ic; - Commitment binary_clk; - Commitment binary_ia_bytes; - Commitment binary_ib_bytes; - Commitment binary_ic_bytes; - Commitment binary_in_tag; - Commitment binary_mem_tag_ctr; - Commitment binary_mem_tag_ctr_inv; - Commitment binary_op_id; - Commitment binary_sel_bin; - Commitment binary_start; - Commitment byte_lookup_sel_bin; - Commitment byte_lookup_table_byte_lengths; - Commitment byte_lookup_table_in_tags; - Commitment byte_lookup_table_input_a; - Commitment byte_lookup_table_input_b; - Commitment byte_lookup_table_op_id; - Commitment byte_lookup_table_output; - Commitment conversion_clk; - Commitment conversion_input; - Commitment conversion_num_limbs; - Commitment conversion_radix; - Commitment conversion_sel_to_radix_le; - Commitment gas_da_gas_fixed_table; - Commitment gas_l2_gas_fixed_table; - Commitment gas_sel_gas_cost; - Commitment keccakf1600_clk; - Commitment keccakf1600_input; - Commitment keccakf1600_output; - Commitment keccakf1600_sel_keccakf1600; - Commitment kernel_emit_l2_to_l1_msg_write_offset; - Commitment kernel_emit_note_hash_write_offset; - Commitment kernel_emit_nullifier_write_offset; - Commitment kernel_emit_unencrypted_log_write_offset; - Commitment kernel_kernel_in_offset; - Commitment kernel_kernel_out_offset; - Commitment kernel_l1_to_l2_msg_exists_write_offset; - Commitment kernel_note_hash_exist_write_offset; - Commitment kernel_nullifier_exists_write_offset; - Commitment kernel_nullifier_non_exists_write_offset; - Commitment kernel_q_public_input_kernel_add_to_table; - Commitment kernel_q_public_input_kernel_out_add_to_table; - Commitment kernel_side_effect_counter; - Commitment kernel_sload_write_offset; - Commitment kernel_sstore_write_offset; - Commitment main_abs_da_rem_gas_hi; - Commitment main_abs_da_rem_gas_lo; - Commitment main_abs_l2_rem_gas_hi; - Commitment main_abs_l2_rem_gas_lo; - Commitment main_alu_in_tag; - Commitment main_bin_op_id; - Commitment main_call_ptr; - Commitment main_da_gas_op_cost; - Commitment main_da_gas_remaining; - Commitment main_da_out_of_gas; - Commitment main_ia; - Commitment main_ib; - Commitment main_ic; - Commitment main_id; - Commitment main_id_zero; - Commitment main_ind_addr_a; - Commitment main_ind_addr_b; - Commitment main_ind_addr_c; - Commitment main_ind_addr_d; - Commitment main_internal_return_ptr; - Commitment main_inv; - Commitment main_l2_gas_op_cost; - Commitment main_l2_gas_remaining; - Commitment main_l2_out_of_gas; - Commitment main_mem_addr_a; - Commitment main_mem_addr_b; - Commitment main_mem_addr_c; - Commitment main_mem_addr_d; - Commitment main_op_err; - Commitment main_opcode_val; - Commitment main_pc; - Commitment main_r_in_tag; - Commitment main_rwa; - Commitment main_rwb; - Commitment main_rwc; - Commitment main_rwd; - Commitment main_sel_alu; - Commitment main_sel_bin; - Commitment main_sel_calldata; - Commitment main_sel_gas_accounting_active; - Commitment main_sel_last; - Commitment main_sel_mem_op_a; - Commitment main_sel_mem_op_activate_gas; - Commitment main_sel_mem_op_b; - Commitment main_sel_mem_op_c; - Commitment main_sel_mem_op_d; - Commitment main_sel_mov_ia_to_ic; - Commitment main_sel_mov_ib_to_ic; - Commitment main_sel_op_add; - Commitment main_sel_op_address; - Commitment main_sel_op_and; - Commitment main_sel_op_block_number; - Commitment main_sel_op_calldata_copy; - Commitment main_sel_op_cast; - Commitment main_sel_op_chain_id; - Commitment main_sel_op_cmov; - Commitment main_sel_op_coinbase; - Commitment main_sel_op_dagasleft; - Commitment main_sel_op_div; - Commitment main_sel_op_emit_l2_to_l1_msg; - Commitment main_sel_op_emit_note_hash; - Commitment main_sel_op_emit_nullifier; - Commitment main_sel_op_emit_unencrypted_log; - Commitment main_sel_op_eq; - Commitment main_sel_op_external_call; - Commitment main_sel_op_external_return; - Commitment main_sel_op_fdiv; - Commitment main_sel_op_fee_per_da_gas; - Commitment main_sel_op_fee_per_l2_gas; - Commitment main_sel_op_function_selector; - Commitment main_sel_op_get_contract_instance; - Commitment main_sel_op_halt; - Commitment main_sel_op_internal_call; - Commitment main_sel_op_internal_return; - Commitment main_sel_op_jump; - Commitment main_sel_op_jumpi; - Commitment main_sel_op_keccak; - Commitment main_sel_op_l1_to_l2_msg_exists; - Commitment main_sel_op_l2gasleft; - Commitment main_sel_op_lt; - Commitment main_sel_op_lte; - Commitment main_sel_op_mov; - Commitment main_sel_op_mul; - Commitment main_sel_op_not; - Commitment main_sel_op_note_hash_exists; - Commitment main_sel_op_nullifier_exists; - Commitment main_sel_op_or; - Commitment main_sel_op_pedersen; - Commitment main_sel_op_poseidon2; - Commitment main_sel_op_radix_le; - Commitment main_sel_op_sender; - Commitment main_sel_op_sha256; - Commitment main_sel_op_shl; - Commitment main_sel_op_shr; - Commitment main_sel_op_sload; - Commitment main_sel_op_sstore; - Commitment main_sel_op_storage_address; - Commitment main_sel_op_sub; - Commitment main_sel_op_timestamp; - Commitment main_sel_op_transaction_fee; - Commitment main_sel_op_version; - Commitment main_sel_op_xor; - Commitment main_sel_q_kernel_lookup; - Commitment main_sel_q_kernel_output_lookup; - Commitment main_sel_resolve_ind_addr_a; - Commitment main_sel_resolve_ind_addr_b; - Commitment main_sel_resolve_ind_addr_c; - Commitment main_sel_resolve_ind_addr_d; - Commitment main_sel_returndata; - Commitment main_sel_rng_16; - Commitment main_sel_rng_8; - Commitment main_sel_slice_gadget; - Commitment main_space_id; - Commitment main_tag_err; - Commitment main_w_in_tag; - Commitment mem_addr; - Commitment mem_clk; - Commitment mem_diff_hi; - Commitment mem_diff_lo; - Commitment mem_diff_mid; - Commitment mem_glob_addr; - Commitment mem_last; - Commitment mem_lastAccess; - Commitment mem_one_min_inv; - Commitment mem_r_in_tag; - Commitment mem_rw; - Commitment mem_sel_mem; - Commitment mem_sel_mov_ia_to_ic; - Commitment mem_sel_mov_ib_to_ic; - Commitment mem_sel_op_a; - Commitment mem_sel_op_b; - Commitment mem_sel_op_c; - Commitment mem_sel_op_cmov; - Commitment mem_sel_op_d; - Commitment mem_sel_op_slice; - Commitment mem_sel_resolve_ind_addr_a; - Commitment mem_sel_resolve_ind_addr_b; - Commitment mem_sel_resolve_ind_addr_c; - Commitment mem_sel_resolve_ind_addr_d; - Commitment mem_sel_rng_chk; - Commitment mem_skip_check_tag; - Commitment mem_space_id; - Commitment mem_tag; - Commitment mem_tag_err; - Commitment mem_tsp; - Commitment mem_val; - Commitment mem_w_in_tag; - Commitment pedersen_clk; - Commitment pedersen_input; - Commitment pedersen_output; - Commitment pedersen_sel_pedersen; - Commitment poseidon2_clk; - Commitment poseidon2_input; - Commitment poseidon2_output; - Commitment poseidon2_sel_poseidon_perm; - Commitment powers_power_of_2; - Commitment sha256_clk; - Commitment sha256_input; - Commitment sha256_output; - Commitment sha256_sel_sha256_compression; - Commitment sha256_state; - Commitment slice_addr; - Commitment slice_clk; - Commitment slice_cnt; - Commitment slice_col_offset; - Commitment slice_one_min_inv; - Commitment slice_sel_cd_cpy; - Commitment slice_sel_mem_active; - Commitment slice_sel_return; - Commitment slice_sel_start; - Commitment slice_space_id; - Commitment slice_val; - Commitment perm_slice_mem; - Commitment perm_main_alu; - Commitment perm_main_bin; - Commitment perm_main_conv; - Commitment perm_main_pos2_perm; - Commitment perm_main_pedersen; - Commitment perm_main_slice; - Commitment perm_main_mem_a; - Commitment perm_main_mem_b; - Commitment perm_main_mem_c; - Commitment perm_main_mem_d; - Commitment perm_main_mem_ind_addr_a; - Commitment perm_main_mem_ind_addr_b; - Commitment perm_main_mem_ind_addr_c; - Commitment perm_main_mem_ind_addr_d; - Commitment lookup_byte_lengths; - Commitment lookup_byte_operations; - Commitment lookup_cd_value; - Commitment lookup_ret_value; - Commitment lookup_opcode_gas; - Commitment range_check_l2_gas_hi; - Commitment range_check_l2_gas_lo; - Commitment range_check_da_gas_hi; - Commitment range_check_da_gas_lo; - Commitment kernel_output_lookup; - Commitment lookup_into_kernel; - Commitment incl_main_tag_err; - Commitment incl_mem_tag_err; - Commitment lookup_mem_rng_chk_lo; - Commitment lookup_mem_rng_chk_mid; - Commitment lookup_mem_rng_chk_hi; - Commitment lookup_pow_2_0; - Commitment lookup_pow_2_1; - Commitment lookup_u8_0; - Commitment lookup_u8_1; - Commitment lookup_u16_0; - Commitment lookup_u16_1; - Commitment lookup_u16_2; - Commitment lookup_u16_3; - Commitment lookup_u16_4; - Commitment lookup_u16_5; - Commitment lookup_u16_6; - Commitment lookup_u16_7; - Commitment lookup_u16_8; - Commitment lookup_u16_9; - Commitment lookup_u16_10; - Commitment lookup_u16_11; - Commitment lookup_u16_12; - Commitment lookup_u16_13; - Commitment lookup_u16_14; - Commitment lookup_div_u16_0; - Commitment lookup_div_u16_1; - Commitment lookup_div_u16_2; - Commitment lookup_div_u16_3; - Commitment lookup_div_u16_4; - Commitment lookup_div_u16_5; - Commitment lookup_div_u16_6; - Commitment lookup_div_u16_7; - Commitment lookup_byte_lengths_counts; - Commitment lookup_byte_operations_counts; - Commitment lookup_cd_value_counts; - Commitment lookup_ret_value_counts; - Commitment lookup_opcode_gas_counts; - Commitment range_check_l2_gas_hi_counts; - Commitment range_check_l2_gas_lo_counts; - Commitment range_check_da_gas_hi_counts; - Commitment range_check_da_gas_lo_counts; - Commitment kernel_output_lookup_counts; - Commitment lookup_into_kernel_counts; - Commitment incl_main_tag_err_counts; - Commitment incl_mem_tag_err_counts; - Commitment lookup_mem_rng_chk_lo_counts; - Commitment lookup_mem_rng_chk_mid_counts; - Commitment lookup_mem_rng_chk_hi_counts; - Commitment lookup_pow_2_0_counts; - Commitment lookup_pow_2_1_counts; - Commitment lookup_u8_0_counts; - Commitment lookup_u8_1_counts; - Commitment lookup_u16_0_counts; - Commitment lookup_u16_1_counts; - Commitment lookup_u16_2_counts; - Commitment lookup_u16_3_counts; - Commitment lookup_u16_4_counts; - Commitment lookup_u16_5_counts; - Commitment lookup_u16_6_counts; - Commitment lookup_u16_7_counts; - Commitment lookup_u16_8_counts; - Commitment lookup_u16_9_counts; - Commitment lookup_u16_10_counts; - Commitment lookup_u16_11_counts; - Commitment lookup_u16_12_counts; - Commitment lookup_u16_13_counts; - Commitment lookup_u16_14_counts; - Commitment lookup_div_u16_0_counts; - Commitment lookup_div_u16_1_counts; - Commitment lookup_div_u16_2_counts; - Commitment lookup_div_u16_3_counts; - Commitment lookup_div_u16_4_counts; - Commitment lookup_div_u16_5_counts; - Commitment lookup_div_u16_6_counts; - Commitment lookup_div_u16_7_counts; ->>>>>>> b9f802b1e7 (7381: add returndata public column) std::vector> sumcheck_univariates; std::array sumcheck_evaluations; @@ -3409,434 +2814,9 @@ class AvmFlavor { circuit_size = deserialize_from_buffer(proof_data, num_frs_read); size_t log_n = numeric::get_msb(circuit_size); -<<<<<<< HEAD for (auto& commitment : commitments) { commitment = deserialize_from_buffer(proof_data, num_frs_read); } -======= - kernel_kernel_inputs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_value_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_side_effect_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_metadata_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_returndata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_cf = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_cmp_rng_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_div_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_divisor_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_divisor_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_ff_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_cast_prev = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_div_a_lt_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_div_std = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_eq_diff_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_a_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_b_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_sub_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_sub_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_sub_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_p_sub_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_partial_prod_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_partial_prod_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_quotient_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_quotient_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_remainder = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_res_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_res_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_cmp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_div_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_rng_chk_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_sel_shift_which = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_shift_lt_bit_len = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_t_sub_s_bits = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_two_pow_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_two_pow_t_sub_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u128_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_r9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u16_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u32_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u64_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u8_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u8_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - alu_u8_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_acc_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_acc_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_acc_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_mem_tag_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_mem_tag_ctr_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - binary_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_in_tags = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_input_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_input_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - byte_lookup_table_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_num_limbs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_radix = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - conversion_sel_to_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - gas_da_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - gas_l2_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - gas_sel_gas_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - keccakf1600_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - keccakf1600_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - keccakf1600_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - keccakf1600_sel_keccakf1600 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_emit_l2_to_l1_msg_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_emit_note_hash_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_emit_nullifier_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_emit_unencrypted_log_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_in_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_kernel_out_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_l1_to_l2_msg_exists_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_note_hash_exist_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_nullifier_exists_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_nullifier_non_exists_write_offset = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_q_public_input_kernel_add_to_table = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_q_public_input_kernel_out_add_to_table = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_side_effect_counter = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_sload_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_sstore_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_abs_da_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_abs_da_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_abs_l2_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_abs_l2_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_bin_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_call_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_da_gas_op_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_da_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_da_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_id_zero = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_internal_return_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_l2_gas_op_cost = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_l2_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_l2_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_mem_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_mem_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_mem_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_mem_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_op_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_opcode_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_pc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_rwa = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_rwb = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_rwc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_rwd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_calldata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_gas_accounting_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_activate_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mem_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mov_ia_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_mov_ib_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_and = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_block_number = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_calldata_copy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_chain_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_coinbase = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_dagasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_emit_l2_to_l1_msg = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_emit_note_hash = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_emit_nullifier = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_emit_unencrypted_log = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_external_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_external_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_fdiv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_fee_per_da_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_fee_per_l2_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_function_selector = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_get_contract_instance = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_halt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_internal_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_internal_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_jump = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_jumpi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_keccak = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_l1_to_l2_msg_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_l2gasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_note_hash_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_nullifier_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_or = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_poseidon2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sender = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sha256 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sload = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sstore = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_storage_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_timestamp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_transaction_fee = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_version = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_op_xor = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_q_kernel_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_q_kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_returndata = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_sel_slice_gadget = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_diff_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_diff_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_diff_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_glob_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_lastAccess = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_rw = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_mov_ia_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_mov_ib_to_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_op_slice = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_resolve_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_resolve_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_resolve_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_resolve_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_sel_rng_chk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_skip_check_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_tsp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - mem_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - pedersen_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - pedersen_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - pedersen_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - pedersen_sel_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - poseidon2_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - poseidon2_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - poseidon2_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - poseidon2_sel_poseidon_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - powers_power_of_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_sel_sha256_compression = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - sha256_state = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_cnt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_col_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_cd_cpy = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_mem_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_sel_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - slice_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_slice_mem = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_conv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_pos2_perm = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_slice = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_ind_addr_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_ind_addr_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_ind_addr_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - perm_main_mem_ind_addr_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_byte_operations = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_cd_value = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_ret_value = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_opcode_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_l2_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_l2_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_da_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_da_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_into_kernel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - incl_main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - incl_mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_pow_2_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_pow_2_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u8_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u8_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_byte_lengths_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_byte_operations_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_cd_value_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_ret_value_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_opcode_gas_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_l2_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_l2_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_da_gas_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - range_check_da_gas_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - kernel_output_lookup_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_into_kernel_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - incl_main_tag_err_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - incl_mem_tag_err_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_lo_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_mid_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_mem_rng_chk_hi_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_pow_2_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_pow_2_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u8_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u8_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_2_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_3_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_4_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_5_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_6_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_7_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_8_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_9_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_10_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_11_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_12_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_13_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_u16_14_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_0_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_1_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_2_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_3_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_4_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_5_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_6_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - lookup_div_u16_7_counts = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - ->>>>>>> b9f802b1e7 (7381: add returndata public column) for (size_t i = 0; i < log_n; ++i) { sumcheck_univariates.emplace_back( deserialize_from_buffer>(Transcript::proof_data, @@ -3859,422 +2839,9 @@ class AvmFlavor { serialize_to_buffer(circuit_size, Transcript::proof_data); -<<<<<<< HEAD for (const auto& commitment : commitments) { serialize_to_buffer(commitment, Transcript::proof_data); } -======= - serialize_to_buffer(kernel_kernel_inputs, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_value_out, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_side_effect_out, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_metadata_out, Transcript::proof_data); - serialize_to_buffer(main_calldata, Transcript::proof_data); - serialize_to_buffer(main_returndata, Transcript::proof_data); - serialize_to_buffer(alu_a_hi, Transcript::proof_data); - serialize_to_buffer(alu_a_lo, Transcript::proof_data); - serialize_to_buffer(alu_b_hi, Transcript::proof_data); - serialize_to_buffer(alu_b_lo, Transcript::proof_data); - serialize_to_buffer(alu_borrow, Transcript::proof_data); - serialize_to_buffer(alu_cf, Transcript::proof_data); - serialize_to_buffer(alu_clk, Transcript::proof_data); - serialize_to_buffer(alu_cmp_rng_ctr, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r0, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r1, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r2, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r3, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r4, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r5, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r6, Transcript::proof_data); - serialize_to_buffer(alu_div_u16_r7, Transcript::proof_data); - serialize_to_buffer(alu_divisor_hi, Transcript::proof_data); - serialize_to_buffer(alu_divisor_lo, Transcript::proof_data); - serialize_to_buffer(alu_ff_tag, Transcript::proof_data); - serialize_to_buffer(alu_ia, Transcript::proof_data); - serialize_to_buffer(alu_ib, Transcript::proof_data); - serialize_to_buffer(alu_ic, Transcript::proof_data); - serialize_to_buffer(alu_in_tag, Transcript::proof_data); - serialize_to_buffer(alu_op_add, Transcript::proof_data); - serialize_to_buffer(alu_op_cast, Transcript::proof_data); - serialize_to_buffer(alu_op_cast_prev, Transcript::proof_data); - serialize_to_buffer(alu_op_div, Transcript::proof_data); - serialize_to_buffer(alu_op_div_a_lt_b, Transcript::proof_data); - serialize_to_buffer(alu_op_div_std, Transcript::proof_data); - serialize_to_buffer(alu_op_eq, Transcript::proof_data); - serialize_to_buffer(alu_op_eq_diff_inv, Transcript::proof_data); - serialize_to_buffer(alu_op_lt, Transcript::proof_data); - serialize_to_buffer(alu_op_lte, Transcript::proof_data); - serialize_to_buffer(alu_op_mul, Transcript::proof_data); - serialize_to_buffer(alu_op_not, Transcript::proof_data); - serialize_to_buffer(alu_op_shl, Transcript::proof_data); - serialize_to_buffer(alu_op_shr, Transcript::proof_data); - serialize_to_buffer(alu_op_sub, Transcript::proof_data); - serialize_to_buffer(alu_p_a_borrow, Transcript::proof_data); - serialize_to_buffer(alu_p_b_borrow, Transcript::proof_data); - serialize_to_buffer(alu_p_sub_a_hi, Transcript::proof_data); - serialize_to_buffer(alu_p_sub_a_lo, Transcript::proof_data); - serialize_to_buffer(alu_p_sub_b_hi, Transcript::proof_data); - serialize_to_buffer(alu_p_sub_b_lo, Transcript::proof_data); - serialize_to_buffer(alu_partial_prod_hi, Transcript::proof_data); - serialize_to_buffer(alu_partial_prod_lo, Transcript::proof_data); - serialize_to_buffer(alu_quotient_hi, Transcript::proof_data); - serialize_to_buffer(alu_quotient_lo, Transcript::proof_data); - serialize_to_buffer(alu_remainder, Transcript::proof_data); - serialize_to_buffer(alu_res_hi, Transcript::proof_data); - serialize_to_buffer(alu_res_lo, Transcript::proof_data); - serialize_to_buffer(alu_sel_alu, Transcript::proof_data); - serialize_to_buffer(alu_sel_cmp, Transcript::proof_data); - serialize_to_buffer(alu_sel_div_rng_chk, Transcript::proof_data); - serialize_to_buffer(alu_sel_rng_chk, Transcript::proof_data); - serialize_to_buffer(alu_sel_rng_chk_lookup, Transcript::proof_data); - serialize_to_buffer(alu_sel_shift_which, Transcript::proof_data); - serialize_to_buffer(alu_shift_lt_bit_len, Transcript::proof_data); - serialize_to_buffer(alu_t_sub_s_bits, Transcript::proof_data); - serialize_to_buffer(alu_two_pow_s, Transcript::proof_data); - serialize_to_buffer(alu_two_pow_t_sub_s, Transcript::proof_data); - serialize_to_buffer(alu_u128_tag, Transcript::proof_data); - serialize_to_buffer(alu_u16_r0, Transcript::proof_data); - serialize_to_buffer(alu_u16_r1, Transcript::proof_data); - serialize_to_buffer(alu_u16_r10, Transcript::proof_data); - serialize_to_buffer(alu_u16_r11, Transcript::proof_data); - serialize_to_buffer(alu_u16_r12, Transcript::proof_data); - serialize_to_buffer(alu_u16_r13, Transcript::proof_data); - serialize_to_buffer(alu_u16_r14, Transcript::proof_data); - serialize_to_buffer(alu_u16_r2, Transcript::proof_data); - serialize_to_buffer(alu_u16_r3, Transcript::proof_data); - serialize_to_buffer(alu_u16_r4, Transcript::proof_data); - serialize_to_buffer(alu_u16_r5, Transcript::proof_data); - serialize_to_buffer(alu_u16_r6, Transcript::proof_data); - serialize_to_buffer(alu_u16_r7, Transcript::proof_data); - serialize_to_buffer(alu_u16_r8, Transcript::proof_data); - serialize_to_buffer(alu_u16_r9, Transcript::proof_data); - serialize_to_buffer(alu_u16_tag, Transcript::proof_data); - serialize_to_buffer(alu_u32_tag, Transcript::proof_data); - serialize_to_buffer(alu_u64_tag, Transcript::proof_data); - serialize_to_buffer(alu_u8_r0, Transcript::proof_data); - serialize_to_buffer(alu_u8_r1, Transcript::proof_data); - serialize_to_buffer(alu_u8_tag, Transcript::proof_data); - serialize_to_buffer(binary_acc_ia, Transcript::proof_data); - serialize_to_buffer(binary_acc_ib, Transcript::proof_data); - serialize_to_buffer(binary_acc_ic, Transcript::proof_data); - serialize_to_buffer(binary_clk, Transcript::proof_data); - serialize_to_buffer(binary_ia_bytes, Transcript::proof_data); - serialize_to_buffer(binary_ib_bytes, Transcript::proof_data); - serialize_to_buffer(binary_ic_bytes, Transcript::proof_data); - serialize_to_buffer(binary_in_tag, Transcript::proof_data); - serialize_to_buffer(binary_mem_tag_ctr, Transcript::proof_data); - serialize_to_buffer(binary_mem_tag_ctr_inv, Transcript::proof_data); - serialize_to_buffer(binary_op_id, Transcript::proof_data); - serialize_to_buffer(binary_sel_bin, Transcript::proof_data); - serialize_to_buffer(binary_start, Transcript::proof_data); - serialize_to_buffer(byte_lookup_sel_bin, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_byte_lengths, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_in_tags, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_input_a, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_input_b, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_op_id, Transcript::proof_data); - serialize_to_buffer(byte_lookup_table_output, Transcript::proof_data); - serialize_to_buffer(conversion_clk, Transcript::proof_data); - serialize_to_buffer(conversion_input, Transcript::proof_data); - serialize_to_buffer(conversion_num_limbs, Transcript::proof_data); - serialize_to_buffer(conversion_radix, Transcript::proof_data); - serialize_to_buffer(conversion_sel_to_radix_le, Transcript::proof_data); - serialize_to_buffer(gas_da_gas_fixed_table, Transcript::proof_data); - serialize_to_buffer(gas_l2_gas_fixed_table, Transcript::proof_data); - serialize_to_buffer(gas_sel_gas_cost, Transcript::proof_data); - serialize_to_buffer(keccakf1600_clk, Transcript::proof_data); - serialize_to_buffer(keccakf1600_input, Transcript::proof_data); - serialize_to_buffer(keccakf1600_output, Transcript::proof_data); - serialize_to_buffer(keccakf1600_sel_keccakf1600, Transcript::proof_data); - serialize_to_buffer(kernel_emit_l2_to_l1_msg_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_emit_note_hash_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_emit_nullifier_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_emit_unencrypted_log_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_in_offset, Transcript::proof_data); - serialize_to_buffer(kernel_kernel_out_offset, Transcript::proof_data); - serialize_to_buffer(kernel_l1_to_l2_msg_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_note_hash_exist_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_nullifier_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_nullifier_non_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_q_public_input_kernel_add_to_table, Transcript::proof_data); - serialize_to_buffer(kernel_q_public_input_kernel_out_add_to_table, Transcript::proof_data); - serialize_to_buffer(kernel_side_effect_counter, Transcript::proof_data); - serialize_to_buffer(kernel_sload_write_offset, Transcript::proof_data); - serialize_to_buffer(kernel_sstore_write_offset, Transcript::proof_data); - serialize_to_buffer(main_abs_da_rem_gas_hi, Transcript::proof_data); - serialize_to_buffer(main_abs_da_rem_gas_lo, Transcript::proof_data); - serialize_to_buffer(main_abs_l2_rem_gas_hi, Transcript::proof_data); - serialize_to_buffer(main_abs_l2_rem_gas_lo, Transcript::proof_data); - serialize_to_buffer(main_alu_in_tag, Transcript::proof_data); - serialize_to_buffer(main_bin_op_id, Transcript::proof_data); - serialize_to_buffer(main_call_ptr, Transcript::proof_data); - serialize_to_buffer(main_da_gas_op_cost, Transcript::proof_data); - serialize_to_buffer(main_da_gas_remaining, Transcript::proof_data); - serialize_to_buffer(main_da_out_of_gas, Transcript::proof_data); - serialize_to_buffer(main_ia, Transcript::proof_data); - serialize_to_buffer(main_ib, Transcript::proof_data); - serialize_to_buffer(main_ic, Transcript::proof_data); - serialize_to_buffer(main_id, Transcript::proof_data); - serialize_to_buffer(main_id_zero, Transcript::proof_data); - serialize_to_buffer(main_ind_addr_a, Transcript::proof_data); - serialize_to_buffer(main_ind_addr_b, Transcript::proof_data); - serialize_to_buffer(main_ind_addr_c, Transcript::proof_data); - serialize_to_buffer(main_ind_addr_d, Transcript::proof_data); - serialize_to_buffer(main_internal_return_ptr, Transcript::proof_data); - serialize_to_buffer(main_inv, Transcript::proof_data); - serialize_to_buffer(main_l2_gas_op_cost, Transcript::proof_data); - serialize_to_buffer(main_l2_gas_remaining, Transcript::proof_data); - serialize_to_buffer(main_l2_out_of_gas, Transcript::proof_data); - serialize_to_buffer(main_mem_addr_a, Transcript::proof_data); - serialize_to_buffer(main_mem_addr_b, Transcript::proof_data); - serialize_to_buffer(main_mem_addr_c, Transcript::proof_data); - serialize_to_buffer(main_mem_addr_d, Transcript::proof_data); - serialize_to_buffer(main_op_err, Transcript::proof_data); - serialize_to_buffer(main_opcode_val, Transcript::proof_data); - serialize_to_buffer(main_pc, Transcript::proof_data); - serialize_to_buffer(main_r_in_tag, Transcript::proof_data); - serialize_to_buffer(main_rwa, Transcript::proof_data); - serialize_to_buffer(main_rwb, Transcript::proof_data); - serialize_to_buffer(main_rwc, Transcript::proof_data); - serialize_to_buffer(main_rwd, Transcript::proof_data); - serialize_to_buffer(main_sel_alu, Transcript::proof_data); - serialize_to_buffer(main_sel_bin, Transcript::proof_data); - serialize_to_buffer(main_sel_calldata, Transcript::proof_data); - serialize_to_buffer(main_sel_gas_accounting_active, Transcript::proof_data); - serialize_to_buffer(main_sel_last, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_a, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_activate_gas, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_b, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_c, Transcript::proof_data); - serialize_to_buffer(main_sel_mem_op_d, Transcript::proof_data); - serialize_to_buffer(main_sel_mov_ia_to_ic, Transcript::proof_data); - serialize_to_buffer(main_sel_mov_ib_to_ic, Transcript::proof_data); - serialize_to_buffer(main_sel_op_add, Transcript::proof_data); - serialize_to_buffer(main_sel_op_address, Transcript::proof_data); - serialize_to_buffer(main_sel_op_and, Transcript::proof_data); - serialize_to_buffer(main_sel_op_block_number, Transcript::proof_data); - serialize_to_buffer(main_sel_op_calldata_copy, Transcript::proof_data); - serialize_to_buffer(main_sel_op_cast, Transcript::proof_data); - serialize_to_buffer(main_sel_op_chain_id, Transcript::proof_data); - serialize_to_buffer(main_sel_op_cmov, Transcript::proof_data); - serialize_to_buffer(main_sel_op_coinbase, Transcript::proof_data); - serialize_to_buffer(main_sel_op_dagasleft, Transcript::proof_data); - serialize_to_buffer(main_sel_op_div, Transcript::proof_data); - serialize_to_buffer(main_sel_op_emit_l2_to_l1_msg, Transcript::proof_data); - serialize_to_buffer(main_sel_op_emit_note_hash, Transcript::proof_data); - serialize_to_buffer(main_sel_op_emit_nullifier, Transcript::proof_data); - serialize_to_buffer(main_sel_op_emit_unencrypted_log, Transcript::proof_data); - serialize_to_buffer(main_sel_op_eq, Transcript::proof_data); - serialize_to_buffer(main_sel_op_external_call, Transcript::proof_data); - serialize_to_buffer(main_sel_op_external_return, Transcript::proof_data); - serialize_to_buffer(main_sel_op_fdiv, Transcript::proof_data); - serialize_to_buffer(main_sel_op_fee_per_da_gas, Transcript::proof_data); - serialize_to_buffer(main_sel_op_fee_per_l2_gas, Transcript::proof_data); - serialize_to_buffer(main_sel_op_function_selector, Transcript::proof_data); - serialize_to_buffer(main_sel_op_get_contract_instance, Transcript::proof_data); - serialize_to_buffer(main_sel_op_halt, Transcript::proof_data); - serialize_to_buffer(main_sel_op_internal_call, Transcript::proof_data); - serialize_to_buffer(main_sel_op_internal_return, Transcript::proof_data); - serialize_to_buffer(main_sel_op_jump, Transcript::proof_data); - serialize_to_buffer(main_sel_op_jumpi, Transcript::proof_data); - serialize_to_buffer(main_sel_op_keccak, Transcript::proof_data); - serialize_to_buffer(main_sel_op_l1_to_l2_msg_exists, Transcript::proof_data); - serialize_to_buffer(main_sel_op_l2gasleft, Transcript::proof_data); - serialize_to_buffer(main_sel_op_lt, Transcript::proof_data); - serialize_to_buffer(main_sel_op_lte, Transcript::proof_data); - serialize_to_buffer(main_sel_op_mov, Transcript::proof_data); - serialize_to_buffer(main_sel_op_mul, Transcript::proof_data); - serialize_to_buffer(main_sel_op_not, Transcript::proof_data); - serialize_to_buffer(main_sel_op_note_hash_exists, Transcript::proof_data); - serialize_to_buffer(main_sel_op_nullifier_exists, Transcript::proof_data); - serialize_to_buffer(main_sel_op_or, Transcript::proof_data); - serialize_to_buffer(main_sel_op_pedersen, Transcript::proof_data); - serialize_to_buffer(main_sel_op_poseidon2, Transcript::proof_data); - serialize_to_buffer(main_sel_op_radix_le, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sender, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sha256, Transcript::proof_data); - serialize_to_buffer(main_sel_op_shl, Transcript::proof_data); - serialize_to_buffer(main_sel_op_shr, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sload, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sstore, Transcript::proof_data); - serialize_to_buffer(main_sel_op_storage_address, Transcript::proof_data); - serialize_to_buffer(main_sel_op_sub, Transcript::proof_data); - serialize_to_buffer(main_sel_op_timestamp, Transcript::proof_data); - serialize_to_buffer(main_sel_op_transaction_fee, Transcript::proof_data); - serialize_to_buffer(main_sel_op_version, Transcript::proof_data); - serialize_to_buffer(main_sel_op_xor, Transcript::proof_data); - serialize_to_buffer(main_sel_q_kernel_lookup, Transcript::proof_data); - serialize_to_buffer(main_sel_q_kernel_output_lookup, Transcript::proof_data); - serialize_to_buffer(main_sel_resolve_ind_addr_a, Transcript::proof_data); - serialize_to_buffer(main_sel_resolve_ind_addr_b, Transcript::proof_data); - serialize_to_buffer(main_sel_resolve_ind_addr_c, Transcript::proof_data); - serialize_to_buffer(main_sel_resolve_ind_addr_d, Transcript::proof_data); - serialize_to_buffer(main_sel_returndata, Transcript::proof_data); - serialize_to_buffer(main_sel_rng_16, Transcript::proof_data); - serialize_to_buffer(main_sel_rng_8, Transcript::proof_data); - serialize_to_buffer(main_sel_slice_gadget, Transcript::proof_data); - serialize_to_buffer(main_space_id, Transcript::proof_data); - serialize_to_buffer(main_tag_err, Transcript::proof_data); - serialize_to_buffer(main_w_in_tag, Transcript::proof_data); - serialize_to_buffer(mem_addr, Transcript::proof_data); - serialize_to_buffer(mem_clk, Transcript::proof_data); - serialize_to_buffer(mem_diff_hi, Transcript::proof_data); - serialize_to_buffer(mem_diff_lo, Transcript::proof_data); - serialize_to_buffer(mem_diff_mid, Transcript::proof_data); - serialize_to_buffer(mem_glob_addr, Transcript::proof_data); - serialize_to_buffer(mem_last, Transcript::proof_data); - serialize_to_buffer(mem_lastAccess, Transcript::proof_data); - serialize_to_buffer(mem_one_min_inv, Transcript::proof_data); - serialize_to_buffer(mem_r_in_tag, Transcript::proof_data); - serialize_to_buffer(mem_rw, Transcript::proof_data); - serialize_to_buffer(mem_sel_mem, Transcript::proof_data); - serialize_to_buffer(mem_sel_mov_ia_to_ic, Transcript::proof_data); - serialize_to_buffer(mem_sel_mov_ib_to_ic, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_a, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_b, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_c, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_cmov, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_d, Transcript::proof_data); - serialize_to_buffer(mem_sel_op_slice, Transcript::proof_data); - serialize_to_buffer(mem_sel_resolve_ind_addr_a, Transcript::proof_data); - serialize_to_buffer(mem_sel_resolve_ind_addr_b, Transcript::proof_data); - serialize_to_buffer(mem_sel_resolve_ind_addr_c, Transcript::proof_data); - serialize_to_buffer(mem_sel_resolve_ind_addr_d, Transcript::proof_data); - serialize_to_buffer(mem_sel_rng_chk, Transcript::proof_data); - serialize_to_buffer(mem_skip_check_tag, Transcript::proof_data); - serialize_to_buffer(mem_space_id, Transcript::proof_data); - serialize_to_buffer(mem_tag, Transcript::proof_data); - serialize_to_buffer(mem_tag_err, Transcript::proof_data); - serialize_to_buffer(mem_tsp, Transcript::proof_data); - serialize_to_buffer(mem_val, Transcript::proof_data); - serialize_to_buffer(mem_w_in_tag, Transcript::proof_data); - serialize_to_buffer(pedersen_clk, Transcript::proof_data); - serialize_to_buffer(pedersen_input, Transcript::proof_data); - serialize_to_buffer(pedersen_output, Transcript::proof_data); - serialize_to_buffer(pedersen_sel_pedersen, Transcript::proof_data); - serialize_to_buffer(poseidon2_clk, Transcript::proof_data); - serialize_to_buffer(poseidon2_input, Transcript::proof_data); - serialize_to_buffer(poseidon2_output, Transcript::proof_data); - serialize_to_buffer(poseidon2_sel_poseidon_perm, Transcript::proof_data); - serialize_to_buffer(powers_power_of_2, Transcript::proof_data); - serialize_to_buffer(sha256_clk, Transcript::proof_data); - serialize_to_buffer(sha256_input, Transcript::proof_data); - serialize_to_buffer(sha256_output, Transcript::proof_data); - serialize_to_buffer(sha256_sel_sha256_compression, Transcript::proof_data); - serialize_to_buffer(sha256_state, Transcript::proof_data); - serialize_to_buffer(slice_addr, Transcript::proof_data); - serialize_to_buffer(slice_clk, Transcript::proof_data); - serialize_to_buffer(slice_cnt, Transcript::proof_data); - serialize_to_buffer(slice_col_offset, Transcript::proof_data); - serialize_to_buffer(slice_one_min_inv, Transcript::proof_data); - serialize_to_buffer(slice_sel_cd_cpy, Transcript::proof_data); - serialize_to_buffer(slice_sel_mem_active, Transcript::proof_data); - serialize_to_buffer(slice_sel_return, Transcript::proof_data); - serialize_to_buffer(slice_sel_start, Transcript::proof_data); - serialize_to_buffer(slice_space_id, Transcript::proof_data); - serialize_to_buffer(slice_val, Transcript::proof_data); - serialize_to_buffer(perm_slice_mem, Transcript::proof_data); - serialize_to_buffer(perm_main_alu, Transcript::proof_data); - serialize_to_buffer(perm_main_bin, Transcript::proof_data); - serialize_to_buffer(perm_main_conv, Transcript::proof_data); - serialize_to_buffer(perm_main_pos2_perm, Transcript::proof_data); - serialize_to_buffer(perm_main_pedersen, Transcript::proof_data); - serialize_to_buffer(perm_main_slice, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_a, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_b, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_c, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_d, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_ind_addr_a, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_ind_addr_b, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_ind_addr_c, Transcript::proof_data); - serialize_to_buffer(perm_main_mem_ind_addr_d, Transcript::proof_data); - serialize_to_buffer(lookup_byte_lengths, Transcript::proof_data); - serialize_to_buffer(lookup_byte_operations, Transcript::proof_data); - serialize_to_buffer(lookup_cd_value, Transcript::proof_data); - serialize_to_buffer(lookup_ret_value, Transcript::proof_data); - serialize_to_buffer(lookup_opcode_gas, Transcript::proof_data); - serialize_to_buffer(range_check_l2_gas_hi, Transcript::proof_data); - serialize_to_buffer(range_check_l2_gas_lo, Transcript::proof_data); - serialize_to_buffer(range_check_da_gas_hi, Transcript::proof_data); - serialize_to_buffer(range_check_da_gas_lo, Transcript::proof_data); - serialize_to_buffer(kernel_output_lookup, Transcript::proof_data); - serialize_to_buffer(lookup_into_kernel, Transcript::proof_data); - serialize_to_buffer(incl_main_tag_err, Transcript::proof_data); - serialize_to_buffer(incl_mem_tag_err, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_lo, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_mid, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_hi, Transcript::proof_data); - serialize_to_buffer(lookup_pow_2_0, Transcript::proof_data); - serialize_to_buffer(lookup_pow_2_1, Transcript::proof_data); - serialize_to_buffer(lookup_u8_0, Transcript::proof_data); - serialize_to_buffer(lookup_u8_1, Transcript::proof_data); - serialize_to_buffer(lookup_u16_0, Transcript::proof_data); - serialize_to_buffer(lookup_u16_1, Transcript::proof_data); - serialize_to_buffer(lookup_u16_2, Transcript::proof_data); - serialize_to_buffer(lookup_u16_3, Transcript::proof_data); - serialize_to_buffer(lookup_u16_4, Transcript::proof_data); - serialize_to_buffer(lookup_u16_5, Transcript::proof_data); - serialize_to_buffer(lookup_u16_6, Transcript::proof_data); - serialize_to_buffer(lookup_u16_7, Transcript::proof_data); - serialize_to_buffer(lookup_u16_8, Transcript::proof_data); - serialize_to_buffer(lookup_u16_9, Transcript::proof_data); - serialize_to_buffer(lookup_u16_10, Transcript::proof_data); - serialize_to_buffer(lookup_u16_11, Transcript::proof_data); - serialize_to_buffer(lookup_u16_12, Transcript::proof_data); - serialize_to_buffer(lookup_u16_13, Transcript::proof_data); - serialize_to_buffer(lookup_u16_14, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_0, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_1, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_2, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_3, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_4, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_5, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_6, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_7, Transcript::proof_data); - serialize_to_buffer(lookup_byte_lengths_counts, Transcript::proof_data); - serialize_to_buffer(lookup_byte_operations_counts, Transcript::proof_data); - serialize_to_buffer(lookup_cd_value_counts, Transcript::proof_data); - serialize_to_buffer(lookup_ret_value_counts, Transcript::proof_data); - serialize_to_buffer(lookup_opcode_gas_counts, Transcript::proof_data); - serialize_to_buffer(range_check_l2_gas_hi_counts, Transcript::proof_data); - serialize_to_buffer(range_check_l2_gas_lo_counts, Transcript::proof_data); - serialize_to_buffer(range_check_da_gas_hi_counts, Transcript::proof_data); - serialize_to_buffer(range_check_da_gas_lo_counts, Transcript::proof_data); - serialize_to_buffer(kernel_output_lookup_counts, Transcript::proof_data); - serialize_to_buffer(lookup_into_kernel_counts, Transcript::proof_data); - serialize_to_buffer(incl_main_tag_err_counts, Transcript::proof_data); - serialize_to_buffer(incl_mem_tag_err_counts, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_lo_counts, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_mid_counts, Transcript::proof_data); - serialize_to_buffer(lookup_mem_rng_chk_hi_counts, Transcript::proof_data); - serialize_to_buffer(lookup_pow_2_0_counts, Transcript::proof_data); - serialize_to_buffer(lookup_pow_2_1_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u8_0_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u8_1_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_0_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_1_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_2_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_3_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_4_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_5_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_6_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_7_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_8_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_9_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_10_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_11_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_12_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_13_counts, Transcript::proof_data); - serialize_to_buffer(lookup_u16_14_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_0_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_1_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_2_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_3_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_4_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_5_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_6_counts, Transcript::proof_data); - serialize_to_buffer(lookup_div_u16_7_counts, Transcript::proof_data); - ->>>>>>> b9f802b1e7 (7381: add returndata public column) for (size_t i = 0; i < log_n; ++i) { serialize_to_buffer(sumcheck_univariates[i], Transcript::proof_data); } diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp index d49e9277b0e..fcb1803a2cb 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.cpp @@ -25,6 +25,7 @@ template std::vector AvmFullRow::names() "kernel_kernel_side_effect_out", "kernel_kernel_metadata_out", "main_calldata", + "main_returndata", "alu_a_hi", "alu_a_lo", "alu_b_hi", @@ -194,7 +195,6 @@ template std::vector AvmFullRow::names() "main_sel_alu", "main_sel_bin", "main_sel_calldata", - "main_sel_cd_cpy_gadget", "main_sel_gas_accounting_active", "main_sel_last", "main_sel_mem_op_a", @@ -221,6 +221,7 @@ template std::vector AvmFullRow::names() "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", @@ -263,8 +264,10 @@ template std::vector AvmFullRow::names() "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", @@ -285,9 +288,9 @@ template std::vector AvmFullRow::names() "mem_sel_op_a", "mem_sel_op_b", "mem_sel_op_c", - "mem_sel_op_cd_cpy", "mem_sel_op_cmov", "mem_sel_op_d", + "mem_sel_op_slice", "mem_sel_resolve_ind_addr_a", "mem_sel_resolve_ind_addr_b", "mem_sel_resolve_ind_addr_c", @@ -315,21 +318,23 @@ template std::vector AvmFullRow::names() "sha256_sel_sha256_compression", "sha256_state", "slice_addr", - "slice_cd_offset", "slice_clk", "slice_cnt", + "slice_col_offset", "slice_one_min_inv", "slice_sel_cd_cpy", - "slice_sel_start_cd_cpy", + "slice_sel_mem_active", + "slice_sel_return", + "slice_sel_start", "slice_space_id", "slice_val", - "perm_cd_mem", + "perm_slice_mem", "perm_main_alu", "perm_main_bin", "perm_main_conv", "perm_main_pos2_perm", "perm_main_pedersen", - "perm_main_cd_copy", + "perm_main_slice", "perm_main_mem_a", "perm_main_mem_b", "perm_main_mem_c", @@ -341,6 +346,7 @@ template std::vector AvmFullRow::names() "lookup_byte_lengths", "lookup_byte_operations", "lookup_cd_value", + "lookup_ret_value", "lookup_opcode_gas", "range_check_l2_gas_hi", "range_check_l2_gas_lo", @@ -383,6 +389,7 @@ template std::vector AvmFullRow::names() "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", @@ -433,6 +440,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.kernel_kernel_side_effect_out) // << "," << field_to_string(row.kernel_kernel_metadata_out) // << "," << field_to_string(row.main_calldata) // + << "," << field_to_string(row.main_returndata) // << "," << field_to_string(row.alu_a_hi) // << "," << field_to_string(row.alu_a_lo) // << "," << field_to_string(row.alu_b_hi) // @@ -602,7 +610,6 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_sel_alu) // << "," << field_to_string(row.main_sel_bin) // << "," << field_to_string(row.main_sel_calldata) // - << "," << field_to_string(row.main_sel_cd_cpy_gadget) // << "," << field_to_string(row.main_sel_gas_accounting_active) // << "," << field_to_string(row.main_sel_last) // << "," << field_to_string(row.main_sel_mem_op_a) // @@ -629,6 +636,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_sel_op_emit_unencrypted_log) // << "," << field_to_string(row.main_sel_op_eq) // << "," << field_to_string(row.main_sel_op_external_call) // + << "," << field_to_string(row.main_sel_op_external_return) // << "," << field_to_string(row.main_sel_op_fdiv) // << "," << field_to_string(row.main_sel_op_fee_per_da_gas) // << "," << field_to_string(row.main_sel_op_fee_per_l2_gas) // @@ -671,8 +679,10 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.main_sel_resolve_ind_addr_b) // << "," << field_to_string(row.main_sel_resolve_ind_addr_c) // << "," << field_to_string(row.main_sel_resolve_ind_addr_d) // + << "," << field_to_string(row.main_sel_returndata) // << "," << field_to_string(row.main_sel_rng_16) // << "," << field_to_string(row.main_sel_rng_8) // + << "," << field_to_string(row.main_sel_slice_gadget) // << "," << field_to_string(row.main_space_id) // << "," << field_to_string(row.main_tag_err) // << "," << field_to_string(row.main_w_in_tag) // @@ -693,9 +703,9 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.mem_sel_op_a) // << "," << field_to_string(row.mem_sel_op_b) // << "," << field_to_string(row.mem_sel_op_c) // - << "," << field_to_string(row.mem_sel_op_cd_cpy) // << "," << field_to_string(row.mem_sel_op_cmov) // << "," << field_to_string(row.mem_sel_op_d) // + << "," << field_to_string(row.mem_sel_op_slice) // << "," << field_to_string(row.mem_sel_resolve_ind_addr_a) // << "," << field_to_string(row.mem_sel_resolve_ind_addr_b) // << "," << field_to_string(row.mem_sel_resolve_ind_addr_c) // @@ -723,21 +733,23 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.sha256_sel_sha256_compression) // << "," << field_to_string(row.sha256_state) // << "," << field_to_string(row.slice_addr) // - << "," << field_to_string(row.slice_cd_offset) // << "," << field_to_string(row.slice_clk) // << "," << field_to_string(row.slice_cnt) // + << "," << field_to_string(row.slice_col_offset) // << "," << field_to_string(row.slice_one_min_inv) // << "," << field_to_string(row.slice_sel_cd_cpy) // - << "," << field_to_string(row.slice_sel_start_cd_cpy) // + << "," << field_to_string(row.slice_sel_mem_active) // + << "," << field_to_string(row.slice_sel_return) // + << "," << field_to_string(row.slice_sel_start) // << "," << field_to_string(row.slice_space_id) // << "," << field_to_string(row.slice_val) // - << "," << field_to_string(row.perm_cd_mem) // + << "," << field_to_string(row.perm_slice_mem) // << "," << field_to_string(row.perm_main_alu) // << "," << field_to_string(row.perm_main_bin) // << "," << field_to_string(row.perm_main_conv) // << "," << field_to_string(row.perm_main_pos2_perm) // << "," << field_to_string(row.perm_main_pedersen) // - << "," << field_to_string(row.perm_main_cd_copy) // + << "," << field_to_string(row.perm_main_slice) // << "," << field_to_string(row.perm_main_mem_a) // << "," << field_to_string(row.perm_main_mem_b) // << "," << field_to_string(row.perm_main_mem_c) // @@ -749,6 +761,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.lookup_byte_lengths) // << "," << field_to_string(row.lookup_byte_operations) // << "," << field_to_string(row.lookup_cd_value) // + << "," << field_to_string(row.lookup_ret_value) // << "," << field_to_string(row.lookup_opcode_gas) // << "," << field_to_string(row.range_check_l2_gas_hi) // << "," << field_to_string(row.range_check_l2_gas_lo) // @@ -791,6 +804,7 @@ template std::ostream& operator<<(std::ostream& os, AvmFullRow << "," << field_to_string(row.lookup_byte_lengths_counts) // << "," << field_to_string(row.lookup_byte_operations_counts) // << "," << field_to_string(row.lookup_cd_value_counts) // + << "," << field_to_string(row.lookup_ret_value_counts) // << "," << field_to_string(row.lookup_opcode_gas_counts) // << "," << field_to_string(row.range_check_l2_gas_hi_counts) // << "," << field_to_string(row.range_check_l2_gas_lo_counts) // diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.hpp index f6a06beafa8..053deb3a1af 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_full_row.hpp @@ -14,6 +14,7 @@ template struct AvmFullRow { FF kernel_kernel_side_effect_out{}; FF kernel_kernel_metadata_out{}; FF main_calldata{}; + FF main_returndata{}; FF alu_a_hi{}; FF alu_a_lo{}; FF alu_b_hi{}; @@ -183,7 +184,6 @@ template struct AvmFullRow { FF main_sel_alu{}; FF main_sel_bin{}; FF main_sel_calldata{}; - FF main_sel_cd_cpy_gadget{}; FF main_sel_gas_accounting_active{}; FF main_sel_last{}; FF main_sel_mem_op_a{}; @@ -210,6 +210,7 @@ template struct AvmFullRow { FF main_sel_op_emit_unencrypted_log{}; FF main_sel_op_eq{}; FF main_sel_op_external_call{}; + FF main_sel_op_external_return{}; FF main_sel_op_fdiv{}; FF main_sel_op_fee_per_da_gas{}; FF main_sel_op_fee_per_l2_gas{}; @@ -252,8 +253,10 @@ template struct AvmFullRow { FF main_sel_resolve_ind_addr_b{}; FF main_sel_resolve_ind_addr_c{}; FF main_sel_resolve_ind_addr_d{}; + FF main_sel_returndata{}; FF main_sel_rng_16{}; FF main_sel_rng_8{}; + FF main_sel_slice_gadget{}; FF main_space_id{}; FF main_tag_err{}; FF main_w_in_tag{}; @@ -274,9 +277,9 @@ template struct AvmFullRow { FF mem_sel_op_a{}; FF mem_sel_op_b{}; FF mem_sel_op_c{}; - FF mem_sel_op_cd_cpy{}; FF mem_sel_op_cmov{}; FF mem_sel_op_d{}; + FF mem_sel_op_slice{}; FF mem_sel_resolve_ind_addr_a{}; FF mem_sel_resolve_ind_addr_b{}; FF mem_sel_resolve_ind_addr_c{}; @@ -304,21 +307,23 @@ template struct AvmFullRow { FF sha256_sel_sha256_compression{}; FF sha256_state{}; FF slice_addr{}; - FF slice_cd_offset{}; FF slice_clk{}; FF slice_cnt{}; + FF slice_col_offset{}; FF slice_one_min_inv{}; FF slice_sel_cd_cpy{}; - FF slice_sel_start_cd_cpy{}; + FF slice_sel_mem_active{}; + FF slice_sel_return{}; + FF slice_sel_start{}; FF slice_space_id{}; FF slice_val{}; - FF perm_cd_mem{}; + FF perm_slice_mem{}; FF perm_main_alu{}; FF perm_main_bin{}; FF perm_main_conv{}; FF perm_main_pos2_perm{}; FF perm_main_pedersen{}; - FF perm_main_cd_copy{}; + FF perm_main_slice{}; FF perm_main_mem_a{}; FF perm_main_mem_b{}; FF perm_main_mem_c{}; @@ -330,6 +335,7 @@ template struct AvmFullRow { FF lookup_byte_lengths{}; FF lookup_byte_operations{}; FF lookup_cd_value{}; + FF lookup_ret_value{}; FF lookup_opcode_gas{}; FF range_check_l2_gas_hi{}; FF range_check_l2_gas_lo{}; @@ -372,6 +378,7 @@ template struct AvmFullRow { FF lookup_byte_lengths_counts{}; FF lookup_byte_operations_counts{}; FF lookup_cd_value_counts{}; + FF lookup_ret_value_counts{}; FF lookup_opcode_gas_counts{}; FF range_check_l2_gas_hi_counts{}; FF range_check_l2_gas_lo_counts{}; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp index 5143cf36963..23762777a9f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp @@ -96,7 +96,6 @@ void AvmProver::execute_log_derivative_inverse_round() compute_logderivative_rel(relation_parameters, prover_polynomials, key->circuit_size); // Commit to all logderivative inverse polynomials -<<<<<<< HEAD for (auto [commitment, key_poly] : zip_view(witness_commitments.get_derived(), key->get_derived())) { commitment = commitment_key->commit(key_poly); } @@ -105,130 +104,6 @@ void AvmProver::execute_log_derivative_inverse_round() for (auto [label, commitment] : zip_view(commitment_labels.get_derived(), witness_commitments.get_derived())) { transcript->send_to_verifier(label, commitment); } -======= - witness_commitments.perm_slice_mem = commitment_key->commit(key->perm_slice_mem); - witness_commitments.perm_main_alu = commitment_key->commit(key->perm_main_alu); - witness_commitments.perm_main_bin = commitment_key->commit(key->perm_main_bin); - witness_commitments.perm_main_conv = commitment_key->commit(key->perm_main_conv); - witness_commitments.perm_main_pos2_perm = commitment_key->commit(key->perm_main_pos2_perm); - witness_commitments.perm_main_pedersen = commitment_key->commit(key->perm_main_pedersen); - witness_commitments.perm_main_slice = commitment_key->commit(key->perm_main_slice); - witness_commitments.perm_main_mem_a = commitment_key->commit(key->perm_main_mem_a); - witness_commitments.perm_main_mem_b = commitment_key->commit(key->perm_main_mem_b); - witness_commitments.perm_main_mem_c = commitment_key->commit(key->perm_main_mem_c); - witness_commitments.perm_main_mem_d = commitment_key->commit(key->perm_main_mem_d); - witness_commitments.perm_main_mem_ind_addr_a = commitment_key->commit(key->perm_main_mem_ind_addr_a); - witness_commitments.perm_main_mem_ind_addr_b = commitment_key->commit(key->perm_main_mem_ind_addr_b); - witness_commitments.perm_main_mem_ind_addr_c = commitment_key->commit(key->perm_main_mem_ind_addr_c); - witness_commitments.perm_main_mem_ind_addr_d = commitment_key->commit(key->perm_main_mem_ind_addr_d); - witness_commitments.lookup_byte_lengths = commitment_key->commit(key->lookup_byte_lengths); - witness_commitments.lookup_byte_operations = commitment_key->commit(key->lookup_byte_operations); - witness_commitments.lookup_cd_value = commitment_key->commit(key->lookup_cd_value); - witness_commitments.lookup_ret_value = commitment_key->commit(key->lookup_ret_value); - witness_commitments.lookup_opcode_gas = commitment_key->commit(key->lookup_opcode_gas); - witness_commitments.range_check_l2_gas_hi = commitment_key->commit(key->range_check_l2_gas_hi); - witness_commitments.range_check_l2_gas_lo = commitment_key->commit(key->range_check_l2_gas_lo); - witness_commitments.range_check_da_gas_hi = commitment_key->commit(key->range_check_da_gas_hi); - witness_commitments.range_check_da_gas_lo = commitment_key->commit(key->range_check_da_gas_lo); - witness_commitments.kernel_output_lookup = commitment_key->commit(key->kernel_output_lookup); - witness_commitments.lookup_into_kernel = commitment_key->commit(key->lookup_into_kernel); - witness_commitments.incl_main_tag_err = commitment_key->commit(key->incl_main_tag_err); - witness_commitments.incl_mem_tag_err = commitment_key->commit(key->incl_mem_tag_err); - witness_commitments.lookup_mem_rng_chk_lo = commitment_key->commit(key->lookup_mem_rng_chk_lo); - witness_commitments.lookup_mem_rng_chk_mid = commitment_key->commit(key->lookup_mem_rng_chk_mid); - witness_commitments.lookup_mem_rng_chk_hi = commitment_key->commit(key->lookup_mem_rng_chk_hi); - witness_commitments.lookup_pow_2_0 = commitment_key->commit(key->lookup_pow_2_0); - witness_commitments.lookup_pow_2_1 = commitment_key->commit(key->lookup_pow_2_1); - witness_commitments.lookup_u8_0 = commitment_key->commit(key->lookup_u8_0); - witness_commitments.lookup_u8_1 = commitment_key->commit(key->lookup_u8_1); - witness_commitments.lookup_u16_0 = commitment_key->commit(key->lookup_u16_0); - witness_commitments.lookup_u16_1 = commitment_key->commit(key->lookup_u16_1); - witness_commitments.lookup_u16_2 = commitment_key->commit(key->lookup_u16_2); - witness_commitments.lookup_u16_3 = commitment_key->commit(key->lookup_u16_3); - witness_commitments.lookup_u16_4 = commitment_key->commit(key->lookup_u16_4); - witness_commitments.lookup_u16_5 = commitment_key->commit(key->lookup_u16_5); - witness_commitments.lookup_u16_6 = commitment_key->commit(key->lookup_u16_6); - witness_commitments.lookup_u16_7 = commitment_key->commit(key->lookup_u16_7); - witness_commitments.lookup_u16_8 = commitment_key->commit(key->lookup_u16_8); - witness_commitments.lookup_u16_9 = commitment_key->commit(key->lookup_u16_9); - witness_commitments.lookup_u16_10 = commitment_key->commit(key->lookup_u16_10); - witness_commitments.lookup_u16_11 = commitment_key->commit(key->lookup_u16_11); - witness_commitments.lookup_u16_12 = commitment_key->commit(key->lookup_u16_12); - witness_commitments.lookup_u16_13 = commitment_key->commit(key->lookup_u16_13); - witness_commitments.lookup_u16_14 = commitment_key->commit(key->lookup_u16_14); - witness_commitments.lookup_div_u16_0 = commitment_key->commit(key->lookup_div_u16_0); - witness_commitments.lookup_div_u16_1 = commitment_key->commit(key->lookup_div_u16_1); - witness_commitments.lookup_div_u16_2 = commitment_key->commit(key->lookup_div_u16_2); - witness_commitments.lookup_div_u16_3 = commitment_key->commit(key->lookup_div_u16_3); - witness_commitments.lookup_div_u16_4 = commitment_key->commit(key->lookup_div_u16_4); - witness_commitments.lookup_div_u16_5 = commitment_key->commit(key->lookup_div_u16_5); - witness_commitments.lookup_div_u16_6 = commitment_key->commit(key->lookup_div_u16_6); - witness_commitments.lookup_div_u16_7 = commitment_key->commit(key->lookup_div_u16_7); - - // Send all commitments to the verifier - transcript->send_to_verifier(commitment_labels.perm_slice_mem, witness_commitments.perm_slice_mem); - transcript->send_to_verifier(commitment_labels.perm_main_alu, witness_commitments.perm_main_alu); - transcript->send_to_verifier(commitment_labels.perm_main_bin, witness_commitments.perm_main_bin); - transcript->send_to_verifier(commitment_labels.perm_main_conv, witness_commitments.perm_main_conv); - transcript->send_to_verifier(commitment_labels.perm_main_pos2_perm, witness_commitments.perm_main_pos2_perm); - transcript->send_to_verifier(commitment_labels.perm_main_pedersen, witness_commitments.perm_main_pedersen); - transcript->send_to_verifier(commitment_labels.perm_main_slice, witness_commitments.perm_main_slice); - transcript->send_to_verifier(commitment_labels.perm_main_mem_a, witness_commitments.perm_main_mem_a); - transcript->send_to_verifier(commitment_labels.perm_main_mem_b, witness_commitments.perm_main_mem_b); - transcript->send_to_verifier(commitment_labels.perm_main_mem_c, witness_commitments.perm_main_mem_c); - transcript->send_to_verifier(commitment_labels.perm_main_mem_d, witness_commitments.perm_main_mem_d); - transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_a, - witness_commitments.perm_main_mem_ind_addr_a); - transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_b, - witness_commitments.perm_main_mem_ind_addr_b); - transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_c, - witness_commitments.perm_main_mem_ind_addr_c); - transcript->send_to_verifier(commitment_labels.perm_main_mem_ind_addr_d, - witness_commitments.perm_main_mem_ind_addr_d); - transcript->send_to_verifier(commitment_labels.lookup_byte_lengths, witness_commitments.lookup_byte_lengths); - transcript->send_to_verifier(commitment_labels.lookup_byte_operations, witness_commitments.lookup_byte_operations); - transcript->send_to_verifier(commitment_labels.lookup_cd_value, witness_commitments.lookup_cd_value); - transcript->send_to_verifier(commitment_labels.lookup_ret_value, witness_commitments.lookup_ret_value); - transcript->send_to_verifier(commitment_labels.lookup_opcode_gas, witness_commitments.lookup_opcode_gas); - transcript->send_to_verifier(commitment_labels.range_check_l2_gas_hi, witness_commitments.range_check_l2_gas_hi); - transcript->send_to_verifier(commitment_labels.range_check_l2_gas_lo, witness_commitments.range_check_l2_gas_lo); - transcript->send_to_verifier(commitment_labels.range_check_da_gas_hi, witness_commitments.range_check_da_gas_hi); - transcript->send_to_verifier(commitment_labels.range_check_da_gas_lo, witness_commitments.range_check_da_gas_lo); - transcript->send_to_verifier(commitment_labels.kernel_output_lookup, witness_commitments.kernel_output_lookup); - transcript->send_to_verifier(commitment_labels.lookup_into_kernel, witness_commitments.lookup_into_kernel); - transcript->send_to_verifier(commitment_labels.incl_main_tag_err, witness_commitments.incl_main_tag_err); - transcript->send_to_verifier(commitment_labels.incl_mem_tag_err, witness_commitments.incl_mem_tag_err); - transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_lo, witness_commitments.lookup_mem_rng_chk_lo); - transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_mid, witness_commitments.lookup_mem_rng_chk_mid); - transcript->send_to_verifier(commitment_labels.lookup_mem_rng_chk_hi, witness_commitments.lookup_mem_rng_chk_hi); - transcript->send_to_verifier(commitment_labels.lookup_pow_2_0, witness_commitments.lookup_pow_2_0); - transcript->send_to_verifier(commitment_labels.lookup_pow_2_1, witness_commitments.lookup_pow_2_1); - transcript->send_to_verifier(commitment_labels.lookup_u8_0, witness_commitments.lookup_u8_0); - transcript->send_to_verifier(commitment_labels.lookup_u8_1, witness_commitments.lookup_u8_1); - transcript->send_to_verifier(commitment_labels.lookup_u16_0, witness_commitments.lookup_u16_0); - transcript->send_to_verifier(commitment_labels.lookup_u16_1, witness_commitments.lookup_u16_1); - transcript->send_to_verifier(commitment_labels.lookup_u16_2, witness_commitments.lookup_u16_2); - transcript->send_to_verifier(commitment_labels.lookup_u16_3, witness_commitments.lookup_u16_3); - transcript->send_to_verifier(commitment_labels.lookup_u16_4, witness_commitments.lookup_u16_4); - transcript->send_to_verifier(commitment_labels.lookup_u16_5, witness_commitments.lookup_u16_5); - transcript->send_to_verifier(commitment_labels.lookup_u16_6, witness_commitments.lookup_u16_6); - transcript->send_to_verifier(commitment_labels.lookup_u16_7, witness_commitments.lookup_u16_7); - transcript->send_to_verifier(commitment_labels.lookup_u16_8, witness_commitments.lookup_u16_8); - transcript->send_to_verifier(commitment_labels.lookup_u16_9, witness_commitments.lookup_u16_9); - transcript->send_to_verifier(commitment_labels.lookup_u16_10, witness_commitments.lookup_u16_10); - transcript->send_to_verifier(commitment_labels.lookup_u16_11, witness_commitments.lookup_u16_11); - transcript->send_to_verifier(commitment_labels.lookup_u16_12, witness_commitments.lookup_u16_12); - transcript->send_to_verifier(commitment_labels.lookup_u16_13, witness_commitments.lookup_u16_13); - transcript->send_to_verifier(commitment_labels.lookup_u16_14, witness_commitments.lookup_u16_14); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_0, witness_commitments.lookup_div_u16_0); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_1, witness_commitments.lookup_div_u16_1); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_2, witness_commitments.lookup_div_u16_2); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_3, witness_commitments.lookup_div_u16_3); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_4, witness_commitments.lookup_div_u16_4); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_5, witness_commitments.lookup_div_u16_5); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_6, witness_commitments.lookup_div_u16_6); - transcript->send_to_verifier(commitment_labels.lookup_div_u16_7, witness_commitments.lookup_div_u16_7); ->>>>>>> 517766bd15 (7381: witness generation for RETURN opcode gadget) } /** From 6d75aa9fe60d9ac81c9ada1c3963d59c59486813 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 10 Jul 2024 12:53:34 +0000 Subject: [PATCH 11/12] 7381: REVERT opcode needs to return data --- barretenberg/cpp/pil/avm/gadgets/mem_slice.pil | 10 ++++++++++ .../relations/generated/avm/declare_views.hpp | 1 + .../relations/generated/avm/mem_slice.hpp | 13 ++++++++++++- .../src/barretenberg/vm/avm_trace/avm_execution.cpp | 11 +++++++---- .../vm/generated/avm_circuit_builder.hpp | 3 ++- .../src/barretenberg/vm/generated/avm_flavor.hpp | 5 ++++- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil index 2c85484d0ed..2fa6f61afe6 100644 --- a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil +++ b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil @@ -51,6 +51,16 @@ namespace slice(256); #[SAME_SEL_CD_CPY] sel_mem_active * sel_mem_active' * (sel_cd_cpy - sel_cd_cpy') = 0; + #[SEL_MEM_INACTIVE] + (1 - sel_mem_active) * sel_mem_active' * (1 - sel_start') = 0; + + // The above relation is crucial to prevent a malicious prover of adding extra active rows + // after the row with cnt == 0 unless another operation starts (sel_start == 1). This relation + // implies that whenever sel_mem_active == 0 and sel_start' != 1, sel_mem_active' == 0. + // Note that the malicious prover can fill other columns such as clk or even sel_cd_cpy + // but as long sel_mem_active == 0, it does not lead to any memory operations. The latter + // is guarded by sel_mem_active in #[PERM_SLICE_MEM] below. + #[LOOKUP_CD_VALUE] sel_cd_cpy {col_offset, val} in main.sel_calldata {main.clk, main.calldata}; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp index 86c0513eeeb..60916f5b043 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -500,4 +500,5 @@ [[maybe_unused]] auto slice_sel_cd_cpy_shift = View(new_term.slice_sel_cd_cpy_shift); \ [[maybe_unused]] auto slice_sel_mem_active_shift = View(new_term.slice_sel_mem_active_shift); \ [[maybe_unused]] auto slice_sel_return_shift = View(new_term.slice_sel_return_shift); \ + [[maybe_unused]] auto slice_sel_start_shift = View(new_term.slice_sel_start_shift); \ [[maybe_unused]] auto slice_space_id_shift = View(new_term.slice_space_id_shift); diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp index 5bb7e7ff8f2..5ad94a5d5fa 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem_slice.hpp @@ -22,6 +22,7 @@ template struct MemSliceRow { FF slice_sel_mem_active_shift{}; FF slice_sel_return{}; FF slice_sel_return_shift{}; + FF slice_sel_start_shift{}; FF slice_space_id{}; FF slice_space_id_shift{}; }; @@ -47,6 +48,8 @@ inline std::string get_relation_label_mem_slice(int index) return "SAME_SEL_RETURN"; case 9: return "SAME_SEL_CD_CPY"; + case 10: + return "SEL_MEM_INACTIVE"; } return std::to_string(index); } @@ -55,7 +58,7 @@ template class mem_sliceImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 2, 3, 3, 3, 3, 3, 3, 3, 4, 4 }; + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4 }; template void static accumulate(ContainerOverSubrelations& evals, @@ -135,6 +138,14 @@ template class mem_sliceImpl { tmp *= scaling_factor; std::get<9>(evals) += tmp; } + // Contribution 10 + { + Avm_DECLARE_VIEWS(10); + auto tmp = + (((-slice_sel_mem_active + FF(1)) * slice_sel_mem_active_shift) * (-slice_sel_start_shift + FF(1))); + tmp *= scaling_factor; + std::get<10>(evals) += tmp; + } } }; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp index 44b58039567..21401f2fe0a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp @@ -654,11 +654,14 @@ std::vector Execution::gen_trace(std::vector const& instructio break; } - case OpCode::REVERT: - trace_builder.op_revert(std::get(inst.operands.at(0)), - std::get(inst.operands.at(1)), - std::get(inst.operands.at(2))); + case OpCode::REVERT: { + auto ret = trace_builder.op_revert(std::get(inst.operands.at(0)), + std::get(inst.operands.at(1)), + std::get(inst.operands.at(2))); + returndata.insert(returndata.end(), ret.begin(), ret.end()); + break; + } // Misc case OpCode::DEBUGLOG: diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index 3fd2448cd4e..9a2382b1d0f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -30,7 +30,7 @@ class AvmCircuitBuilder { using ProverPolynomials = Flavor::ProverPolynomials; static constexpr size_t num_fixed_columns = 411; - static constexpr size_t num_polys = 411 + 73; + static constexpr size_t num_polys = 411 + 74; std::vector rows; void set_trace(std::vector&& trace) { rows = std::move(trace); } @@ -480,6 +480,7 @@ class AvmCircuitBuilder { polys.slice_sel_cd_cpy_shift = Polynomial(polys.slice_sel_cd_cpy.shifted()); polys.slice_sel_mem_active_shift = Polynomial(polys.slice_sel_mem_active.shifted()); polys.slice_sel_return_shift = Polynomial(polys.slice_sel_return.shifted()); + polys.slice_sel_start_shift = Polynomial(polys.slice_sel_start.shifted()); polys.slice_space_id_shift = Polynomial(polys.slice_space_id.shifted()); return polys; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index 682ef3d1cd9..131a9589d6d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -116,7 +116,7 @@ class AvmFlavor { 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 = 484; + static constexpr size_t NUM_ALL_ENTITIES = 485; using MainRelations = std::tuple< // Relations @@ -720,6 +720,7 @@ class AvmFlavor { slice_sel_cd_cpy_shift, slice_sel_mem_active_shift, slice_sel_return_shift, + slice_sel_start_shift, slice_space_id_shift) }; @@ -798,6 +799,7 @@ class AvmFlavor { entities.slice_sel_cd_cpy, entities.slice_sel_mem_active, entities.slice_sel_return, + entities.slice_sel_start, entities.slice_space_id }; } @@ -907,6 +909,7 @@ class AvmFlavor { slice_sel_cd_cpy, slice_sel_mem_active, slice_sel_return, + slice_sel_start, slice_space_id }; } }; From a4c6a53c1ff62de3113c35e909e7baa27d7594a9 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 10 Jul 2024 15:19:02 +0000 Subject: [PATCH 12/12] 7381: rebuild after rebase to master --- .../barretenberg/vm/generated/avm_flavor.hpp | 995 ++++++++++-------- 1 file changed, 547 insertions(+), 448 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index 131a9589d6d..7ea67f9bfb6 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -934,6 +934,7 @@ class AvmFlavor { kernel_kernel_side_effect_out, kernel_kernel_metadata_out, main_calldata, + main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, @@ -1102,6 +1103,7 @@ class AvmFlavor { main_rwd, main_sel_alu, main_sel_bin, + main_sel_calldata, main_sel_gas_accounting_active, main_sel_last, main_sel_mem_op_a, @@ -1115,6 +1117,7 @@ class AvmFlavor { 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, @@ -1127,6 +1130,7 @@ class AvmFlavor { 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, @@ -1169,8 +1173,10 @@ class AvmFlavor { 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, @@ -1193,6 +1199,7 @@ class AvmFlavor { mem_sel_op_c, mem_sel_op_cmov, mem_sel_op_d, + mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, @@ -1219,11 +1226,24 @@ class AvmFlavor { 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, + perm_slice_mem, perm_main_alu, perm_main_bin, perm_main_conv, perm_main_pos2_perm, perm_main_pedersen, + perm_main_slice, perm_main_mem_a, perm_main_mem_b, perm_main_mem_c, @@ -1234,6 +1254,8 @@ class AvmFlavor { perm_main_mem_ind_addr_d, lookup_byte_lengths, lookup_byte_operations, + lookup_cd_value, + lookup_ret_value, lookup_opcode_gas, range_check_l2_gas_hi, range_check_l2_gas_lo, @@ -1275,6 +1297,8 @@ class AvmFlavor { lookup_div_u16_7, 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, @@ -1378,9 +1402,18 @@ class AvmFlavor { mem_sel_mem_shift, mem_tag_shift, mem_tsp_shift, - mem_val_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) - AllConstRefValues(const RefArray& il) + AllConstRefValues(const RefArray& il) : main_clk(il[0]) , main_sel_first(il[1]) , kernel_kernel_inputs(il[2]) @@ -1388,451 +1421,484 @@ class AvmFlavor { , kernel_kernel_side_effect_out(il[4]) , kernel_kernel_metadata_out(il[5]) , main_calldata(il[6]) - , alu_a_hi(il[7]) - , alu_a_lo(il[8]) - , alu_b_hi(il[9]) - , alu_b_lo(il[10]) - , alu_borrow(il[11]) - , alu_cf(il[12]) - , alu_clk(il[13]) - , alu_cmp_rng_ctr(il[14]) - , alu_div_u16_r0(il[15]) - , alu_div_u16_r1(il[16]) - , alu_div_u16_r2(il[17]) - , alu_div_u16_r3(il[18]) - , alu_div_u16_r4(il[19]) - , alu_div_u16_r5(il[20]) - , alu_div_u16_r6(il[21]) - , alu_div_u16_r7(il[22]) - , alu_divisor_hi(il[23]) - , alu_divisor_lo(il[24]) - , alu_ff_tag(il[25]) - , alu_ia(il[26]) - , alu_ib(il[27]) - , alu_ic(il[28]) - , alu_in_tag(il[29]) - , alu_op_add(il[30]) - , alu_op_cast(il[31]) - , alu_op_cast_prev(il[32]) - , alu_op_div(il[33]) - , alu_op_div_a_lt_b(il[34]) - , alu_op_div_std(il[35]) - , alu_op_eq(il[36]) - , alu_op_eq_diff_inv(il[37]) - , alu_op_lt(il[38]) - , alu_op_lte(il[39]) - , alu_op_mul(il[40]) - , alu_op_not(il[41]) - , alu_op_shl(il[42]) - , alu_op_shr(il[43]) - , alu_op_sub(il[44]) - , alu_p_a_borrow(il[45]) - , alu_p_b_borrow(il[46]) - , alu_p_sub_a_hi(il[47]) - , alu_p_sub_a_lo(il[48]) - , alu_p_sub_b_hi(il[49]) - , alu_p_sub_b_lo(il[50]) - , alu_partial_prod_hi(il[51]) - , alu_partial_prod_lo(il[52]) - , alu_quotient_hi(il[53]) - , alu_quotient_lo(il[54]) - , alu_remainder(il[55]) - , alu_res_hi(il[56]) - , alu_res_lo(il[57]) - , alu_sel_alu(il[58]) - , alu_sel_cmp(il[59]) - , alu_sel_div_rng_chk(il[60]) - , alu_sel_rng_chk(il[61]) - , alu_sel_rng_chk_lookup(il[62]) - , alu_sel_shift_which(il[63]) - , alu_shift_lt_bit_len(il[64]) - , alu_t_sub_s_bits(il[65]) - , alu_two_pow_s(il[66]) - , alu_two_pow_t_sub_s(il[67]) - , alu_u128_tag(il[68]) - , alu_u16_r0(il[69]) - , alu_u16_r1(il[70]) - , alu_u16_r10(il[71]) - , alu_u16_r11(il[72]) - , alu_u16_r12(il[73]) - , alu_u16_r13(il[74]) - , alu_u16_r14(il[75]) - , alu_u16_r2(il[76]) - , alu_u16_r3(il[77]) - , alu_u16_r4(il[78]) - , alu_u16_r5(il[79]) - , alu_u16_r6(il[80]) - , alu_u16_r7(il[81]) - , alu_u16_r8(il[82]) - , alu_u16_r9(il[83]) - , alu_u16_tag(il[84]) - , alu_u32_tag(il[85]) - , alu_u64_tag(il[86]) - , alu_u8_r0(il[87]) - , alu_u8_r1(il[88]) - , alu_u8_tag(il[89]) - , binary_acc_ia(il[90]) - , binary_acc_ib(il[91]) - , binary_acc_ic(il[92]) - , binary_clk(il[93]) - , binary_ia_bytes(il[94]) - , binary_ib_bytes(il[95]) - , binary_ic_bytes(il[96]) - , binary_in_tag(il[97]) - , binary_mem_tag_ctr(il[98]) - , binary_mem_tag_ctr_inv(il[99]) - , binary_op_id(il[100]) - , binary_sel_bin(il[101]) - , binary_start(il[102]) - , byte_lookup_sel_bin(il[103]) - , byte_lookup_table_byte_lengths(il[104]) - , byte_lookup_table_in_tags(il[105]) - , byte_lookup_table_input_a(il[106]) - , byte_lookup_table_input_b(il[107]) - , byte_lookup_table_op_id(il[108]) - , byte_lookup_table_output(il[109]) - , conversion_clk(il[110]) - , conversion_input(il[111]) - , conversion_num_limbs(il[112]) - , conversion_radix(il[113]) - , conversion_sel_to_radix_le(il[114]) - , gas_da_gas_fixed_table(il[115]) - , gas_l2_gas_fixed_table(il[116]) - , gas_sel_gas_cost(il[117]) - , keccakf1600_clk(il[118]) - , keccakf1600_input(il[119]) - , keccakf1600_output(il[120]) - , keccakf1600_sel_keccakf1600(il[121]) - , kernel_emit_l2_to_l1_msg_write_offset(il[122]) - , kernel_emit_note_hash_write_offset(il[123]) - , kernel_emit_nullifier_write_offset(il[124]) - , kernel_emit_unencrypted_log_write_offset(il[125]) - , kernel_kernel_in_offset(il[126]) - , kernel_kernel_out_offset(il[127]) - , kernel_l1_to_l2_msg_exists_write_offset(il[128]) - , kernel_note_hash_exist_write_offset(il[129]) - , kernel_nullifier_exists_write_offset(il[130]) - , kernel_nullifier_non_exists_write_offset(il[131]) - , kernel_q_public_input_kernel_add_to_table(il[132]) - , kernel_q_public_input_kernel_out_add_to_table(il[133]) - , kernel_side_effect_counter(il[134]) - , kernel_sload_write_offset(il[135]) - , kernel_sstore_write_offset(il[136]) - , main_abs_da_rem_gas_hi(il[137]) - , main_abs_da_rem_gas_lo(il[138]) - , main_abs_l2_rem_gas_hi(il[139]) - , main_abs_l2_rem_gas_lo(il[140]) - , main_alu_in_tag(il[141]) - , main_bin_op_id(il[142]) - , main_call_ptr(il[143]) - , main_da_gas_op_cost(il[144]) - , main_da_gas_remaining(il[145]) - , main_da_out_of_gas(il[146]) - , main_ia(il[147]) - , main_ib(il[148]) - , main_ic(il[149]) - , main_id(il[150]) - , main_id_zero(il[151]) - , main_ind_addr_a(il[152]) - , main_ind_addr_b(il[153]) - , main_ind_addr_c(il[154]) - , main_ind_addr_d(il[155]) - , main_internal_return_ptr(il[156]) - , main_inv(il[157]) - , main_l2_gas_op_cost(il[158]) - , main_l2_gas_remaining(il[159]) - , main_l2_out_of_gas(il[160]) - , main_mem_addr_a(il[161]) - , main_mem_addr_b(il[162]) - , main_mem_addr_c(il[163]) - , main_mem_addr_d(il[164]) - , main_op_err(il[165]) - , main_opcode_val(il[166]) - , main_pc(il[167]) - , main_r_in_tag(il[168]) - , main_rwa(il[169]) - , main_rwb(il[170]) - , main_rwc(il[171]) - , main_rwd(il[172]) - , main_sel_alu(il[173]) - , main_sel_bin(il[174]) - , main_sel_gas_accounting_active(il[175]) - , main_sel_last(il[176]) - , main_sel_mem_op_a(il[177]) - , main_sel_mem_op_activate_gas(il[178]) - , main_sel_mem_op_b(il[179]) - , main_sel_mem_op_c(il[180]) - , main_sel_mem_op_d(il[181]) - , main_sel_mov_ia_to_ic(il[182]) - , main_sel_mov_ib_to_ic(il[183]) - , main_sel_op_add(il[184]) - , main_sel_op_address(il[185]) - , main_sel_op_and(il[186]) - , main_sel_op_block_number(il[187]) - , main_sel_op_cast(il[188]) - , main_sel_op_chain_id(il[189]) - , main_sel_op_cmov(il[190]) - , main_sel_op_coinbase(il[191]) - , main_sel_op_dagasleft(il[192]) - , main_sel_op_div(il[193]) - , main_sel_op_emit_l2_to_l1_msg(il[194]) - , main_sel_op_emit_note_hash(il[195]) - , main_sel_op_emit_nullifier(il[196]) - , main_sel_op_emit_unencrypted_log(il[197]) - , main_sel_op_eq(il[198]) - , main_sel_op_external_call(il[199]) - , main_sel_op_fdiv(il[200]) - , main_sel_op_fee_per_da_gas(il[201]) - , main_sel_op_fee_per_l2_gas(il[202]) - , main_sel_op_function_selector(il[203]) - , main_sel_op_get_contract_instance(il[204]) - , main_sel_op_halt(il[205]) - , main_sel_op_internal_call(il[206]) - , main_sel_op_internal_return(il[207]) - , main_sel_op_jump(il[208]) - , main_sel_op_jumpi(il[209]) - , main_sel_op_keccak(il[210]) - , main_sel_op_l1_to_l2_msg_exists(il[211]) - , main_sel_op_l2gasleft(il[212]) - , main_sel_op_lt(il[213]) - , main_sel_op_lte(il[214]) - , main_sel_op_mov(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_poseidon2(il[222]) - , main_sel_op_radix_le(il[223]) - , main_sel_op_sender(il[224]) - , main_sel_op_sha256(il[225]) - , main_sel_op_shl(il[226]) - , main_sel_op_shr(il[227]) - , main_sel_op_sload(il[228]) - , main_sel_op_sstore(il[229]) - , main_sel_op_storage_address(il[230]) - , main_sel_op_sub(il[231]) - , main_sel_op_timestamp(il[232]) - , main_sel_op_transaction_fee(il[233]) - , main_sel_op_version(il[234]) - , main_sel_op_xor(il[235]) - , main_sel_q_kernel_lookup(il[236]) - , main_sel_q_kernel_output_lookup(il[237]) - , main_sel_resolve_ind_addr_a(il[238]) - , main_sel_resolve_ind_addr_b(il[239]) - , main_sel_resolve_ind_addr_c(il[240]) - , main_sel_resolve_ind_addr_d(il[241]) - , main_sel_rng_16(il[242]) - , main_sel_rng_8(il[243]) - , main_space_id(il[244]) - , main_tag_err(il[245]) - , main_w_in_tag(il[246]) - , mem_addr(il[247]) - , mem_clk(il[248]) - , mem_diff_hi(il[249]) - , mem_diff_lo(il[250]) - , mem_diff_mid(il[251]) - , mem_glob_addr(il[252]) - , mem_last(il[253]) - , mem_lastAccess(il[254]) - , mem_one_min_inv(il[255]) - , mem_r_in_tag(il[256]) - , mem_rw(il[257]) - , mem_sel_mem(il[258]) - , mem_sel_mov_ia_to_ic(il[259]) - , mem_sel_mov_ib_to_ic(il[260]) - , mem_sel_op_a(il[261]) - , mem_sel_op_b(il[262]) - , mem_sel_op_c(il[263]) - , mem_sel_op_cmov(il[264]) - , mem_sel_op_d(il[265]) - , mem_sel_resolve_ind_addr_a(il[266]) - , mem_sel_resolve_ind_addr_b(il[267]) - , mem_sel_resolve_ind_addr_c(il[268]) - , mem_sel_resolve_ind_addr_d(il[269]) - , mem_sel_rng_chk(il[270]) - , mem_skip_check_tag(il[271]) - , mem_space_id(il[272]) - , mem_tag(il[273]) - , mem_tag_err(il[274]) - , mem_tsp(il[275]) - , mem_val(il[276]) - , mem_w_in_tag(il[277]) - , pedersen_clk(il[278]) - , pedersen_input(il[279]) - , pedersen_output(il[280]) - , pedersen_sel_pedersen(il[281]) - , poseidon2_clk(il[282]) - , poseidon2_input(il[283]) - , poseidon2_output(il[284]) - , poseidon2_sel_poseidon_perm(il[285]) - , powers_power_of_2(il[286]) - , sha256_clk(il[287]) - , sha256_input(il[288]) - , sha256_output(il[289]) - , sha256_sel_sha256_compression(il[290]) - , sha256_state(il[291]) - , perm_main_alu(il[292]) - , perm_main_bin(il[293]) - , perm_main_conv(il[294]) - , perm_main_pos2_perm(il[295]) - , perm_main_pedersen(il[296]) - , perm_main_mem_a(il[297]) - , perm_main_mem_b(il[298]) - , perm_main_mem_c(il[299]) - , perm_main_mem_d(il[300]) - , perm_main_mem_ind_addr_a(il[301]) - , perm_main_mem_ind_addr_b(il[302]) - , perm_main_mem_ind_addr_c(il[303]) - , perm_main_mem_ind_addr_d(il[304]) - , lookup_byte_lengths(il[305]) - , lookup_byte_operations(il[306]) - , lookup_opcode_gas(il[307]) - , range_check_l2_gas_hi(il[308]) - , range_check_l2_gas_lo(il[309]) - , range_check_da_gas_hi(il[310]) - , range_check_da_gas_lo(il[311]) - , kernel_output_lookup(il[312]) - , lookup_into_kernel(il[313]) - , incl_main_tag_err(il[314]) - , incl_mem_tag_err(il[315]) - , lookup_mem_rng_chk_lo(il[316]) - , lookup_mem_rng_chk_mid(il[317]) - , lookup_mem_rng_chk_hi(il[318]) - , lookup_pow_2_0(il[319]) - , lookup_pow_2_1(il[320]) - , lookup_u8_0(il[321]) - , lookup_u8_1(il[322]) - , lookup_u16_0(il[323]) - , lookup_u16_1(il[324]) - , lookup_u16_2(il[325]) - , lookup_u16_3(il[326]) - , lookup_u16_4(il[327]) - , lookup_u16_5(il[328]) - , lookup_u16_6(il[329]) - , lookup_u16_7(il[330]) - , lookup_u16_8(il[331]) - , lookup_u16_9(il[332]) - , lookup_u16_10(il[333]) - , lookup_u16_11(il[334]) - , lookup_u16_12(il[335]) - , lookup_u16_13(il[336]) - , lookup_u16_14(il[337]) - , lookup_div_u16_0(il[338]) - , lookup_div_u16_1(il[339]) - , lookup_div_u16_2(il[340]) - , lookup_div_u16_3(il[341]) - , lookup_div_u16_4(il[342]) - , lookup_div_u16_5(il[343]) - , lookup_div_u16_6(il[344]) - , lookup_div_u16_7(il[345]) - , lookup_byte_lengths_counts(il[346]) - , lookup_byte_operations_counts(il[347]) - , lookup_opcode_gas_counts(il[348]) - , range_check_l2_gas_hi_counts(il[349]) - , range_check_l2_gas_lo_counts(il[350]) - , range_check_da_gas_hi_counts(il[351]) - , range_check_da_gas_lo_counts(il[352]) - , kernel_output_lookup_counts(il[353]) - , lookup_into_kernel_counts(il[354]) - , incl_main_tag_err_counts(il[355]) - , incl_mem_tag_err_counts(il[356]) - , lookup_mem_rng_chk_lo_counts(il[357]) - , lookup_mem_rng_chk_mid_counts(il[358]) - , lookup_mem_rng_chk_hi_counts(il[359]) - , lookup_pow_2_0_counts(il[360]) - , lookup_pow_2_1_counts(il[361]) - , lookup_u8_0_counts(il[362]) - , lookup_u8_1_counts(il[363]) - , lookup_u16_0_counts(il[364]) - , lookup_u16_1_counts(il[365]) - , lookup_u16_2_counts(il[366]) - , lookup_u16_3_counts(il[367]) - , lookup_u16_4_counts(il[368]) - , lookup_u16_5_counts(il[369]) - , lookup_u16_6_counts(il[370]) - , lookup_u16_7_counts(il[371]) - , lookup_u16_8_counts(il[372]) - , lookup_u16_9_counts(il[373]) - , lookup_u16_10_counts(il[374]) - , lookup_u16_11_counts(il[375]) - , lookup_u16_12_counts(il[376]) - , lookup_u16_13_counts(il[377]) - , lookup_u16_14_counts(il[378]) - , lookup_div_u16_0_counts(il[379]) - , lookup_div_u16_1_counts(il[380]) - , lookup_div_u16_2_counts(il[381]) - , lookup_div_u16_3_counts(il[382]) - , lookup_div_u16_4_counts(il[383]) - , lookup_div_u16_5_counts(il[384]) - , lookup_div_u16_6_counts(il[385]) - , lookup_div_u16_7_counts(il[386]) - , alu_a_hi_shift(il[387]) - , alu_a_lo_shift(il[388]) - , alu_b_hi_shift(il[389]) - , alu_b_lo_shift(il[390]) - , alu_cmp_rng_ctr_shift(il[391]) - , alu_div_u16_r0_shift(il[392]) - , alu_div_u16_r1_shift(il[393]) - , alu_div_u16_r2_shift(il[394]) - , alu_div_u16_r3_shift(il[395]) - , alu_div_u16_r4_shift(il[396]) - , alu_div_u16_r5_shift(il[397]) - , alu_div_u16_r6_shift(il[398]) - , alu_div_u16_r7_shift(il[399]) - , alu_op_add_shift(il[400]) - , alu_op_cast_prev_shift(il[401]) - , alu_op_cast_shift(il[402]) - , alu_op_div_shift(il[403]) - , alu_op_mul_shift(il[404]) - , alu_op_shl_shift(il[405]) - , alu_op_shr_shift(il[406]) - , alu_op_sub_shift(il[407]) - , alu_p_sub_a_hi_shift(il[408]) - , alu_p_sub_a_lo_shift(il[409]) - , alu_p_sub_b_hi_shift(il[410]) - , alu_p_sub_b_lo_shift(il[411]) - , alu_sel_alu_shift(il[412]) - , alu_sel_cmp_shift(il[413]) - , alu_sel_div_rng_chk_shift(il[414]) - , alu_sel_rng_chk_lookup_shift(il[415]) - , alu_sel_rng_chk_shift(il[416]) - , alu_u16_r0_shift(il[417]) - , alu_u16_r1_shift(il[418]) - , alu_u16_r2_shift(il[419]) - , alu_u16_r3_shift(il[420]) - , alu_u16_r4_shift(il[421]) - , alu_u16_r5_shift(il[422]) - , alu_u16_r6_shift(il[423]) - , alu_u8_r0_shift(il[424]) - , alu_u8_r1_shift(il[425]) - , binary_acc_ia_shift(il[426]) - , binary_acc_ib_shift(il[427]) - , binary_acc_ic_shift(il[428]) - , binary_mem_tag_ctr_shift(il[429]) - , binary_op_id_shift(il[430]) - , kernel_emit_l2_to_l1_msg_write_offset_shift(il[431]) - , kernel_emit_note_hash_write_offset_shift(il[432]) - , kernel_emit_nullifier_write_offset_shift(il[433]) - , kernel_emit_unencrypted_log_write_offset_shift(il[434]) - , kernel_l1_to_l2_msg_exists_write_offset_shift(il[435]) - , kernel_note_hash_exist_write_offset_shift(il[436]) - , kernel_nullifier_exists_write_offset_shift(il[437]) - , kernel_nullifier_non_exists_write_offset_shift(il[438]) - , kernel_side_effect_counter_shift(il[439]) - , kernel_sload_write_offset_shift(il[440]) - , kernel_sstore_write_offset_shift(il[441]) - , main_da_gas_remaining_shift(il[442]) - , main_internal_return_ptr_shift(il[443]) - , main_l2_gas_remaining_shift(il[444]) - , main_pc_shift(il[445]) - , mem_glob_addr_shift(il[446]) - , mem_rw_shift(il[447]) - , mem_sel_mem_shift(il[448]) - , mem_tag_shift(il[449]) - , mem_tsp_shift(il[450]) - , mem_val_shift(il[451]) + , main_returndata(il[7]) + , alu_a_hi(il[8]) + , alu_a_lo(il[9]) + , alu_b_hi(il[10]) + , alu_b_lo(il[11]) + , alu_borrow(il[12]) + , alu_cf(il[13]) + , alu_clk(il[14]) + , alu_cmp_rng_ctr(il[15]) + , alu_div_u16_r0(il[16]) + , alu_div_u16_r1(il[17]) + , alu_div_u16_r2(il[18]) + , alu_div_u16_r3(il[19]) + , alu_div_u16_r4(il[20]) + , alu_div_u16_r5(il[21]) + , alu_div_u16_r6(il[22]) + , alu_div_u16_r7(il[23]) + , alu_divisor_hi(il[24]) + , alu_divisor_lo(il[25]) + , alu_ff_tag(il[26]) + , alu_ia(il[27]) + , alu_ib(il[28]) + , alu_ic(il[29]) + , alu_in_tag(il[30]) + , alu_op_add(il[31]) + , alu_op_cast(il[32]) + , alu_op_cast_prev(il[33]) + , alu_op_div(il[34]) + , alu_op_div_a_lt_b(il[35]) + , alu_op_div_std(il[36]) + , alu_op_eq(il[37]) + , alu_op_eq_diff_inv(il[38]) + , alu_op_lt(il[39]) + , alu_op_lte(il[40]) + , alu_op_mul(il[41]) + , alu_op_not(il[42]) + , alu_op_shl(il[43]) + , alu_op_shr(il[44]) + , alu_op_sub(il[45]) + , alu_p_a_borrow(il[46]) + , alu_p_b_borrow(il[47]) + , alu_p_sub_a_hi(il[48]) + , alu_p_sub_a_lo(il[49]) + , alu_p_sub_b_hi(il[50]) + , alu_p_sub_b_lo(il[51]) + , alu_partial_prod_hi(il[52]) + , alu_partial_prod_lo(il[53]) + , alu_quotient_hi(il[54]) + , alu_quotient_lo(il[55]) + , alu_remainder(il[56]) + , alu_res_hi(il[57]) + , alu_res_lo(il[58]) + , alu_sel_alu(il[59]) + , alu_sel_cmp(il[60]) + , alu_sel_div_rng_chk(il[61]) + , alu_sel_rng_chk(il[62]) + , alu_sel_rng_chk_lookup(il[63]) + , alu_sel_shift_which(il[64]) + , alu_shift_lt_bit_len(il[65]) + , alu_t_sub_s_bits(il[66]) + , alu_two_pow_s(il[67]) + , alu_two_pow_t_sub_s(il[68]) + , alu_u128_tag(il[69]) + , alu_u16_r0(il[70]) + , alu_u16_r1(il[71]) + , alu_u16_r10(il[72]) + , alu_u16_r11(il[73]) + , alu_u16_r12(il[74]) + , alu_u16_r13(il[75]) + , alu_u16_r14(il[76]) + , alu_u16_r2(il[77]) + , alu_u16_r3(il[78]) + , alu_u16_r4(il[79]) + , alu_u16_r5(il[80]) + , alu_u16_r6(il[81]) + , alu_u16_r7(il[82]) + , alu_u16_r8(il[83]) + , alu_u16_r9(il[84]) + , alu_u16_tag(il[85]) + , alu_u32_tag(il[86]) + , alu_u64_tag(il[87]) + , alu_u8_r0(il[88]) + , alu_u8_r1(il[89]) + , alu_u8_tag(il[90]) + , binary_acc_ia(il[91]) + , binary_acc_ib(il[92]) + , binary_acc_ic(il[93]) + , binary_clk(il[94]) + , binary_ia_bytes(il[95]) + , binary_ib_bytes(il[96]) + , binary_ic_bytes(il[97]) + , binary_in_tag(il[98]) + , binary_mem_tag_ctr(il[99]) + , binary_mem_tag_ctr_inv(il[100]) + , binary_op_id(il[101]) + , binary_sel_bin(il[102]) + , binary_start(il[103]) + , byte_lookup_sel_bin(il[104]) + , byte_lookup_table_byte_lengths(il[105]) + , byte_lookup_table_in_tags(il[106]) + , byte_lookup_table_input_a(il[107]) + , byte_lookup_table_input_b(il[108]) + , byte_lookup_table_op_id(il[109]) + , byte_lookup_table_output(il[110]) + , conversion_clk(il[111]) + , conversion_input(il[112]) + , conversion_num_limbs(il[113]) + , conversion_radix(il[114]) + , conversion_sel_to_radix_le(il[115]) + , gas_da_gas_fixed_table(il[116]) + , gas_l2_gas_fixed_table(il[117]) + , gas_sel_gas_cost(il[118]) + , keccakf1600_clk(il[119]) + , keccakf1600_input(il[120]) + , keccakf1600_output(il[121]) + , keccakf1600_sel_keccakf1600(il[122]) + , kernel_emit_l2_to_l1_msg_write_offset(il[123]) + , kernel_emit_note_hash_write_offset(il[124]) + , kernel_emit_nullifier_write_offset(il[125]) + , kernel_emit_unencrypted_log_write_offset(il[126]) + , kernel_kernel_in_offset(il[127]) + , kernel_kernel_out_offset(il[128]) + , kernel_l1_to_l2_msg_exists_write_offset(il[129]) + , kernel_note_hash_exist_write_offset(il[130]) + , kernel_nullifier_exists_write_offset(il[131]) + , kernel_nullifier_non_exists_write_offset(il[132]) + , kernel_q_public_input_kernel_add_to_table(il[133]) + , kernel_q_public_input_kernel_out_add_to_table(il[134]) + , kernel_side_effect_counter(il[135]) + , kernel_sload_write_offset(il[136]) + , kernel_sstore_write_offset(il[137]) + , main_abs_da_rem_gas_hi(il[138]) + , main_abs_da_rem_gas_lo(il[139]) + , main_abs_l2_rem_gas_hi(il[140]) + , main_abs_l2_rem_gas_lo(il[141]) + , main_alu_in_tag(il[142]) + , main_bin_op_id(il[143]) + , main_call_ptr(il[144]) + , main_da_gas_op_cost(il[145]) + , main_da_gas_remaining(il[146]) + , main_da_out_of_gas(il[147]) + , main_ia(il[148]) + , main_ib(il[149]) + , main_ic(il[150]) + , main_id(il[151]) + , main_id_zero(il[152]) + , main_ind_addr_a(il[153]) + , main_ind_addr_b(il[154]) + , main_ind_addr_c(il[155]) + , main_ind_addr_d(il[156]) + , main_internal_return_ptr(il[157]) + , main_inv(il[158]) + , main_l2_gas_op_cost(il[159]) + , main_l2_gas_remaining(il[160]) + , main_l2_out_of_gas(il[161]) + , main_mem_addr_a(il[162]) + , main_mem_addr_b(il[163]) + , main_mem_addr_c(il[164]) + , main_mem_addr_d(il[165]) + , main_op_err(il[166]) + , main_opcode_val(il[167]) + , main_pc(il[168]) + , main_r_in_tag(il[169]) + , main_rwa(il[170]) + , main_rwb(il[171]) + , main_rwc(il[172]) + , main_rwd(il[173]) + , main_sel_alu(il[174]) + , main_sel_bin(il[175]) + , main_sel_calldata(il[176]) + , main_sel_gas_accounting_active(il[177]) + , main_sel_last(il[178]) + , main_sel_mem_op_a(il[179]) + , main_sel_mem_op_activate_gas(il[180]) + , main_sel_mem_op_b(il[181]) + , main_sel_mem_op_c(il[182]) + , main_sel_mem_op_d(il[183]) + , main_sel_mov_ia_to_ic(il[184]) + , main_sel_mov_ib_to_ic(il[185]) + , main_sel_op_add(il[186]) + , main_sel_op_address(il[187]) + , main_sel_op_and(il[188]) + , main_sel_op_block_number(il[189]) + , main_sel_op_calldata_copy(il[190]) + , main_sel_op_cast(il[191]) + , main_sel_op_chain_id(il[192]) + , main_sel_op_cmov(il[193]) + , main_sel_op_coinbase(il[194]) + , main_sel_op_dagasleft(il[195]) + , main_sel_op_div(il[196]) + , main_sel_op_emit_l2_to_l1_msg(il[197]) + , main_sel_op_emit_note_hash(il[198]) + , main_sel_op_emit_nullifier(il[199]) + , main_sel_op_emit_unencrypted_log(il[200]) + , main_sel_op_eq(il[201]) + , main_sel_op_external_call(il[202]) + , main_sel_op_external_return(il[203]) + , main_sel_op_fdiv(il[204]) + , main_sel_op_fee_per_da_gas(il[205]) + , main_sel_op_fee_per_l2_gas(il[206]) + , main_sel_op_function_selector(il[207]) + , main_sel_op_get_contract_instance(il[208]) + , main_sel_op_halt(il[209]) + , main_sel_op_internal_call(il[210]) + , main_sel_op_internal_return(il[211]) + , main_sel_op_jump(il[212]) + , main_sel_op_jumpi(il[213]) + , main_sel_op_keccak(il[214]) + , main_sel_op_l1_to_l2_msg_exists(il[215]) + , main_sel_op_l2gasleft(il[216]) + , main_sel_op_lt(il[217]) + , main_sel_op_lte(il[218]) + , main_sel_op_mov(il[219]) + , main_sel_op_mul(il[220]) + , main_sel_op_not(il[221]) + , main_sel_op_note_hash_exists(il[222]) + , main_sel_op_nullifier_exists(il[223]) + , main_sel_op_or(il[224]) + , main_sel_op_pedersen(il[225]) + , main_sel_op_poseidon2(il[226]) + , main_sel_op_radix_le(il[227]) + , main_sel_op_sender(il[228]) + , main_sel_op_sha256(il[229]) + , main_sel_op_shl(il[230]) + , main_sel_op_shr(il[231]) + , main_sel_op_sload(il[232]) + , main_sel_op_sstore(il[233]) + , main_sel_op_storage_address(il[234]) + , main_sel_op_sub(il[235]) + , main_sel_op_timestamp(il[236]) + , main_sel_op_transaction_fee(il[237]) + , main_sel_op_version(il[238]) + , main_sel_op_xor(il[239]) + , main_sel_q_kernel_lookup(il[240]) + , main_sel_q_kernel_output_lookup(il[241]) + , main_sel_resolve_ind_addr_a(il[242]) + , main_sel_resolve_ind_addr_b(il[243]) + , main_sel_resolve_ind_addr_c(il[244]) + , main_sel_resolve_ind_addr_d(il[245]) + , main_sel_returndata(il[246]) + , main_sel_rng_16(il[247]) + , main_sel_rng_8(il[248]) + , main_sel_slice_gadget(il[249]) + , main_space_id(il[250]) + , main_tag_err(il[251]) + , main_w_in_tag(il[252]) + , mem_addr(il[253]) + , mem_clk(il[254]) + , mem_diff_hi(il[255]) + , mem_diff_lo(il[256]) + , mem_diff_mid(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_slice(il[272]) + , mem_sel_resolve_ind_addr_a(il[273]) + , mem_sel_resolve_ind_addr_b(il[274]) + , mem_sel_resolve_ind_addr_c(il[275]) + , mem_sel_resolve_ind_addr_d(il[276]) + , mem_sel_rng_chk(il[277]) + , mem_skip_check_tag(il[278]) + , mem_space_id(il[279]) + , mem_tag(il[280]) + , mem_tag_err(il[281]) + , mem_tsp(il[282]) + , mem_val(il[283]) + , mem_w_in_tag(il[284]) + , pedersen_clk(il[285]) + , pedersen_input(il[286]) + , pedersen_output(il[287]) + , pedersen_sel_pedersen(il[288]) + , poseidon2_clk(il[289]) + , poseidon2_input(il[290]) + , poseidon2_output(il[291]) + , poseidon2_sel_poseidon_perm(il[292]) + , powers_power_of_2(il[293]) + , sha256_clk(il[294]) + , sha256_input(il[295]) + , sha256_output(il[296]) + , sha256_sel_sha256_compression(il[297]) + , sha256_state(il[298]) + , slice_addr(il[299]) + , slice_clk(il[300]) + , slice_cnt(il[301]) + , slice_col_offset(il[302]) + , slice_one_min_inv(il[303]) + , slice_sel_cd_cpy(il[304]) + , slice_sel_mem_active(il[305]) + , slice_sel_return(il[306]) + , slice_sel_start(il[307]) + , slice_space_id(il[308]) + , slice_val(il[309]) + , perm_slice_mem(il[310]) + , perm_main_alu(il[311]) + , perm_main_bin(il[312]) + , perm_main_conv(il[313]) + , perm_main_pos2_perm(il[314]) + , perm_main_pedersen(il[315]) + , perm_main_slice(il[316]) + , perm_main_mem_a(il[317]) + , perm_main_mem_b(il[318]) + , perm_main_mem_c(il[319]) + , perm_main_mem_d(il[320]) + , perm_main_mem_ind_addr_a(il[321]) + , perm_main_mem_ind_addr_b(il[322]) + , perm_main_mem_ind_addr_c(il[323]) + , perm_main_mem_ind_addr_d(il[324]) + , lookup_byte_lengths(il[325]) + , lookup_byte_operations(il[326]) + , lookup_cd_value(il[327]) + , lookup_ret_value(il[328]) + , lookup_opcode_gas(il[329]) + , range_check_l2_gas_hi(il[330]) + , range_check_l2_gas_lo(il[331]) + , range_check_da_gas_hi(il[332]) + , range_check_da_gas_lo(il[333]) + , kernel_output_lookup(il[334]) + , lookup_into_kernel(il[335]) + , incl_main_tag_err(il[336]) + , incl_mem_tag_err(il[337]) + , lookup_mem_rng_chk_lo(il[338]) + , lookup_mem_rng_chk_mid(il[339]) + , lookup_mem_rng_chk_hi(il[340]) + , lookup_pow_2_0(il[341]) + , lookup_pow_2_1(il[342]) + , lookup_u8_0(il[343]) + , lookup_u8_1(il[344]) + , lookup_u16_0(il[345]) + , lookup_u16_1(il[346]) + , lookup_u16_2(il[347]) + , lookup_u16_3(il[348]) + , lookup_u16_4(il[349]) + , lookup_u16_5(il[350]) + , lookup_u16_6(il[351]) + , lookup_u16_7(il[352]) + , lookup_u16_8(il[353]) + , lookup_u16_9(il[354]) + , lookup_u16_10(il[355]) + , lookup_u16_11(il[356]) + , lookup_u16_12(il[357]) + , lookup_u16_13(il[358]) + , lookup_u16_14(il[359]) + , lookup_div_u16_0(il[360]) + , lookup_div_u16_1(il[361]) + , lookup_div_u16_2(il[362]) + , lookup_div_u16_3(il[363]) + , lookup_div_u16_4(il[364]) + , lookup_div_u16_5(il[365]) + , lookup_div_u16_6(il[366]) + , lookup_div_u16_7(il[367]) + , lookup_byte_lengths_counts(il[368]) + , lookup_byte_operations_counts(il[369]) + , lookup_cd_value_counts(il[370]) + , lookup_ret_value_counts(il[371]) + , lookup_opcode_gas_counts(il[372]) + , range_check_l2_gas_hi_counts(il[373]) + , range_check_l2_gas_lo_counts(il[374]) + , range_check_da_gas_hi_counts(il[375]) + , range_check_da_gas_lo_counts(il[376]) + , kernel_output_lookup_counts(il[377]) + , lookup_into_kernel_counts(il[378]) + , incl_main_tag_err_counts(il[379]) + , incl_mem_tag_err_counts(il[380]) + , lookup_mem_rng_chk_lo_counts(il[381]) + , lookup_mem_rng_chk_mid_counts(il[382]) + , lookup_mem_rng_chk_hi_counts(il[383]) + , lookup_pow_2_0_counts(il[384]) + , lookup_pow_2_1_counts(il[385]) + , lookup_u8_0_counts(il[386]) + , lookup_u8_1_counts(il[387]) + , lookup_u16_0_counts(il[388]) + , lookup_u16_1_counts(il[389]) + , lookup_u16_2_counts(il[390]) + , lookup_u16_3_counts(il[391]) + , lookup_u16_4_counts(il[392]) + , lookup_u16_5_counts(il[393]) + , lookup_u16_6_counts(il[394]) + , lookup_u16_7_counts(il[395]) + , lookup_u16_8_counts(il[396]) + , lookup_u16_9_counts(il[397]) + , lookup_u16_10_counts(il[398]) + , lookup_u16_11_counts(il[399]) + , lookup_u16_12_counts(il[400]) + , lookup_u16_13_counts(il[401]) + , lookup_u16_14_counts(il[402]) + , lookup_div_u16_0_counts(il[403]) + , lookup_div_u16_1_counts(il[404]) + , lookup_div_u16_2_counts(il[405]) + , lookup_div_u16_3_counts(il[406]) + , lookup_div_u16_4_counts(il[407]) + , lookup_div_u16_5_counts(il[408]) + , lookup_div_u16_6_counts(il[409]) + , lookup_div_u16_7_counts(il[410]) + , alu_a_hi_shift(il[411]) + , alu_a_lo_shift(il[412]) + , alu_b_hi_shift(il[413]) + , alu_b_lo_shift(il[414]) + , alu_cmp_rng_ctr_shift(il[415]) + , alu_div_u16_r0_shift(il[416]) + , alu_div_u16_r1_shift(il[417]) + , alu_div_u16_r2_shift(il[418]) + , alu_div_u16_r3_shift(il[419]) + , alu_div_u16_r4_shift(il[420]) + , alu_div_u16_r5_shift(il[421]) + , alu_div_u16_r6_shift(il[422]) + , alu_div_u16_r7_shift(il[423]) + , alu_op_add_shift(il[424]) + , alu_op_cast_prev_shift(il[425]) + , alu_op_cast_shift(il[426]) + , alu_op_div_shift(il[427]) + , alu_op_mul_shift(il[428]) + , alu_op_shl_shift(il[429]) + , alu_op_shr_shift(il[430]) + , alu_op_sub_shift(il[431]) + , alu_p_sub_a_hi_shift(il[432]) + , alu_p_sub_a_lo_shift(il[433]) + , alu_p_sub_b_hi_shift(il[434]) + , alu_p_sub_b_lo_shift(il[435]) + , alu_sel_alu_shift(il[436]) + , alu_sel_cmp_shift(il[437]) + , alu_sel_div_rng_chk_shift(il[438]) + , alu_sel_rng_chk_lookup_shift(il[439]) + , alu_sel_rng_chk_shift(il[440]) + , alu_u16_r0_shift(il[441]) + , alu_u16_r1_shift(il[442]) + , alu_u16_r2_shift(il[443]) + , alu_u16_r3_shift(il[444]) + , alu_u16_r4_shift(il[445]) + , alu_u16_r5_shift(il[446]) + , alu_u16_r6_shift(il[447]) + , alu_u8_r0_shift(il[448]) + , alu_u8_r1_shift(il[449]) + , binary_acc_ia_shift(il[450]) + , binary_acc_ib_shift(il[451]) + , binary_acc_ic_shift(il[452]) + , binary_mem_tag_ctr_shift(il[453]) + , binary_op_id_shift(il[454]) + , kernel_emit_l2_to_l1_msg_write_offset_shift(il[455]) + , kernel_emit_note_hash_write_offset_shift(il[456]) + , kernel_emit_nullifier_write_offset_shift(il[457]) + , kernel_emit_unencrypted_log_write_offset_shift(il[458]) + , kernel_l1_to_l2_msg_exists_write_offset_shift(il[459]) + , kernel_note_hash_exist_write_offset_shift(il[460]) + , kernel_nullifier_exists_write_offset_shift(il[461]) + , kernel_nullifier_non_exists_write_offset_shift(il[462]) + , kernel_side_effect_counter_shift(il[463]) + , kernel_sload_write_offset_shift(il[464]) + , kernel_sstore_write_offset_shift(il[465]) + , main_da_gas_remaining_shift(il[466]) + , main_internal_return_ptr_shift(il[467]) + , main_l2_gas_remaining_shift(il[468]) + , main_pc_shift(il[469]) + , mem_glob_addr_shift(il[470]) + , mem_rw_shift(il[471]) + , mem_sel_mem_shift(il[472]) + , mem_tag_shift(il[473]) + , mem_tsp_shift(il[474]) + , mem_val_shift(il[475]) + , slice_addr_shift(il[476]) + , slice_clk_shift(il[477]) + , slice_cnt_shift(il[478]) + , slice_col_offset_shift(il[479]) + , slice_sel_cd_cpy_shift(il[480]) + , slice_sel_mem_active_shift(il[481]) + , slice_sel_return_shift(il[482]) + , slice_sel_start_shift(il[483]) + , slice_space_id_shift(il[484]) {} }; @@ -1875,6 +1941,7 @@ class AvmFlavor { kernel_kernel_side_effect_out[row_idx], kernel_kernel_metadata_out[row_idx], main_calldata[row_idx], + main_returndata[row_idx], alu_a_hi[row_idx], alu_a_lo[row_idx], alu_b_hi[row_idx], @@ -2043,6 +2110,7 @@ class AvmFlavor { main_rwd[row_idx], main_sel_alu[row_idx], main_sel_bin[row_idx], + main_sel_calldata[row_idx], main_sel_gas_accounting_active[row_idx], main_sel_last[row_idx], main_sel_mem_op_a[row_idx], @@ -2056,6 +2124,7 @@ class AvmFlavor { main_sel_op_address[row_idx], main_sel_op_and[row_idx], main_sel_op_block_number[row_idx], + 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], @@ -2068,6 +2137,7 @@ class AvmFlavor { main_sel_op_emit_unencrypted_log[row_idx], main_sel_op_eq[row_idx], main_sel_op_external_call[row_idx], + main_sel_op_external_return[row_idx], main_sel_op_fdiv[row_idx], main_sel_op_fee_per_da_gas[row_idx], main_sel_op_fee_per_l2_gas[row_idx], @@ -2110,8 +2180,10 @@ class AvmFlavor { main_sel_resolve_ind_addr_b[row_idx], main_sel_resolve_ind_addr_c[row_idx], main_sel_resolve_ind_addr_d[row_idx], + main_sel_returndata[row_idx], main_sel_rng_16[row_idx], main_sel_rng_8[row_idx], + main_sel_slice_gadget[row_idx], main_space_id[row_idx], main_tag_err[row_idx], main_w_in_tag[row_idx], @@ -2134,6 +2206,7 @@ class AvmFlavor { mem_sel_op_c[row_idx], mem_sel_op_cmov[row_idx], mem_sel_op_d[row_idx], + mem_sel_op_slice[row_idx], mem_sel_resolve_ind_addr_a[row_idx], mem_sel_resolve_ind_addr_b[row_idx], mem_sel_resolve_ind_addr_c[row_idx], @@ -2160,11 +2233,24 @@ class AvmFlavor { sha256_output[row_idx], sha256_sel_sha256_compression[row_idx], sha256_state[row_idx], + slice_addr[row_idx], + slice_clk[row_idx], + slice_cnt[row_idx], + slice_col_offset[row_idx], + slice_one_min_inv[row_idx], + slice_sel_cd_cpy[row_idx], + slice_sel_mem_active[row_idx], + slice_sel_return[row_idx], + slice_sel_start[row_idx], + slice_space_id[row_idx], + slice_val[row_idx], + perm_slice_mem[row_idx], perm_main_alu[row_idx], perm_main_bin[row_idx], perm_main_conv[row_idx], perm_main_pos2_perm[row_idx], perm_main_pedersen[row_idx], + perm_main_slice[row_idx], perm_main_mem_a[row_idx], perm_main_mem_b[row_idx], perm_main_mem_c[row_idx], @@ -2175,6 +2261,8 @@ class AvmFlavor { perm_main_mem_ind_addr_d[row_idx], lookup_byte_lengths[row_idx], lookup_byte_operations[row_idx], + lookup_cd_value[row_idx], + lookup_ret_value[row_idx], lookup_opcode_gas[row_idx], range_check_l2_gas_hi[row_idx], range_check_l2_gas_lo[row_idx], @@ -2216,6 +2304,8 @@ class AvmFlavor { lookup_div_u16_7[row_idx], lookup_byte_lengths_counts[row_idx], lookup_byte_operations_counts[row_idx], + lookup_cd_value_counts[row_idx], + lookup_ret_value_counts[row_idx], lookup_opcode_gas_counts[row_idx], range_check_l2_gas_hi_counts[row_idx], range_check_l2_gas_lo_counts[row_idx], @@ -2319,7 +2409,16 @@ class AvmFlavor { mem_sel_mem_shift[row_idx], mem_tag_shift[row_idx], mem_tsp_shift[row_idx], - mem_val_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] }); } };