From 697571f6ac7e8c8332f38209d4ae6c4f62145f20 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 27 Mar 2024 11:19:58 +0000 Subject: [PATCH 1/2] PIL deterministic code generation and renaming --- barretenberg/cpp/pil/avm/avm_alu.pil | 156 +- barretenberg/cpp/pil/avm/avm_main.pil | 41 +- barretenberg/cpp/pil/avm/avm_mem.pil | 162 +- .../relations/generated/avm/avm_alu.hpp | 322 ++- .../relations/generated/avm/avm_binary.hpp | 40 +- .../relations/generated/avm/avm_main.hpp | 92 +- .../relations/generated/avm/avm_mem.hpp | 136 +- .../relations/generated/avm/declare_views.hpp | 214 +- .../generated/avm/incl_main_tag_err.hpp | 12 +- .../generated/avm/incl_mem_tag_err.hpp | 12 +- .../relations/generated/avm/perm_main_alu.hpp | 40 +- .../generated/avm/perm_main_mem_a.hpp | 26 +- .../generated/avm/perm_main_mem_b.hpp | 22 +- .../generated/avm/perm_main_mem_c.hpp | 22 +- .../generated/avm/perm_main_mem_ind_a.hpp | 18 +- .../generated/avm/perm_main_mem_ind_b.hpp | 18 +- .../generated/avm/perm_main_mem_ind_c.hpp | 18 +- .../barretenberg/vm/avm_trace/avm_helper.cpp | 30 +- .../barretenberg/vm/avm_trace/avm_trace.cpp | 382 ++-- .../vm/generated/avm_circuit_builder.hpp | 436 ++-- .../barretenberg/vm/generated/avm_flavor.hpp | 1786 ++++++++--------- .../vm/generated/avm_verifier.cpp | 309 ++- .../vm/tests/avm_arithmetic.test.cpp | 548 ++--- .../vm/tests/avm_bitwise.test.cpp | 28 +- .../vm/tests/avm_inter_table.test.cpp | 100 +- .../vm/tests/avm_mem_opcodes.test.cpp | 70 +- .../barretenberg/vm/tests/avm_memory.test.cpp | 58 +- .../barretenberg/vm/tests/helpers.test.cpp | 9 +- 28 files changed, 2529 insertions(+), 2578 deletions(-) diff --git a/barretenberg/cpp/pil/avm/avm_alu.pil b/barretenberg/cpp/pil/avm/avm_alu.pil index 4ca20dd903c..ccae88eda84 100644 --- a/barretenberg/cpp/pil/avm/avm_alu.pil +++ b/barretenberg/cpp/pil/avm/avm_alu.pil @@ -7,51 +7,51 @@ namespace avm_alu(256); // References to main trace table of sub-operations, clk, intermediate // registers, operation selectors. // TODO: Think on optimizations to decrease the number of such "copied" columns - pol commit alu_clk; - pol commit alu_ia; // Intermediate registers - pol commit alu_ib; - pol commit alu_ic; - pol commit alu_op_add; // Operation selectors - pol commit alu_op_sub; - pol commit alu_op_mul; - pol commit alu_op_div; - pol commit alu_op_not; - pol commit alu_op_eq; + pol commit clk; + pol commit ia; // Intermediate registers + pol commit ib; + pol commit ic; + pol commit op_add; // Operation selectors + pol commit op_sub; + pol commit op_mul; + pol commit op_div; + pol commit op_not; + pol commit op_eq; pol commit alu_sel; // Predicate to activate the copy of intermediate registers to ALU table. // Instruction tag (1: u8, 2: u16, 3: u32, 4: u64, 5: u128, 6: field) copied from Main table - pol commit alu_in_tag; + pol commit in_tag; // Flattened boolean instruction tags - pol commit alu_ff_tag; - pol commit alu_u8_tag; - pol commit alu_u16_tag; - pol commit alu_u32_tag; - pol commit alu_u64_tag; - pol commit alu_u128_tag; + pol commit ff_tag; + pol commit u8_tag; + pol commit u16_tag; + pol commit u32_tag; + pol commit u64_tag; + pol commit u128_tag; // 8-bit slice registers - pol commit alu_u8_r0; - pol commit alu_u8_r1; + pol commit u8_r0; + pol commit u8_r1; // 16-bit slice registers - pol commit alu_u16_r0; - pol commit alu_u16_r1; - pol commit alu_u16_r2; - pol commit alu_u16_r3; - pol commit alu_u16_r4; - pol commit alu_u16_r5; - pol commit alu_u16_r6; - pol commit alu_u16_r7; + pol commit u16_r0; + pol commit u16_r1; + pol commit u16_r2; + pol commit u16_r3; + pol commit u16_r4; + pol commit u16_r5; + pol commit u16_r6; + pol commit u16_r7; // 64-bit slice register - pol commit alu_u64_r0; + pol commit u64_r0; // Carry flag - pol commit alu_cf; + pol commit cf; // Compute predicate telling whether there is a row entry in the ALU table. - alu_sel = alu_op_add + alu_op_sub + alu_op_mul + alu_op_not + alu_op_eq; + alu_sel = op_add + op_sub + op_mul + op_not + op_eq; // ========= Type Constraints ============================================= // TODO: Range constraints @@ -63,21 +63,21 @@ namespace avm_alu(256); // Remark: Operation selectors are constrained in the main trace. // Boolean flattened instructions tags - alu_ff_tag * (1 - alu_ff_tag) = 0; - alu_u8_tag * (1 - alu_u8_tag) = 0; - alu_u16_tag * (1 - alu_u16_tag) = 0; - alu_u32_tag * (1 - alu_u32_tag) = 0; - alu_u64_tag * (1 - alu_u64_tag) = 0; - alu_u128_tag * (1 - alu_u128_tag) = 0; + ff_tag * (1 - ff_tag) = 0; + u8_tag * (1 - u8_tag) = 0; + u16_tag * (1 - u16_tag) = 0; + u32_tag * (1 - u32_tag) = 0; + u64_tag * (1 - u64_tag) = 0; + u128_tag * (1 - u128_tag) = 0; // Mutual exclusion of the flattened instruction tag. - alu_sel * (alu_ff_tag + alu_u8_tag + alu_u16_tag + alu_u32_tag + alu_u64_tag + alu_u128_tag - 1) = 0; + alu_sel * (ff_tag + u8_tag + u16_tag + u32_tag + u64_tag + u128_tag - 1) = 0; // Correct flattening of the instruction tag. - alu_in_tag = alu_u8_tag + 2 * alu_u16_tag + 3 * alu_u32_tag + 4 * alu_u64_tag + 5 * alu_u128_tag + 6 * alu_ff_tag; + in_tag = u8_tag + 2 * u16_tag + 3 * u32_tag + 4 * u64_tag + 5 * u128_tag + 6 * ff_tag; // Operation selectors are copied from main table and do not need to be constrained here. - // TODO: Ensure mutual exclusion of alu_op_add and alu_op_sub as some relations below + // TODO: Ensure mutual exclusion of op_add and op_sub as some relations below // requires it. // ========= ARITHMETIC OPERATION - EXPLANATIONS ================================================= @@ -115,12 +115,12 @@ namespace avm_alu(256); // serves to an algebraic expression of commited polynomials in a more concise way. // Bit slices partial sums - pol SUM_8 = alu_u8_r0; - pol SUM_16 = SUM_8 + alu_u8_r1 * 2**8; - pol SUM_32 = SUM_16 + alu_u16_r0 * 2**16; - pol SUM_64 = SUM_32 + alu_u16_r1 * 2**32 + alu_u16_r2 * 2**48; - pol SUM_96 = SUM_64 + alu_u16_r3 * 2**64 + alu_u16_r4 * 2**80; - pol SUM_128 = SUM_96 + alu_u16_r5 * 2**96 + alu_u16_r6 * 2**112; + pol SUM_8 = u8_r0; + pol SUM_16 = SUM_8 + u8_r1 * 2**8; + pol SUM_32 = SUM_16 + u16_r0 * 2**16; + pol SUM_64 = SUM_32 + u16_r1 * 2**32 + u16_r2 * 2**48; + pol SUM_96 = SUM_64 + u16_r3 * 2**64 + u16_r4 * 2**80; + pol SUM_128 = SUM_96 + u16_r5 * 2**96 + u16_r6 * 2**112; // ========= ADDITION/SUBTRACTION Operation Constraints =============================== // @@ -135,26 +135,26 @@ namespace avm_alu(256); // sum_128 - carry * 2^128 - a + b = 0 // // Finally, we would like this relation to also satisfy the addition over the finite field. - // For this, we add c in the relation conditoned by the ff type selector alu_ff_tag. We emphasize + // For this, we add c in the relation conditoned by the ff type selector ff_tag. We emphasize // that this relation alone for FF will not imply correctness of the FF addition. We only want // it to be satisfied. A separate relation will ensure correctness of it. // // The second relation will consist in showing that sum_N - c = 0 for N = 8, 16, 32, 64, 128. #[ALU_ADD_SUB_1] - (alu_op_add + alu_op_sub) * (SUM_128 - alu_ia + alu_ff_tag * alu_ic) + (alu_op_add - alu_op_sub) * (alu_cf * 2**128 - alu_ib) = 0; + (op_add + op_sub) * (SUM_128 - ia + ff_tag * ic) + (op_add - op_sub) * (cf * 2**128 - ib) = 0; // Helper polynomial - pol SUM_TAG = alu_u8_tag * SUM_8 + alu_u16_tag * SUM_16 + alu_u32_tag * SUM_32 + alu_u64_tag * SUM_64 + alu_u128_tag * SUM_128; + pol SUM_TAG = u8_tag * SUM_8 + u16_tag * SUM_16 + u32_tag * SUM_32 + u64_tag * SUM_64 + u128_tag * SUM_128; #[ALU_ADD_SUB_2] - (alu_op_add + alu_op_sub) * (SUM_TAG + alu_ff_tag * alu_ia - alu_ic) + alu_ff_tag * (alu_op_add - alu_op_sub) * alu_ib = 0; + (op_add + op_sub) * (SUM_TAG + ff_tag * ia - ic) + ff_tag * (op_add - op_sub) * ib = 0; // ========= MULTIPLICATION Operation Constraints =============================== // ff multiplication #[ALU_MULTIPLICATION_FF] - alu_ff_tag * alu_op_mul * (alu_ia * alu_ib - alu_ic) = 0; + ff_tag * op_mul * (ia * ib - ic) = 0; // We need 2k bits to express the product (a*b) over the integer, i.e., for type uk @@ -163,13 +163,13 @@ namespace avm_alu(256); // We group relations for u8, u16, u32, u64 together. // Helper polynomial - pol SUM_TAG_NO_128 = alu_u8_tag * SUM_8 + alu_u16_tag * SUM_16 + alu_u32_tag * SUM_32 + alu_u64_tag * SUM_64; + pol SUM_TAG_NO_128 = u8_tag * SUM_8 + u16_tag * SUM_16 + u32_tag * SUM_32 + u64_tag * SUM_64; #[ALU_MUL_COMMON_1] - (1 - alu_ff_tag - alu_u128_tag) * alu_op_mul * (SUM_128 - alu_ia * alu_ib) = 0; + (1 - ff_tag - u128_tag) * op_mul * (SUM_128 - ia * ib) = 0; #[ALU_MUL_COMMON_2] - alu_op_mul * (SUM_TAG_NO_128 - (1 - alu_ff_tag - alu_u128_tag) * alu_ic) = 0; + op_mul * (SUM_TAG_NO_128 - (1 - ff_tag - u128_tag) * ic) = 0; // ========= u128 MULTIPLICATION Operation Constraints =============================== // @@ -183,52 +183,52 @@ namespace avm_alu(256); // as decomposed over 16-bit registers. Second line represents b. // Selector flag is only toggled in the first line and we access b through // shifted polynomials. - // R' is stored in alu_u64_r0 + // R' is stored in u64_r0 // 64-bit lower limb - pol SUM_LOW_64 = alu_u16_r0 + alu_u16_r1 * 2**16 + alu_u16_r2 * 2**32 + alu_u16_r3 * 2**48; + pol SUM_LOW_64 = u16_r0 + u16_r1 * 2**16 + u16_r2 * 2**32 + u16_r3 * 2**48; // 64-bit higher limb - pol SUM_HIGH_64 = alu_u16_r4 + alu_u16_r5 * 2**16 + alu_u16_r6 * 2**32 + alu_u16_r7 * 2**48; + pol SUM_HIGH_64 = u16_r4 + u16_r5 * 2**16 + u16_r6 * 2**32 + u16_r7 * 2**48; // 64-bit lower limb for next row - pol SUM_LOW_SHIFTED_64 = alu_u16_r0' + alu_u16_r1' * 2**16 + alu_u16_r2' * 2**32 + alu_u16_r3' * 2**48; + pol SUM_LOW_SHIFTED_64 = u16_r0' + u16_r1' * 2**16 + u16_r2' * 2**32 + u16_r3' * 2**48; // 64-bit higher limb for next row - pol SUM_HIGH_SHIFTED_64 = alu_u16_r4' + alu_u16_r5' * 2**16 + alu_u16_r6' * 2**32 + alu_u16_r7' * 2**48; + pol SUM_HIGH_SHIFTED_64 = u16_r4' + u16_r5' * 2**16 + u16_r6' * 2**32 + u16_r7' * 2**48; // Arithmetic relations - alu_u128_tag * alu_op_mul * (SUM_LOW_64 + SUM_HIGH_64 * 2**64 - alu_ia) = 0; - alu_u128_tag * alu_op_mul * (SUM_LOW_SHIFTED_64 + SUM_HIGH_SHIFTED_64 * 2**64 - alu_ib) = 0; + u128_tag * op_mul * (SUM_LOW_64 + SUM_HIGH_64 * 2**64 - ia) = 0; + u128_tag * op_mul * (SUM_LOW_SHIFTED_64 + SUM_HIGH_SHIFTED_64 * 2**64 - ib) = 0; #[ALU_MULTIPLICATION_OUT_U128] - alu_u128_tag * alu_op_mul * ( - alu_ia * SUM_LOW_SHIFTED_64 + u128_tag * op_mul * ( + ia * SUM_LOW_SHIFTED_64 + SUM_LOW_64 * SUM_HIGH_SHIFTED_64 * 2**64 - - (alu_cf * 2**64 + alu_u64_r0) * 2**128 - - alu_ic + - (cf * 2**64 + u64_r0) * 2**128 + - ic ) = 0; // ========= BITWISE NOT Operation Constraints =============================== // Constrain mem_tag to not be FF (BITWISE NOT doesn't make sense for FF) // TODO decide if it is done here or in another trace - // Do not allow alu_ff_tag to be set if we are doing bitwise - pol BITWISE_SEL = alu_op_not; // Add more bitwise operations + // Do not allow ff_tag to be set if we are doing bitwise + pol BITWISE_SEL = op_not; // Add more bitwise operations #[ALU_FF_NOT_XOR] - BITWISE_SEL * alu_ff_tag = 0; + BITWISE_SEL * ff_tag = 0; // The value 2^k - 1 - pol UINT_MAX = alu_u8_tag * 2**8 + - alu_u16_tag * 2**16 + - alu_u32_tag * 2**32 + - alu_u64_tag * 2**64 + - alu_u128_tag * 2**128 - 1; + pol UINT_MAX = u8_tag * 2**8 + + u16_tag * 2**16 + + u32_tag * 2**32 + + u64_tag * 2**64 + + u128_tag * 2**128 - 1; // BITWISE NOT relation is: a + ~a = 2^k - 1 // Or (a + ~a - 2^k + 1) = 0; - // value of "a" stored in alu_ia and "~a" stored in alu_ic + // value of "a" stored in ia and "~a" stored in ic #[ALU_OP_NOT] - alu_op_not * (alu_ia + alu_ic - UINT_MAX) = 0; + op_not * (ia + ic - UINT_MAX) = 0; // ========= EQUALITY Operation Constraints =============================== // TODO: Note this method differs from the approach taken for "equality to zero" checks @@ -245,16 +245,16 @@ namespace avm_alu(256); // c) if e == 0; zw = 1 && z has an inverse. If e == 1; z == 0 and we set w = 0; // Registers Ia and Ib hold the values that equality is to be tested on - pol DIFF = alu_ia - alu_ib; + pol DIFF = ia - ib; // Need an additional helper that holds the inverse of the difference; - pol commit alu_op_eq_diff_inv; + pol commit op_eq_diff_inv; // If EQ selector is set, ic needs to be boolean #[ALU_RES_IS_BOOL] - alu_op_eq * (alu_ic * (1 - alu_ic)) = 0; + op_eq * (ic * (1 - ic)) = 0; #[ALU_OP_EQ] - alu_op_eq * (DIFF * (alu_ic * (1 - alu_op_eq_diff_inv) + alu_op_eq_diff_inv) - 1 + alu_ic) = 0; + op_eq * (DIFF * (ic * (1 - op_eq_diff_inv) + op_eq_diff_inv) - 1 + ic) = 0; diff --git a/barretenberg/cpp/pil/avm/avm_main.pil b/barretenberg/cpp/pil/avm/avm_main.pil index a6ef15fcad1..5e0b27d6a30 100644 --- a/barretenberg/cpp/pil/avm/avm_main.pil +++ b/barretenberg/cpp/pil/avm/avm_main.pil @@ -66,7 +66,7 @@ namespace avm_main(256); // Errors pol commit op_err; // Boolean flag pertaining to an operation error - pol commit tag_err; // Boolean flag (foreign key to avm_mem.m_tag_err) + pol commit tag_err; // Boolean flag (foreign key to avm_mem.tag_err) // A helper witness being the inverse of some value // to show a non-zero equality @@ -246,10 +246,10 @@ namespace avm_main(256); //====== Inter-table Constraints ============================================ #[INCL_MAIN_TAG_ERR] - avm_mem.m_tag_err {avm_mem.m_clk} in tag_err {clk}; + avm_mem.tag_err {avm_mem.clk} in tag_err {clk}; #[INCL_MEM_TAG_ERR] - tag_err {clk} in avm_mem.m_tag_err {avm_mem.m_clk}; + tag_err {clk} in avm_mem.tag_err {avm_mem.clk}; // Predicate to activate the copy of intermediate registers to ALU table. If tag_err == 1, // the operation is not copied to the ALU table. @@ -257,14 +257,11 @@ namespace avm_main(256); alu_sel = (sel_op_add + sel_op_sub + sel_op_mul + sel_op_not + sel_op_eq) * (1 - tag_err); #[PERM_MAIN_ALU] - alu_sel {clk, ia, ib, ic, - sel_op_add, sel_op_sub, sel_op_mul, sel_op_eq, - sel_op_not, r_in_tag} + alu_sel {clk, ia, ib, ic, sel_op_add, sel_op_sub, + sel_op_mul, sel_op_eq, sel_op_not, r_in_tag} is - avm_alu.alu_sel {avm_alu.alu_clk, avm_alu.alu_ia, avm_alu.alu_ib, avm_alu.alu_ic, - avm_alu.alu_op_add, avm_alu.alu_op_sub, avm_alu.alu_op_mul, avm_alu.alu_op_eq, - avm_alu.alu_op_not, avm_alu.alu_in_tag}; - + avm_alu.alu_sel {avm_alu.clk, avm_alu.ia, avm_alu.ib, avm_alu.ic, avm_alu.op_add, avm_alu.op_sub, + avm_alu.op_mul, avm_alu.op_eq, avm_alu.op_not, avm_alu.in_tag}; // Based on the boolean selectors, we derive the binary op id to lookup in the table; // TODO: Check if having 4 columns (op_id + 3 boolean selectors) is more optimal that just using the op_id @@ -282,38 +279,28 @@ namespace avm_main(256); #[PERM_MAIN_BIN] bin_sel {ia, ib, ic, bin_op_id, r_in_tag} is - avm_binary.start {avm_binary.acc_ia, avm_binary.acc_ib, avm_binary.acc_ic, - avm_binary.op_id, avm_binary.in_tag}; + avm_binary.start {avm_binary.acc_ia, avm_binary.acc_ib, avm_binary.acc_ic, avm_binary.op_id, avm_binary.in_tag}; #[PERM_MAIN_MEM_A] mem_op_a {clk, mem_idx_a, ia, rwa, r_in_tag, w_in_tag, sel_mov} is - avm_mem.m_op_a {avm_mem.m_clk, avm_mem.m_addr, avm_mem.m_val, avm_mem.m_rw, - avm_mem.r_in_tag, avm_mem.w_in_tag, avm_mem.m_sel_mov}; + avm_mem.op_a {avm_mem.clk, avm_mem.addr, avm_mem.val, avm_mem.rw, avm_mem.r_in_tag, avm_mem.w_in_tag, avm_mem.sel_mov}; #[PERM_MAIN_MEM_B] mem_op_b {clk, mem_idx_b, ib, rwb, r_in_tag, w_in_tag} is - avm_mem.m_op_b {avm_mem.m_clk, avm_mem.m_addr, avm_mem.m_val, avm_mem.m_rw, - avm_mem.r_in_tag, avm_mem.w_in_tag}; + avm_mem.op_b {avm_mem.clk, avm_mem.addr, avm_mem.val, avm_mem.rw, avm_mem.r_in_tag, avm_mem.w_in_tag}; #[PERM_MAIN_MEM_C] mem_op_c {clk, mem_idx_c, ic, rwc, r_in_tag, w_in_tag} is - avm_mem.m_op_c {avm_mem.m_clk, avm_mem.m_addr, avm_mem.m_val, avm_mem.m_rw, - avm_mem.r_in_tag, avm_mem.w_in_tag}; + avm_mem.op_c {avm_mem.clk, avm_mem.addr, avm_mem.val, avm_mem.rw, avm_mem.r_in_tag, avm_mem.w_in_tag}; #[PERM_MAIN_MEM_IND_A] - ind_op_a {clk, ind_a, mem_idx_a} - is - avm_mem.m_ind_op_a {avm_mem.m_clk, avm_mem.m_addr, avm_mem.m_val}; + ind_op_a {clk, ind_a, mem_idx_a} is avm_mem.ind_op_a {avm_mem.clk, avm_mem.addr, avm_mem.val}; #[PERM_MAIN_MEM_IND_B] - ind_op_b {clk, ind_b, mem_idx_b} - is - avm_mem.m_ind_op_b {avm_mem.m_clk, avm_mem.m_addr, avm_mem.m_val}; + ind_op_b {clk, ind_b, mem_idx_b} is avm_mem.ind_op_b {avm_mem.clk, avm_mem.addr, avm_mem.val}; #[PERM_MAIN_MEM_IND_C] - ind_op_c {clk, ind_c, mem_idx_c} - is - avm_mem.m_ind_op_c {avm_mem.m_clk, avm_mem.m_addr, avm_mem.m_val}; + ind_op_c {clk, ind_c, mem_idx_c} is avm_mem.ind_op_c {avm_mem.clk, avm_mem.addr, avm_mem.val}; \ No newline at end of file diff --git a/barretenberg/cpp/pil/avm/avm_mem.pil b/barretenberg/cpp/pil/avm/avm_mem.pil index fb23e57adcf..7be221ed2f5 100644 --- a/barretenberg/cpp/pil/avm/avm_mem.pil +++ b/barretenberg/cpp/pil/avm/avm_mem.pil @@ -4,154 +4,154 @@ include "avm_main.pil"; namespace avm_mem(256); // ========= Table MEM-TR ================= - pol commit m_clk; - pol commit m_sub_clk; - pol commit m_addr; - pol commit m_tag; // Memory tag (0: uninitialized, 1: u8, 2: u16, 3: u32, 4: u64, 5: u128, 6:field) - pol commit m_val; - pol commit m_lastAccess; // Boolean (1 when this row is the last of a given address) - pol commit m_last; // Boolean indicating the last row of the memory trace (not execution trace) - pol commit m_rw; // Enum: 0 (read), 1 (write) + pol commit clk; + pol commit sub_clk; + pol commit addr; + pol commit tag; // Memory tag (0: uninitialized, 1: u8, 2: u16, 3: u32, 4: u64, 5: u128, 6:field) + pol commit val; + pol commit lastAccess; // Boolean (1 when this row is the last of a given address) + pol commit last; // Boolean indicating the last row of the memory trace (not execution trace) + pol commit rw; // Enum: 0 (read), 1 (write) pol commit r_in_tag; // Instruction memory tag ("foreign key" pointing to avm_main.r_in_tag) pol commit w_in_tag; // Instruction memory tag ("foreign key" pointing to avm_main.w_in_tag) // Indicator of the intermediate register pertaining to the memory operation (foreign key to avm_main.mem_op_XXX) - pol commit m_op_a; - pol commit m_op_b; - pol commit m_op_c; + pol commit op_a; + pol commit op_b; + pol commit op_c; // Indicator of the indirect register pertaining to the memory operation (foreign key to avm_main.ind_op_XXX) - pol commit m_ind_op_a; - pol commit m_ind_op_b; - pol commit m_ind_op_c; + pol commit ind_op_a; + pol commit ind_op_b; + pol commit ind_op_c; // Selector for MOV opcode (copied from main trace for loading operation on intermediated register ia) // Boolean constraint is performed in main trace. - pol commit m_sel_mov; + pol commit sel_mov; // Error columns - pol commit m_tag_err; // Boolean (1 if r_in_tag != m_tag is detected) + pol commit tag_err; // Boolean (1 if r_in_tag != tag is detected) // Helper columns - pol commit m_one_min_inv; // Extra value to prove r_in_tag != m_tag with error handling + pol commit one_min_inv; // Extra value to prove r_in_tag != tag with error handling // Type constraints - m_lastAccess * (1 - m_lastAccess) = 0; - m_last * (1 - m_last) = 0; - m_rw * (1 - m_rw) = 0; - m_tag_err * (1 - m_tag_err) = 0; - m_op_a * (1 - m_op_a) = 0; - m_op_b * (1 - m_op_b) = 0; - m_op_c * (1 - m_op_c) = 0; - m_ind_op_a * (1 - m_ind_op_a) = 0; - m_ind_op_b * (1 - m_ind_op_b) = 0; - m_ind_op_c * (1 - m_ind_op_c) = 0; - - // TODO: m_addr is u32 and 0 <= m_tag <= 6 + lastAccess * (1 - lastAccess) = 0; + last * (1 - last) = 0; + rw * (1 - rw) = 0; + tag_err * (1 - tag_err) = 0; + op_a * (1 - op_a) = 0; + op_b * (1 - op_b) = 0; + op_c * (1 - op_c) = 0; + ind_op_a * (1 - ind_op_a) = 0; + ind_op_b * (1 - ind_op_b) = 0; + ind_op_c * (1 - ind_op_c) = 0; + + // TODO: addr is u32 and 0 <= tag <= 6 // (r_in_tag, w_in_tag will be constrained through inclusion check to main trace) // Maximum one memory operation enabled per row - pol MEM_SEL = m_op_a + m_op_b + m_op_c + m_ind_op_a + m_ind_op_b + m_ind_op_c; + pol MEM_SEL = op_a + op_b + op_c + ind_op_a + ind_op_b + ind_op_c; MEM_SEL * (MEM_SEL - 1) = 0; // sub_clk derivation - pol IND_OP = m_ind_op_a + m_ind_op_b + m_ind_op_c; - m_sub_clk = MEM_SEL * (m_ind_op_b + m_op_b + 2 * (m_ind_op_c + m_op_c) + 3 * (1 - IND_OP + m_rw)); + pol IND_OP = ind_op_a + ind_op_b + ind_op_c; + sub_clk = MEM_SEL * (ind_op_b + op_b + 2 * (ind_op_c + op_c) + 3 * (1 - IND_OP + rw)); // We need the MEM_SEL factor as the right factor is not zero when all columns are zero. - // Remark: m_lastAccess == 1 on first row and therefore any relation with the - // multiplicative term (1 - m_lastAccess) implicitly includes (1 - avm_main.first) - // Similarly, this includes (1 - m_last) as well. + // Remark: lastAccess == 1 on first row and therefore any relation with the + // multiplicative term (1 - lastAccess) implicitly includes (1 - avm_main.first) + // Similarly, this includes (1 - last) as well. - // m_lastAccess == 0 ==> m_addr' == m_addr + // lastAccess == 0 ==> addr' == addr // Optimization: We removed the term (1 - avm_main.first) #[MEM_LAST_ACCESS_DELIMITER] - (1 - m_lastAccess) * (m_addr' - m_addr) = 0; + (1 - lastAccess) * (addr' - addr) = 0; - // We need: m_lastAccess == 1 ==> m_addr' > m_addr - // The above implies: m_addr' == m_addr ==> m_lastAccess == 0 + // We need: lastAccess == 1 ==> addr' > addr + // The above implies: addr' == addr ==> lastAccess == 0 // This condition does not apply on the last row. // clk + 1 used as an expression for positive integers // TODO: Uncomment when lookups are supported - // (1 - first) * (1 - m_last) * m_lastAccess { (m_addr' - m_addr) } in clk + 1; // Gated inclusion check. Is it supported? + // (1 - first) * (1 - last) * lastAccess { (addr' - addr) } in clk + 1; // Gated inclusion check. Is it supported? // TODO: following constraint - // m_addr' == m_addr && m_clk == m_clk' ==> m_sub_clk' - m_sub_clk > 0 - // Can be enforced with (1 - first) * (1 - m_lastAccess) { 6 * (m_clk' - m_clk) + m_sub_clk' - m_sub_clk } in clk + 1 + // addr' == addr && clk == clk' ==> sub_clk' - sub_clk > 0 + // Can be enforced with (1 - first) * (1 - lastAccess) { 6 * (clk' - clk) + sub_clk' - sub_clk } in clk + 1 // Alternatively to the above, one could require - // that m_addr' - m_addr is 0 or 1 (needs to add placeholders m_addr values): - // (m_addr' - m_addr) * (m_addr' - m_addr) - (m_addr' - m_addr) = 0; - // if m_addr' - m_addr is 0 or 1, the following is equiv. to m_lastAccess - // (m_addr' - m_addr) + // that addr' - addr is 0 or 1 (needs to add placeholders addr values): + // (addr' - addr) * (addr' - addr) - (addr' - addr) = 0; + // if addr' - addr is 0 or 1, the following is equiv. to lastAccess + // (addr' - addr) - // m_lastAccess == 0 && m_rw' == 0 ==> m_val == m_val' + // lastAccess == 0 && rw' == 0 ==> val == val' // This condition does not apply on the last row. // Note: in barretenberg, a shifted polynomial will be 0 on the last row (shift is not cyclic) // Note2: in barretenberg, if a poynomial is shifted, its non-shifted equivalent must be 0 on the first row - // Optimization: We removed the term (1 - avm_main.first) and (1 - m_last) + // Optimization: We removed the term (1 - avm_main.first) and (1 - last) #[MEM_READ_WRITE_VAL_CONSISTENCY] - (1 - m_lastAccess) * (1 - m_rw') * (m_val' - m_val) = 0; + (1 - lastAccess) * (1 - rw') * (val' - val) = 0; - // m_lastAccess == 0 && m_rw' == 0 ==> m_tag == m_tag' - // Optimization: We removed the term (1 - avm_main.first) and (1 - m_last) + // lastAccess == 0 && rw' == 0 ==> tag == tag' + // Optimization: We removed the term (1 - avm_main.first) and (1 - last) #[MEM_READ_WRITE_TAG_CONSISTENCY] - (1 - m_lastAccess) * (1 - m_rw') * (m_tag' - m_tag) = 0; + (1 - lastAccess) * (1 - rw') * (tag' - tag) = 0; // Constrain that the first load from a given address has value 0. (Consistency of memory initialization.) - // We do not constrain that the m_tag == 0 as the 0 value is compatible with any memory type. - // If we set m_lastAccess = 1 on the first row, we can enforce this (should be ok as long as we do not shift m_lastAccess): + // We do not constrain that the tag == 0 as the 0 value is compatible with any memory type. + // If we set lastAccess = 1 on the first row, we can enforce this (should be ok as long as we do not shift lastAccess): #[MEM_ZERO_INIT] - m_lastAccess * (1 - m_rw') * m_val' = 0; + lastAccess * (1 - rw') * val' = 0; - // Memory tag consistency check for load operations, i.e., m_rw == 0. - // We want to prove that r_in_tag == m_tag <==> m_tag_err == 0 - // We want to show that we can invert (r_in_tag - m_tag) when m_tag_err == 1, - // i.e., m_tag_err == 1 ==> r_in_tag != m_tag + // Memory tag consistency check for load operations, i.e., rw == 0. + // We want to prove that r_in_tag == tag <==> tag_err == 0 + // We want to show that we can invert (r_in_tag - tag) when tag_err == 1, + // i.e., tag_err == 1 ==> r_in_tag != tag // For this purpose, we need an extra column to store a witness - // which can be used to show that (r_in_tag - m_tag) is invertible (non-zero). + // which can be used to show that (r_in_tag - tag) is invertible (non-zero). // We re-use the same zero (non)-equality technique as in SUBOP_DIVISION_ZERO_ERR1/2 applied - // to (r_in_tag - m_tag) by replacing m_tag_err by 1 - m_tag_err because here + // to (r_in_tag - tag) by replacing tag_err by 1 - tag_err because here // the equality to zero is not an error. Another modification - // consists in storing 1 - (r_in_tag - m_tag)^(-1) in the extra witness column - // instead of (r_in_tag - m_tag)^(-1) as this allows to store zero by default (i.e., when m_tag_err == 0). - // The new column m_one_min_inv is set to 1 - (r_in_tag - m_tag)^(-1) when m_tag_err == 1 - // but must be set to 0 when tags are matching and m_tag_err = 0 + // consists in storing 1 - (r_in_tag - tag)^(-1) in the extra witness column + // instead of (r_in_tag - tag)^(-1) as this allows to store zero by default (i.e., when tag_err == 0). + // The new column one_min_inv is set to 1 - (r_in_tag - tag)^(-1) when tag_err == 1 + // but must be set to 0 when tags are matching and tag_err = 0 #[MEM_IN_TAG_CONSISTENCY_1] - (1 - m_rw) * ((r_in_tag - m_tag) * (1 - m_one_min_inv) - m_tag_err) = 0; + (1 - rw) * ((r_in_tag - tag) * (1 - one_min_inv) - tag_err) = 0; #[MEM_IN_TAG_CONSISTENCY_2] - (1 - m_tag_err) * m_one_min_inv = 0; + (1 - tag_err) * one_min_inv = 0; - // Correctness of two above checks MEM_IN_TAG_CONSISTENCY_1/2 (assuming m_rw == 0): - // r_in_tag == m_tag ==> m_tag_err == 0 (first relation) - // m_tag_err == 0 ==> m_one_min_inv == 0 by second relation. First relation ==> r_in_tag - m_tag == 0 + // Correctness of two above checks MEM_IN_TAG_CONSISTENCY_1/2 (assuming rw == 0): + // r_in_tag == tag ==> tag_err == 0 (first relation) + // tag_err == 0 ==> one_min_inv == 0 by second relation. First relation ==> r_in_tag - tag == 0 - // Enforce that a write instruction tag is equal to m_tag for a write operation - m_rw * (w_in_tag - m_tag) = 0; + // Enforce that a write instruction tag is equal to tag for a write operation + rw * (w_in_tag - tag) = 0; // Enforce that a write instruction never leads to a tag error #[NO_TAG_ERR_WRITE] - m_rw * m_tag_err = 0; + rw * tag_err = 0; //====== Indirect Memory Constraints ===================================== // Enforce r_in_tag == 3, i.e., r_in_tag must be U32 - m_ind_op_a * (r_in_tag - 3) = 0; - m_ind_op_b * (r_in_tag - 3) = 0; - m_ind_op_c * (r_in_tag - 3) = 0; + ind_op_a * (r_in_tag - 3) = 0; + ind_op_b * (r_in_tag - 3) = 0; + ind_op_c * (r_in_tag - 3) = 0; // Indirect operation is always a load - m_ind_op_a * m_rw = 0; - m_ind_op_b * m_rw = 0; - m_ind_op_c * m_rw = 0; + ind_op_a * rw = 0; + ind_op_b * rw = 0; + ind_op_c * rw = 0; //====== MOV Opcode Tag Constraint ===================================== - // The following constraint ensures that the r_in_tag is set to m_tag for + // The following constraint ensures that the r_in_tag is set to tag for // the load operation pertaining to Ia. // The permutation check #[PERM_MAIN_MEM_A] guarantees that the r_in_tag // value load operation for Ia is copied back in the main trace. // Constraint #[MOV_MAIN_SAME_TAG] copies r_in_tag to w_in_tag in the main // trace. Then, #[PERM_MAIN_MEM_C] copies w_in_tag for store operation from Ic. #[MOV_SAME_TAG] - m_sel_mov * m_tag_err = 0; // Equivalent to m_sel_mov * (r_in_tag - m_tag) = 0 \ No newline at end of file + sel_mov * tag_err = 0; // Equivalent to sel_mov * (r_in_tag - tag) = 0 \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_alu.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_alu.hpp index f9e5e00873e..ef98385518f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_alu.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_alu.hpp @@ -7,43 +7,43 @@ namespace bb::Avm_vm { template struct Avm_aluRow { - FF avm_alu_alu_ff_tag{}; - FF avm_alu_alu_u16_r1_shift{}; - FF avm_alu_alu_u16_r3_shift{}; - FF avm_alu_alu_u16_r4{}; - FF avm_alu_alu_u8_r1{}; - FF avm_alu_alu_u16_r7{}; - FF avm_alu_alu_u16_r2_shift{}; - FF avm_alu_alu_op_eq{}; - FF avm_alu_alu_u8_tag{}; - FF avm_alu_alu_u16_r5_shift{}; - FF avm_alu_alu_u16_tag{}; - FF avm_alu_alu_u16_r4_shift{}; - FF avm_alu_alu_u16_r6_shift{}; - FF avm_alu_alu_u64_r0{}; - FF avm_alu_alu_u16_r0_shift{}; - FF avm_alu_alu_op_add{}; - FF avm_alu_alu_ic{}; - FF avm_alu_alu_u32_tag{}; - FF avm_alu_alu_op_sub{}; - FF avm_alu_alu_u16_r6{}; - FF avm_alu_alu_u64_tag{}; - FF avm_alu_alu_u8_r0{}; - FF avm_alu_alu_ib{}; - FF avm_alu_alu_u16_r1{}; - FF avm_alu_alu_u16_r3{}; - FF avm_alu_alu_u16_r0{}; - FF avm_alu_alu_cf{}; - FF avm_alu_alu_u16_r7_shift{}; - FF avm_alu_alu_u16_r5{}; - FF avm_alu_alu_u16_r2{}; - FF avm_alu_alu_op_eq_diff_inv{}; - FF avm_alu_alu_u128_tag{}; FF avm_alu_alu_sel{}; - FF avm_alu_alu_op_not{}; - FF avm_alu_alu_op_mul{}; - FF avm_alu_alu_in_tag{}; - FF avm_alu_alu_ia{}; + FF avm_alu_cf{}; + FF avm_alu_ff_tag{}; + FF avm_alu_ia{}; + FF avm_alu_ib{}; + FF avm_alu_ic{}; + FF avm_alu_in_tag{}; + FF avm_alu_op_add{}; + FF avm_alu_op_eq{}; + FF avm_alu_op_eq_diff_inv{}; + FF avm_alu_op_mul{}; + FF avm_alu_op_not{}; + FF avm_alu_op_sub{}; + FF avm_alu_u128_tag{}; + FF avm_alu_u16_r0{}; + FF avm_alu_u16_r0_shift{}; + FF avm_alu_u16_r1{}; + FF avm_alu_u16_r1_shift{}; + FF avm_alu_u16_r2{}; + FF avm_alu_u16_r2_shift{}; + FF avm_alu_u16_r3{}; + FF avm_alu_u16_r3_shift{}; + FF avm_alu_u16_r4{}; + FF avm_alu_u16_r4_shift{}; + FF avm_alu_u16_r5{}; + FF avm_alu_u16_r5_shift{}; + FF avm_alu_u16_r6{}; + FF avm_alu_u16_r6_shift{}; + FF avm_alu_u16_r7{}; + FF avm_alu_u16_r7_shift{}; + FF avm_alu_u16_tag{}; + FF avm_alu_u32_tag{}; + FF avm_alu_u64_r0{}; + FF avm_alu_u64_tag{}; + FF avm_alu_u8_r0{}; + FF avm_alu_u8_r1{}; + FF avm_alu_u8_tag{}; }; inline std::string get_relation_label_avm_alu(int index) @@ -52,32 +52,32 @@ inline std::string get_relation_label_avm_alu(int index) case 9: return "ALU_ADD_SUB_1"; - case 19: - return "ALU_RES_IS_BOOL"; - - case 16: - return "ALU_MULTIPLICATION_OUT_U128"; - case 10: return "ALU_ADD_SUB_2"; - case 12: - return "ALU_MUL_COMMON_1"; - - case 18: - return "ALU_OP_NOT"; - case 11: return "ALU_MULTIPLICATION_FF"; + case 12: + return "ALU_MUL_COMMON_1"; + case 13: return "ALU_MUL_COMMON_2"; - case 20: - return "ALU_OP_EQ"; + case 16: + return "ALU_MULTIPLICATION_OUT_U128"; case 17: return "ALU_FF_NOT_XOR"; + + case 18: + return "ALU_OP_NOT"; + + case 19: + return "ALU_RES_IS_BOOL"; + + case 20: + return "ALU_OP_EQ"; } return std::to_string(index); } @@ -102,8 +102,7 @@ template class avm_aluImpl { Avm_DECLARE_VIEWS(0); auto tmp = (avm_alu_alu_sel - - ((((avm_alu_alu_op_add + avm_alu_alu_op_sub) + avm_alu_alu_op_mul) + avm_alu_alu_op_not) + - avm_alu_alu_op_eq)); + ((((avm_alu_op_add + avm_alu_op_sub) + avm_alu_op_mul) + avm_alu_op_not) + avm_alu_op_eq)); tmp *= scaling_factor; std::get<0>(evals) += tmp; } @@ -111,7 +110,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(1); - auto tmp = (avm_alu_alu_ff_tag * (-avm_alu_alu_ff_tag + FF(1))); + auto tmp = (avm_alu_ff_tag * (-avm_alu_ff_tag + FF(1))); tmp *= scaling_factor; std::get<1>(evals) += tmp; } @@ -119,7 +118,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(2); - auto tmp = (avm_alu_alu_u8_tag * (-avm_alu_alu_u8_tag + FF(1))); + auto tmp = (avm_alu_u8_tag * (-avm_alu_u8_tag + FF(1))); tmp *= scaling_factor; std::get<2>(evals) += tmp; } @@ -127,7 +126,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(3); - auto tmp = (avm_alu_alu_u16_tag * (-avm_alu_alu_u16_tag + FF(1))); + auto tmp = (avm_alu_u16_tag * (-avm_alu_u16_tag + FF(1))); tmp *= scaling_factor; std::get<3>(evals) += tmp; } @@ -135,7 +134,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(4); - auto tmp = (avm_alu_alu_u32_tag * (-avm_alu_alu_u32_tag + FF(1))); + auto tmp = (avm_alu_u32_tag * (-avm_alu_u32_tag + FF(1))); tmp *= scaling_factor; std::get<4>(evals) += tmp; } @@ -143,7 +142,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(5); - auto tmp = (avm_alu_alu_u64_tag * (-avm_alu_alu_u64_tag + FF(1))); + auto tmp = (avm_alu_u64_tag * (-avm_alu_u64_tag + FF(1))); tmp *= scaling_factor; std::get<5>(evals) += tmp; } @@ -151,7 +150,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(6); - auto tmp = (avm_alu_alu_u128_tag * (-avm_alu_alu_u128_tag + FF(1))); + auto tmp = (avm_alu_u128_tag * (-avm_alu_u128_tag + FF(1))); tmp *= scaling_factor; std::get<6>(evals) += tmp; } @@ -159,11 +158,11 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(7); - auto tmp = (avm_alu_alu_sel * - ((((((avm_alu_alu_ff_tag + avm_alu_alu_u8_tag) + avm_alu_alu_u16_tag) + avm_alu_alu_u32_tag) + - avm_alu_alu_u64_tag) + - avm_alu_alu_u128_tag) - - FF(1))); + auto tmp = + (avm_alu_alu_sel * + ((((((avm_alu_ff_tag + avm_alu_u8_tag) + avm_alu_u16_tag) + avm_alu_u32_tag) + avm_alu_u64_tag) + + avm_alu_u128_tag) - + FF(1))); tmp *= scaling_factor; std::get<7>(evals) += tmp; } @@ -171,11 +170,10 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(8); - auto tmp = (avm_alu_alu_in_tag - - (((((avm_alu_alu_u8_tag + (avm_alu_alu_u16_tag * FF(2))) + (avm_alu_alu_u32_tag * FF(3))) + - (avm_alu_alu_u64_tag * FF(4))) + - (avm_alu_alu_u128_tag * FF(5))) + - (avm_alu_alu_ff_tag * FF(6)))); + auto tmp = (avm_alu_in_tag - (((((avm_alu_u8_tag + (avm_alu_u16_tag * FF(2))) + (avm_alu_u32_tag * FF(3))) + + (avm_alu_u64_tag * FF(4))) + + (avm_alu_u128_tag * FF(5))) + + (avm_alu_ff_tag * FF(6)))); tmp *= scaling_factor; std::get<8>(evals) += tmp; } @@ -184,18 +182,17 @@ template class avm_aluImpl { Avm_DECLARE_VIEWS(9); auto tmp = - (((avm_alu_alu_op_add + avm_alu_alu_op_sub) * - ((((((((((avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))) + (avm_alu_alu_u16_r0 * FF(65536))) + - (avm_alu_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_alu_u16_r2 * FF(281474976710656UL))) + - (avm_alu_alu_u16_r3 * FF(uint256_t{ 0, 1, 0, 0 }))) + - (avm_alu_alu_u16_r4 * FF(uint256_t{ 0, 65536, 0, 0 }))) + - (avm_alu_alu_u16_r5 * FF(uint256_t{ 0, 4294967296, 0, 0 }))) + - (avm_alu_alu_u16_r6 * FF(uint256_t{ 0, 281474976710656, 0, 0 }))) - - avm_alu_alu_ia) + - (avm_alu_alu_ff_tag * avm_alu_alu_ic))) + - ((avm_alu_alu_op_add - avm_alu_alu_op_sub) * - ((avm_alu_alu_cf * FF(uint256_t{ 0, 0, 1, 0 })) - avm_alu_alu_ib))); + (((avm_alu_op_add + avm_alu_op_sub) * + ((((((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + + (avm_alu_u16_r1 * FF(4294967296UL))) + + (avm_alu_u16_r2 * FF(281474976710656UL))) + + (avm_alu_u16_r3 * FF(uint256_t{ 0, 1, 0, 0 }))) + + (avm_alu_u16_r4 * FF(uint256_t{ 0, 65536, 0, 0 }))) + + (avm_alu_u16_r5 * FF(uint256_t{ 0, 4294967296, 0, 0 }))) + + (avm_alu_u16_r6 * FF(uint256_t{ 0, 281474976710656, 0, 0 }))) - + avm_alu_ia) + + (avm_alu_ff_tag * avm_alu_ic))) + + ((avm_alu_op_add - avm_alu_op_sub) * ((avm_alu_cf * FF(uint256_t{ 0, 0, 1, 0 })) - avm_alu_ib))); tmp *= scaling_factor; std::get<9>(evals) += tmp; } @@ -203,27 +200,26 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(10); - auto tmp = - (((avm_alu_alu_op_add + avm_alu_alu_op_sub) * - (((((((avm_alu_alu_u8_tag * avm_alu_alu_u8_r0) + - (avm_alu_alu_u16_tag * (avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))))) + - (avm_alu_alu_u32_tag * - ((avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))) + (avm_alu_alu_u16_r0 * FF(65536))))) + - (avm_alu_alu_u64_tag * - ((((avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))) + (avm_alu_alu_u16_r0 * FF(65536))) + - (avm_alu_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_alu_u16_r2 * FF(281474976710656UL))))) + - (avm_alu_alu_u128_tag * - ((((((((avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))) + (avm_alu_alu_u16_r0 * FF(65536))) + - (avm_alu_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_alu_u16_r2 * FF(281474976710656UL))) + - (avm_alu_alu_u16_r3 * FF(uint256_t{ 0, 1, 0, 0 }))) + - (avm_alu_alu_u16_r4 * FF(uint256_t{ 0, 65536, 0, 0 }))) + - (avm_alu_alu_u16_r5 * FF(uint256_t{ 0, 4294967296, 0, 0 }))) + - (avm_alu_alu_u16_r6 * FF(uint256_t{ 0, 281474976710656, 0, 0 }))))) + - (avm_alu_alu_ff_tag * avm_alu_alu_ia)) - - avm_alu_alu_ic)) + - ((avm_alu_alu_ff_tag * (avm_alu_alu_op_add - avm_alu_alu_op_sub)) * avm_alu_alu_ib)); + auto tmp = (((avm_alu_op_add + avm_alu_op_sub) * + (((((((avm_alu_u8_tag * avm_alu_u8_r0) + + (avm_alu_u16_tag * (avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))))) + + (avm_alu_u32_tag * + ((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))))) + + (avm_alu_u64_tag * + ((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + + (avm_alu_u16_r1 * FF(4294967296UL))) + + (avm_alu_u16_r2 * FF(281474976710656UL))))) + + (avm_alu_u128_tag * + ((((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + + (avm_alu_u16_r1 * FF(4294967296UL))) + + (avm_alu_u16_r2 * FF(281474976710656UL))) + + (avm_alu_u16_r3 * FF(uint256_t{ 0, 1, 0, 0 }))) + + (avm_alu_u16_r4 * FF(uint256_t{ 0, 65536, 0, 0 }))) + + (avm_alu_u16_r5 * FF(uint256_t{ 0, 4294967296, 0, 0 }))) + + (avm_alu_u16_r6 * FF(uint256_t{ 0, 281474976710656, 0, 0 }))))) + + (avm_alu_ff_tag * avm_alu_ia)) - + avm_alu_ic)) + + ((avm_alu_ff_tag * (avm_alu_op_add - avm_alu_op_sub)) * avm_alu_ib)); tmp *= scaling_factor; std::get<10>(evals) += tmp; } @@ -231,8 +227,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(11); - auto tmp = - ((avm_alu_alu_ff_tag * avm_alu_alu_op_mul) * ((avm_alu_alu_ia * avm_alu_alu_ib) - avm_alu_alu_ic)); + auto tmp = ((avm_alu_ff_tag * avm_alu_op_mul) * ((avm_alu_ia * avm_alu_ib) - avm_alu_ic)); tmp *= scaling_factor; std::get<11>(evals) += tmp; } @@ -240,16 +235,15 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(12); - auto tmp = - ((((-avm_alu_alu_ff_tag + FF(1)) - avm_alu_alu_u128_tag) * avm_alu_alu_op_mul) * - (((((((((avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))) + (avm_alu_alu_u16_r0 * FF(65536))) + - (avm_alu_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_alu_u16_r2 * FF(281474976710656UL))) + - (avm_alu_alu_u16_r3 * FF(uint256_t{ 0, 1, 0, 0 }))) + - (avm_alu_alu_u16_r4 * FF(uint256_t{ 0, 65536, 0, 0 }))) + - (avm_alu_alu_u16_r5 * FF(uint256_t{ 0, 4294967296, 0, 0 }))) + - (avm_alu_alu_u16_r6 * FF(uint256_t{ 0, 281474976710656, 0, 0 }))) - - (avm_alu_alu_ia * avm_alu_alu_ib))); + auto tmp = ((((-avm_alu_ff_tag + FF(1)) - avm_alu_u128_tag) * avm_alu_op_mul) * + (((((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + + (avm_alu_u16_r1 * FF(4294967296UL))) + + (avm_alu_u16_r2 * FF(281474976710656UL))) + + (avm_alu_u16_r3 * FF(uint256_t{ 0, 1, 0, 0 }))) + + (avm_alu_u16_r4 * FF(uint256_t{ 0, 65536, 0, 0 }))) + + (avm_alu_u16_r5 * FF(uint256_t{ 0, 4294967296, 0, 0 }))) + + (avm_alu_u16_r6 * FF(uint256_t{ 0, 281474976710656, 0, 0 }))) - + (avm_alu_ia * avm_alu_ib))); tmp *= scaling_factor; std::get<12>(evals) += tmp; } @@ -257,16 +251,15 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(13); - auto tmp = (avm_alu_alu_op_mul * - (((((avm_alu_alu_u8_tag * avm_alu_alu_u8_r0) + - (avm_alu_alu_u16_tag * (avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))))) + - (avm_alu_alu_u32_tag * - ((avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))) + (avm_alu_alu_u16_r0 * FF(65536))))) + - (avm_alu_alu_u64_tag * - ((((avm_alu_alu_u8_r0 + (avm_alu_alu_u8_r1 * FF(256))) + (avm_alu_alu_u16_r0 * FF(65536))) + - (avm_alu_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_alu_u16_r2 * FF(281474976710656UL))))) - - (((-avm_alu_alu_ff_tag + FF(1)) - avm_alu_alu_u128_tag) * avm_alu_alu_ic))); + auto tmp = + (avm_alu_op_mul * + (((((avm_alu_u8_tag * avm_alu_u8_r0) + + (avm_alu_u16_tag * (avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))))) + + (avm_alu_u32_tag * ((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))))) + + (avm_alu_u64_tag * ((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + + (avm_alu_u16_r1 * FF(4294967296UL))) + + (avm_alu_u16_r2 * FF(281474976710656UL))))) - + (((-avm_alu_ff_tag + FF(1)) - avm_alu_u128_tag) * avm_alu_ic))); tmp *= scaling_factor; std::get<13>(evals) += tmp; } @@ -274,15 +267,13 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(14); - auto tmp = ((avm_alu_alu_u128_tag * avm_alu_alu_op_mul) * - (((((avm_alu_alu_u16_r0 + (avm_alu_alu_u16_r1 * FF(65536))) + - (avm_alu_alu_u16_r2 * FF(4294967296UL))) + - (avm_alu_alu_u16_r3 * FF(281474976710656UL))) + - ((((avm_alu_alu_u16_r4 + (avm_alu_alu_u16_r5 * FF(65536))) + - (avm_alu_alu_u16_r6 * FF(4294967296UL))) + - (avm_alu_alu_u16_r7 * FF(281474976710656UL))) * + auto tmp = ((avm_alu_u128_tag * avm_alu_op_mul) * + (((((avm_alu_u16_r0 + (avm_alu_u16_r1 * FF(65536))) + (avm_alu_u16_r2 * FF(4294967296UL))) + + (avm_alu_u16_r3 * FF(281474976710656UL))) + + ((((avm_alu_u16_r4 + (avm_alu_u16_r5 * FF(65536))) + (avm_alu_u16_r6 * FF(4294967296UL))) + + (avm_alu_u16_r7 * FF(281474976710656UL))) * FF(uint256_t{ 0, 1, 0, 0 }))) - - avm_alu_alu_ia)); + avm_alu_ia)); tmp *= scaling_factor; std::get<14>(evals) += tmp; } @@ -290,15 +281,15 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(15); - auto tmp = ((avm_alu_alu_u128_tag * avm_alu_alu_op_mul) * - (((((avm_alu_alu_u16_r0_shift + (avm_alu_alu_u16_r1_shift * FF(65536))) + - (avm_alu_alu_u16_r2_shift * FF(4294967296UL))) + - (avm_alu_alu_u16_r3_shift * FF(281474976710656UL))) + - ((((avm_alu_alu_u16_r4_shift + (avm_alu_alu_u16_r5_shift * FF(65536))) + - (avm_alu_alu_u16_r6_shift * FF(4294967296UL))) + - (avm_alu_alu_u16_r7_shift * FF(281474976710656UL))) * + auto tmp = ((avm_alu_u128_tag * avm_alu_op_mul) * + (((((avm_alu_u16_r0_shift + (avm_alu_u16_r1_shift * FF(65536))) + + (avm_alu_u16_r2_shift * FF(4294967296UL))) + + (avm_alu_u16_r3_shift * FF(281474976710656UL))) + + ((((avm_alu_u16_r4_shift + (avm_alu_u16_r5_shift * FF(65536))) + + (avm_alu_u16_r6_shift * FF(4294967296UL))) + + (avm_alu_u16_r7_shift * FF(281474976710656UL))) * FF(uint256_t{ 0, 1, 0, 0 }))) - - avm_alu_alu_ib)); + avm_alu_ib)); tmp *= scaling_factor; std::get<15>(evals) += tmp; } @@ -306,20 +297,19 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(16); - auto tmp = ((avm_alu_alu_u128_tag * avm_alu_alu_op_mul) * - ((((avm_alu_alu_ia * (((avm_alu_alu_u16_r0_shift + (avm_alu_alu_u16_r1_shift * FF(65536))) + - (avm_alu_alu_u16_r2_shift * FF(4294967296UL))) + - (avm_alu_alu_u16_r3_shift * FF(281474976710656UL)))) + - (((((avm_alu_alu_u16_r0 + (avm_alu_alu_u16_r1 * FF(65536))) + - (avm_alu_alu_u16_r2 * FF(4294967296UL))) + - (avm_alu_alu_u16_r3 * FF(281474976710656UL))) * - (((avm_alu_alu_u16_r4_shift + (avm_alu_alu_u16_r5_shift * FF(65536))) + - (avm_alu_alu_u16_r6_shift * FF(4294967296UL))) + - (avm_alu_alu_u16_r7_shift * FF(281474976710656UL)))) * - FF(uint256_t{ 0, 1, 0, 0 }))) - - (((avm_alu_alu_cf * FF(uint256_t{ 0, 1, 0, 0 })) + avm_alu_alu_u64_r0) * - FF(uint256_t{ 0, 0, 1, 0 }))) - - avm_alu_alu_ic)); + auto tmp = + ((avm_alu_u128_tag * avm_alu_op_mul) * + ((((avm_alu_ia * (((avm_alu_u16_r0_shift + (avm_alu_u16_r1_shift * FF(65536))) + + (avm_alu_u16_r2_shift * FF(4294967296UL))) + + (avm_alu_u16_r3_shift * FF(281474976710656UL)))) + + (((((avm_alu_u16_r0 + (avm_alu_u16_r1 * FF(65536))) + (avm_alu_u16_r2 * FF(4294967296UL))) + + (avm_alu_u16_r3 * FF(281474976710656UL))) * + (((avm_alu_u16_r4_shift + (avm_alu_u16_r5_shift * FF(65536))) + + (avm_alu_u16_r6_shift * FF(4294967296UL))) + + (avm_alu_u16_r7_shift * FF(281474976710656UL)))) * + FF(uint256_t{ 0, 1, 0, 0 }))) - + (((avm_alu_cf * FF(uint256_t{ 0, 1, 0, 0 })) + avm_alu_u64_r0) * FF(uint256_t{ 0, 0, 1, 0 }))) - + avm_alu_ic)); tmp *= scaling_factor; std::get<16>(evals) += tmp; } @@ -327,7 +317,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(17); - auto tmp = (avm_alu_alu_op_not * avm_alu_alu_ff_tag); + auto tmp = (avm_alu_op_not * avm_alu_ff_tag); tmp *= scaling_factor; std::get<17>(evals) += tmp; } @@ -335,12 +325,12 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(18); - auto tmp = (avm_alu_alu_op_not * ((avm_alu_alu_ia + avm_alu_alu_ic) - - ((((((avm_alu_alu_u8_tag * FF(256)) + (avm_alu_alu_u16_tag * FF(65536))) + - (avm_alu_alu_u32_tag * FF(4294967296UL))) + - (avm_alu_alu_u64_tag * FF(uint256_t{ 0, 1, 0, 0 }))) + - (avm_alu_alu_u128_tag * FF(uint256_t{ 0, 0, 1, 0 }))) - - FF(1)))); + auto tmp = (avm_alu_op_not * + ((avm_alu_ia + avm_alu_ic) - ((((((avm_alu_u8_tag * FF(256)) + (avm_alu_u16_tag * FF(65536))) + + (avm_alu_u32_tag * FF(4294967296UL))) + + (avm_alu_u64_tag * FF(uint256_t{ 0, 1, 0, 0 }))) + + (avm_alu_u128_tag * FF(uint256_t{ 0, 0, 1, 0 }))) - + FF(1)))); tmp *= scaling_factor; std::get<18>(evals) += tmp; } @@ -348,7 +338,7 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(19); - auto tmp = (avm_alu_alu_op_eq * (avm_alu_alu_ic * (-avm_alu_alu_ic + FF(1)))); + auto tmp = (avm_alu_op_eq * (avm_alu_ic * (-avm_alu_ic + FF(1)))); tmp *= scaling_factor; std::get<19>(evals) += tmp; } @@ -356,11 +346,11 @@ template class avm_aluImpl { { Avm_DECLARE_VIEWS(20); - auto tmp = (avm_alu_alu_op_eq * - ((((avm_alu_alu_ia - avm_alu_alu_ib) * - ((avm_alu_alu_ic * (-avm_alu_alu_op_eq_diff_inv + FF(1))) + avm_alu_alu_op_eq_diff_inv)) - - FF(1)) + - avm_alu_alu_ic)); + auto tmp = + (avm_alu_op_eq * ((((avm_alu_ia - avm_alu_ib) * + ((avm_alu_ic * (-avm_alu_op_eq_diff_inv + FF(1))) + avm_alu_op_eq_diff_inv)) - + FF(1)) + + avm_alu_ic)); tmp *= scaling_factor; std::get<20>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp index ab696f4c560..1cbdaabb96e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp @@ -7,43 +7,43 @@ namespace bb::Avm_vm { template struct Avm_binaryRow { - FF avm_binary_acc_ic_shift{}; - FF avm_binary_op_id_shift{}; - FF avm_binary_acc_ib_shift{}; - FF avm_binary_bin_sel{}; - FF avm_binary_mem_tag_ctr_shift{}; - FF avm_binary_mem_tag_ctr_inv{}; - FF avm_binary_mem_tag_ctr{}; + FF avm_binary_acc_ia{}; + FF avm_binary_acc_ia_shift{}; FF avm_binary_acc_ib{}; + FF avm_binary_acc_ib_shift{}; + FF avm_binary_acc_ic{}; + FF avm_binary_acc_ic_shift{}; + FF avm_binary_bin_ia_bytes{}; FF avm_binary_bin_ib_bytes{}; - FF avm_binary_acc_ia{}; FF avm_binary_bin_ic_bytes{}; + FF avm_binary_bin_sel{}; + FF avm_binary_mem_tag_ctr{}; + FF avm_binary_mem_tag_ctr_inv{}; + FF avm_binary_mem_tag_ctr_shift{}; FF avm_binary_op_id{}; - FF avm_binary_bin_ia_bytes{}; - FF avm_binary_acc_ia_shift{}; - FF avm_binary_acc_ic{}; + FF avm_binary_op_id_shift{}; }; inline std::string get_relation_label_avm_binary(int index) { switch (index) { - case 8: - return "ACC_REL_B"; - - case 9: - return "ACC_REL_C"; + case 1: + return "OP_ID_REL"; case 2: return "MEM_TAG_REL"; + case 3: + return "BIN_SEL_CTR_REL"; + case 7: return "ACC_REL_A"; - case 1: - return "OP_ID_REL"; + case 8: + return "ACC_REL_B"; - case 3: - return "BIN_SEL_CTR_REL"; + case 9: + return "ACC_REL_C"; } return std::to_string(index); } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_main.hpp index 95322178c10..c6cb110f1f9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_main.hpp @@ -7,78 +7,81 @@ namespace bb::Avm_vm { template struct Avm_mainRow { - FF avm_main_sel_internal_call{}; - FF avm_main_mem_op_c{}; - FF avm_main_internal_return_ptr_shift{}; - FF avm_main_mem_idx_a{}; - FF avm_main_r_in_tag{}; - FF avm_main_mem_op_a{}; - FF avm_main_sel_op_add{}; - FF avm_main_rwc{}; - FF avm_main_ind_op_c{}; - FF avm_main_sel_op_and{}; - FF avm_main_mem_idx_b{}; FF avm_main_alu_sel{}; - FF avm_main_sel_op_or{}; - FF avm_main_ia{}; + FF avm_main_bin_op_id{}; + FF avm_main_bin_sel{}; FF avm_main_first{}; + FF avm_main_ia{}; FF avm_main_ib{}; - FF avm_main_sel_internal_return{}; + FF avm_main_ic{}; + FF avm_main_ind_op_a{}; FF avm_main_ind_op_b{}; + FF avm_main_ind_op_c{}; + FF avm_main_internal_return_ptr{}; + FF avm_main_internal_return_ptr_shift{}; FF avm_main_inv{}; - FF avm_main_sel_op_div{}; - FF avm_main_sel_op_not{}; + FF avm_main_mem_idx_a{}; + FF avm_main_mem_idx_b{}; + FF avm_main_mem_op_a{}; FF avm_main_mem_op_b{}; - FF avm_main_ind_op_a{}; - FF avm_main_rwb{}; - FF avm_main_pc_shift{}; + FF avm_main_mem_op_c{}; FF avm_main_op_err{}; - FF avm_main_sel_op_mul{}; - FF avm_main_sel_op_xor{}; - FF avm_main_sel_op_sub{}; - FF avm_main_internal_return_ptr{}; - FF avm_main_rwa{}; - FF avm_main_bin_op_id{}; - FF avm_main_sel_jump{}; - FF avm_main_sel_op_eq{}; FF avm_main_pc{}; - FF avm_main_w_in_tag{}; + FF avm_main_pc_shift{}; + FF avm_main_r_in_tag{}; + FF avm_main_rwa{}; + FF avm_main_rwb{}; + FF avm_main_rwc{}; FF avm_main_sel_halt{}; + FF avm_main_sel_internal_call{}; + FF avm_main_sel_internal_return{}; + FF avm_main_sel_jump{}; FF avm_main_sel_mov{}; - FF avm_main_ic{}; + FF avm_main_sel_op_add{}; + FF avm_main_sel_op_and{}; + FF avm_main_sel_op_div{}; + FF avm_main_sel_op_eq{}; + FF avm_main_sel_op_mul{}; + FF avm_main_sel_op_not{}; + FF avm_main_sel_op_or{}; + FF avm_main_sel_op_sub{}; + FF avm_main_sel_op_xor{}; FF avm_main_tag_err{}; - FF avm_main_bin_sel{}; + FF avm_main_w_in_tag{}; }; inline std::string get_relation_label_avm_main(int index) { switch (index) { + case 25: + return "EQ_OUTPUT_U8"; + + case 26: + return "SUBOP_DIVISION_FF"; + case 27: return "SUBOP_DIVISION_ZERO_ERR1"; - case 31: - return "RETURN_POINTER_INCREMENT"; + case 28: + return "SUBOP_DIVISION_ZERO_ERR2"; case 29: return "SUBOP_ERROR_RELEVANT_OP"; - case 43: - return "INTERNAL_RETURN_POINTER_CONSISTENCY"; - - case 25: - return "EQ_OUTPUT_U8"; + case 31: + return "RETURN_POINTER_INCREMENT"; case 37: return "RETURN_POINTER_DECREMENT"; - case 44: - return "MOV_SAME_VALUE"; + case 42: + return "PC_INCREMENT"; - case 26: - return "SUBOP_DIVISION_FF"; + case 43: + return "INTERNAL_RETURN_POINTER_CONSISTENCY"; - case 28: - return "SUBOP_DIVISION_ZERO_ERR2"; + case 44: + return "MOV_SAME_VALUE"; case 45: return "MOV_MAIN_SAME_TAG"; @@ -86,9 +89,6 @@ inline std::string get_relation_label_avm_main(int index) case 47: return "BIN_SEL_1"; - case 42: - return "PC_INCREMENT"; - case 48: return "BIN_SEL_2"; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_mem.hpp index 42ad067c6c3..7ab7905c9b8 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_mem.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_mem.hpp @@ -7,48 +7,42 @@ namespace bb::Avm_vm { template struct Avm_memRow { - FF avm_mem_m_tag_shift{}; - FF avm_mem_m_rw_shift{}; + FF avm_mem_addr{}; + FF avm_mem_addr_shift{}; + FF avm_mem_ind_op_a{}; + FF avm_mem_ind_op_b{}; + FF avm_mem_ind_op_c{}; + FF avm_mem_last{}; + FF avm_mem_lastAccess{}; + FF avm_mem_one_min_inv{}; + FF avm_mem_op_a{}; + FF avm_mem_op_b{}; + FF avm_mem_op_c{}; FF avm_mem_r_in_tag{}; - FF avm_mem_m_val{}; - FF avm_mem_m_addr_shift{}; - FF avm_mem_m_tag{}; - FF avm_mem_m_val_shift{}; - FF avm_mem_m_sel_mov{}; - FF avm_mem_m_last{}; - FF avm_mem_m_sub_clk{}; - FF avm_mem_m_op_c{}; - FF avm_mem_m_op_b{}; - FF avm_mem_m_addr{}; - FF avm_mem_m_tag_err{}; - FF avm_mem_m_rw{}; - FF avm_mem_m_op_a{}; - FF avm_mem_m_ind_op_c{}; - FF avm_mem_m_lastAccess{}; - FF avm_mem_m_ind_op_a{}; - FF avm_mem_m_one_min_inv{}; + FF avm_mem_rw{}; + FF avm_mem_rw_shift{}; + FF avm_mem_sel_mov{}; + FF avm_mem_sub_clk{}; + FF avm_mem_tag{}; + FF avm_mem_tag_err{}; + FF avm_mem_tag_shift{}; + FF avm_mem_val{}; + FF avm_mem_val_shift{}; FF avm_mem_w_in_tag{}; - FF avm_mem_m_ind_op_b{}; }; inline std::string get_relation_label_avm_mem(int index) { switch (index) { + case 12: + return "MEM_LAST_ACCESS_DELIMITER"; + case 13: return "MEM_READ_WRITE_VAL_CONSISTENCY"; case 14: return "MEM_READ_WRITE_TAG_CONSISTENCY"; - case 19: - return "NO_TAG_ERR_WRITE"; - - case 26: - return "MOV_SAME_TAG"; - - case 12: - return "MEM_LAST_ACCESS_DELIMITER"; - case 15: return "MEM_ZERO_INIT"; @@ -57,6 +51,12 @@ inline std::string get_relation_label_avm_mem(int index) case 17: return "MEM_IN_TAG_CONSISTENCY_2"; + + case 19: + return "NO_TAG_ERR_WRITE"; + + case 26: + return "MOV_SAME_TAG"; } return std::to_string(index); } @@ -80,7 +80,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(0); - auto tmp = (avm_mem_m_lastAccess * (-avm_mem_m_lastAccess + FF(1))); + auto tmp = (avm_mem_lastAccess * (-avm_mem_lastAccess + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } @@ -88,7 +88,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(1); - auto tmp = (avm_mem_m_last * (-avm_mem_m_last + FF(1))); + auto tmp = (avm_mem_last * (-avm_mem_last + FF(1))); tmp *= scaling_factor; std::get<1>(evals) += tmp; } @@ -96,7 +96,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(2); - auto tmp = (avm_mem_m_rw * (-avm_mem_m_rw + FF(1))); + auto tmp = (avm_mem_rw * (-avm_mem_rw + FF(1))); tmp *= scaling_factor; std::get<2>(evals) += tmp; } @@ -104,7 +104,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(3); - auto tmp = (avm_mem_m_tag_err * (-avm_mem_m_tag_err + FF(1))); + auto tmp = (avm_mem_tag_err * (-avm_mem_tag_err + FF(1))); tmp *= scaling_factor; std::get<3>(evals) += tmp; } @@ -112,7 +112,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(4); - auto tmp = (avm_mem_m_op_a * (-avm_mem_m_op_a + FF(1))); + auto tmp = (avm_mem_op_a * (-avm_mem_op_a + FF(1))); tmp *= scaling_factor; std::get<4>(evals) += tmp; } @@ -120,7 +120,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(5); - auto tmp = (avm_mem_m_op_b * (-avm_mem_m_op_b + FF(1))); + auto tmp = (avm_mem_op_b * (-avm_mem_op_b + FF(1))); tmp *= scaling_factor; std::get<5>(evals) += tmp; } @@ -128,7 +128,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(6); - auto tmp = (avm_mem_m_op_c * (-avm_mem_m_op_c + FF(1))); + auto tmp = (avm_mem_op_c * (-avm_mem_op_c + FF(1))); tmp *= scaling_factor; std::get<6>(evals) += tmp; } @@ -136,7 +136,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(7); - auto tmp = (avm_mem_m_ind_op_a * (-avm_mem_m_ind_op_a + FF(1))); + auto tmp = (avm_mem_ind_op_a * (-avm_mem_ind_op_a + FF(1))); tmp *= scaling_factor; std::get<7>(evals) += tmp; } @@ -144,7 +144,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(8); - auto tmp = (avm_mem_m_ind_op_b * (-avm_mem_m_ind_op_b + FF(1))); + auto tmp = (avm_mem_ind_op_b * (-avm_mem_ind_op_b + FF(1))); tmp *= scaling_factor; std::get<8>(evals) += tmp; } @@ -152,7 +152,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(9); - auto tmp = (avm_mem_m_ind_op_c * (-avm_mem_m_ind_op_c + FF(1))); + auto tmp = (avm_mem_ind_op_c * (-avm_mem_ind_op_c + FF(1))); tmp *= scaling_factor; std::get<9>(evals) += tmp; } @@ -160,12 +160,11 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(10); - auto tmp = - ((((((avm_mem_m_op_a + avm_mem_m_op_b) + avm_mem_m_op_c) + avm_mem_m_ind_op_a) + avm_mem_m_ind_op_b) + - avm_mem_m_ind_op_c) * - ((((((avm_mem_m_op_a + avm_mem_m_op_b) + avm_mem_m_op_c) + avm_mem_m_ind_op_a) + avm_mem_m_ind_op_b) + - avm_mem_m_ind_op_c) - - FF(1))); + auto tmp = ((((((avm_mem_op_a + avm_mem_op_b) + avm_mem_op_c) + avm_mem_ind_op_a) + avm_mem_ind_op_b) + + avm_mem_ind_op_c) * + ((((((avm_mem_op_a + avm_mem_op_b) + avm_mem_op_c) + avm_mem_ind_op_a) + avm_mem_ind_op_b) + + avm_mem_ind_op_c) - + FF(1))); tmp *= scaling_factor; std::get<10>(evals) += tmp; } @@ -174,12 +173,11 @@ template class avm_memImpl { Avm_DECLARE_VIEWS(11); auto tmp = - (avm_mem_m_sub_clk - - ((((((avm_mem_m_op_a + avm_mem_m_op_b) + avm_mem_m_op_c) + avm_mem_m_ind_op_a) + avm_mem_m_ind_op_b) + - avm_mem_m_ind_op_c) * - (((avm_mem_m_ind_op_b + avm_mem_m_op_b) + ((avm_mem_m_ind_op_c + avm_mem_m_op_c) * FF(2))) + - (((-((avm_mem_m_ind_op_a + avm_mem_m_ind_op_b) + avm_mem_m_ind_op_c) + FF(1)) + avm_mem_m_rw) * - FF(3))))); + (avm_mem_sub_clk - + ((((((avm_mem_op_a + avm_mem_op_b) + avm_mem_op_c) + avm_mem_ind_op_a) + avm_mem_ind_op_b) + + avm_mem_ind_op_c) * + (((avm_mem_ind_op_b + avm_mem_op_b) + ((avm_mem_ind_op_c + avm_mem_op_c) * FF(2))) + + (((-((avm_mem_ind_op_a + avm_mem_ind_op_b) + avm_mem_ind_op_c) + FF(1)) + avm_mem_rw) * FF(3))))); tmp *= scaling_factor; std::get<11>(evals) += tmp; } @@ -187,7 +185,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(12); - auto tmp = ((-avm_mem_m_lastAccess + FF(1)) * (avm_mem_m_addr_shift - avm_mem_m_addr)); + auto tmp = ((-avm_mem_lastAccess + FF(1)) * (avm_mem_addr_shift - avm_mem_addr)); tmp *= scaling_factor; std::get<12>(evals) += tmp; } @@ -195,8 +193,8 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(13); - auto tmp = (((-avm_mem_m_lastAccess + FF(1)) * (-avm_mem_m_rw_shift + FF(1))) * - (avm_mem_m_val_shift - avm_mem_m_val)); + auto tmp = + (((-avm_mem_lastAccess + FF(1)) * (-avm_mem_rw_shift + FF(1))) * (avm_mem_val_shift - avm_mem_val)); tmp *= scaling_factor; std::get<13>(evals) += tmp; } @@ -204,8 +202,8 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(14); - auto tmp = (((-avm_mem_m_lastAccess + FF(1)) * (-avm_mem_m_rw_shift + FF(1))) * - (avm_mem_m_tag_shift - avm_mem_m_tag)); + auto tmp = + (((-avm_mem_lastAccess + FF(1)) * (-avm_mem_rw_shift + FF(1))) * (avm_mem_tag_shift - avm_mem_tag)); tmp *= scaling_factor; std::get<14>(evals) += tmp; } @@ -213,7 +211,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(15); - auto tmp = ((avm_mem_m_lastAccess * (-avm_mem_m_rw_shift + FF(1))) * avm_mem_m_val_shift); + auto tmp = ((avm_mem_lastAccess * (-avm_mem_rw_shift + FF(1))) * avm_mem_val_shift); tmp *= scaling_factor; std::get<15>(evals) += tmp; } @@ -221,8 +219,8 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(16); - auto tmp = ((-avm_mem_m_rw + FF(1)) * - (((avm_mem_r_in_tag - avm_mem_m_tag) * (-avm_mem_m_one_min_inv + FF(1))) - avm_mem_m_tag_err)); + auto tmp = ((-avm_mem_rw + FF(1)) * + (((avm_mem_r_in_tag - avm_mem_tag) * (-avm_mem_one_min_inv + FF(1))) - avm_mem_tag_err)); tmp *= scaling_factor; std::get<16>(evals) += tmp; } @@ -230,7 +228,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(17); - auto tmp = ((-avm_mem_m_tag_err + FF(1)) * avm_mem_m_one_min_inv); + auto tmp = ((-avm_mem_tag_err + FF(1)) * avm_mem_one_min_inv); tmp *= scaling_factor; std::get<17>(evals) += tmp; } @@ -238,7 +236,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(18); - auto tmp = (avm_mem_m_rw * (avm_mem_w_in_tag - avm_mem_m_tag)); + auto tmp = (avm_mem_rw * (avm_mem_w_in_tag - avm_mem_tag)); tmp *= scaling_factor; std::get<18>(evals) += tmp; } @@ -246,7 +244,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(19); - auto tmp = (avm_mem_m_rw * avm_mem_m_tag_err); + auto tmp = (avm_mem_rw * avm_mem_tag_err); tmp *= scaling_factor; std::get<19>(evals) += tmp; } @@ -254,7 +252,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(20); - auto tmp = (avm_mem_m_ind_op_a * (avm_mem_r_in_tag - FF(3))); + auto tmp = (avm_mem_ind_op_a * (avm_mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<20>(evals) += tmp; } @@ -262,7 +260,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(21); - auto tmp = (avm_mem_m_ind_op_b * (avm_mem_r_in_tag - FF(3))); + auto tmp = (avm_mem_ind_op_b * (avm_mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<21>(evals) += tmp; } @@ -270,7 +268,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(22); - auto tmp = (avm_mem_m_ind_op_c * (avm_mem_r_in_tag - FF(3))); + auto tmp = (avm_mem_ind_op_c * (avm_mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<22>(evals) += tmp; } @@ -278,7 +276,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(23); - auto tmp = (avm_mem_m_ind_op_a * avm_mem_m_rw); + auto tmp = (avm_mem_ind_op_a * avm_mem_rw); tmp *= scaling_factor; std::get<23>(evals) += tmp; } @@ -286,7 +284,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(24); - auto tmp = (avm_mem_m_ind_op_b * avm_mem_m_rw); + auto tmp = (avm_mem_ind_op_b * avm_mem_rw); tmp *= scaling_factor; std::get<24>(evals) += tmp; } @@ -294,7 +292,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(25); - auto tmp = (avm_mem_m_ind_op_c * avm_mem_m_rw); + auto tmp = (avm_mem_ind_op_c * avm_mem_rw); tmp *= scaling_factor; std::get<25>(evals) += tmp; } @@ -302,7 +300,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(26); - auto tmp = (avm_mem_m_sel_mov * avm_mem_m_tag_err); + auto tmp = (avm_mem_sel_mov * avm_mem_tag_err); tmp *= scaling_factor; std::get<26>(evals) += tmp; } 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 6148feef5cc..a9fd7fb4ad7 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -4,121 +4,121 @@ using View = typename Accumulator::View; \ [[maybe_unused]] auto avm_main_clk = View(new_term.avm_main_clk); \ [[maybe_unused]] auto avm_main_first = View(new_term.avm_main_first); \ - [[maybe_unused]] auto avm_mem_m_clk = View(new_term.avm_mem_m_clk); \ - [[maybe_unused]] auto avm_mem_m_sub_clk = View(new_term.avm_mem_m_sub_clk); \ - [[maybe_unused]] auto avm_mem_m_addr = View(new_term.avm_mem_m_addr); \ - [[maybe_unused]] auto avm_mem_m_tag = View(new_term.avm_mem_m_tag); \ - [[maybe_unused]] auto avm_mem_m_val = View(new_term.avm_mem_m_val); \ - [[maybe_unused]] auto avm_mem_m_lastAccess = View(new_term.avm_mem_m_lastAccess); \ - [[maybe_unused]] auto avm_mem_m_last = View(new_term.avm_mem_m_last); \ - [[maybe_unused]] auto avm_mem_m_rw = View(new_term.avm_mem_m_rw); \ - [[maybe_unused]] auto avm_mem_r_in_tag = View(new_term.avm_mem_r_in_tag); \ - [[maybe_unused]] auto avm_mem_w_in_tag = View(new_term.avm_mem_w_in_tag); \ - [[maybe_unused]] auto avm_mem_m_op_a = View(new_term.avm_mem_m_op_a); \ - [[maybe_unused]] auto avm_mem_m_op_b = View(new_term.avm_mem_m_op_b); \ - [[maybe_unused]] auto avm_mem_m_op_c = View(new_term.avm_mem_m_op_c); \ - [[maybe_unused]] auto avm_mem_m_ind_op_a = View(new_term.avm_mem_m_ind_op_a); \ - [[maybe_unused]] auto avm_mem_m_ind_op_b = View(new_term.avm_mem_m_ind_op_b); \ - [[maybe_unused]] auto avm_mem_m_ind_op_c = View(new_term.avm_mem_m_ind_op_c); \ - [[maybe_unused]] auto avm_mem_m_sel_mov = View(new_term.avm_mem_m_sel_mov); \ - [[maybe_unused]] auto avm_mem_m_tag_err = View(new_term.avm_mem_m_tag_err); \ - [[maybe_unused]] auto avm_mem_m_one_min_inv = View(new_term.avm_mem_m_one_min_inv); \ - [[maybe_unused]] auto avm_alu_alu_clk = View(new_term.avm_alu_alu_clk); \ - [[maybe_unused]] auto avm_alu_alu_ia = View(new_term.avm_alu_alu_ia); \ - [[maybe_unused]] auto avm_alu_alu_ib = View(new_term.avm_alu_alu_ib); \ - [[maybe_unused]] auto avm_alu_alu_ic = View(new_term.avm_alu_alu_ic); \ - [[maybe_unused]] auto avm_alu_alu_op_add = View(new_term.avm_alu_alu_op_add); \ - [[maybe_unused]] auto avm_alu_alu_op_sub = View(new_term.avm_alu_alu_op_sub); \ - [[maybe_unused]] auto avm_alu_alu_op_mul = View(new_term.avm_alu_alu_op_mul); \ - [[maybe_unused]] auto avm_alu_alu_op_div = View(new_term.avm_alu_alu_op_div); \ - [[maybe_unused]] auto avm_alu_alu_op_not = View(new_term.avm_alu_alu_op_not); \ - [[maybe_unused]] auto avm_alu_alu_op_eq = View(new_term.avm_alu_alu_op_eq); \ [[maybe_unused]] auto avm_alu_alu_sel = View(new_term.avm_alu_alu_sel); \ - [[maybe_unused]] auto avm_alu_alu_in_tag = View(new_term.avm_alu_alu_in_tag); \ - [[maybe_unused]] auto avm_alu_alu_ff_tag = View(new_term.avm_alu_alu_ff_tag); \ - [[maybe_unused]] auto avm_alu_alu_u8_tag = View(new_term.avm_alu_alu_u8_tag); \ - [[maybe_unused]] auto avm_alu_alu_u16_tag = View(new_term.avm_alu_alu_u16_tag); \ - [[maybe_unused]] auto avm_alu_alu_u32_tag = View(new_term.avm_alu_alu_u32_tag); \ - [[maybe_unused]] auto avm_alu_alu_u64_tag = View(new_term.avm_alu_alu_u64_tag); \ - [[maybe_unused]] auto avm_alu_alu_u128_tag = View(new_term.avm_alu_alu_u128_tag); \ - [[maybe_unused]] auto avm_alu_alu_u8_r0 = View(new_term.avm_alu_alu_u8_r0); \ - [[maybe_unused]] auto avm_alu_alu_u8_r1 = View(new_term.avm_alu_alu_u8_r1); \ - [[maybe_unused]] auto avm_alu_alu_u16_r0 = View(new_term.avm_alu_alu_u16_r0); \ - [[maybe_unused]] auto avm_alu_alu_u16_r1 = View(new_term.avm_alu_alu_u16_r1); \ - [[maybe_unused]] auto avm_alu_alu_u16_r2 = View(new_term.avm_alu_alu_u16_r2); \ - [[maybe_unused]] auto avm_alu_alu_u16_r3 = View(new_term.avm_alu_alu_u16_r3); \ - [[maybe_unused]] auto avm_alu_alu_u16_r4 = View(new_term.avm_alu_alu_u16_r4); \ - [[maybe_unused]] auto avm_alu_alu_u16_r5 = View(new_term.avm_alu_alu_u16_r5); \ - [[maybe_unused]] auto avm_alu_alu_u16_r6 = View(new_term.avm_alu_alu_u16_r6); \ - [[maybe_unused]] auto avm_alu_alu_u16_r7 = View(new_term.avm_alu_alu_u16_r7); \ - [[maybe_unused]] auto avm_alu_alu_u64_r0 = View(new_term.avm_alu_alu_u64_r0); \ - [[maybe_unused]] auto avm_alu_alu_cf = View(new_term.avm_alu_alu_cf); \ - [[maybe_unused]] auto avm_alu_alu_op_eq_diff_inv = View(new_term.avm_alu_alu_op_eq_diff_inv); \ - [[maybe_unused]] auto avm_byte_lookup_table_op_id = View(new_term.avm_byte_lookup_table_op_id); \ - [[maybe_unused]] auto avm_byte_lookup_table_input_a = View(new_term.avm_byte_lookup_table_input_a); \ - [[maybe_unused]] auto avm_byte_lookup_table_input_b = View(new_term.avm_byte_lookup_table_input_b); \ - [[maybe_unused]] auto avm_byte_lookup_table_output = View(new_term.avm_byte_lookup_table_output); \ - [[maybe_unused]] auto avm_byte_lookup_bin_sel = View(new_term.avm_byte_lookup_bin_sel); \ - [[maybe_unused]] auto avm_byte_lookup_table_in_tags = View(new_term.avm_byte_lookup_table_in_tags); \ - [[maybe_unused]] auto avm_byte_lookup_table_byte_lengths = View(new_term.avm_byte_lookup_table_byte_lengths); \ - [[maybe_unused]] auto avm_binary_bin_clk = View(new_term.avm_binary_bin_clk); \ - [[maybe_unused]] auto avm_binary_bin_sel = View(new_term.avm_binary_bin_sel); \ + [[maybe_unused]] auto avm_alu_cf = View(new_term.avm_alu_cf); \ + [[maybe_unused]] auto avm_alu_clk = View(new_term.avm_alu_clk); \ + [[maybe_unused]] auto avm_alu_ff_tag = View(new_term.avm_alu_ff_tag); \ + [[maybe_unused]] auto avm_alu_ia = View(new_term.avm_alu_ia); \ + [[maybe_unused]] auto avm_alu_ib = View(new_term.avm_alu_ib); \ + [[maybe_unused]] auto avm_alu_ic = View(new_term.avm_alu_ic); \ + [[maybe_unused]] auto avm_alu_in_tag = View(new_term.avm_alu_in_tag); \ + [[maybe_unused]] auto avm_alu_op_add = View(new_term.avm_alu_op_add); \ + [[maybe_unused]] auto avm_alu_op_div = View(new_term.avm_alu_op_div); \ + [[maybe_unused]] auto avm_alu_op_eq = View(new_term.avm_alu_op_eq); \ + [[maybe_unused]] auto avm_alu_op_eq_diff_inv = View(new_term.avm_alu_op_eq_diff_inv); \ + [[maybe_unused]] auto avm_alu_op_mul = View(new_term.avm_alu_op_mul); \ + [[maybe_unused]] auto avm_alu_op_not = View(new_term.avm_alu_op_not); \ + [[maybe_unused]] auto avm_alu_op_sub = View(new_term.avm_alu_op_sub); \ + [[maybe_unused]] auto avm_alu_u128_tag = View(new_term.avm_alu_u128_tag); \ + [[maybe_unused]] auto avm_alu_u16_r0 = View(new_term.avm_alu_u16_r0); \ + [[maybe_unused]] auto avm_alu_u16_r1 = View(new_term.avm_alu_u16_r1); \ + [[maybe_unused]] auto avm_alu_u16_r2 = View(new_term.avm_alu_u16_r2); \ + [[maybe_unused]] auto avm_alu_u16_r3 = View(new_term.avm_alu_u16_r3); \ + [[maybe_unused]] auto avm_alu_u16_r4 = View(new_term.avm_alu_u16_r4); \ + [[maybe_unused]] auto avm_alu_u16_r5 = View(new_term.avm_alu_u16_r5); \ + [[maybe_unused]] auto avm_alu_u16_r6 = View(new_term.avm_alu_u16_r6); \ + [[maybe_unused]] auto avm_alu_u16_r7 = View(new_term.avm_alu_u16_r7); \ + [[maybe_unused]] auto avm_alu_u16_tag = View(new_term.avm_alu_u16_tag); \ + [[maybe_unused]] auto avm_alu_u32_tag = View(new_term.avm_alu_u32_tag); \ + [[maybe_unused]] auto avm_alu_u64_r0 = View(new_term.avm_alu_u64_r0); \ + [[maybe_unused]] auto avm_alu_u64_tag = View(new_term.avm_alu_u64_tag); \ + [[maybe_unused]] auto avm_alu_u8_r0 = View(new_term.avm_alu_u8_r0); \ + [[maybe_unused]] auto avm_alu_u8_r1 = View(new_term.avm_alu_u8_r1); \ + [[maybe_unused]] auto avm_alu_u8_tag = View(new_term.avm_alu_u8_tag); \ [[maybe_unused]] auto avm_binary_acc_ia = View(new_term.avm_binary_acc_ia); \ [[maybe_unused]] auto avm_binary_acc_ib = View(new_term.avm_binary_acc_ib); \ [[maybe_unused]] auto avm_binary_acc_ic = View(new_term.avm_binary_acc_ic); \ - [[maybe_unused]] auto avm_binary_in_tag = View(new_term.avm_binary_in_tag); \ - [[maybe_unused]] auto avm_binary_op_id = View(new_term.avm_binary_op_id); \ + [[maybe_unused]] auto avm_binary_bin_clk = View(new_term.avm_binary_bin_clk); \ [[maybe_unused]] auto avm_binary_bin_ia_bytes = View(new_term.avm_binary_bin_ia_bytes); \ [[maybe_unused]] auto avm_binary_bin_ib_bytes = View(new_term.avm_binary_bin_ib_bytes); \ [[maybe_unused]] auto avm_binary_bin_ic_bytes = View(new_term.avm_binary_bin_ic_bytes); \ - [[maybe_unused]] auto avm_binary_start = View(new_term.avm_binary_start); \ + [[maybe_unused]] auto avm_binary_bin_sel = View(new_term.avm_binary_bin_sel); \ + [[maybe_unused]] auto avm_binary_in_tag = View(new_term.avm_binary_in_tag); \ [[maybe_unused]] auto avm_binary_mem_tag_ctr = View(new_term.avm_binary_mem_tag_ctr); \ [[maybe_unused]] auto avm_binary_mem_tag_ctr_inv = View(new_term.avm_binary_mem_tag_ctr_inv); \ - [[maybe_unused]] auto avm_main_sel_rng_8 = View(new_term.avm_main_sel_rng_8); \ - [[maybe_unused]] auto avm_main_sel_rng_16 = View(new_term.avm_main_sel_rng_16); \ - [[maybe_unused]] auto avm_main_pc = View(new_term.avm_main_pc); \ - [[maybe_unused]] auto avm_main_internal_return_ptr = View(new_term.avm_main_internal_return_ptr); \ - [[maybe_unused]] auto avm_main_sel_internal_call = View(new_term.avm_main_sel_internal_call); \ - [[maybe_unused]] auto avm_main_sel_internal_return = View(new_term.avm_main_sel_internal_return); \ - [[maybe_unused]] auto avm_main_sel_jump = View(new_term.avm_main_sel_jump); \ - [[maybe_unused]] auto avm_main_sel_halt = View(new_term.avm_main_sel_halt); \ - [[maybe_unused]] auto avm_main_sel_mov = View(new_term.avm_main_sel_mov); \ - [[maybe_unused]] auto avm_main_sel_op_add = View(new_term.avm_main_sel_op_add); \ - [[maybe_unused]] auto avm_main_sel_op_sub = View(new_term.avm_main_sel_op_sub); \ - [[maybe_unused]] auto avm_main_sel_op_mul = View(new_term.avm_main_sel_op_mul); \ - [[maybe_unused]] auto avm_main_sel_op_div = View(new_term.avm_main_sel_op_div); \ - [[maybe_unused]] auto avm_main_sel_op_not = View(new_term.avm_main_sel_op_not); \ - [[maybe_unused]] auto avm_main_sel_op_eq = View(new_term.avm_main_sel_op_eq); \ - [[maybe_unused]] auto avm_main_sel_op_and = View(new_term.avm_main_sel_op_and); \ - [[maybe_unused]] auto avm_main_sel_op_or = View(new_term.avm_main_sel_op_or); \ - [[maybe_unused]] auto avm_main_sel_op_xor = View(new_term.avm_main_sel_op_xor); \ + [[maybe_unused]] auto avm_binary_op_id = View(new_term.avm_binary_op_id); \ + [[maybe_unused]] auto avm_binary_start = View(new_term.avm_binary_start); \ + [[maybe_unused]] auto avm_byte_lookup_bin_sel = View(new_term.avm_byte_lookup_bin_sel); \ + [[maybe_unused]] auto avm_byte_lookup_table_byte_lengths = View(new_term.avm_byte_lookup_table_byte_lengths); \ + [[maybe_unused]] auto avm_byte_lookup_table_in_tags = View(new_term.avm_byte_lookup_table_in_tags); \ + [[maybe_unused]] auto avm_byte_lookup_table_input_a = View(new_term.avm_byte_lookup_table_input_a); \ + [[maybe_unused]] auto avm_byte_lookup_table_input_b = View(new_term.avm_byte_lookup_table_input_b); \ + [[maybe_unused]] auto avm_byte_lookup_table_op_id = View(new_term.avm_byte_lookup_table_op_id); \ + [[maybe_unused]] auto avm_byte_lookup_table_output = View(new_term.avm_byte_lookup_table_output); \ [[maybe_unused]] auto avm_main_alu_sel = View(new_term.avm_main_alu_sel); \ + [[maybe_unused]] auto avm_main_bin_op_id = View(new_term.avm_main_bin_op_id); \ [[maybe_unused]] auto avm_main_bin_sel = View(new_term.avm_main_bin_sel); \ - [[maybe_unused]] auto avm_main_r_in_tag = View(new_term.avm_main_r_in_tag); \ - [[maybe_unused]] auto avm_main_w_in_tag = View(new_term.avm_main_w_in_tag); \ - [[maybe_unused]] auto avm_main_op_err = View(new_term.avm_main_op_err); \ - [[maybe_unused]] auto avm_main_tag_err = View(new_term.avm_main_tag_err); \ - [[maybe_unused]] auto avm_main_inv = View(new_term.avm_main_inv); \ [[maybe_unused]] auto avm_main_ia = View(new_term.avm_main_ia); \ [[maybe_unused]] auto avm_main_ib = View(new_term.avm_main_ib); \ [[maybe_unused]] auto avm_main_ic = View(new_term.avm_main_ic); \ - [[maybe_unused]] auto avm_main_mem_op_a = View(new_term.avm_main_mem_op_a); \ - [[maybe_unused]] auto avm_main_mem_op_b = View(new_term.avm_main_mem_op_b); \ - [[maybe_unused]] auto avm_main_mem_op_c = View(new_term.avm_main_mem_op_c); \ - [[maybe_unused]] auto avm_main_rwa = View(new_term.avm_main_rwa); \ - [[maybe_unused]] auto avm_main_rwb = View(new_term.avm_main_rwb); \ - [[maybe_unused]] auto avm_main_rwc = View(new_term.avm_main_rwc); \ [[maybe_unused]] auto avm_main_ind_a = View(new_term.avm_main_ind_a); \ [[maybe_unused]] auto avm_main_ind_b = View(new_term.avm_main_ind_b); \ [[maybe_unused]] auto avm_main_ind_c = View(new_term.avm_main_ind_c); \ [[maybe_unused]] auto avm_main_ind_op_a = View(new_term.avm_main_ind_op_a); \ [[maybe_unused]] auto avm_main_ind_op_b = View(new_term.avm_main_ind_op_b); \ [[maybe_unused]] auto avm_main_ind_op_c = View(new_term.avm_main_ind_op_c); \ + [[maybe_unused]] auto avm_main_internal_return_ptr = View(new_term.avm_main_internal_return_ptr); \ + [[maybe_unused]] auto avm_main_inv = View(new_term.avm_main_inv); \ + [[maybe_unused]] auto avm_main_last = View(new_term.avm_main_last); \ [[maybe_unused]] auto avm_main_mem_idx_a = View(new_term.avm_main_mem_idx_a); \ [[maybe_unused]] auto avm_main_mem_idx_b = View(new_term.avm_main_mem_idx_b); \ [[maybe_unused]] auto avm_main_mem_idx_c = View(new_term.avm_main_mem_idx_c); \ - [[maybe_unused]] auto avm_main_last = View(new_term.avm_main_last); \ - [[maybe_unused]] auto avm_main_bin_op_id = View(new_term.avm_main_bin_op_id); \ + [[maybe_unused]] auto avm_main_mem_op_a = View(new_term.avm_main_mem_op_a); \ + [[maybe_unused]] auto avm_main_mem_op_b = View(new_term.avm_main_mem_op_b); \ + [[maybe_unused]] auto avm_main_mem_op_c = View(new_term.avm_main_mem_op_c); \ + [[maybe_unused]] auto avm_main_op_err = View(new_term.avm_main_op_err); \ + [[maybe_unused]] auto avm_main_pc = View(new_term.avm_main_pc); \ + [[maybe_unused]] auto avm_main_r_in_tag = View(new_term.avm_main_r_in_tag); \ + [[maybe_unused]] auto avm_main_rwa = View(new_term.avm_main_rwa); \ + [[maybe_unused]] auto avm_main_rwb = View(new_term.avm_main_rwb); \ + [[maybe_unused]] auto avm_main_rwc = View(new_term.avm_main_rwc); \ + [[maybe_unused]] auto avm_main_sel_halt = View(new_term.avm_main_sel_halt); \ + [[maybe_unused]] auto avm_main_sel_internal_call = View(new_term.avm_main_sel_internal_call); \ + [[maybe_unused]] auto avm_main_sel_internal_return = View(new_term.avm_main_sel_internal_return); \ + [[maybe_unused]] auto avm_main_sel_jump = View(new_term.avm_main_sel_jump); \ + [[maybe_unused]] auto avm_main_sel_mov = View(new_term.avm_main_sel_mov); \ + [[maybe_unused]] auto avm_main_sel_op_add = View(new_term.avm_main_sel_op_add); \ + [[maybe_unused]] auto avm_main_sel_op_and = View(new_term.avm_main_sel_op_and); \ + [[maybe_unused]] auto avm_main_sel_op_div = View(new_term.avm_main_sel_op_div); \ + [[maybe_unused]] auto avm_main_sel_op_eq = View(new_term.avm_main_sel_op_eq); \ + [[maybe_unused]] auto avm_main_sel_op_mul = View(new_term.avm_main_sel_op_mul); \ + [[maybe_unused]] auto avm_main_sel_op_not = View(new_term.avm_main_sel_op_not); \ + [[maybe_unused]] auto avm_main_sel_op_or = View(new_term.avm_main_sel_op_or); \ + [[maybe_unused]] auto avm_main_sel_op_sub = View(new_term.avm_main_sel_op_sub); \ + [[maybe_unused]] auto avm_main_sel_op_xor = View(new_term.avm_main_sel_op_xor); \ + [[maybe_unused]] auto avm_main_sel_rng_16 = View(new_term.avm_main_sel_rng_16); \ + [[maybe_unused]] auto avm_main_sel_rng_8 = View(new_term.avm_main_sel_rng_8); \ + [[maybe_unused]] auto avm_main_tag_err = View(new_term.avm_main_tag_err); \ + [[maybe_unused]] auto avm_main_w_in_tag = View(new_term.avm_main_w_in_tag); \ + [[maybe_unused]] auto avm_mem_addr = View(new_term.avm_mem_addr); \ + [[maybe_unused]] auto avm_mem_clk = View(new_term.avm_mem_clk); \ + [[maybe_unused]] auto avm_mem_ind_op_a = View(new_term.avm_mem_ind_op_a); \ + [[maybe_unused]] auto avm_mem_ind_op_b = View(new_term.avm_mem_ind_op_b); \ + [[maybe_unused]] auto avm_mem_ind_op_c = View(new_term.avm_mem_ind_op_c); \ + [[maybe_unused]] auto avm_mem_last = View(new_term.avm_mem_last); \ + [[maybe_unused]] auto avm_mem_lastAccess = View(new_term.avm_mem_lastAccess); \ + [[maybe_unused]] auto avm_mem_one_min_inv = View(new_term.avm_mem_one_min_inv); \ + [[maybe_unused]] auto avm_mem_op_a = View(new_term.avm_mem_op_a); \ + [[maybe_unused]] auto avm_mem_op_b = View(new_term.avm_mem_op_b); \ + [[maybe_unused]] auto avm_mem_op_c = View(new_term.avm_mem_op_c); \ + [[maybe_unused]] auto avm_mem_r_in_tag = View(new_term.avm_mem_r_in_tag); \ + [[maybe_unused]] auto avm_mem_rw = View(new_term.avm_mem_rw); \ + [[maybe_unused]] auto avm_mem_sel_mov = View(new_term.avm_mem_sel_mov); \ + [[maybe_unused]] auto avm_mem_sub_clk = View(new_term.avm_mem_sub_clk); \ + [[maybe_unused]] auto avm_mem_tag = View(new_term.avm_mem_tag); \ + [[maybe_unused]] auto avm_mem_tag_err = View(new_term.avm_mem_tag_err); \ + [[maybe_unused]] auto avm_mem_val = View(new_term.avm_mem_val); \ + [[maybe_unused]] auto avm_mem_w_in_tag = View(new_term.avm_mem_w_in_tag); \ [[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_mem_a = View(new_term.perm_main_mem_a); \ @@ -135,22 +135,22 @@ [[maybe_unused]] auto lookup_byte_operations_counts = View(new_term.lookup_byte_operations_counts); \ [[maybe_unused]] auto incl_main_tag_err_counts = View(new_term.incl_main_tag_err_counts); \ [[maybe_unused]] auto incl_mem_tag_err_counts = View(new_term.incl_mem_tag_err_counts); \ - [[maybe_unused]] auto avm_mem_m_tag_shift = View(new_term.avm_mem_m_tag_shift); \ - [[maybe_unused]] auto avm_mem_m_rw_shift = View(new_term.avm_mem_m_rw_shift); \ - [[maybe_unused]] auto avm_mem_m_addr_shift = View(new_term.avm_mem_m_addr_shift); \ - [[maybe_unused]] auto avm_mem_m_val_shift = View(new_term.avm_mem_m_val_shift); \ - [[maybe_unused]] auto avm_binary_acc_ic_shift = View(new_term.avm_binary_acc_ic_shift); \ - [[maybe_unused]] auto avm_binary_op_id_shift = View(new_term.avm_binary_op_id_shift); \ + [[maybe_unused]] auto avm_alu_u16_r0_shift = View(new_term.avm_alu_u16_r0_shift); \ + [[maybe_unused]] auto avm_alu_u16_r1_shift = View(new_term.avm_alu_u16_r1_shift); \ + [[maybe_unused]] auto avm_alu_u16_r2_shift = View(new_term.avm_alu_u16_r2_shift); \ + [[maybe_unused]] auto avm_alu_u16_r3_shift = View(new_term.avm_alu_u16_r3_shift); \ + [[maybe_unused]] auto avm_alu_u16_r4_shift = View(new_term.avm_alu_u16_r4_shift); \ + [[maybe_unused]] auto avm_alu_u16_r5_shift = View(new_term.avm_alu_u16_r5_shift); \ + [[maybe_unused]] auto avm_alu_u16_r6_shift = View(new_term.avm_alu_u16_r6_shift); \ + [[maybe_unused]] auto avm_alu_u16_r7_shift = View(new_term.avm_alu_u16_r7_shift); \ + [[maybe_unused]] auto avm_binary_acc_ia_shift = View(new_term.avm_binary_acc_ia_shift); \ [[maybe_unused]] auto avm_binary_acc_ib_shift = View(new_term.avm_binary_acc_ib_shift); \ + [[maybe_unused]] auto avm_binary_acc_ic_shift = View(new_term.avm_binary_acc_ic_shift); \ [[maybe_unused]] auto avm_binary_mem_tag_ctr_shift = View(new_term.avm_binary_mem_tag_ctr_shift); \ - [[maybe_unused]] auto avm_binary_acc_ia_shift = View(new_term.avm_binary_acc_ia_shift); \ + [[maybe_unused]] auto avm_binary_op_id_shift = View(new_term.avm_binary_op_id_shift); \ [[maybe_unused]] auto avm_main_internal_return_ptr_shift = View(new_term.avm_main_internal_return_ptr_shift); \ [[maybe_unused]] auto avm_main_pc_shift = View(new_term.avm_main_pc_shift); \ - [[maybe_unused]] auto avm_alu_alu_u16_r1_shift = View(new_term.avm_alu_alu_u16_r1_shift); \ - [[maybe_unused]] auto avm_alu_alu_u16_r3_shift = View(new_term.avm_alu_alu_u16_r3_shift); \ - [[maybe_unused]] auto avm_alu_alu_u16_r2_shift = View(new_term.avm_alu_alu_u16_r2_shift); \ - [[maybe_unused]] auto avm_alu_alu_u16_r5_shift = View(new_term.avm_alu_alu_u16_r5_shift); \ - [[maybe_unused]] auto avm_alu_alu_u16_r4_shift = View(new_term.avm_alu_alu_u16_r4_shift); \ - [[maybe_unused]] auto avm_alu_alu_u16_r6_shift = View(new_term.avm_alu_alu_u16_r6_shift); \ - [[maybe_unused]] auto avm_alu_alu_u16_r0_shift = View(new_term.avm_alu_alu_u16_r0_shift); \ - [[maybe_unused]] auto avm_alu_alu_u16_r7_shift = View(new_term.avm_alu_alu_u16_r7_shift); + [[maybe_unused]] auto avm_mem_addr_shift = View(new_term.avm_mem_addr_shift); \ + [[maybe_unused]] auto avm_mem_rw_shift = View(new_term.avm_mem_rw_shift); \ + [[maybe_unused]] auto avm_mem_tag_shift = View(new_term.avm_mem_tag_shift); \ + [[maybe_unused]] auto avm_mem_val_shift = View(new_term.avm_mem_val_shift); 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 050f662d86b..01e8335fd7e 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 @@ -87,7 +87,7 @@ class incl_main_tag_err_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_mem_m_tag_err == 1 || in.avm_main_tag_err == 1); + return (in.avm_mem_tag_err == 1 || in.avm_main_tag_err == 1); } /** @@ -104,7 +104,7 @@ class incl_main_tag_err_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_mem_m_tag_err); + const auto is_operation = View(in.avm_mem_tag_err); const auto is_table_entry = View(in.avm_main_tag_err); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,9 +135,9 @@ class incl_main_tag_err_lookup_settings { return std::forward_as_tuple(in.incl_main_tag_err, in.incl_main_tag_err_counts, - in.avm_mem_m_tag_err, + in.avm_mem_tag_err, in.avm_main_tag_err, - in.avm_mem_m_clk, + in.avm_mem_clk, in.avm_main_clk); } @@ -153,9 +153,9 @@ class incl_main_tag_err_lookup_settings { return std::forward_as_tuple(in.incl_main_tag_err, in.incl_main_tag_err_counts, - in.avm_mem_m_tag_err, + in.avm_mem_tag_err, in.avm_main_tag_err, - in.avm_mem_m_clk, + in.avm_mem_clk, in.avm_main_clk); } }; 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 8c7535bc1c4..94b43658059 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 @@ -87,7 +87,7 @@ class incl_mem_tag_err_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_tag_err == 1 || in.avm_mem_m_tag_err == 1); + return (in.avm_main_tag_err == 1 || in.avm_mem_tag_err == 1); } /** @@ -105,7 +105,7 @@ class incl_mem_tag_err_lookup_settings { { using View = typename Accumulator::View; const auto is_operation = View(in.avm_main_tag_err); - const auto is_table_entry = View(in.avm_mem_m_tag_err); + const auto is_table_entry = View(in.avm_mem_tag_err); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -136,9 +136,9 @@ class incl_mem_tag_err_lookup_settings { return std::forward_as_tuple(in.incl_mem_tag_err, in.incl_mem_tag_err_counts, in.avm_main_tag_err, - in.avm_mem_m_tag_err, + in.avm_mem_tag_err, in.avm_main_clk, - in.avm_mem_m_clk); + in.avm_mem_clk); } /** @@ -154,9 +154,9 @@ class incl_mem_tag_err_lookup_settings { return std::forward_as_tuple(in.incl_mem_tag_err, in.incl_mem_tag_err_counts, in.avm_main_tag_err, - in.avm_mem_m_tag_err, + in.avm_mem_tag_err, in.avm_main_clk, - in.avm_mem_m_clk); + in.avm_mem_clk); } }; 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 434fe76f8fb..8019768c54c 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 @@ -60,16 +60,16 @@ class perm_main_alu_permutation_settings { in.avm_main_sel_op_eq, in.avm_main_sel_op_not, in.avm_main_r_in_tag, - in.avm_alu_alu_clk, - in.avm_alu_alu_ia, - in.avm_alu_alu_ib, - in.avm_alu_alu_ic, - in.avm_alu_alu_op_add, - in.avm_alu_alu_op_sub, - in.avm_alu_alu_op_mul, - in.avm_alu_alu_op_eq, - in.avm_alu_alu_op_not, - in.avm_alu_alu_in_tag); + in.avm_alu_clk, + in.avm_alu_ia, + in.avm_alu_ib, + in.avm_alu_ic, + in.avm_alu_op_add, + in.avm_alu_op_sub, + in.avm_alu_op_mul, + in.avm_alu_op_eq, + in.avm_alu_op_not, + in.avm_alu_in_tag); } /** @@ -106,16 +106,16 @@ class perm_main_alu_permutation_settings { in.avm_main_sel_op_eq, in.avm_main_sel_op_not, in.avm_main_r_in_tag, - in.avm_alu_alu_clk, - in.avm_alu_alu_ia, - in.avm_alu_alu_ib, - in.avm_alu_alu_ic, - in.avm_alu_alu_op_add, - in.avm_alu_alu_op_sub, - in.avm_alu_alu_op_mul, - in.avm_alu_alu_op_eq, - in.avm_alu_alu_op_not, - in.avm_alu_alu_in_tag); + in.avm_alu_clk, + in.avm_alu_ia, + in.avm_alu_ib, + in.avm_alu_ic, + in.avm_alu_op_add, + in.avm_alu_op_sub, + in.avm_alu_op_mul, + in.avm_alu_op_eq, + in.avm_alu_op_not, + in.avm_alu_in_tag); } }; 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 2f98b563669..62e4f48c289 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 @@ -23,7 +23,7 @@ class perm_main_mem_a_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_mem_op_a == 1 || in.avm_mem_m_op_a == 1); + return (in.avm_main_mem_op_a == 1 || in.avm_mem_op_a == 1); } /** @@ -49,7 +49,7 @@ class perm_main_mem_a_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_a, in.avm_main_mem_op_a, in.avm_main_mem_op_a, - in.avm_mem_m_op_a, + in.avm_mem_op_a, in.avm_main_clk, in.avm_main_mem_idx_a, in.avm_main_ia, @@ -57,13 +57,13 @@ class perm_main_mem_a_permutation_settings { in.avm_main_r_in_tag, in.avm_main_w_in_tag, in.avm_main_sel_mov, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val, - in.avm_mem_m_rw, + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val, + in.avm_mem_rw, in.avm_mem_r_in_tag, in.avm_mem_w_in_tag, - in.avm_mem_m_sel_mov); + in.avm_mem_sel_mov); } /** @@ -89,7 +89,7 @@ class perm_main_mem_a_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_a, in.avm_main_mem_op_a, in.avm_main_mem_op_a, - in.avm_mem_m_op_a, + in.avm_mem_op_a, in.avm_main_clk, in.avm_main_mem_idx_a, in.avm_main_ia, @@ -97,13 +97,13 @@ class perm_main_mem_a_permutation_settings { in.avm_main_r_in_tag, in.avm_main_w_in_tag, in.avm_main_sel_mov, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val, - in.avm_mem_m_rw, + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val, + in.avm_mem_rw, in.avm_mem_r_in_tag, in.avm_mem_w_in_tag, - in.avm_mem_m_sel_mov); + in.avm_mem_sel_mov); } }; 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 743b546a204..4da414817f1 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 @@ -23,7 +23,7 @@ class perm_main_mem_b_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_mem_op_b == 1 || in.avm_mem_m_op_b == 1); + return (in.avm_main_mem_op_b == 1 || in.avm_mem_op_b == 1); } /** @@ -49,17 +49,17 @@ class perm_main_mem_b_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_b, in.avm_main_mem_op_b, in.avm_main_mem_op_b, - in.avm_mem_m_op_b, + in.avm_mem_op_b, in.avm_main_clk, in.avm_main_mem_idx_b, in.avm_main_ib, in.avm_main_rwb, in.avm_main_r_in_tag, in.avm_main_w_in_tag, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val, - in.avm_mem_m_rw, + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val, + in.avm_mem_rw, in.avm_mem_r_in_tag, in.avm_mem_w_in_tag); } @@ -87,17 +87,17 @@ class perm_main_mem_b_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_b, in.avm_main_mem_op_b, in.avm_main_mem_op_b, - in.avm_mem_m_op_b, + in.avm_mem_op_b, in.avm_main_clk, in.avm_main_mem_idx_b, in.avm_main_ib, in.avm_main_rwb, in.avm_main_r_in_tag, in.avm_main_w_in_tag, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val, - in.avm_mem_m_rw, + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val, + in.avm_mem_rw, in.avm_mem_r_in_tag, in.avm_mem_w_in_tag); } 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 cd1a4e071d2..5db71414a95 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 @@ -23,7 +23,7 @@ class perm_main_mem_c_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_mem_op_c == 1 || in.avm_mem_m_op_c == 1); + return (in.avm_main_mem_op_c == 1 || in.avm_mem_op_c == 1); } /** @@ -49,17 +49,17 @@ class perm_main_mem_c_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_c, in.avm_main_mem_op_c, in.avm_main_mem_op_c, - in.avm_mem_m_op_c, + in.avm_mem_op_c, in.avm_main_clk, in.avm_main_mem_idx_c, in.avm_main_ic, in.avm_main_rwc, in.avm_main_r_in_tag, in.avm_main_w_in_tag, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val, - in.avm_mem_m_rw, + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val, + in.avm_mem_rw, in.avm_mem_r_in_tag, in.avm_mem_w_in_tag); } @@ -87,17 +87,17 @@ class perm_main_mem_c_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_c, in.avm_main_mem_op_c, in.avm_main_mem_op_c, - in.avm_mem_m_op_c, + in.avm_mem_op_c, in.avm_main_clk, in.avm_main_mem_idx_c, in.avm_main_ic, in.avm_main_rwc, in.avm_main_r_in_tag, in.avm_main_w_in_tag, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val, - in.avm_mem_m_rw, + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val, + in.avm_mem_rw, in.avm_mem_r_in_tag, in.avm_mem_w_in_tag); } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_a.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_a.hpp index 71f8af97195..10504566450 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_a.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_a.hpp @@ -23,7 +23,7 @@ class perm_main_mem_ind_a_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_ind_op_a == 1 || in.avm_mem_m_ind_op_a == 1); + return (in.avm_main_ind_op_a == 1 || in.avm_mem_ind_op_a == 1); } /** @@ -49,13 +49,13 @@ class perm_main_mem_ind_a_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_ind_a, in.avm_main_ind_op_a, in.avm_main_ind_op_a, - in.avm_mem_m_ind_op_a, + in.avm_mem_ind_op_a, in.avm_main_clk, in.avm_main_ind_a, in.avm_main_mem_idx_a, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val); + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val); } /** @@ -81,13 +81,13 @@ class perm_main_mem_ind_a_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_ind_a, in.avm_main_ind_op_a, in.avm_main_ind_op_a, - in.avm_mem_m_ind_op_a, + in.avm_mem_ind_op_a, in.avm_main_clk, in.avm_main_ind_a, in.avm_main_mem_idx_a, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val); + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_b.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_b.hpp index 755defdf4b9..2214f7d0bd1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_b.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_b.hpp @@ -23,7 +23,7 @@ class perm_main_mem_ind_b_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_ind_op_b == 1 || in.avm_mem_m_ind_op_b == 1); + return (in.avm_main_ind_op_b == 1 || in.avm_mem_ind_op_b == 1); } /** @@ -49,13 +49,13 @@ class perm_main_mem_ind_b_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_ind_b, in.avm_main_ind_op_b, in.avm_main_ind_op_b, - in.avm_mem_m_ind_op_b, + in.avm_mem_ind_op_b, in.avm_main_clk, in.avm_main_ind_b, in.avm_main_mem_idx_b, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val); + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val); } /** @@ -81,13 +81,13 @@ class perm_main_mem_ind_b_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_ind_b, in.avm_main_ind_op_b, in.avm_main_ind_op_b, - in.avm_mem_m_ind_op_b, + in.avm_mem_ind_op_b, in.avm_main_clk, in.avm_main_ind_b, in.avm_main_mem_idx_b, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val); + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_c.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_c.hpp index 73f9fe5638a..37bdc19f975 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_c.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_c.hpp @@ -23,7 +23,7 @@ class perm_main_mem_ind_c_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_ind_op_c == 1 || in.avm_mem_m_ind_op_c == 1); + return (in.avm_main_ind_op_c == 1 || in.avm_mem_ind_op_c == 1); } /** @@ -49,13 +49,13 @@ class perm_main_mem_ind_c_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_ind_c, in.avm_main_ind_op_c, in.avm_main_ind_op_c, - in.avm_mem_m_ind_op_c, + in.avm_mem_ind_op_c, in.avm_main_clk, in.avm_main_ind_c, in.avm_main_mem_idx_c, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val); + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val); } /** @@ -81,13 +81,13 @@ class perm_main_mem_ind_c_permutation_settings { return std::forward_as_tuple(in.perm_main_mem_ind_c, in.avm_main_ind_op_c, in.avm_main_ind_op_c, - in.avm_mem_m_ind_op_c, + in.avm_mem_ind_op_c, in.avm_main_clk, in.avm_main_ind_c, in.avm_main_mem_idx_c, - in.avm_mem_m_clk, - in.avm_mem_m_addr, - in.avm_mem_m_val); + in.avm_mem_clk, + in.avm_mem_addr, + in.avm_mem_val); } }; 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 104f3de530f..71bc1b292ae 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp @@ -19,20 +19,20 @@ void log_avm_trace(std::vector const& trace, size_t beg, size_t end, bool e info("====================================================================================="); info("=======MEMORY TRACE=================================================================="); - info("m_addr: ", trace.at(i).avm_mem_m_addr); - info("m_clk: ", trace.at(i).avm_mem_m_clk); - info("m_sub_clk: ", trace.at(i).avm_mem_m_sub_clk); - info("m_val: ", trace.at(i).avm_mem_m_val); - info("m_rw: ", trace.at(i).avm_mem_m_rw); - info("m_tag: ", trace.at(i).avm_mem_m_tag); + info("m_addr: ", trace.at(i).avm_mem_addr); + info("m_clk: ", trace.at(i).avm_mem_clk); + info("m_sub_clk: ", trace.at(i).avm_mem_sub_clk); + info("m_val: ", trace.at(i).avm_mem_val); + info("m_rw: ", trace.at(i).avm_mem_rw); + info("m_tag: ", trace.at(i).avm_mem_tag); info("r_in_tag: ", trace.at(i).avm_mem_r_in_tag); info("w_in_tag: ", trace.at(i).avm_mem_w_in_tag); - info("m_tag_err: ", trace.at(i).avm_mem_m_tag_err); - info("m_one_min_inv: ", trace.at(i).avm_mem_m_one_min_inv); + info("m_tag_err: ", trace.at(i).avm_mem_tag_err); + info("m_one_min_inv: ", trace.at(i).avm_mem_one_min_inv); - info("m_lastAccess: ", trace.at(i).avm_mem_m_lastAccess); - info("m_last: ", trace.at(i).avm_mem_m_last); - info("m_val_shift: ", trace.at(i).avm_mem_m_val_shift); + info("m_lastAccess: ", trace.at(i).avm_mem_lastAccess); + info("m_last: ", trace.at(i).avm_mem_last); + info("m_val_shift: ", trace.at(i).avm_mem_val_shift); info("=======CONTROL_FLOW==================================================================="); info("pc: ", trace.at(i).avm_main_pc); @@ -41,10 +41,10 @@ void log_avm_trace(std::vector const& trace, size_t beg, size_t end, bool e info("internal_return_ptr:", trace.at(i).avm_main_internal_return_ptr); info("=======ALU TRACE====================================================================="); - info("alu_clk ", trace.at(i).avm_alu_alu_clk); - info("alu_ia ", trace.at(i).avm_alu_alu_ia); - info("alu_ib ", trace.at(i).avm_alu_alu_ib); - info("alu_ic ", trace.at(i).avm_alu_alu_ic); + info("alu_clk ", trace.at(i).avm_alu_clk); + info("alu_ia ", trace.at(i).avm_alu_ia); + info("alu_ib ", trace.at(i).avm_alu_ib); + info("alu_ic ", trace.at(i).avm_alu_ic); info("=======MAIN TRACE===================================================================="); info("clk: ", trace.at(i).avm_main_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 0bbb9748f0a..220904058d2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -119,28 +119,28 @@ void AvmTraceBuilder::op_add( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_add = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = a, .avm_main_ib = b, .avm_main_ic = c, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(res.direct_a_offset), .avm_main_mem_idx_b = FF(res.direct_b_offset), .avm_main_mem_idx_c = FF(res.direct_dst_offset), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_add = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -182,28 +182,28 @@ void AvmTraceBuilder::op_sub( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_sub = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = a, .avm_main_ib = b, .avm_main_ic = c, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(res.direct_a_offset), .avm_main_mem_idx_b = FF(res.direct_b_offset), .avm_main_mem_idx_c = FF(res.direct_dst_offset), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_sub = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -245,28 +245,28 @@ void AvmTraceBuilder::op_mul( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_mul = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = a, .avm_main_ib = b, .avm_main_ic = c, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(res.direct_a_offset), .avm_main_mem_idx_b = FF(res.direct_b_offset), .avm_main_mem_idx_c = FF(res.direct_dst_offset), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_mul = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -317,30 +317,30 @@ void AvmTraceBuilder::op_div( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_div = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), - .avm_main_op_err = tag_match ? error : FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_inv = tag_match ? inv : FF(1), .avm_main_ia = tag_match ? a : FF(0), .avm_main_ib = tag_match ? b : FF(0), .avm_main_ic = tag_match ? c : FF(0), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_inv = tag_match ? inv : FF(1), .avm_main_mem_idx_a = FF(res.direct_a_offset), .avm_main_mem_idx_b = FF(res.direct_b_offset), .avm_main_mem_idx_c = FF(res.direct_dst_offset), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_op_err = tag_match ? error : FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_div = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -391,23 +391,23 @@ void AvmTraceBuilder::op_not(uint8_t indirect, uint32_t a_offset, uint32_t dst_o main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_not = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), - .avm_main_tag_err = FF(static_cast(!read_a.tag_match)), .avm_main_ia = a, .avm_main_ic = c, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = indirect_a_flag ? FF(a_offset) : FF(0), .avm_main_ind_c = indirect_c_flag ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(indirect_a_flag)), .avm_main_ind_op_c = FF(static_cast(indirect_c_flag)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(direct_a_offset), .avm_main_mem_idx_c = FF(direct_dst_offset), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_not = FF(1), + .avm_main_tag_err = FF(static_cast(!read_a.tag_match)), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -448,28 +448,28 @@ void AvmTraceBuilder::op_eq( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_eq = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = a, .avm_main_ib = b, .avm_main_ic = c, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(res.direct_a_offset), .avm_main_mem_idx_b = FF(res.direct_b_offset), .avm_main_mem_idx_c = FF(res.direct_dst_offset), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_eq = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); } @@ -498,30 +498,30 @@ void AvmTraceBuilder::op_and( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_and = FF(1), + .avm_main_bin_op_id = FF(0), .avm_main_bin_sel = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = a, .avm_main_ib = b, .avm_main_ic = c, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(res.direct_a_offset), .avm_main_mem_idx_b = FF(res.direct_b_offset), .avm_main_mem_idx_c = FF(res.direct_dst_offset), - .avm_main_bin_op_id = FF(0), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_and = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -550,30 +550,30 @@ void AvmTraceBuilder::op_or( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_or = FF(1), + .avm_main_bin_op_id = FF(1), .avm_main_bin_sel = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = a, .avm_main_ib = b, .avm_main_ic = c, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(res.direct_a_offset), .avm_main_mem_idx_b = FF(res.direct_b_offset), .avm_main_mem_idx_c = FF(res.direct_dst_offset), - .avm_main_bin_op_id = FF(1), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_or = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -602,30 +602,30 @@ void AvmTraceBuilder::op_xor( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_op_xor = FF(1), + .avm_main_bin_op_id = FF(2), .avm_main_bin_sel = FF(1), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = a, .avm_main_ib = b, .avm_main_ic = c, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_rwc = FF(1), .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(res.direct_a_offset), .avm_main_mem_idx_b = FF(res.direct_b_offset), .avm_main_mem_idx_c = FF(res.direct_dst_offset), - .avm_main_bin_op_id = FF(2), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(in_tag)), + .avm_main_rwc = FF(1), + .avm_main_sel_op_xor = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -651,13 +651,13 @@ void AvmTraceBuilder::set(uint128_t val, uint32_t dst_offset, AvmMemoryTag in_ta main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_w_in_tag = FF(static_cast(in_tag)), .avm_main_ic = val_ff, + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_c = FF(dst_offset), .avm_main_mem_op_c = FF(1), + .avm_main_pc = FF(pc++), .avm_main_rwc = FF(1), - .avm_main_mem_idx_c = FF(dst_offset), + .avm_main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -701,23 +701,23 @@ void AvmTraceBuilder::op_mov(uint8_t indirect, uint32_t src_offset, uint32_t dst main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = pc++, - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_sel_mov = 1, - .avm_main_r_in_tag = static_cast(tag), - .avm_main_w_in_tag = static_cast(tag), - .avm_main_tag_err = static_cast(!tag_match), .avm_main_ia = val, .avm_main_ic = val, - .avm_main_mem_op_a = 1, - .avm_main_mem_op_c = 1, - .avm_main_rwc = 1, .avm_main_ind_a = indirect_src_flag ? src_offset : 0, .avm_main_ind_c = indirect_dst_flag ? dst_offset : 0, .avm_main_ind_op_a = static_cast(indirect_src_flag), .avm_main_ind_op_c = static_cast(indirect_dst_flag), + .avm_main_internal_return_ptr = internal_return_ptr, .avm_main_mem_idx_a = direct_src_offset, .avm_main_mem_idx_c = direct_dst_offset, + .avm_main_mem_op_a = 1, + .avm_main_mem_op_c = 1, + .avm_main_pc = pc++, + .avm_main_r_in_tag = static_cast(tag), + .avm_main_rwc = 1, + .avm_main_sel_mov = 1, + .avm_main_tag_err = static_cast(!tag_match), + .avm_main_w_in_tag = static_cast(tag), }); } @@ -810,24 +810,24 @@ void AvmTraceBuilder::calldata_copy( main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc++), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = ia, .avm_main_ib = ib, .avm_main_ic = ic, + .avm_main_ind_a = indirect_flag ? FF(dst_offset) : FF(0), + .avm_main_ind_op_a = FF(static_cast(indirect_flag)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_a = FF(mem_idx_a), + .avm_main_mem_idx_b = FF(mem_idx_b), + .avm_main_mem_idx_c = FF(mem_idx_c), .avm_main_mem_op_a = FF(mem_op_a), .avm_main_mem_op_b = FF(mem_op_b), .avm_main_mem_op_c = FF(mem_op_c), + .avm_main_pc = FF(pc++), .avm_main_rwa = FF(rwa), .avm_main_rwb = FF(rwb), .avm_main_rwc = FF(rwc), - .avm_main_ind_a = indirect_flag ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_flag)), - .avm_main_mem_idx_a = FF(mem_idx_a), - .avm_main_mem_idx_b = FF(mem_idx_b), - .avm_main_mem_idx_c = FF(mem_idx_c), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); if (copy_size - pos > 2) { // Guard to prevent overflow if copy_size is close to uint32_t maximum value. @@ -929,23 +929,23 @@ std::vector AvmTraceBuilder::return_op(uint8_t indirect, uint32_t ret_offset main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_halt = FF(1), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_tag_err = FF(static_cast(!tag_match)), .avm_main_ia = ia, .avm_main_ib = ib, .avm_main_ic = ic, - .avm_main_mem_op_a = FF(mem_op_a), - .avm_main_mem_op_b = FF(mem_op_b), - .avm_main_mem_op_c = FF(mem_op_c), .avm_main_ind_a = indirect_flag ? FF(ret_offset) : FF(0), .avm_main_ind_op_a = FF(static_cast(indirect_flag)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), .avm_main_mem_idx_a = FF(mem_idx_a), .avm_main_mem_idx_b = FF(mem_idx_b), .avm_main_mem_idx_c = FF(mem_idx_c), + .avm_main_mem_op_a = FF(mem_op_a), + .avm_main_mem_op_b = FF(mem_op_b), + .avm_main_mem_op_c = FF(mem_op_c), + .avm_main_pc = FF(pc), + .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .avm_main_sel_halt = FF(1), + .avm_main_tag_err = FF(static_cast(!tag_match)), + .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); if (ret_size - pos > 2) { // Guard to prevent overflow if ret_size is close to uint32_t maximum value. @@ -970,8 +970,8 @@ void AvmTraceBuilder::halt() main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc), .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_pc = FF(pc), .avm_main_sel_halt = FF(1), }); @@ -992,10 +992,10 @@ void AvmTraceBuilder::jump(uint32_t jmp_dest) main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc), + .avm_main_ia = FF(jmp_dest), .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_pc = FF(pc), .avm_main_sel_jump = FF(1), - .avm_main_ia = FF(jmp_dest), }); // Adjust parameters for the next row @@ -1029,15 +1029,15 @@ void AvmTraceBuilder::internal_call(uint32_t jmp_dest) main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = FF(pc), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_internal_call = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), .avm_main_ia = FF(jmp_dest), .avm_main_ib = FF(stored_pc), + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_b = FF(internal_return_ptr), .avm_main_mem_op_b = FF(1), + .avm_main_pc = FF(pc), .avm_main_rwb = FF(1), - .avm_main_mem_idx_b = FF(internal_return_ptr), + .avm_main_sel_internal_call = FF(1), + .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), }); // Adjust parameters for the next row @@ -1067,15 +1067,15 @@ void AvmTraceBuilder::internal_return() main_trace.push_back(Row{ .avm_main_clk = clk, - .avm_main_pc = pc, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_sel_internal_return = FF(1), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), - .avm_main_tag_err = FF(static_cast(!read_a.tag_match)), .avm_main_ia = read_a.val, + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_a = FF(internal_return_ptr - 1), .avm_main_mem_op_a = FF(1), + .avm_main_pc = pc, + .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), .avm_main_rwa = FF(0), - .avm_main_mem_idx_a = FF(internal_return_ptr - 1), + .avm_main_sel_internal_return = FF(1), + .avm_main_tag_err = FF(static_cast(!read_a.tag_match)), }); // We want the next row to be the one pointed by jmp_dest @@ -1142,41 +1142,41 @@ std::vector AvmTraceBuilder::finalize() auto const& src = mem_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_mem_m_clk = FF(src.m_clk); - dest.avm_mem_m_sub_clk = FF(src.m_sub_clk); - dest.avm_mem_m_addr = FF(src.m_addr); - dest.avm_mem_m_val = src.m_val; - dest.avm_mem_m_rw = FF(static_cast(src.m_rw)); + dest.avm_mem_clk = FF(src.m_clk); + dest.avm_mem_sub_clk = FF(src.m_sub_clk); + dest.avm_mem_addr = FF(src.m_addr); + dest.avm_mem_val = src.m_val; + dest.avm_mem_rw = FF(static_cast(src.m_rw)); dest.avm_mem_r_in_tag = FF(static_cast(src.r_in_tag)); dest.avm_mem_w_in_tag = FF(static_cast(src.w_in_tag)); - dest.avm_mem_m_tag = FF(static_cast(src.m_tag)); - dest.avm_mem_m_tag_err = FF(static_cast(src.m_tag_err)); - dest.avm_mem_m_one_min_inv = src.m_one_min_inv; - dest.avm_mem_m_sel_mov = FF(static_cast(src.m_sel_mov)); + dest.avm_mem_tag = FF(static_cast(src.m_tag)); + dest.avm_mem_tag_err = FF(static_cast(src.m_tag_err)); + dest.avm_mem_one_min_inv = src.m_one_min_inv; + dest.avm_mem_sel_mov = FF(static_cast(src.m_sel_mov)); 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.avm_mem_m_op_a = 1; + dest.avm_mem_op_a = 1; break; case AvmMemTraceBuilder::SUB_CLK_LOAD_B: case AvmMemTraceBuilder::SUB_CLK_STORE_B: - dest.avm_mem_m_op_b = 1; + dest.avm_mem_op_b = 1; break; case AvmMemTraceBuilder::SUB_CLK_LOAD_C: case AvmMemTraceBuilder::SUB_CLK_STORE_C: - dest.avm_mem_m_op_c = 1; + dest.avm_mem_op_c = 1; break; case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_A: - dest.avm_mem_m_ind_op_a = 1; + dest.avm_mem_ind_op_a = 1; break; case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_B: - dest.avm_mem_m_ind_op_b = 1; + dest.avm_mem_ind_op_b = 1; break; case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_C: - dest.avm_mem_m_ind_op_c = 1; + dest.avm_mem_ind_op_c = 1; break; default: break; @@ -1184,10 +1184,10 @@ std::vector AvmTraceBuilder::finalize() if (i + 1 < mem_trace_size) { auto const& next = mem_trace.at(i + 1); - dest.avm_mem_m_lastAccess = FF(static_cast(src.m_addr != next.m_addr)); + dest.avm_mem_lastAccess = FF(static_cast(src.m_addr != next.m_addr)); } else { - dest.avm_mem_m_lastAccess = FF(1); - dest.avm_mem_m_last = FF(1); + dest.avm_mem_lastAccess = FF(1); + dest.avm_mem_last = FF(1); } } @@ -1196,50 +1196,50 @@ std::vector AvmTraceBuilder::finalize() auto const& src = alu_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_alu_alu_clk = FF(static_cast(src.alu_clk)); + dest.avm_alu_clk = FF(static_cast(src.alu_clk)); - dest.avm_alu_alu_op_add = FF(static_cast(src.alu_op_add)); - dest.avm_alu_alu_op_sub = FF(static_cast(src.alu_op_sub)); - dest.avm_alu_alu_op_mul = FF(static_cast(src.alu_op_mul)); - dest.avm_alu_alu_op_not = FF(static_cast(src.alu_op_not)); - dest.avm_alu_alu_op_eq = FF(static_cast(src.alu_op_eq)); + dest.avm_alu_op_add = FF(static_cast(src.alu_op_add)); + dest.avm_alu_op_sub = FF(static_cast(src.alu_op_sub)); + dest.avm_alu_op_mul = FF(static_cast(src.alu_op_mul)); + dest.avm_alu_op_not = FF(static_cast(src.alu_op_not)); + dest.avm_alu_op_eq = FF(static_cast(src.alu_op_eq)); - dest.avm_alu_alu_ff_tag = FF(static_cast(src.alu_ff_tag)); - dest.avm_alu_alu_u8_tag = FF(static_cast(src.alu_u8_tag)); - dest.avm_alu_alu_u16_tag = FF(static_cast(src.alu_u16_tag)); - dest.avm_alu_alu_u32_tag = FF(static_cast(src.alu_u32_tag)); - dest.avm_alu_alu_u64_tag = FF(static_cast(src.alu_u64_tag)); - dest.avm_alu_alu_u128_tag = FF(static_cast(src.alu_u128_tag)); + dest.avm_alu_ff_tag = FF(static_cast(src.alu_ff_tag)); + dest.avm_alu_u8_tag = FF(static_cast(src.alu_u8_tag)); + dest.avm_alu_u16_tag = FF(static_cast(src.alu_u16_tag)); + dest.avm_alu_u32_tag = FF(static_cast(src.alu_u32_tag)); + dest.avm_alu_u64_tag = FF(static_cast(src.alu_u64_tag)); + dest.avm_alu_u128_tag = FF(static_cast(src.alu_u128_tag)); - dest.avm_alu_alu_in_tag = dest.avm_alu_alu_u8_tag + FF(2) * dest.avm_alu_alu_u16_tag + - FF(3) * dest.avm_alu_alu_u32_tag + FF(4) * dest.avm_alu_alu_u64_tag + - FF(5) * dest.avm_alu_alu_u128_tag + FF(6) * dest.avm_alu_alu_ff_tag; + dest.avm_alu_in_tag = dest.avm_alu_u8_tag + FF(2) * dest.avm_alu_u16_tag + FF(3) * dest.avm_alu_u32_tag + + FF(4) * dest.avm_alu_u64_tag + FF(5) * dest.avm_alu_u128_tag + + FF(6) * dest.avm_alu_ff_tag; - dest.avm_alu_alu_ia = src.alu_ia; - dest.avm_alu_alu_ib = src.alu_ib; - dest.avm_alu_alu_ic = src.alu_ic; + dest.avm_alu_ia = src.alu_ia; + dest.avm_alu_ib = src.alu_ib; + dest.avm_alu_ic = src.alu_ic; - dest.avm_alu_alu_cf = FF(static_cast(src.alu_cf)); + dest.avm_alu_cf = FF(static_cast(src.alu_cf)); - dest.avm_alu_alu_u8_r0 = FF(src.alu_u8_r0); - dest.avm_alu_alu_u8_r1 = FF(src.alu_u8_r1); + dest.avm_alu_u8_r0 = FF(src.alu_u8_r0); + dest.avm_alu_u8_r1 = FF(src.alu_u8_r1); - dest.avm_alu_alu_u16_r0 = FF(src.alu_u16_reg.at(0)); - dest.avm_alu_alu_u16_r1 = FF(src.alu_u16_reg.at(1)); - dest.avm_alu_alu_u16_r2 = FF(src.alu_u16_reg.at(2)); - dest.avm_alu_alu_u16_r3 = FF(src.alu_u16_reg.at(3)); - dest.avm_alu_alu_u16_r4 = FF(src.alu_u16_reg.at(4)); - dest.avm_alu_alu_u16_r5 = FF(src.alu_u16_reg.at(5)); - dest.avm_alu_alu_u16_r6 = FF(src.alu_u16_reg.at(6)); - dest.avm_alu_alu_u16_r7 = FF(src.alu_u16_reg.at(7)); + dest.avm_alu_u16_r0 = FF(src.alu_u16_reg.at(0)); + dest.avm_alu_u16_r1 = FF(src.alu_u16_reg.at(1)); + dest.avm_alu_u16_r2 = FF(src.alu_u16_reg.at(2)); + dest.avm_alu_u16_r3 = FF(src.alu_u16_reg.at(3)); + dest.avm_alu_u16_r4 = FF(src.alu_u16_reg.at(4)); + dest.avm_alu_u16_r5 = FF(src.alu_u16_reg.at(5)); + dest.avm_alu_u16_r6 = FF(src.alu_u16_reg.at(6)); + dest.avm_alu_u16_r7 = FF(src.alu_u16_reg.at(7)); - dest.avm_alu_alu_u64_r0 = FF(src.alu_u64_r0); - dest.avm_alu_alu_op_eq_diff_inv = FF(src.alu_op_eq_diff_inv); + dest.avm_alu_u64_r0 = FF(src.alu_u64_r0); + dest.avm_alu_op_eq_diff_inv = FF(src.alu_op_eq_diff_inv); // Not all rows in ALU are enabled with a selector. For instance, // multiplication over u128 is taking two lines. - if (dest.avm_alu_alu_op_add == FF(1) || dest.avm_alu_alu_op_sub == FF(1) || dest.avm_alu_alu_op_mul == FF(1) || - dest.avm_alu_alu_op_eq == FF(1) || dest.avm_alu_alu_op_not == FF(1)) { + if (dest.avm_alu_op_add == FF(1) || dest.avm_alu_op_sub == FF(1) || dest.avm_alu_op_mul == FF(1) || + dest.avm_alu_op_eq == FF(1) || dest.avm_alu_op_not == FF(1)) { dest.avm_alu_alu_sel = FF(1); } } @@ -1330,7 +1330,7 @@ std::vector AvmTraceBuilder::finalize() } } // Adding extra row for the shifted values at the top of the execution trace. - Row first_row = Row{ .avm_main_first = FF(1), .avm_mem_m_lastAccess = FF(1) }; + Row first_row = Row{ .avm_main_first = FF(1), .avm_mem_lastAccess = FF(1) }; main_trace.insert(main_trace.begin(), first_row); auto trace = std::move(main_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 2927780ebf2..2dab6689df6 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -34,121 +34,121 @@ namespace bb { template struct AvmFullRow { FF avm_main_clk{}; FF avm_main_first{}; - FF avm_mem_m_clk{}; - FF avm_mem_m_sub_clk{}; - FF avm_mem_m_addr{}; - FF avm_mem_m_tag{}; - FF avm_mem_m_val{}; - FF avm_mem_m_lastAccess{}; - FF avm_mem_m_last{}; - FF avm_mem_m_rw{}; - FF avm_mem_r_in_tag{}; - FF avm_mem_w_in_tag{}; - FF avm_mem_m_op_a{}; - FF avm_mem_m_op_b{}; - FF avm_mem_m_op_c{}; - FF avm_mem_m_ind_op_a{}; - FF avm_mem_m_ind_op_b{}; - FF avm_mem_m_ind_op_c{}; - FF avm_mem_m_sel_mov{}; - FF avm_mem_m_tag_err{}; - FF avm_mem_m_one_min_inv{}; - FF avm_alu_alu_clk{}; - FF avm_alu_alu_ia{}; - FF avm_alu_alu_ib{}; - FF avm_alu_alu_ic{}; - FF avm_alu_alu_op_add{}; - FF avm_alu_alu_op_sub{}; - FF avm_alu_alu_op_mul{}; - FF avm_alu_alu_op_div{}; - FF avm_alu_alu_op_not{}; - FF avm_alu_alu_op_eq{}; FF avm_alu_alu_sel{}; - FF avm_alu_alu_in_tag{}; - FF avm_alu_alu_ff_tag{}; - FF avm_alu_alu_u8_tag{}; - FF avm_alu_alu_u16_tag{}; - FF avm_alu_alu_u32_tag{}; - FF avm_alu_alu_u64_tag{}; - FF avm_alu_alu_u128_tag{}; - FF avm_alu_alu_u8_r0{}; - FF avm_alu_alu_u8_r1{}; - FF avm_alu_alu_u16_r0{}; - FF avm_alu_alu_u16_r1{}; - FF avm_alu_alu_u16_r2{}; - FF avm_alu_alu_u16_r3{}; - FF avm_alu_alu_u16_r4{}; - FF avm_alu_alu_u16_r5{}; - FF avm_alu_alu_u16_r6{}; - FF avm_alu_alu_u16_r7{}; - FF avm_alu_alu_u64_r0{}; - FF avm_alu_alu_cf{}; - FF avm_alu_alu_op_eq_diff_inv{}; - FF avm_byte_lookup_table_op_id{}; - FF avm_byte_lookup_table_input_a{}; - FF avm_byte_lookup_table_input_b{}; - FF avm_byte_lookup_table_output{}; - FF avm_byte_lookup_bin_sel{}; - FF avm_byte_lookup_table_in_tags{}; - FF avm_byte_lookup_table_byte_lengths{}; - FF avm_binary_bin_clk{}; - FF avm_binary_bin_sel{}; + FF avm_alu_cf{}; + FF avm_alu_clk{}; + FF avm_alu_ff_tag{}; + FF avm_alu_ia{}; + FF avm_alu_ib{}; + FF avm_alu_ic{}; + FF avm_alu_in_tag{}; + FF avm_alu_op_add{}; + FF avm_alu_op_div{}; + FF avm_alu_op_eq{}; + FF avm_alu_op_eq_diff_inv{}; + FF avm_alu_op_mul{}; + FF avm_alu_op_not{}; + FF avm_alu_op_sub{}; + FF avm_alu_u128_tag{}; + FF avm_alu_u16_r0{}; + FF avm_alu_u16_r1{}; + FF avm_alu_u16_r2{}; + FF avm_alu_u16_r3{}; + FF avm_alu_u16_r4{}; + FF avm_alu_u16_r5{}; + FF avm_alu_u16_r6{}; + FF avm_alu_u16_r7{}; + FF avm_alu_u16_tag{}; + FF avm_alu_u32_tag{}; + FF avm_alu_u64_r0{}; + FF avm_alu_u64_tag{}; + FF avm_alu_u8_r0{}; + FF avm_alu_u8_r1{}; + FF avm_alu_u8_tag{}; FF avm_binary_acc_ia{}; FF avm_binary_acc_ib{}; FF avm_binary_acc_ic{}; - FF avm_binary_in_tag{}; - FF avm_binary_op_id{}; + FF avm_binary_bin_clk{}; FF avm_binary_bin_ia_bytes{}; FF avm_binary_bin_ib_bytes{}; FF avm_binary_bin_ic_bytes{}; - FF avm_binary_start{}; + FF avm_binary_bin_sel{}; + FF avm_binary_in_tag{}; FF avm_binary_mem_tag_ctr{}; FF avm_binary_mem_tag_ctr_inv{}; - FF avm_main_sel_rng_8{}; - FF avm_main_sel_rng_16{}; - FF avm_main_pc{}; - FF avm_main_internal_return_ptr{}; - FF avm_main_sel_internal_call{}; - FF avm_main_sel_internal_return{}; - FF avm_main_sel_jump{}; - FF avm_main_sel_halt{}; - FF avm_main_sel_mov{}; - FF avm_main_sel_op_add{}; - FF avm_main_sel_op_sub{}; - FF avm_main_sel_op_mul{}; - FF avm_main_sel_op_div{}; - FF avm_main_sel_op_not{}; - FF avm_main_sel_op_eq{}; - FF avm_main_sel_op_and{}; - FF avm_main_sel_op_or{}; - FF avm_main_sel_op_xor{}; + FF avm_binary_op_id{}; + FF avm_binary_start{}; + FF avm_byte_lookup_bin_sel{}; + FF avm_byte_lookup_table_byte_lengths{}; + FF avm_byte_lookup_table_in_tags{}; + FF avm_byte_lookup_table_input_a{}; + FF avm_byte_lookup_table_input_b{}; + FF avm_byte_lookup_table_op_id{}; + FF avm_byte_lookup_table_output{}; FF avm_main_alu_sel{}; + FF avm_main_bin_op_id{}; FF avm_main_bin_sel{}; - FF avm_main_r_in_tag{}; - FF avm_main_w_in_tag{}; - FF avm_main_op_err{}; - FF avm_main_tag_err{}; - FF avm_main_inv{}; FF avm_main_ia{}; FF avm_main_ib{}; FF avm_main_ic{}; - FF avm_main_mem_op_a{}; - FF avm_main_mem_op_b{}; - FF avm_main_mem_op_c{}; - FF avm_main_rwa{}; - FF avm_main_rwb{}; - FF avm_main_rwc{}; FF avm_main_ind_a{}; FF avm_main_ind_b{}; FF avm_main_ind_c{}; FF avm_main_ind_op_a{}; FF avm_main_ind_op_b{}; FF avm_main_ind_op_c{}; + FF avm_main_internal_return_ptr{}; + FF avm_main_inv{}; + FF avm_main_last{}; FF avm_main_mem_idx_a{}; FF avm_main_mem_idx_b{}; FF avm_main_mem_idx_c{}; - FF avm_main_last{}; - FF avm_main_bin_op_id{}; + FF avm_main_mem_op_a{}; + FF avm_main_mem_op_b{}; + FF avm_main_mem_op_c{}; + FF avm_main_op_err{}; + FF avm_main_pc{}; + FF avm_main_r_in_tag{}; + FF avm_main_rwa{}; + FF avm_main_rwb{}; + FF avm_main_rwc{}; + FF avm_main_sel_halt{}; + FF avm_main_sel_internal_call{}; + FF avm_main_sel_internal_return{}; + FF avm_main_sel_jump{}; + FF avm_main_sel_mov{}; + FF avm_main_sel_op_add{}; + FF avm_main_sel_op_and{}; + FF avm_main_sel_op_div{}; + FF avm_main_sel_op_eq{}; + FF avm_main_sel_op_mul{}; + FF avm_main_sel_op_not{}; + FF avm_main_sel_op_or{}; + FF avm_main_sel_op_sub{}; + FF avm_main_sel_op_xor{}; + FF avm_main_sel_rng_16{}; + FF avm_main_sel_rng_8{}; + FF avm_main_tag_err{}; + FF avm_main_w_in_tag{}; + FF avm_mem_addr{}; + FF avm_mem_clk{}; + FF avm_mem_ind_op_a{}; + FF avm_mem_ind_op_b{}; + FF avm_mem_ind_op_c{}; + FF avm_mem_last{}; + FF avm_mem_lastAccess{}; + FF avm_mem_one_min_inv{}; + FF avm_mem_op_a{}; + FF avm_mem_op_b{}; + FF avm_mem_op_c{}; + FF avm_mem_r_in_tag{}; + FF avm_mem_rw{}; + FF avm_mem_sel_mov{}; + FF avm_mem_sub_clk{}; + FF avm_mem_tag{}; + FF avm_mem_tag_err{}; + FF avm_mem_val{}; + FF avm_mem_w_in_tag{}; FF perm_main_alu{}; FF perm_main_bin{}; FF perm_main_mem_a{}; @@ -165,25 +165,25 @@ template struct AvmFullRow { FF lookup_byte_operations_counts{}; FF incl_main_tag_err_counts{}; FF incl_mem_tag_err_counts{}; - FF avm_mem_m_tag_shift{}; - FF avm_mem_m_rw_shift{}; - FF avm_mem_m_addr_shift{}; - FF avm_mem_m_val_shift{}; - FF avm_binary_acc_ic_shift{}; - FF avm_binary_op_id_shift{}; + FF avm_alu_u16_r0_shift{}; + FF avm_alu_u16_r1_shift{}; + FF avm_alu_u16_r2_shift{}; + FF avm_alu_u16_r3_shift{}; + FF avm_alu_u16_r4_shift{}; + FF avm_alu_u16_r5_shift{}; + FF avm_alu_u16_r6_shift{}; + FF avm_alu_u16_r7_shift{}; + FF avm_binary_acc_ia_shift{}; FF avm_binary_acc_ib_shift{}; + FF avm_binary_acc_ic_shift{}; FF avm_binary_mem_tag_ctr_shift{}; - FF avm_binary_acc_ia_shift{}; + FF avm_binary_op_id_shift{}; FF avm_main_internal_return_ptr_shift{}; FF avm_main_pc_shift{}; - FF avm_alu_alu_u16_r1_shift{}; - FF avm_alu_alu_u16_r3_shift{}; - FF avm_alu_alu_u16_r2_shift{}; - FF avm_alu_alu_u16_r5_shift{}; - FF avm_alu_alu_u16_r4_shift{}; - FF avm_alu_alu_u16_r6_shift{}; - FF avm_alu_alu_u16_r0_shift{}; - FF avm_alu_alu_u16_r7_shift{}; + FF avm_mem_addr_shift{}; + FF avm_mem_rw_shift{}; + FF avm_mem_tag_shift{}; + FF avm_mem_val_shift{}; }; class AvmCircuitBuilder { @@ -215,121 +215,121 @@ class AvmCircuitBuilder { for (size_t i = 0; i < rows.size(); i++) { polys.avm_main_clk[i] = rows[i].avm_main_clk; polys.avm_main_first[i] = rows[i].avm_main_first; - polys.avm_mem_m_clk[i] = rows[i].avm_mem_m_clk; - polys.avm_mem_m_sub_clk[i] = rows[i].avm_mem_m_sub_clk; - polys.avm_mem_m_addr[i] = rows[i].avm_mem_m_addr; - polys.avm_mem_m_tag[i] = rows[i].avm_mem_m_tag; - polys.avm_mem_m_val[i] = rows[i].avm_mem_m_val; - polys.avm_mem_m_lastAccess[i] = rows[i].avm_mem_m_lastAccess; - polys.avm_mem_m_last[i] = rows[i].avm_mem_m_last; - polys.avm_mem_m_rw[i] = rows[i].avm_mem_m_rw; - polys.avm_mem_r_in_tag[i] = rows[i].avm_mem_r_in_tag; - polys.avm_mem_w_in_tag[i] = rows[i].avm_mem_w_in_tag; - polys.avm_mem_m_op_a[i] = rows[i].avm_mem_m_op_a; - polys.avm_mem_m_op_b[i] = rows[i].avm_mem_m_op_b; - polys.avm_mem_m_op_c[i] = rows[i].avm_mem_m_op_c; - polys.avm_mem_m_ind_op_a[i] = rows[i].avm_mem_m_ind_op_a; - polys.avm_mem_m_ind_op_b[i] = rows[i].avm_mem_m_ind_op_b; - polys.avm_mem_m_ind_op_c[i] = rows[i].avm_mem_m_ind_op_c; - polys.avm_mem_m_sel_mov[i] = rows[i].avm_mem_m_sel_mov; - polys.avm_mem_m_tag_err[i] = rows[i].avm_mem_m_tag_err; - polys.avm_mem_m_one_min_inv[i] = rows[i].avm_mem_m_one_min_inv; - polys.avm_alu_alu_clk[i] = rows[i].avm_alu_alu_clk; - polys.avm_alu_alu_ia[i] = rows[i].avm_alu_alu_ia; - polys.avm_alu_alu_ib[i] = rows[i].avm_alu_alu_ib; - polys.avm_alu_alu_ic[i] = rows[i].avm_alu_alu_ic; - polys.avm_alu_alu_op_add[i] = rows[i].avm_alu_alu_op_add; - polys.avm_alu_alu_op_sub[i] = rows[i].avm_alu_alu_op_sub; - polys.avm_alu_alu_op_mul[i] = rows[i].avm_alu_alu_op_mul; - polys.avm_alu_alu_op_div[i] = rows[i].avm_alu_alu_op_div; - polys.avm_alu_alu_op_not[i] = rows[i].avm_alu_alu_op_not; - polys.avm_alu_alu_op_eq[i] = rows[i].avm_alu_alu_op_eq; polys.avm_alu_alu_sel[i] = rows[i].avm_alu_alu_sel; - polys.avm_alu_alu_in_tag[i] = rows[i].avm_alu_alu_in_tag; - polys.avm_alu_alu_ff_tag[i] = rows[i].avm_alu_alu_ff_tag; - polys.avm_alu_alu_u8_tag[i] = rows[i].avm_alu_alu_u8_tag; - polys.avm_alu_alu_u16_tag[i] = rows[i].avm_alu_alu_u16_tag; - polys.avm_alu_alu_u32_tag[i] = rows[i].avm_alu_alu_u32_tag; - polys.avm_alu_alu_u64_tag[i] = rows[i].avm_alu_alu_u64_tag; - polys.avm_alu_alu_u128_tag[i] = rows[i].avm_alu_alu_u128_tag; - polys.avm_alu_alu_u8_r0[i] = rows[i].avm_alu_alu_u8_r0; - polys.avm_alu_alu_u8_r1[i] = rows[i].avm_alu_alu_u8_r1; - polys.avm_alu_alu_u16_r0[i] = rows[i].avm_alu_alu_u16_r0; - polys.avm_alu_alu_u16_r1[i] = rows[i].avm_alu_alu_u16_r1; - polys.avm_alu_alu_u16_r2[i] = rows[i].avm_alu_alu_u16_r2; - polys.avm_alu_alu_u16_r3[i] = rows[i].avm_alu_alu_u16_r3; - polys.avm_alu_alu_u16_r4[i] = rows[i].avm_alu_alu_u16_r4; - polys.avm_alu_alu_u16_r5[i] = rows[i].avm_alu_alu_u16_r5; - polys.avm_alu_alu_u16_r6[i] = rows[i].avm_alu_alu_u16_r6; - polys.avm_alu_alu_u16_r7[i] = rows[i].avm_alu_alu_u16_r7; - polys.avm_alu_alu_u64_r0[i] = rows[i].avm_alu_alu_u64_r0; - polys.avm_alu_alu_cf[i] = rows[i].avm_alu_alu_cf; - polys.avm_alu_alu_op_eq_diff_inv[i] = rows[i].avm_alu_alu_op_eq_diff_inv; - polys.avm_byte_lookup_table_op_id[i] = rows[i].avm_byte_lookup_table_op_id; - polys.avm_byte_lookup_table_input_a[i] = rows[i].avm_byte_lookup_table_input_a; - polys.avm_byte_lookup_table_input_b[i] = rows[i].avm_byte_lookup_table_input_b; - polys.avm_byte_lookup_table_output[i] = rows[i].avm_byte_lookup_table_output; - polys.avm_byte_lookup_bin_sel[i] = rows[i].avm_byte_lookup_bin_sel; - polys.avm_byte_lookup_table_in_tags[i] = rows[i].avm_byte_lookup_table_in_tags; - polys.avm_byte_lookup_table_byte_lengths[i] = rows[i].avm_byte_lookup_table_byte_lengths; - polys.avm_binary_bin_clk[i] = rows[i].avm_binary_bin_clk; - polys.avm_binary_bin_sel[i] = rows[i].avm_binary_bin_sel; + polys.avm_alu_cf[i] = rows[i].avm_alu_cf; + polys.avm_alu_clk[i] = rows[i].avm_alu_clk; + polys.avm_alu_ff_tag[i] = rows[i].avm_alu_ff_tag; + polys.avm_alu_ia[i] = rows[i].avm_alu_ia; + polys.avm_alu_ib[i] = rows[i].avm_alu_ib; + polys.avm_alu_ic[i] = rows[i].avm_alu_ic; + polys.avm_alu_in_tag[i] = rows[i].avm_alu_in_tag; + polys.avm_alu_op_add[i] = rows[i].avm_alu_op_add; + polys.avm_alu_op_div[i] = rows[i].avm_alu_op_div; + polys.avm_alu_op_eq[i] = rows[i].avm_alu_op_eq; + polys.avm_alu_op_eq_diff_inv[i] = rows[i].avm_alu_op_eq_diff_inv; + polys.avm_alu_op_mul[i] = rows[i].avm_alu_op_mul; + polys.avm_alu_op_not[i] = rows[i].avm_alu_op_not; + polys.avm_alu_op_sub[i] = rows[i].avm_alu_op_sub; + polys.avm_alu_u128_tag[i] = rows[i].avm_alu_u128_tag; + polys.avm_alu_u16_r0[i] = rows[i].avm_alu_u16_r0; + polys.avm_alu_u16_r1[i] = rows[i].avm_alu_u16_r1; + polys.avm_alu_u16_r2[i] = rows[i].avm_alu_u16_r2; + polys.avm_alu_u16_r3[i] = rows[i].avm_alu_u16_r3; + polys.avm_alu_u16_r4[i] = rows[i].avm_alu_u16_r4; + polys.avm_alu_u16_r5[i] = rows[i].avm_alu_u16_r5; + polys.avm_alu_u16_r6[i] = rows[i].avm_alu_u16_r6; + polys.avm_alu_u16_r7[i] = rows[i].avm_alu_u16_r7; + polys.avm_alu_u16_tag[i] = rows[i].avm_alu_u16_tag; + polys.avm_alu_u32_tag[i] = rows[i].avm_alu_u32_tag; + polys.avm_alu_u64_r0[i] = rows[i].avm_alu_u64_r0; + polys.avm_alu_u64_tag[i] = rows[i].avm_alu_u64_tag; + polys.avm_alu_u8_r0[i] = rows[i].avm_alu_u8_r0; + polys.avm_alu_u8_r1[i] = rows[i].avm_alu_u8_r1; + polys.avm_alu_u8_tag[i] = rows[i].avm_alu_u8_tag; polys.avm_binary_acc_ia[i] = rows[i].avm_binary_acc_ia; polys.avm_binary_acc_ib[i] = rows[i].avm_binary_acc_ib; polys.avm_binary_acc_ic[i] = rows[i].avm_binary_acc_ic; - polys.avm_binary_in_tag[i] = rows[i].avm_binary_in_tag; - polys.avm_binary_op_id[i] = rows[i].avm_binary_op_id; + polys.avm_binary_bin_clk[i] = rows[i].avm_binary_bin_clk; polys.avm_binary_bin_ia_bytes[i] = rows[i].avm_binary_bin_ia_bytes; polys.avm_binary_bin_ib_bytes[i] = rows[i].avm_binary_bin_ib_bytes; polys.avm_binary_bin_ic_bytes[i] = rows[i].avm_binary_bin_ic_bytes; - polys.avm_binary_start[i] = rows[i].avm_binary_start; + polys.avm_binary_bin_sel[i] = rows[i].avm_binary_bin_sel; + polys.avm_binary_in_tag[i] = rows[i].avm_binary_in_tag; polys.avm_binary_mem_tag_ctr[i] = rows[i].avm_binary_mem_tag_ctr; polys.avm_binary_mem_tag_ctr_inv[i] = rows[i].avm_binary_mem_tag_ctr_inv; - polys.avm_main_sel_rng_8[i] = rows[i].avm_main_sel_rng_8; - polys.avm_main_sel_rng_16[i] = rows[i].avm_main_sel_rng_16; - polys.avm_main_pc[i] = rows[i].avm_main_pc; - polys.avm_main_internal_return_ptr[i] = rows[i].avm_main_internal_return_ptr; - polys.avm_main_sel_internal_call[i] = rows[i].avm_main_sel_internal_call; - polys.avm_main_sel_internal_return[i] = rows[i].avm_main_sel_internal_return; - polys.avm_main_sel_jump[i] = rows[i].avm_main_sel_jump; - polys.avm_main_sel_halt[i] = rows[i].avm_main_sel_halt; - polys.avm_main_sel_mov[i] = rows[i].avm_main_sel_mov; - polys.avm_main_sel_op_add[i] = rows[i].avm_main_sel_op_add; - polys.avm_main_sel_op_sub[i] = rows[i].avm_main_sel_op_sub; - polys.avm_main_sel_op_mul[i] = rows[i].avm_main_sel_op_mul; - polys.avm_main_sel_op_div[i] = rows[i].avm_main_sel_op_div; - polys.avm_main_sel_op_not[i] = rows[i].avm_main_sel_op_not; - polys.avm_main_sel_op_eq[i] = rows[i].avm_main_sel_op_eq; - polys.avm_main_sel_op_and[i] = rows[i].avm_main_sel_op_and; - polys.avm_main_sel_op_or[i] = rows[i].avm_main_sel_op_or; - polys.avm_main_sel_op_xor[i] = rows[i].avm_main_sel_op_xor; + polys.avm_binary_op_id[i] = rows[i].avm_binary_op_id; + polys.avm_binary_start[i] = rows[i].avm_binary_start; + polys.avm_byte_lookup_bin_sel[i] = rows[i].avm_byte_lookup_bin_sel; + polys.avm_byte_lookup_table_byte_lengths[i] = rows[i].avm_byte_lookup_table_byte_lengths; + polys.avm_byte_lookup_table_in_tags[i] = rows[i].avm_byte_lookup_table_in_tags; + polys.avm_byte_lookup_table_input_a[i] = rows[i].avm_byte_lookup_table_input_a; + polys.avm_byte_lookup_table_input_b[i] = rows[i].avm_byte_lookup_table_input_b; + polys.avm_byte_lookup_table_op_id[i] = rows[i].avm_byte_lookup_table_op_id; + polys.avm_byte_lookup_table_output[i] = rows[i].avm_byte_lookup_table_output; polys.avm_main_alu_sel[i] = rows[i].avm_main_alu_sel; + polys.avm_main_bin_op_id[i] = rows[i].avm_main_bin_op_id; polys.avm_main_bin_sel[i] = rows[i].avm_main_bin_sel; - polys.avm_main_r_in_tag[i] = rows[i].avm_main_r_in_tag; - polys.avm_main_w_in_tag[i] = rows[i].avm_main_w_in_tag; - polys.avm_main_op_err[i] = rows[i].avm_main_op_err; - polys.avm_main_tag_err[i] = rows[i].avm_main_tag_err; - polys.avm_main_inv[i] = rows[i].avm_main_inv; polys.avm_main_ia[i] = rows[i].avm_main_ia; polys.avm_main_ib[i] = rows[i].avm_main_ib; polys.avm_main_ic[i] = rows[i].avm_main_ic; - polys.avm_main_mem_op_a[i] = rows[i].avm_main_mem_op_a; - polys.avm_main_mem_op_b[i] = rows[i].avm_main_mem_op_b; - polys.avm_main_mem_op_c[i] = rows[i].avm_main_mem_op_c; - polys.avm_main_rwa[i] = rows[i].avm_main_rwa; - polys.avm_main_rwb[i] = rows[i].avm_main_rwb; - polys.avm_main_rwc[i] = rows[i].avm_main_rwc; polys.avm_main_ind_a[i] = rows[i].avm_main_ind_a; polys.avm_main_ind_b[i] = rows[i].avm_main_ind_b; polys.avm_main_ind_c[i] = rows[i].avm_main_ind_c; polys.avm_main_ind_op_a[i] = rows[i].avm_main_ind_op_a; polys.avm_main_ind_op_b[i] = rows[i].avm_main_ind_op_b; polys.avm_main_ind_op_c[i] = rows[i].avm_main_ind_op_c; + polys.avm_main_internal_return_ptr[i] = rows[i].avm_main_internal_return_ptr; + polys.avm_main_inv[i] = rows[i].avm_main_inv; + polys.avm_main_last[i] = rows[i].avm_main_last; polys.avm_main_mem_idx_a[i] = rows[i].avm_main_mem_idx_a; polys.avm_main_mem_idx_b[i] = rows[i].avm_main_mem_idx_b; polys.avm_main_mem_idx_c[i] = rows[i].avm_main_mem_idx_c; - polys.avm_main_last[i] = rows[i].avm_main_last; - polys.avm_main_bin_op_id[i] = rows[i].avm_main_bin_op_id; + polys.avm_main_mem_op_a[i] = rows[i].avm_main_mem_op_a; + polys.avm_main_mem_op_b[i] = rows[i].avm_main_mem_op_b; + polys.avm_main_mem_op_c[i] = rows[i].avm_main_mem_op_c; + polys.avm_main_op_err[i] = rows[i].avm_main_op_err; + polys.avm_main_pc[i] = rows[i].avm_main_pc; + polys.avm_main_r_in_tag[i] = rows[i].avm_main_r_in_tag; + polys.avm_main_rwa[i] = rows[i].avm_main_rwa; + polys.avm_main_rwb[i] = rows[i].avm_main_rwb; + polys.avm_main_rwc[i] = rows[i].avm_main_rwc; + polys.avm_main_sel_halt[i] = rows[i].avm_main_sel_halt; + polys.avm_main_sel_internal_call[i] = rows[i].avm_main_sel_internal_call; + polys.avm_main_sel_internal_return[i] = rows[i].avm_main_sel_internal_return; + polys.avm_main_sel_jump[i] = rows[i].avm_main_sel_jump; + polys.avm_main_sel_mov[i] = rows[i].avm_main_sel_mov; + polys.avm_main_sel_op_add[i] = rows[i].avm_main_sel_op_add; + polys.avm_main_sel_op_and[i] = rows[i].avm_main_sel_op_and; + polys.avm_main_sel_op_div[i] = rows[i].avm_main_sel_op_div; + polys.avm_main_sel_op_eq[i] = rows[i].avm_main_sel_op_eq; + polys.avm_main_sel_op_mul[i] = rows[i].avm_main_sel_op_mul; + polys.avm_main_sel_op_not[i] = rows[i].avm_main_sel_op_not; + polys.avm_main_sel_op_or[i] = rows[i].avm_main_sel_op_or; + polys.avm_main_sel_op_sub[i] = rows[i].avm_main_sel_op_sub; + polys.avm_main_sel_op_xor[i] = rows[i].avm_main_sel_op_xor; + polys.avm_main_sel_rng_16[i] = rows[i].avm_main_sel_rng_16; + polys.avm_main_sel_rng_8[i] = rows[i].avm_main_sel_rng_8; + polys.avm_main_tag_err[i] = rows[i].avm_main_tag_err; + polys.avm_main_w_in_tag[i] = rows[i].avm_main_w_in_tag; + polys.avm_mem_addr[i] = rows[i].avm_mem_addr; + polys.avm_mem_clk[i] = rows[i].avm_mem_clk; + polys.avm_mem_ind_op_a[i] = rows[i].avm_mem_ind_op_a; + polys.avm_mem_ind_op_b[i] = rows[i].avm_mem_ind_op_b; + polys.avm_mem_ind_op_c[i] = rows[i].avm_mem_ind_op_c; + polys.avm_mem_last[i] = rows[i].avm_mem_last; + polys.avm_mem_lastAccess[i] = rows[i].avm_mem_lastAccess; + polys.avm_mem_one_min_inv[i] = rows[i].avm_mem_one_min_inv; + polys.avm_mem_op_a[i] = rows[i].avm_mem_op_a; + polys.avm_mem_op_b[i] = rows[i].avm_mem_op_b; + polys.avm_mem_op_c[i] = rows[i].avm_mem_op_c; + polys.avm_mem_r_in_tag[i] = rows[i].avm_mem_r_in_tag; + polys.avm_mem_rw[i] = rows[i].avm_mem_rw; + polys.avm_mem_sel_mov[i] = rows[i].avm_mem_sel_mov; + polys.avm_mem_sub_clk[i] = rows[i].avm_mem_sub_clk; + polys.avm_mem_tag[i] = rows[i].avm_mem_tag; + polys.avm_mem_tag_err[i] = rows[i].avm_mem_tag_err; + polys.avm_mem_val[i] = rows[i].avm_mem_val; + polys.avm_mem_w_in_tag[i] = rows[i].avm_mem_w_in_tag; polys.perm_main_alu[i] = rows[i].perm_main_alu; polys.perm_main_bin[i] = rows[i].perm_main_bin; polys.perm_main_mem_a[i] = rows[i].perm_main_mem_a; @@ -348,25 +348,25 @@ class AvmCircuitBuilder { polys.incl_mem_tag_err_counts[i] = rows[i].incl_mem_tag_err_counts; } - polys.avm_mem_m_tag_shift = Polynomial(polys.avm_mem_m_tag.shifted()); - polys.avm_mem_m_rw_shift = Polynomial(polys.avm_mem_m_rw.shifted()); - polys.avm_mem_m_addr_shift = Polynomial(polys.avm_mem_m_addr.shifted()); - polys.avm_mem_m_val_shift = Polynomial(polys.avm_mem_m_val.shifted()); - polys.avm_binary_acc_ic_shift = Polynomial(polys.avm_binary_acc_ic.shifted()); - polys.avm_binary_op_id_shift = Polynomial(polys.avm_binary_op_id.shifted()); + polys.avm_alu_u16_r0_shift = Polynomial(polys.avm_alu_u16_r0.shifted()); + polys.avm_alu_u16_r1_shift = Polynomial(polys.avm_alu_u16_r1.shifted()); + polys.avm_alu_u16_r2_shift = Polynomial(polys.avm_alu_u16_r2.shifted()); + polys.avm_alu_u16_r3_shift = Polynomial(polys.avm_alu_u16_r3.shifted()); + polys.avm_alu_u16_r4_shift = Polynomial(polys.avm_alu_u16_r4.shifted()); + polys.avm_alu_u16_r5_shift = Polynomial(polys.avm_alu_u16_r5.shifted()); + polys.avm_alu_u16_r6_shift = Polynomial(polys.avm_alu_u16_r6.shifted()); + polys.avm_alu_u16_r7_shift = Polynomial(polys.avm_alu_u16_r7.shifted()); + polys.avm_binary_acc_ia_shift = Polynomial(polys.avm_binary_acc_ia.shifted()); polys.avm_binary_acc_ib_shift = Polynomial(polys.avm_binary_acc_ib.shifted()); + polys.avm_binary_acc_ic_shift = Polynomial(polys.avm_binary_acc_ic.shifted()); polys.avm_binary_mem_tag_ctr_shift = Polynomial(polys.avm_binary_mem_tag_ctr.shifted()); - polys.avm_binary_acc_ia_shift = Polynomial(polys.avm_binary_acc_ia.shifted()); + polys.avm_binary_op_id_shift = Polynomial(polys.avm_binary_op_id.shifted()); polys.avm_main_internal_return_ptr_shift = Polynomial(polys.avm_main_internal_return_ptr.shifted()); polys.avm_main_pc_shift = Polynomial(polys.avm_main_pc.shifted()); - polys.avm_alu_alu_u16_r1_shift = Polynomial(polys.avm_alu_alu_u16_r1.shifted()); - polys.avm_alu_alu_u16_r3_shift = Polynomial(polys.avm_alu_alu_u16_r3.shifted()); - polys.avm_alu_alu_u16_r2_shift = Polynomial(polys.avm_alu_alu_u16_r2.shifted()); - polys.avm_alu_alu_u16_r5_shift = Polynomial(polys.avm_alu_alu_u16_r5.shifted()); - polys.avm_alu_alu_u16_r4_shift = Polynomial(polys.avm_alu_alu_u16_r4.shifted()); - polys.avm_alu_alu_u16_r6_shift = Polynomial(polys.avm_alu_alu_u16_r6.shifted()); - polys.avm_alu_alu_u16_r0_shift = Polynomial(polys.avm_alu_alu_u16_r0.shifted()); - polys.avm_alu_alu_u16_r7_shift = Polynomial(polys.avm_alu_alu_u16_r7.shifted()); + polys.avm_mem_addr_shift = Polynomial(polys.avm_mem_addr.shifted()); + polys.avm_mem_rw_shift = Polynomial(polys.avm_mem_rw.shifted()); + polys.avm_mem_tag_shift = Polynomial(polys.avm_mem_tag.shifted()); + polys.avm_mem_val_shift = Polynomial(polys.avm_mem_val.shifted()); return polys; } @@ -438,8 +438,8 @@ class AvmCircuitBuilder { return true; }; - if (!evaluate_relation.template operator()>("avm_mem", - Avm_vm::get_relation_label_avm_mem)) { + if (!evaluate_relation.template operator()>("avm_alu", + Avm_vm::get_relation_label_avm_alu)) { return false; } if (!evaluate_relation.template operator()>("avm_binary", @@ -450,8 +450,8 @@ class AvmCircuitBuilder { Avm_vm::get_relation_label_avm_main)) { return false; } - if (!evaluate_relation.template operator()>("avm_alu", - Avm_vm::get_relation_label_avm_alu)) { + if (!evaluate_relation.template operator()>("avm_mem", + Avm_vm::get_relation_label_avm_mem)) { return false; } diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index 08c37288d85..b52c474533a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -52,10 +52,10 @@ class AvmFlavor { // the unshifted and one for the shifted static constexpr size_t NUM_ALL_ENTITIES = 152; - using Relations = std::tuple, + using Relations = std::tuple, Avm_vm::avm_binary, Avm_vm::avm_main, - Avm_vm::avm_alu, + Avm_vm::avm_mem, perm_main_alu_relation, perm_main_bin_relation, perm_main_mem_a_relation, @@ -97,121 +97,121 @@ class AvmFlavor { template class WitnessEntities { public: DEFINE_FLAVOR_MEMBERS(DataType, - avm_mem_m_clk, - avm_mem_m_sub_clk, - avm_mem_m_addr, - avm_mem_m_tag, - avm_mem_m_val, - avm_mem_m_lastAccess, - avm_mem_m_last, - avm_mem_m_rw, - avm_mem_r_in_tag, - avm_mem_w_in_tag, - avm_mem_m_op_a, - avm_mem_m_op_b, - avm_mem_m_op_c, - avm_mem_m_ind_op_a, - avm_mem_m_ind_op_b, - avm_mem_m_ind_op_c, - avm_mem_m_sel_mov, - avm_mem_m_tag_err, - avm_mem_m_one_min_inv, - avm_alu_alu_clk, - avm_alu_alu_ia, - avm_alu_alu_ib, - avm_alu_alu_ic, - avm_alu_alu_op_add, - avm_alu_alu_op_sub, - avm_alu_alu_op_mul, - avm_alu_alu_op_div, - avm_alu_alu_op_not, - avm_alu_alu_op_eq, avm_alu_alu_sel, - avm_alu_alu_in_tag, - avm_alu_alu_ff_tag, - avm_alu_alu_u8_tag, - avm_alu_alu_u16_tag, - avm_alu_alu_u32_tag, - avm_alu_alu_u64_tag, - avm_alu_alu_u128_tag, - avm_alu_alu_u8_r0, - avm_alu_alu_u8_r1, - avm_alu_alu_u16_r0, - avm_alu_alu_u16_r1, - avm_alu_alu_u16_r2, - avm_alu_alu_u16_r3, - avm_alu_alu_u16_r4, - avm_alu_alu_u16_r5, - avm_alu_alu_u16_r6, - avm_alu_alu_u16_r7, - avm_alu_alu_u64_r0, - avm_alu_alu_cf, - avm_alu_alu_op_eq_diff_inv, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_output, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_byte_lengths, - avm_binary_bin_clk, - avm_binary_bin_sel, + avm_alu_cf, + avm_alu_clk, + avm_alu_ff_tag, + avm_alu_ia, + avm_alu_ib, + avm_alu_ic, + avm_alu_in_tag, + avm_alu_op_add, + avm_alu_op_div, + avm_alu_op_eq, + avm_alu_op_eq_diff_inv, + avm_alu_op_mul, + avm_alu_op_not, + avm_alu_op_sub, + avm_alu_u128_tag, + avm_alu_u16_r0, + avm_alu_u16_r1, + avm_alu_u16_r2, + avm_alu_u16_r3, + avm_alu_u16_r4, + avm_alu_u16_r5, + avm_alu_u16_r6, + avm_alu_u16_r7, + avm_alu_u16_tag, + avm_alu_u32_tag, + avm_alu_u64_r0, + avm_alu_u64_tag, + avm_alu_u8_r0, + avm_alu_u8_r1, + avm_alu_u8_tag, avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_in_tag, - avm_binary_op_id, + avm_binary_bin_clk, avm_binary_bin_ia_bytes, avm_binary_bin_ib_bytes, avm_binary_bin_ic_bytes, - avm_binary_start, + avm_binary_bin_sel, + avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, - avm_main_sel_rng_8, - avm_main_sel_rng_16, - avm_main_pc, - avm_main_internal_return_ptr, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_halt, - avm_main_sel_mov, - avm_main_sel_op_add, - avm_main_sel_op_sub, - avm_main_sel_op_mul, - avm_main_sel_op_div, - avm_main_sel_op_not, - avm_main_sel_op_eq, - avm_main_sel_op_and, - avm_main_sel_op_or, - avm_main_sel_op_xor, + avm_binary_op_id, + avm_binary_start, + avm_byte_lookup_bin_sel, + avm_byte_lookup_table_byte_lengths, + avm_byte_lookup_table_in_tags, + avm_byte_lookup_table_input_a, + avm_byte_lookup_table_input_b, + avm_byte_lookup_table_op_id, + avm_byte_lookup_table_output, avm_main_alu_sel, + avm_main_bin_op_id, avm_main_bin_sel, - avm_main_r_in_tag, - avm_main_w_in_tag, - avm_main_op_err, - avm_main_tag_err, - avm_main_inv, avm_main_ia, avm_main_ib, avm_main_ic, - avm_main_mem_op_a, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, avm_main_ind_a, avm_main_ind_b, avm_main_ind_c, avm_main_ind_op_a, avm_main_ind_op_b, avm_main_ind_op_c, + avm_main_internal_return_ptr, + avm_main_inv, + avm_main_last, avm_main_mem_idx_a, avm_main_mem_idx_b, avm_main_mem_idx_c, - avm_main_last, - avm_main_bin_op_id, + avm_main_mem_op_a, + avm_main_mem_op_b, + avm_main_mem_op_c, + avm_main_op_err, + avm_main_pc, + avm_main_r_in_tag, + avm_main_rwa, + avm_main_rwb, + avm_main_rwc, + avm_main_sel_halt, + avm_main_sel_internal_call, + avm_main_sel_internal_return, + avm_main_sel_jump, + avm_main_sel_mov, + avm_main_sel_op_add, + avm_main_sel_op_and, + avm_main_sel_op_div, + avm_main_sel_op_eq, + avm_main_sel_op_mul, + avm_main_sel_op_not, + avm_main_sel_op_or, + avm_main_sel_op_sub, + avm_main_sel_op_xor, + avm_main_sel_rng_16, + avm_main_sel_rng_8, + avm_main_tag_err, + avm_main_w_in_tag, + avm_mem_addr, + avm_mem_clk, + avm_mem_ind_op_a, + avm_mem_ind_op_b, + avm_mem_ind_op_c, + avm_mem_last, + avm_mem_lastAccess, + avm_mem_one_min_inv, + avm_mem_op_a, + avm_mem_op_b, + avm_mem_op_c, + avm_mem_r_in_tag, + avm_mem_rw, + avm_mem_sel_mov, + avm_mem_sub_clk, + avm_mem_tag, + avm_mem_tag_err, + avm_mem_val, + avm_mem_w_in_tag, perm_main_alu, perm_main_bin, perm_main_mem_a, @@ -231,121 +231,121 @@ class AvmFlavor { RefVector get_wires() { - return { avm_mem_m_clk, - avm_mem_m_sub_clk, - avm_mem_m_addr, - avm_mem_m_tag, - avm_mem_m_val, - avm_mem_m_lastAccess, - avm_mem_m_last, - avm_mem_m_rw, - avm_mem_r_in_tag, - avm_mem_w_in_tag, - avm_mem_m_op_a, - avm_mem_m_op_b, - avm_mem_m_op_c, - avm_mem_m_ind_op_a, - avm_mem_m_ind_op_b, - avm_mem_m_ind_op_c, - avm_mem_m_sel_mov, - avm_mem_m_tag_err, - avm_mem_m_one_min_inv, - avm_alu_alu_clk, - avm_alu_alu_ia, - avm_alu_alu_ib, - avm_alu_alu_ic, - avm_alu_alu_op_add, - avm_alu_alu_op_sub, - avm_alu_alu_op_mul, - avm_alu_alu_op_div, - avm_alu_alu_op_not, - avm_alu_alu_op_eq, - avm_alu_alu_sel, - avm_alu_alu_in_tag, - avm_alu_alu_ff_tag, - avm_alu_alu_u8_tag, - avm_alu_alu_u16_tag, - avm_alu_alu_u32_tag, - avm_alu_alu_u64_tag, - avm_alu_alu_u128_tag, - avm_alu_alu_u8_r0, - avm_alu_alu_u8_r1, - avm_alu_alu_u16_r0, - avm_alu_alu_u16_r1, - avm_alu_alu_u16_r2, - avm_alu_alu_u16_r3, - avm_alu_alu_u16_r4, - avm_alu_alu_u16_r5, - avm_alu_alu_u16_r6, - avm_alu_alu_u16_r7, - avm_alu_alu_u64_r0, - avm_alu_alu_cf, - avm_alu_alu_op_eq_diff_inv, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_output, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_byte_lengths, - avm_binary_bin_clk, - avm_binary_bin_sel, + return { avm_alu_alu_sel, + avm_alu_cf, + avm_alu_clk, + avm_alu_ff_tag, + avm_alu_ia, + avm_alu_ib, + avm_alu_ic, + avm_alu_in_tag, + avm_alu_op_add, + avm_alu_op_div, + avm_alu_op_eq, + avm_alu_op_eq_diff_inv, + avm_alu_op_mul, + avm_alu_op_not, + avm_alu_op_sub, + avm_alu_u128_tag, + avm_alu_u16_r0, + avm_alu_u16_r1, + avm_alu_u16_r2, + avm_alu_u16_r3, + avm_alu_u16_r4, + avm_alu_u16_r5, + avm_alu_u16_r6, + avm_alu_u16_r7, + avm_alu_u16_tag, + avm_alu_u32_tag, + avm_alu_u64_r0, + avm_alu_u64_tag, + avm_alu_u8_r0, + avm_alu_u8_r1, + avm_alu_u8_tag, avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_in_tag, - avm_binary_op_id, + avm_binary_bin_clk, avm_binary_bin_ia_bytes, avm_binary_bin_ib_bytes, avm_binary_bin_ic_bytes, - avm_binary_start, + avm_binary_bin_sel, + avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, - avm_main_sel_rng_8, - avm_main_sel_rng_16, - avm_main_pc, - avm_main_internal_return_ptr, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_halt, - avm_main_sel_mov, - avm_main_sel_op_add, - avm_main_sel_op_sub, - avm_main_sel_op_mul, - avm_main_sel_op_div, - avm_main_sel_op_not, - avm_main_sel_op_eq, - avm_main_sel_op_and, - avm_main_sel_op_or, - avm_main_sel_op_xor, + avm_binary_op_id, + avm_binary_start, + avm_byte_lookup_bin_sel, + avm_byte_lookup_table_byte_lengths, + avm_byte_lookup_table_in_tags, + avm_byte_lookup_table_input_a, + avm_byte_lookup_table_input_b, + avm_byte_lookup_table_op_id, + avm_byte_lookup_table_output, avm_main_alu_sel, + avm_main_bin_op_id, avm_main_bin_sel, - avm_main_r_in_tag, - avm_main_w_in_tag, - avm_main_op_err, - avm_main_tag_err, - avm_main_inv, avm_main_ia, avm_main_ib, avm_main_ic, - avm_main_mem_op_a, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, avm_main_ind_a, avm_main_ind_b, avm_main_ind_c, avm_main_ind_op_a, avm_main_ind_op_b, avm_main_ind_op_c, + avm_main_internal_return_ptr, + avm_main_inv, + avm_main_last, avm_main_mem_idx_a, avm_main_mem_idx_b, avm_main_mem_idx_c, - avm_main_last, - avm_main_bin_op_id, + avm_main_mem_op_a, + avm_main_mem_op_b, + avm_main_mem_op_c, + avm_main_op_err, + avm_main_pc, + avm_main_r_in_tag, + avm_main_rwa, + avm_main_rwb, + avm_main_rwc, + avm_main_sel_halt, + avm_main_sel_internal_call, + avm_main_sel_internal_return, + avm_main_sel_jump, + avm_main_sel_mov, + avm_main_sel_op_add, + avm_main_sel_op_and, + avm_main_sel_op_div, + avm_main_sel_op_eq, + avm_main_sel_op_mul, + avm_main_sel_op_not, + avm_main_sel_op_or, + avm_main_sel_op_sub, + avm_main_sel_op_xor, + avm_main_sel_rng_16, + avm_main_sel_rng_8, + avm_main_tag_err, + avm_main_w_in_tag, + avm_mem_addr, + avm_mem_clk, + avm_mem_ind_op_a, + avm_mem_ind_op_b, + avm_mem_ind_op_c, + avm_mem_last, + avm_mem_lastAccess, + avm_mem_one_min_inv, + avm_mem_op_a, + avm_mem_op_b, + avm_mem_op_c, + avm_mem_r_in_tag, + avm_mem_rw, + avm_mem_sel_mov, + avm_mem_sub_clk, + avm_mem_tag, + avm_mem_tag_err, + avm_mem_val, + avm_mem_w_in_tag, perm_main_alu, perm_main_bin, perm_main_mem_a, @@ -371,121 +371,121 @@ class AvmFlavor { DEFINE_FLAVOR_MEMBERS(DataType, avm_main_clk, avm_main_first, - avm_mem_m_clk, - avm_mem_m_sub_clk, - avm_mem_m_addr, - avm_mem_m_tag, - avm_mem_m_val, - avm_mem_m_lastAccess, - avm_mem_m_last, - avm_mem_m_rw, - avm_mem_r_in_tag, - avm_mem_w_in_tag, - avm_mem_m_op_a, - avm_mem_m_op_b, - avm_mem_m_op_c, - avm_mem_m_ind_op_a, - avm_mem_m_ind_op_b, - avm_mem_m_ind_op_c, - avm_mem_m_sel_mov, - avm_mem_m_tag_err, - avm_mem_m_one_min_inv, - avm_alu_alu_clk, - avm_alu_alu_ia, - avm_alu_alu_ib, - avm_alu_alu_ic, - avm_alu_alu_op_add, - avm_alu_alu_op_sub, - avm_alu_alu_op_mul, - avm_alu_alu_op_div, - avm_alu_alu_op_not, - avm_alu_alu_op_eq, avm_alu_alu_sel, - avm_alu_alu_in_tag, - avm_alu_alu_ff_tag, - avm_alu_alu_u8_tag, - avm_alu_alu_u16_tag, - avm_alu_alu_u32_tag, - avm_alu_alu_u64_tag, - avm_alu_alu_u128_tag, - avm_alu_alu_u8_r0, - avm_alu_alu_u8_r1, - avm_alu_alu_u16_r0, - avm_alu_alu_u16_r1, - avm_alu_alu_u16_r2, - avm_alu_alu_u16_r3, - avm_alu_alu_u16_r4, - avm_alu_alu_u16_r5, - avm_alu_alu_u16_r6, - avm_alu_alu_u16_r7, - avm_alu_alu_u64_r0, - avm_alu_alu_cf, - avm_alu_alu_op_eq_diff_inv, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_output, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_byte_lengths, - avm_binary_bin_clk, - avm_binary_bin_sel, + avm_alu_cf, + avm_alu_clk, + avm_alu_ff_tag, + avm_alu_ia, + avm_alu_ib, + avm_alu_ic, + avm_alu_in_tag, + avm_alu_op_add, + avm_alu_op_div, + avm_alu_op_eq, + avm_alu_op_eq_diff_inv, + avm_alu_op_mul, + avm_alu_op_not, + avm_alu_op_sub, + avm_alu_u128_tag, + avm_alu_u16_r0, + avm_alu_u16_r1, + avm_alu_u16_r2, + avm_alu_u16_r3, + avm_alu_u16_r4, + avm_alu_u16_r5, + avm_alu_u16_r6, + avm_alu_u16_r7, + avm_alu_u16_tag, + avm_alu_u32_tag, + avm_alu_u64_r0, + avm_alu_u64_tag, + avm_alu_u8_r0, + avm_alu_u8_r1, + avm_alu_u8_tag, avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_in_tag, - avm_binary_op_id, + avm_binary_bin_clk, avm_binary_bin_ia_bytes, avm_binary_bin_ib_bytes, avm_binary_bin_ic_bytes, - avm_binary_start, + avm_binary_bin_sel, + avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, - avm_main_sel_rng_8, - avm_main_sel_rng_16, - avm_main_pc, - avm_main_internal_return_ptr, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_halt, - avm_main_sel_mov, - avm_main_sel_op_add, - avm_main_sel_op_sub, - avm_main_sel_op_mul, - avm_main_sel_op_div, - avm_main_sel_op_not, - avm_main_sel_op_eq, - avm_main_sel_op_and, - avm_main_sel_op_or, - avm_main_sel_op_xor, + avm_binary_op_id, + avm_binary_start, + avm_byte_lookup_bin_sel, + avm_byte_lookup_table_byte_lengths, + avm_byte_lookup_table_in_tags, + avm_byte_lookup_table_input_a, + avm_byte_lookup_table_input_b, + avm_byte_lookup_table_op_id, + avm_byte_lookup_table_output, avm_main_alu_sel, + avm_main_bin_op_id, avm_main_bin_sel, - avm_main_r_in_tag, - avm_main_w_in_tag, - avm_main_op_err, - avm_main_tag_err, - avm_main_inv, avm_main_ia, avm_main_ib, avm_main_ic, - avm_main_mem_op_a, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, avm_main_ind_a, avm_main_ind_b, avm_main_ind_c, avm_main_ind_op_a, avm_main_ind_op_b, avm_main_ind_op_c, + avm_main_internal_return_ptr, + avm_main_inv, + avm_main_last, avm_main_mem_idx_a, avm_main_mem_idx_b, avm_main_mem_idx_c, - avm_main_last, - avm_main_bin_op_id, + avm_main_mem_op_a, + avm_main_mem_op_b, + avm_main_mem_op_c, + avm_main_op_err, + avm_main_pc, + avm_main_r_in_tag, + avm_main_rwa, + avm_main_rwb, + avm_main_rwc, + avm_main_sel_halt, + avm_main_sel_internal_call, + avm_main_sel_internal_return, + avm_main_sel_jump, + avm_main_sel_mov, + avm_main_sel_op_add, + avm_main_sel_op_and, + avm_main_sel_op_div, + avm_main_sel_op_eq, + avm_main_sel_op_mul, + avm_main_sel_op_not, + avm_main_sel_op_or, + avm_main_sel_op_sub, + avm_main_sel_op_xor, + avm_main_sel_rng_16, + avm_main_sel_rng_8, + avm_main_tag_err, + avm_main_w_in_tag, + avm_mem_addr, + avm_mem_clk, + avm_mem_ind_op_a, + avm_mem_ind_op_b, + avm_mem_ind_op_c, + avm_mem_last, + avm_mem_lastAccess, + avm_mem_one_min_inv, + avm_mem_op_a, + avm_mem_op_b, + avm_mem_op_c, + avm_mem_r_in_tag, + avm_mem_rw, + avm_mem_sel_mov, + avm_mem_sub_clk, + avm_mem_tag, + avm_mem_tag_err, + avm_mem_val, + avm_mem_w_in_tag, perm_main_alu, perm_main_bin, perm_main_mem_a, @@ -502,145 +502,145 @@ class AvmFlavor { lookup_byte_operations_counts, incl_main_tag_err_counts, incl_mem_tag_err_counts, - avm_mem_m_tag_shift, - avm_mem_m_rw_shift, - avm_mem_m_addr_shift, - avm_mem_m_val_shift, - avm_binary_acc_ic_shift, - avm_binary_op_id_shift, + avm_alu_u16_r0_shift, + avm_alu_u16_r1_shift, + avm_alu_u16_r2_shift, + avm_alu_u16_r3_shift, + avm_alu_u16_r4_shift, + avm_alu_u16_r5_shift, + avm_alu_u16_r6_shift, + avm_alu_u16_r7_shift, + avm_binary_acc_ia_shift, avm_binary_acc_ib_shift, + avm_binary_acc_ic_shift, avm_binary_mem_tag_ctr_shift, - avm_binary_acc_ia_shift, + avm_binary_op_id_shift, avm_main_internal_return_ptr_shift, avm_main_pc_shift, - avm_alu_alu_u16_r1_shift, - avm_alu_alu_u16_r3_shift, - avm_alu_alu_u16_r2_shift, - avm_alu_alu_u16_r5_shift, - avm_alu_alu_u16_r4_shift, - avm_alu_alu_u16_r6_shift, - avm_alu_alu_u16_r0_shift, - avm_alu_alu_u16_r7_shift) + avm_mem_addr_shift, + avm_mem_rw_shift, + avm_mem_tag_shift, + avm_mem_val_shift) RefVector get_wires() { return { avm_main_clk, avm_main_first, - avm_mem_m_clk, - avm_mem_m_sub_clk, - avm_mem_m_addr, - avm_mem_m_tag, - avm_mem_m_val, - avm_mem_m_lastAccess, - avm_mem_m_last, - avm_mem_m_rw, - avm_mem_r_in_tag, - avm_mem_w_in_tag, - avm_mem_m_op_a, - avm_mem_m_op_b, - avm_mem_m_op_c, - avm_mem_m_ind_op_a, - avm_mem_m_ind_op_b, - avm_mem_m_ind_op_c, - avm_mem_m_sel_mov, - avm_mem_m_tag_err, - avm_mem_m_one_min_inv, - avm_alu_alu_clk, - avm_alu_alu_ia, - avm_alu_alu_ib, - avm_alu_alu_ic, - avm_alu_alu_op_add, - avm_alu_alu_op_sub, - avm_alu_alu_op_mul, - avm_alu_alu_op_div, - avm_alu_alu_op_not, - avm_alu_alu_op_eq, avm_alu_alu_sel, - avm_alu_alu_in_tag, - avm_alu_alu_ff_tag, - avm_alu_alu_u8_tag, - avm_alu_alu_u16_tag, - avm_alu_alu_u32_tag, - avm_alu_alu_u64_tag, - avm_alu_alu_u128_tag, - avm_alu_alu_u8_r0, - avm_alu_alu_u8_r1, - avm_alu_alu_u16_r0, - avm_alu_alu_u16_r1, - avm_alu_alu_u16_r2, - avm_alu_alu_u16_r3, - avm_alu_alu_u16_r4, - avm_alu_alu_u16_r5, - avm_alu_alu_u16_r6, - avm_alu_alu_u16_r7, - avm_alu_alu_u64_r0, - avm_alu_alu_cf, - avm_alu_alu_op_eq_diff_inv, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_output, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_byte_lengths, - avm_binary_bin_clk, - avm_binary_bin_sel, + avm_alu_cf, + avm_alu_clk, + avm_alu_ff_tag, + avm_alu_ia, + avm_alu_ib, + avm_alu_ic, + avm_alu_in_tag, + avm_alu_op_add, + avm_alu_op_div, + avm_alu_op_eq, + avm_alu_op_eq_diff_inv, + avm_alu_op_mul, + avm_alu_op_not, + avm_alu_op_sub, + avm_alu_u128_tag, + avm_alu_u16_r0, + avm_alu_u16_r1, + avm_alu_u16_r2, + avm_alu_u16_r3, + avm_alu_u16_r4, + avm_alu_u16_r5, + avm_alu_u16_r6, + avm_alu_u16_r7, + avm_alu_u16_tag, + avm_alu_u32_tag, + avm_alu_u64_r0, + avm_alu_u64_tag, + avm_alu_u8_r0, + avm_alu_u8_r1, + avm_alu_u8_tag, avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_in_tag, - avm_binary_op_id, + avm_binary_bin_clk, avm_binary_bin_ia_bytes, avm_binary_bin_ib_bytes, avm_binary_bin_ic_bytes, - avm_binary_start, + avm_binary_bin_sel, + avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, - avm_main_sel_rng_8, - avm_main_sel_rng_16, - avm_main_pc, - avm_main_internal_return_ptr, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_halt, - avm_main_sel_mov, - avm_main_sel_op_add, - avm_main_sel_op_sub, - avm_main_sel_op_mul, - avm_main_sel_op_div, - avm_main_sel_op_not, - avm_main_sel_op_eq, - avm_main_sel_op_and, - avm_main_sel_op_or, - avm_main_sel_op_xor, + avm_binary_op_id, + avm_binary_start, + avm_byte_lookup_bin_sel, + avm_byte_lookup_table_byte_lengths, + avm_byte_lookup_table_in_tags, + avm_byte_lookup_table_input_a, + avm_byte_lookup_table_input_b, + avm_byte_lookup_table_op_id, + avm_byte_lookup_table_output, avm_main_alu_sel, + avm_main_bin_op_id, avm_main_bin_sel, - avm_main_r_in_tag, - avm_main_w_in_tag, - avm_main_op_err, - avm_main_tag_err, - avm_main_inv, avm_main_ia, avm_main_ib, avm_main_ic, - avm_main_mem_op_a, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, avm_main_ind_a, avm_main_ind_b, avm_main_ind_c, avm_main_ind_op_a, avm_main_ind_op_b, avm_main_ind_op_c, + avm_main_internal_return_ptr, + avm_main_inv, + avm_main_last, avm_main_mem_idx_a, avm_main_mem_idx_b, avm_main_mem_idx_c, - avm_main_last, - avm_main_bin_op_id, + avm_main_mem_op_a, + avm_main_mem_op_b, + avm_main_mem_op_c, + avm_main_op_err, + avm_main_pc, + avm_main_r_in_tag, + avm_main_rwa, + avm_main_rwb, + avm_main_rwc, + avm_main_sel_halt, + avm_main_sel_internal_call, + avm_main_sel_internal_return, + avm_main_sel_jump, + avm_main_sel_mov, + avm_main_sel_op_add, + avm_main_sel_op_and, + avm_main_sel_op_div, + avm_main_sel_op_eq, + avm_main_sel_op_mul, + avm_main_sel_op_not, + avm_main_sel_op_or, + avm_main_sel_op_sub, + avm_main_sel_op_xor, + avm_main_sel_rng_16, + avm_main_sel_rng_8, + avm_main_tag_err, + avm_main_w_in_tag, + avm_mem_addr, + avm_mem_clk, + avm_mem_ind_op_a, + avm_mem_ind_op_b, + avm_mem_ind_op_c, + avm_mem_last, + avm_mem_lastAccess, + avm_mem_one_min_inv, + avm_mem_op_a, + avm_mem_op_b, + avm_mem_op_c, + avm_mem_r_in_tag, + avm_mem_rw, + avm_mem_sel_mov, + avm_mem_sub_clk, + avm_mem_tag, + avm_mem_tag_err, + avm_mem_val, + avm_mem_w_in_tag, perm_main_alu, perm_main_bin, perm_main_mem_a, @@ -657,145 +657,145 @@ class AvmFlavor { lookup_byte_operations_counts, incl_main_tag_err_counts, incl_mem_tag_err_counts, - avm_mem_m_tag_shift, - avm_mem_m_rw_shift, - avm_mem_m_addr_shift, - avm_mem_m_val_shift, - avm_binary_acc_ic_shift, - avm_binary_op_id_shift, + avm_alu_u16_r0_shift, + avm_alu_u16_r1_shift, + avm_alu_u16_r2_shift, + avm_alu_u16_r3_shift, + avm_alu_u16_r4_shift, + avm_alu_u16_r5_shift, + avm_alu_u16_r6_shift, + avm_alu_u16_r7_shift, + avm_binary_acc_ia_shift, avm_binary_acc_ib_shift, + avm_binary_acc_ic_shift, avm_binary_mem_tag_ctr_shift, - avm_binary_acc_ia_shift, + avm_binary_op_id_shift, avm_main_internal_return_ptr_shift, avm_main_pc_shift, - avm_alu_alu_u16_r1_shift, - avm_alu_alu_u16_r3_shift, - avm_alu_alu_u16_r2_shift, - avm_alu_alu_u16_r5_shift, - avm_alu_alu_u16_r4_shift, - avm_alu_alu_u16_r6_shift, - avm_alu_alu_u16_r0_shift, - avm_alu_alu_u16_r7_shift }; + avm_mem_addr_shift, + avm_mem_rw_shift, + avm_mem_tag_shift, + avm_mem_val_shift }; }; RefVector get_unshifted() { return { avm_main_clk, avm_main_first, - avm_mem_m_clk, - avm_mem_m_sub_clk, - avm_mem_m_addr, - avm_mem_m_tag, - avm_mem_m_val, - avm_mem_m_lastAccess, - avm_mem_m_last, - avm_mem_m_rw, - avm_mem_r_in_tag, - avm_mem_w_in_tag, - avm_mem_m_op_a, - avm_mem_m_op_b, - avm_mem_m_op_c, - avm_mem_m_ind_op_a, - avm_mem_m_ind_op_b, - avm_mem_m_ind_op_c, - avm_mem_m_sel_mov, - avm_mem_m_tag_err, - avm_mem_m_one_min_inv, - avm_alu_alu_clk, - avm_alu_alu_ia, - avm_alu_alu_ib, - avm_alu_alu_ic, - avm_alu_alu_op_add, - avm_alu_alu_op_sub, - avm_alu_alu_op_mul, - avm_alu_alu_op_div, - avm_alu_alu_op_not, - avm_alu_alu_op_eq, avm_alu_alu_sel, - avm_alu_alu_in_tag, - avm_alu_alu_ff_tag, - avm_alu_alu_u8_tag, - avm_alu_alu_u16_tag, - avm_alu_alu_u32_tag, - avm_alu_alu_u64_tag, - avm_alu_alu_u128_tag, - avm_alu_alu_u8_r0, - avm_alu_alu_u8_r1, - avm_alu_alu_u16_r0, - avm_alu_alu_u16_r1, - avm_alu_alu_u16_r2, - avm_alu_alu_u16_r3, - avm_alu_alu_u16_r4, - avm_alu_alu_u16_r5, - avm_alu_alu_u16_r6, - avm_alu_alu_u16_r7, - avm_alu_alu_u64_r0, - avm_alu_alu_cf, - avm_alu_alu_op_eq_diff_inv, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_output, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_byte_lengths, - avm_binary_bin_clk, - avm_binary_bin_sel, + avm_alu_cf, + avm_alu_clk, + avm_alu_ff_tag, + avm_alu_ia, + avm_alu_ib, + avm_alu_ic, + avm_alu_in_tag, + avm_alu_op_add, + avm_alu_op_div, + avm_alu_op_eq, + avm_alu_op_eq_diff_inv, + avm_alu_op_mul, + avm_alu_op_not, + avm_alu_op_sub, + avm_alu_u128_tag, + avm_alu_u16_r0, + avm_alu_u16_r1, + avm_alu_u16_r2, + avm_alu_u16_r3, + avm_alu_u16_r4, + avm_alu_u16_r5, + avm_alu_u16_r6, + avm_alu_u16_r7, + avm_alu_u16_tag, + avm_alu_u32_tag, + avm_alu_u64_r0, + avm_alu_u64_tag, + avm_alu_u8_r0, + avm_alu_u8_r1, + avm_alu_u8_tag, avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_in_tag, - avm_binary_op_id, + avm_binary_bin_clk, avm_binary_bin_ia_bytes, avm_binary_bin_ib_bytes, avm_binary_bin_ic_bytes, - avm_binary_start, + avm_binary_bin_sel, + avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, - avm_main_sel_rng_8, - avm_main_sel_rng_16, - avm_main_pc, - avm_main_internal_return_ptr, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_halt, - avm_main_sel_mov, - avm_main_sel_op_add, - avm_main_sel_op_sub, - avm_main_sel_op_mul, - avm_main_sel_op_div, - avm_main_sel_op_not, - avm_main_sel_op_eq, - avm_main_sel_op_and, - avm_main_sel_op_or, - avm_main_sel_op_xor, + avm_binary_op_id, + avm_binary_start, + avm_byte_lookup_bin_sel, + avm_byte_lookup_table_byte_lengths, + avm_byte_lookup_table_in_tags, + avm_byte_lookup_table_input_a, + avm_byte_lookup_table_input_b, + avm_byte_lookup_table_op_id, + avm_byte_lookup_table_output, avm_main_alu_sel, + avm_main_bin_op_id, avm_main_bin_sel, - avm_main_r_in_tag, - avm_main_w_in_tag, - avm_main_op_err, - avm_main_tag_err, - avm_main_inv, avm_main_ia, avm_main_ib, avm_main_ic, - avm_main_mem_op_a, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, avm_main_ind_a, avm_main_ind_b, avm_main_ind_c, avm_main_ind_op_a, avm_main_ind_op_b, avm_main_ind_op_c, + avm_main_internal_return_ptr, + avm_main_inv, + avm_main_last, avm_main_mem_idx_a, avm_main_mem_idx_b, avm_main_mem_idx_c, - avm_main_last, - avm_main_bin_op_id, + avm_main_mem_op_a, + avm_main_mem_op_b, + avm_main_mem_op_c, + avm_main_op_err, + avm_main_pc, + avm_main_r_in_tag, + avm_main_rwa, + avm_main_rwb, + avm_main_rwc, + avm_main_sel_halt, + avm_main_sel_internal_call, + avm_main_sel_internal_return, + avm_main_sel_jump, + avm_main_sel_mov, + avm_main_sel_op_add, + avm_main_sel_op_and, + avm_main_sel_op_div, + avm_main_sel_op_eq, + avm_main_sel_op_mul, + avm_main_sel_op_not, + avm_main_sel_op_or, + avm_main_sel_op_sub, + avm_main_sel_op_xor, + avm_main_sel_rng_16, + avm_main_sel_rng_8, + avm_main_tag_err, + avm_main_w_in_tag, + avm_mem_addr, + avm_mem_clk, + avm_mem_ind_op_a, + avm_mem_ind_op_b, + avm_mem_ind_op_c, + avm_mem_last, + avm_mem_lastAccess, + avm_mem_one_min_inv, + avm_mem_op_a, + avm_mem_op_b, + avm_mem_op_c, + avm_mem_r_in_tag, + avm_mem_rw, + avm_mem_sel_mov, + avm_mem_sub_clk, + avm_mem_tag, + avm_mem_tag_err, + avm_mem_val, + avm_mem_w_in_tag, perm_main_alu, perm_main_bin, perm_main_mem_a, @@ -815,29 +815,29 @@ class AvmFlavor { }; RefVector get_to_be_shifted() { - return { avm_mem_m_tag, avm_mem_m_rw, - avm_mem_m_addr, avm_mem_m_val, - avm_binary_acc_ic, avm_binary_op_id, - avm_binary_acc_ib, avm_binary_mem_tag_ctr, - avm_binary_acc_ia, avm_main_internal_return_ptr, - avm_main_pc, avm_alu_alu_u16_r1, - avm_alu_alu_u16_r3, avm_alu_alu_u16_r2, - avm_alu_alu_u16_r5, avm_alu_alu_u16_r4, - avm_alu_alu_u16_r6, avm_alu_alu_u16_r0, - avm_alu_alu_u16_r7 }; + return { avm_alu_u16_r0, avm_alu_u16_r1, + avm_alu_u16_r2, avm_alu_u16_r3, + avm_alu_u16_r4, avm_alu_u16_r5, + avm_alu_u16_r6, avm_alu_u16_r7, + avm_binary_acc_ia, avm_binary_acc_ib, + avm_binary_acc_ic, avm_binary_mem_tag_ctr, + avm_binary_op_id, avm_main_internal_return_ptr, + avm_main_pc, avm_mem_addr, + avm_mem_rw, avm_mem_tag, + avm_mem_val }; }; RefVector get_shifted() { - return { avm_mem_m_tag_shift, avm_mem_m_rw_shift, - avm_mem_m_addr_shift, avm_mem_m_val_shift, - avm_binary_acc_ic_shift, avm_binary_op_id_shift, - avm_binary_acc_ib_shift, avm_binary_mem_tag_ctr_shift, - avm_binary_acc_ia_shift, avm_main_internal_return_ptr_shift, - avm_main_pc_shift, avm_alu_alu_u16_r1_shift, - avm_alu_alu_u16_r3_shift, avm_alu_alu_u16_r2_shift, - avm_alu_alu_u16_r5_shift, avm_alu_alu_u16_r4_shift, - avm_alu_alu_u16_r6_shift, avm_alu_alu_u16_r0_shift, - avm_alu_alu_u16_r7_shift }; + return { avm_alu_u16_r0_shift, avm_alu_u16_r1_shift, + avm_alu_u16_r2_shift, avm_alu_u16_r3_shift, + avm_alu_u16_r4_shift, avm_alu_u16_r5_shift, + avm_alu_u16_r6_shift, avm_alu_u16_r7_shift, + avm_binary_acc_ia_shift, avm_binary_acc_ib_shift, + avm_binary_acc_ic_shift, avm_binary_mem_tag_ctr_shift, + avm_binary_op_id_shift, avm_main_internal_return_ptr_shift, + avm_main_pc_shift, avm_mem_addr_shift, + avm_mem_rw_shift, avm_mem_tag_shift, + avm_mem_val_shift }; }; }; @@ -850,16 +850,16 @@ class AvmFlavor { RefVector get_to_be_shifted() { - return { avm_mem_m_tag, avm_mem_m_rw, - avm_mem_m_addr, avm_mem_m_val, - avm_binary_acc_ic, avm_binary_op_id, - avm_binary_acc_ib, avm_binary_mem_tag_ctr, - avm_binary_acc_ia, avm_main_internal_return_ptr, - avm_main_pc, avm_alu_alu_u16_r1, - avm_alu_alu_u16_r3, avm_alu_alu_u16_r2, - avm_alu_alu_u16_r5, avm_alu_alu_u16_r4, - avm_alu_alu_u16_r6, avm_alu_alu_u16_r0, - avm_alu_alu_u16_r7 }; + return { avm_alu_u16_r0, avm_alu_u16_r1, + avm_alu_u16_r2, avm_alu_u16_r3, + avm_alu_u16_r4, avm_alu_u16_r5, + avm_alu_u16_r6, avm_alu_u16_r7, + avm_binary_acc_ia, avm_binary_acc_ib, + avm_binary_acc_ic, avm_binary_mem_tag_ctr, + avm_binary_op_id, avm_main_internal_return_ptr, + avm_main_pc, avm_mem_addr, + avm_mem_rw, avm_mem_tag, + avm_mem_val }; }; // The plookup wires that store plookup read data. @@ -888,7 +888,7 @@ class AvmFlavor { ProverPolynomials(ProverPolynomials&& o) noexcept = default; ProverPolynomials& operator=(ProverPolynomials&& o) noexcept = default; ~ProverPolynomials() = default; - [[nodiscard]] size_t get_polynomial_size() const { return avm_mem_m_clk.size(); } + [[nodiscard]] size_t get_polynomial_size() const { return avm_alu_alu_sel.size(); } /** * @brief Returns the evaluations of all prover polynomials at one point on the boolean hypercube, which * represents one row in the execution trace. @@ -938,121 +938,121 @@ class AvmFlavor { { Base::avm_main_clk = "AVM_MAIN_CLK"; Base::avm_main_first = "AVM_MAIN_FIRST"; - Base::avm_mem_m_clk = "AVM_MEM_M_CLK"; - Base::avm_mem_m_sub_clk = "AVM_MEM_M_SUB_CLK"; - Base::avm_mem_m_addr = "AVM_MEM_M_ADDR"; - Base::avm_mem_m_tag = "AVM_MEM_M_TAG"; - Base::avm_mem_m_val = "AVM_MEM_M_VAL"; - Base::avm_mem_m_lastAccess = "AVM_MEM_M_LASTACCESS"; - Base::avm_mem_m_last = "AVM_MEM_M_LAST"; - Base::avm_mem_m_rw = "AVM_MEM_M_RW"; - Base::avm_mem_r_in_tag = "AVM_MEM_R_IN_TAG"; - Base::avm_mem_w_in_tag = "AVM_MEM_W_IN_TAG"; - Base::avm_mem_m_op_a = "AVM_MEM_M_OP_A"; - Base::avm_mem_m_op_b = "AVM_MEM_M_OP_B"; - Base::avm_mem_m_op_c = "AVM_MEM_M_OP_C"; - Base::avm_mem_m_ind_op_a = "AVM_MEM_M_IND_OP_A"; - Base::avm_mem_m_ind_op_b = "AVM_MEM_M_IND_OP_B"; - Base::avm_mem_m_ind_op_c = "AVM_MEM_M_IND_OP_C"; - Base::avm_mem_m_sel_mov = "AVM_MEM_M_SEL_MOV"; - Base::avm_mem_m_tag_err = "AVM_MEM_M_TAG_ERR"; - Base::avm_mem_m_one_min_inv = "AVM_MEM_M_ONE_MIN_INV"; - Base::avm_alu_alu_clk = "AVM_ALU_ALU_CLK"; - Base::avm_alu_alu_ia = "AVM_ALU_ALU_IA"; - Base::avm_alu_alu_ib = "AVM_ALU_ALU_IB"; - Base::avm_alu_alu_ic = "AVM_ALU_ALU_IC"; - Base::avm_alu_alu_op_add = "AVM_ALU_ALU_OP_ADD"; - Base::avm_alu_alu_op_sub = "AVM_ALU_ALU_OP_SUB"; - Base::avm_alu_alu_op_mul = "AVM_ALU_ALU_OP_MUL"; - Base::avm_alu_alu_op_div = "AVM_ALU_ALU_OP_DIV"; - Base::avm_alu_alu_op_not = "AVM_ALU_ALU_OP_NOT"; - Base::avm_alu_alu_op_eq = "AVM_ALU_ALU_OP_EQ"; Base::avm_alu_alu_sel = "AVM_ALU_ALU_SEL"; - Base::avm_alu_alu_in_tag = "AVM_ALU_ALU_IN_TAG"; - Base::avm_alu_alu_ff_tag = "AVM_ALU_ALU_FF_TAG"; - Base::avm_alu_alu_u8_tag = "AVM_ALU_ALU_U8_TAG"; - Base::avm_alu_alu_u16_tag = "AVM_ALU_ALU_U16_TAG"; - Base::avm_alu_alu_u32_tag = "AVM_ALU_ALU_U32_TAG"; - Base::avm_alu_alu_u64_tag = "AVM_ALU_ALU_U64_TAG"; - Base::avm_alu_alu_u128_tag = "AVM_ALU_ALU_U128_TAG"; - Base::avm_alu_alu_u8_r0 = "AVM_ALU_ALU_U8_R0"; - Base::avm_alu_alu_u8_r1 = "AVM_ALU_ALU_U8_R1"; - Base::avm_alu_alu_u16_r0 = "AVM_ALU_ALU_U16_R0"; - Base::avm_alu_alu_u16_r1 = "AVM_ALU_ALU_U16_R1"; - Base::avm_alu_alu_u16_r2 = "AVM_ALU_ALU_U16_R2"; - Base::avm_alu_alu_u16_r3 = "AVM_ALU_ALU_U16_R3"; - Base::avm_alu_alu_u16_r4 = "AVM_ALU_ALU_U16_R4"; - Base::avm_alu_alu_u16_r5 = "AVM_ALU_ALU_U16_R5"; - Base::avm_alu_alu_u16_r6 = "AVM_ALU_ALU_U16_R6"; - Base::avm_alu_alu_u16_r7 = "AVM_ALU_ALU_U16_R7"; - Base::avm_alu_alu_u64_r0 = "AVM_ALU_ALU_U64_R0"; - Base::avm_alu_alu_cf = "AVM_ALU_ALU_CF"; - Base::avm_alu_alu_op_eq_diff_inv = "AVM_ALU_ALU_OP_EQ_DIFF_INV"; - Base::avm_byte_lookup_table_op_id = "AVM_BYTE_LOOKUP_TABLE_OP_ID"; - Base::avm_byte_lookup_table_input_a = "AVM_BYTE_LOOKUP_TABLE_INPUT_A"; - Base::avm_byte_lookup_table_input_b = "AVM_BYTE_LOOKUP_TABLE_INPUT_B"; - Base::avm_byte_lookup_table_output = "AVM_BYTE_LOOKUP_TABLE_OUTPUT"; - Base::avm_byte_lookup_bin_sel = "AVM_BYTE_LOOKUP_BIN_SEL"; - Base::avm_byte_lookup_table_in_tags = "AVM_BYTE_LOOKUP_TABLE_IN_TAGS"; - Base::avm_byte_lookup_table_byte_lengths = "AVM_BYTE_LOOKUP_TABLE_BYTE_LENGTHS"; - Base::avm_binary_bin_clk = "AVM_BINARY_BIN_CLK"; - Base::avm_binary_bin_sel = "AVM_BINARY_BIN_SEL"; + Base::avm_alu_cf = "AVM_ALU_CF"; + Base::avm_alu_clk = "AVM_ALU_CLK"; + Base::avm_alu_ff_tag = "AVM_ALU_FF_TAG"; + Base::avm_alu_ia = "AVM_ALU_IA"; + Base::avm_alu_ib = "AVM_ALU_IB"; + Base::avm_alu_ic = "AVM_ALU_IC"; + Base::avm_alu_in_tag = "AVM_ALU_IN_TAG"; + Base::avm_alu_op_add = "AVM_ALU_OP_ADD"; + Base::avm_alu_op_div = "AVM_ALU_OP_DIV"; + Base::avm_alu_op_eq = "AVM_ALU_OP_EQ"; + Base::avm_alu_op_eq_diff_inv = "AVM_ALU_OP_EQ_DIFF_INV"; + Base::avm_alu_op_mul = "AVM_ALU_OP_MUL"; + Base::avm_alu_op_not = "AVM_ALU_OP_NOT"; + Base::avm_alu_op_sub = "AVM_ALU_OP_SUB"; + Base::avm_alu_u128_tag = "AVM_ALU_U128_TAG"; + Base::avm_alu_u16_r0 = "AVM_ALU_U16_R0"; + Base::avm_alu_u16_r1 = "AVM_ALU_U16_R1"; + Base::avm_alu_u16_r2 = "AVM_ALU_U16_R2"; + Base::avm_alu_u16_r3 = "AVM_ALU_U16_R3"; + Base::avm_alu_u16_r4 = "AVM_ALU_U16_R4"; + Base::avm_alu_u16_r5 = "AVM_ALU_U16_R5"; + Base::avm_alu_u16_r6 = "AVM_ALU_U16_R6"; + Base::avm_alu_u16_r7 = "AVM_ALU_U16_R7"; + Base::avm_alu_u16_tag = "AVM_ALU_U16_TAG"; + Base::avm_alu_u32_tag = "AVM_ALU_U32_TAG"; + Base::avm_alu_u64_r0 = "AVM_ALU_U64_R0"; + Base::avm_alu_u64_tag = "AVM_ALU_U64_TAG"; + Base::avm_alu_u8_r0 = "AVM_ALU_U8_R0"; + Base::avm_alu_u8_r1 = "AVM_ALU_U8_R1"; + Base::avm_alu_u8_tag = "AVM_ALU_U8_TAG"; Base::avm_binary_acc_ia = "AVM_BINARY_ACC_IA"; Base::avm_binary_acc_ib = "AVM_BINARY_ACC_IB"; Base::avm_binary_acc_ic = "AVM_BINARY_ACC_IC"; - Base::avm_binary_in_tag = "AVM_BINARY_IN_TAG"; - Base::avm_binary_op_id = "AVM_BINARY_OP_ID"; + Base::avm_binary_bin_clk = "AVM_BINARY_BIN_CLK"; Base::avm_binary_bin_ia_bytes = "AVM_BINARY_BIN_IA_BYTES"; Base::avm_binary_bin_ib_bytes = "AVM_BINARY_BIN_IB_BYTES"; Base::avm_binary_bin_ic_bytes = "AVM_BINARY_BIN_IC_BYTES"; - Base::avm_binary_start = "AVM_BINARY_START"; + Base::avm_binary_bin_sel = "AVM_BINARY_BIN_SEL"; + Base::avm_binary_in_tag = "AVM_BINARY_IN_TAG"; Base::avm_binary_mem_tag_ctr = "AVM_BINARY_MEM_TAG_CTR"; Base::avm_binary_mem_tag_ctr_inv = "AVM_BINARY_MEM_TAG_CTR_INV"; - Base::avm_main_sel_rng_8 = "AVM_MAIN_SEL_RNG_8"; - Base::avm_main_sel_rng_16 = "AVM_MAIN_SEL_RNG_16"; - Base::avm_main_pc = "AVM_MAIN_PC"; - Base::avm_main_internal_return_ptr = "AVM_MAIN_INTERNAL_RETURN_PTR"; - Base::avm_main_sel_internal_call = "AVM_MAIN_SEL_INTERNAL_CALL"; - Base::avm_main_sel_internal_return = "AVM_MAIN_SEL_INTERNAL_RETURN"; - Base::avm_main_sel_jump = "AVM_MAIN_SEL_JUMP"; - Base::avm_main_sel_halt = "AVM_MAIN_SEL_HALT"; - Base::avm_main_sel_mov = "AVM_MAIN_SEL_MOV"; - Base::avm_main_sel_op_add = "AVM_MAIN_SEL_OP_ADD"; - Base::avm_main_sel_op_sub = "AVM_MAIN_SEL_OP_SUB"; - Base::avm_main_sel_op_mul = "AVM_MAIN_SEL_OP_MUL"; - Base::avm_main_sel_op_div = "AVM_MAIN_SEL_OP_DIV"; - Base::avm_main_sel_op_not = "AVM_MAIN_SEL_OP_NOT"; - Base::avm_main_sel_op_eq = "AVM_MAIN_SEL_OP_EQ"; - Base::avm_main_sel_op_and = "AVM_MAIN_SEL_OP_AND"; - Base::avm_main_sel_op_or = "AVM_MAIN_SEL_OP_OR"; - Base::avm_main_sel_op_xor = "AVM_MAIN_SEL_OP_XOR"; + Base::avm_binary_op_id = "AVM_BINARY_OP_ID"; + Base::avm_binary_start = "AVM_BINARY_START"; + Base::avm_byte_lookup_bin_sel = "AVM_BYTE_LOOKUP_BIN_SEL"; + Base::avm_byte_lookup_table_byte_lengths = "AVM_BYTE_LOOKUP_TABLE_BYTE_LENGTHS"; + Base::avm_byte_lookup_table_in_tags = "AVM_BYTE_LOOKUP_TABLE_IN_TAGS"; + Base::avm_byte_lookup_table_input_a = "AVM_BYTE_LOOKUP_TABLE_INPUT_A"; + Base::avm_byte_lookup_table_input_b = "AVM_BYTE_LOOKUP_TABLE_INPUT_B"; + Base::avm_byte_lookup_table_op_id = "AVM_BYTE_LOOKUP_TABLE_OP_ID"; + Base::avm_byte_lookup_table_output = "AVM_BYTE_LOOKUP_TABLE_OUTPUT"; Base::avm_main_alu_sel = "AVM_MAIN_ALU_SEL"; + Base::avm_main_bin_op_id = "AVM_MAIN_BIN_OP_ID"; Base::avm_main_bin_sel = "AVM_MAIN_BIN_SEL"; - Base::avm_main_r_in_tag = "AVM_MAIN_R_IN_TAG"; - Base::avm_main_w_in_tag = "AVM_MAIN_W_IN_TAG"; - Base::avm_main_op_err = "AVM_MAIN_OP_ERR"; - Base::avm_main_tag_err = "AVM_MAIN_TAG_ERR"; - Base::avm_main_inv = "AVM_MAIN_INV"; Base::avm_main_ia = "AVM_MAIN_IA"; Base::avm_main_ib = "AVM_MAIN_IB"; Base::avm_main_ic = "AVM_MAIN_IC"; - Base::avm_main_mem_op_a = "AVM_MAIN_MEM_OP_A"; - Base::avm_main_mem_op_b = "AVM_MAIN_MEM_OP_B"; - Base::avm_main_mem_op_c = "AVM_MAIN_MEM_OP_C"; - Base::avm_main_rwa = "AVM_MAIN_RWA"; - Base::avm_main_rwb = "AVM_MAIN_RWB"; - Base::avm_main_rwc = "AVM_MAIN_RWC"; Base::avm_main_ind_a = "AVM_MAIN_IND_A"; Base::avm_main_ind_b = "AVM_MAIN_IND_B"; Base::avm_main_ind_c = "AVM_MAIN_IND_C"; Base::avm_main_ind_op_a = "AVM_MAIN_IND_OP_A"; Base::avm_main_ind_op_b = "AVM_MAIN_IND_OP_B"; Base::avm_main_ind_op_c = "AVM_MAIN_IND_OP_C"; + Base::avm_main_internal_return_ptr = "AVM_MAIN_INTERNAL_RETURN_PTR"; + Base::avm_main_inv = "AVM_MAIN_INV"; + Base::avm_main_last = "AVM_MAIN_LAST"; Base::avm_main_mem_idx_a = "AVM_MAIN_MEM_IDX_A"; Base::avm_main_mem_idx_b = "AVM_MAIN_MEM_IDX_B"; Base::avm_main_mem_idx_c = "AVM_MAIN_MEM_IDX_C"; - Base::avm_main_last = "AVM_MAIN_LAST"; - Base::avm_main_bin_op_id = "AVM_MAIN_BIN_OP_ID"; + Base::avm_main_mem_op_a = "AVM_MAIN_MEM_OP_A"; + Base::avm_main_mem_op_b = "AVM_MAIN_MEM_OP_B"; + Base::avm_main_mem_op_c = "AVM_MAIN_MEM_OP_C"; + Base::avm_main_op_err = "AVM_MAIN_OP_ERR"; + Base::avm_main_pc = "AVM_MAIN_PC"; + Base::avm_main_r_in_tag = "AVM_MAIN_R_IN_TAG"; + Base::avm_main_rwa = "AVM_MAIN_RWA"; + Base::avm_main_rwb = "AVM_MAIN_RWB"; + Base::avm_main_rwc = "AVM_MAIN_RWC"; + Base::avm_main_sel_halt = "AVM_MAIN_SEL_HALT"; + Base::avm_main_sel_internal_call = "AVM_MAIN_SEL_INTERNAL_CALL"; + Base::avm_main_sel_internal_return = "AVM_MAIN_SEL_INTERNAL_RETURN"; + Base::avm_main_sel_jump = "AVM_MAIN_SEL_JUMP"; + Base::avm_main_sel_mov = "AVM_MAIN_SEL_MOV"; + Base::avm_main_sel_op_add = "AVM_MAIN_SEL_OP_ADD"; + Base::avm_main_sel_op_and = "AVM_MAIN_SEL_OP_AND"; + Base::avm_main_sel_op_div = "AVM_MAIN_SEL_OP_DIV"; + Base::avm_main_sel_op_eq = "AVM_MAIN_SEL_OP_EQ"; + Base::avm_main_sel_op_mul = "AVM_MAIN_SEL_OP_MUL"; + Base::avm_main_sel_op_not = "AVM_MAIN_SEL_OP_NOT"; + Base::avm_main_sel_op_or = "AVM_MAIN_SEL_OP_OR"; + Base::avm_main_sel_op_sub = "AVM_MAIN_SEL_OP_SUB"; + Base::avm_main_sel_op_xor = "AVM_MAIN_SEL_OP_XOR"; + Base::avm_main_sel_rng_16 = "AVM_MAIN_SEL_RNG_16"; + Base::avm_main_sel_rng_8 = "AVM_MAIN_SEL_RNG_8"; + Base::avm_main_tag_err = "AVM_MAIN_TAG_ERR"; + Base::avm_main_w_in_tag = "AVM_MAIN_W_IN_TAG"; + Base::avm_mem_addr = "AVM_MEM_ADDR"; + Base::avm_mem_clk = "AVM_MEM_CLK"; + Base::avm_mem_ind_op_a = "AVM_MEM_IND_OP_A"; + Base::avm_mem_ind_op_b = "AVM_MEM_IND_OP_B"; + Base::avm_mem_ind_op_c = "AVM_MEM_IND_OP_C"; + Base::avm_mem_last = "AVM_MEM_LAST"; + Base::avm_mem_lastAccess = "AVM_MEM_LASTACCESS"; + Base::avm_mem_one_min_inv = "AVM_MEM_ONE_MIN_INV"; + Base::avm_mem_op_a = "AVM_MEM_OP_A"; + Base::avm_mem_op_b = "AVM_MEM_OP_B"; + Base::avm_mem_op_c = "AVM_MEM_OP_C"; + Base::avm_mem_r_in_tag = "AVM_MEM_R_IN_TAG"; + Base::avm_mem_rw = "AVM_MEM_RW"; + Base::avm_mem_sel_mov = "AVM_MEM_SEL_MOV"; + Base::avm_mem_sub_clk = "AVM_MEM_SUB_CLK"; + Base::avm_mem_tag = "AVM_MEM_TAG"; + Base::avm_mem_tag_err = "AVM_MEM_TAG_ERR"; + Base::avm_mem_val = "AVM_MEM_VAL"; + Base::avm_mem_w_in_tag = "AVM_MEM_W_IN_TAG"; Base::perm_main_alu = "PERM_MAIN_ALU"; Base::perm_main_bin = "PERM_MAIN_BIN"; Base::perm_main_mem_a = "PERM_MAIN_MEM_A"; @@ -1088,121 +1088,121 @@ class AvmFlavor { public: uint32_t circuit_size; - Commitment avm_mem_m_clk; - Commitment avm_mem_m_sub_clk; - Commitment avm_mem_m_addr; - Commitment avm_mem_m_tag; - Commitment avm_mem_m_val; - Commitment avm_mem_m_lastAccess; - Commitment avm_mem_m_last; - Commitment avm_mem_m_rw; - Commitment avm_mem_r_in_tag; - Commitment avm_mem_w_in_tag; - Commitment avm_mem_m_op_a; - Commitment avm_mem_m_op_b; - Commitment avm_mem_m_op_c; - Commitment avm_mem_m_ind_op_a; - Commitment avm_mem_m_ind_op_b; - Commitment avm_mem_m_ind_op_c; - Commitment avm_mem_m_sel_mov; - Commitment avm_mem_m_tag_err; - Commitment avm_mem_m_one_min_inv; - Commitment avm_alu_alu_clk; - Commitment avm_alu_alu_ia; - Commitment avm_alu_alu_ib; - Commitment avm_alu_alu_ic; - Commitment avm_alu_alu_op_add; - Commitment avm_alu_alu_op_sub; - Commitment avm_alu_alu_op_mul; - Commitment avm_alu_alu_op_div; - Commitment avm_alu_alu_op_not; - Commitment avm_alu_alu_op_eq; Commitment avm_alu_alu_sel; - Commitment avm_alu_alu_in_tag; - Commitment avm_alu_alu_ff_tag; - Commitment avm_alu_alu_u8_tag; - Commitment avm_alu_alu_u16_tag; - Commitment avm_alu_alu_u32_tag; - Commitment avm_alu_alu_u64_tag; - Commitment avm_alu_alu_u128_tag; - Commitment avm_alu_alu_u8_r0; - Commitment avm_alu_alu_u8_r1; - Commitment avm_alu_alu_u16_r0; - Commitment avm_alu_alu_u16_r1; - Commitment avm_alu_alu_u16_r2; - Commitment avm_alu_alu_u16_r3; - Commitment avm_alu_alu_u16_r4; - Commitment avm_alu_alu_u16_r5; - Commitment avm_alu_alu_u16_r6; - Commitment avm_alu_alu_u16_r7; - Commitment avm_alu_alu_u64_r0; - Commitment avm_alu_alu_cf; - Commitment avm_alu_alu_op_eq_diff_inv; - Commitment avm_byte_lookup_table_op_id; - Commitment avm_byte_lookup_table_input_a; - Commitment avm_byte_lookup_table_input_b; - Commitment avm_byte_lookup_table_output; - Commitment avm_byte_lookup_bin_sel; - Commitment avm_byte_lookup_table_in_tags; - Commitment avm_byte_lookup_table_byte_lengths; - Commitment avm_binary_bin_clk; - Commitment avm_binary_bin_sel; + Commitment avm_alu_cf; + Commitment avm_alu_clk; + Commitment avm_alu_ff_tag; + Commitment avm_alu_ia; + Commitment avm_alu_ib; + Commitment avm_alu_ic; + Commitment avm_alu_in_tag; + Commitment avm_alu_op_add; + Commitment avm_alu_op_div; + Commitment avm_alu_op_eq; + Commitment avm_alu_op_eq_diff_inv; + Commitment avm_alu_op_mul; + Commitment avm_alu_op_not; + Commitment avm_alu_op_sub; + Commitment avm_alu_u128_tag; + Commitment avm_alu_u16_r0; + Commitment avm_alu_u16_r1; + Commitment avm_alu_u16_r2; + Commitment avm_alu_u16_r3; + Commitment avm_alu_u16_r4; + Commitment avm_alu_u16_r5; + Commitment avm_alu_u16_r6; + Commitment avm_alu_u16_r7; + Commitment avm_alu_u16_tag; + Commitment avm_alu_u32_tag; + Commitment avm_alu_u64_r0; + Commitment avm_alu_u64_tag; + Commitment avm_alu_u8_r0; + Commitment avm_alu_u8_r1; + Commitment avm_alu_u8_tag; Commitment avm_binary_acc_ia; Commitment avm_binary_acc_ib; Commitment avm_binary_acc_ic; - Commitment avm_binary_in_tag; - Commitment avm_binary_op_id; + Commitment avm_binary_bin_clk; Commitment avm_binary_bin_ia_bytes; Commitment avm_binary_bin_ib_bytes; Commitment avm_binary_bin_ic_bytes; - Commitment avm_binary_start; + Commitment avm_binary_bin_sel; + Commitment avm_binary_in_tag; Commitment avm_binary_mem_tag_ctr; Commitment avm_binary_mem_tag_ctr_inv; - Commitment avm_main_sel_rng_8; - Commitment avm_main_sel_rng_16; - Commitment avm_main_pc; - Commitment avm_main_internal_return_ptr; - Commitment avm_main_sel_internal_call; - Commitment avm_main_sel_internal_return; - Commitment avm_main_sel_jump; - Commitment avm_main_sel_halt; - Commitment avm_main_sel_mov; - Commitment avm_main_sel_op_add; - Commitment avm_main_sel_op_sub; - Commitment avm_main_sel_op_mul; - Commitment avm_main_sel_op_div; - Commitment avm_main_sel_op_not; - Commitment avm_main_sel_op_eq; - Commitment avm_main_sel_op_and; - Commitment avm_main_sel_op_or; - Commitment avm_main_sel_op_xor; + Commitment avm_binary_op_id; + Commitment avm_binary_start; + Commitment avm_byte_lookup_bin_sel; + Commitment avm_byte_lookup_table_byte_lengths; + Commitment avm_byte_lookup_table_in_tags; + Commitment avm_byte_lookup_table_input_a; + Commitment avm_byte_lookup_table_input_b; + Commitment avm_byte_lookup_table_op_id; + Commitment avm_byte_lookup_table_output; Commitment avm_main_alu_sel; + Commitment avm_main_bin_op_id; Commitment avm_main_bin_sel; - Commitment avm_main_r_in_tag; - Commitment avm_main_w_in_tag; - Commitment avm_main_op_err; - Commitment avm_main_tag_err; - Commitment avm_main_inv; Commitment avm_main_ia; Commitment avm_main_ib; Commitment avm_main_ic; - Commitment avm_main_mem_op_a; - Commitment avm_main_mem_op_b; - Commitment avm_main_mem_op_c; - Commitment avm_main_rwa; - Commitment avm_main_rwb; - Commitment avm_main_rwc; Commitment avm_main_ind_a; Commitment avm_main_ind_b; Commitment avm_main_ind_c; Commitment avm_main_ind_op_a; Commitment avm_main_ind_op_b; Commitment avm_main_ind_op_c; + Commitment avm_main_internal_return_ptr; + Commitment avm_main_inv; + Commitment avm_main_last; Commitment avm_main_mem_idx_a; Commitment avm_main_mem_idx_b; Commitment avm_main_mem_idx_c; - Commitment avm_main_last; - Commitment avm_main_bin_op_id; + Commitment avm_main_mem_op_a; + Commitment avm_main_mem_op_b; + Commitment avm_main_mem_op_c; + Commitment avm_main_op_err; + Commitment avm_main_pc; + Commitment avm_main_r_in_tag; + Commitment avm_main_rwa; + Commitment avm_main_rwb; + Commitment avm_main_rwc; + Commitment avm_main_sel_halt; + Commitment avm_main_sel_internal_call; + Commitment avm_main_sel_internal_return; + Commitment avm_main_sel_jump; + Commitment avm_main_sel_mov; + Commitment avm_main_sel_op_add; + Commitment avm_main_sel_op_and; + Commitment avm_main_sel_op_div; + Commitment avm_main_sel_op_eq; + Commitment avm_main_sel_op_mul; + Commitment avm_main_sel_op_not; + Commitment avm_main_sel_op_or; + Commitment avm_main_sel_op_sub; + Commitment avm_main_sel_op_xor; + Commitment avm_main_sel_rng_16; + Commitment avm_main_sel_rng_8; + Commitment avm_main_tag_err; + Commitment avm_main_w_in_tag; + Commitment avm_mem_addr; + Commitment avm_mem_clk; + Commitment avm_mem_ind_op_a; + Commitment avm_mem_ind_op_b; + Commitment avm_mem_ind_op_c; + Commitment avm_mem_last; + Commitment avm_mem_lastAccess; + Commitment avm_mem_one_min_inv; + Commitment avm_mem_op_a; + Commitment avm_mem_op_b; + Commitment avm_mem_op_c; + Commitment avm_mem_r_in_tag; + Commitment avm_mem_rw; + Commitment avm_mem_sel_mov; + Commitment avm_mem_sub_clk; + Commitment avm_mem_tag; + Commitment avm_mem_tag_err; + Commitment avm_mem_val; + Commitment avm_mem_w_in_tag; Commitment perm_main_alu; Commitment perm_main_bin; Commitment perm_main_mem_a; @@ -1238,122 +1238,122 @@ class AvmFlavor { circuit_size = deserialize_from_buffer(proof_data, num_frs_read); size_t log_n = numeric::get_msb(circuit_size); - avm_mem_m_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_sub_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_lastAccess = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_rw = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_ind_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_ind_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_ind_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_sel_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_m_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_alu_alu_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_ff_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u8_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u32_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u64_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u128_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u8_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u8_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_u64_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_cf = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_op_eq_diff_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_input_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_input_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_in_tags = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_byte_lengths = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_bin_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_cf = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_ff_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_op_eq_diff_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u128_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u32_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u64_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u64_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u8_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u8_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u8_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_acc_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_acc_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_acc_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_bin_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_bin_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_bin_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_bin_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_mem_tag_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_mem_tag_ctr_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_pc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_internal_return_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_internal_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_internal_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_jump = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_halt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_and = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_or = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_xor = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_byte_lookup_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_byte_lookup_table_byte_lengths = + deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_byte_lookup_table_in_tags = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_byte_lookup_table_input_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_byte_lookup_table_input_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_byte_lookup_table_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_byte_lookup_table_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_alu_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_bin_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_op_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_rwa = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_rwb = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_rwc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ind_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ind_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ind_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ind_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ind_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_ind_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_internal_return_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_mem_idx_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_mem_idx_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_main_mem_idx_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_bin_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_op_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_pc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_rwa = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_rwb = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_rwc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_halt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_internal_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_internal_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_jump = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_and = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_or = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_op_xor = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_ind_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_ind_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_ind_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_lastAccess = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_rw = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_sel_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_sub_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_mem_w_in_tag = 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_mem_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -1393,121 +1393,121 @@ class AvmFlavor { serialize_to_buffer(circuit_size, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_clk, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_sub_clk, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_addr, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_tag, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_val, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_lastAccess, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_last, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_rw, Transcript::proof_data); - serialize_to_buffer(avm_mem_r_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_mem_w_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_op_a, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_op_b, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_op_c, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_ind_op_a, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_ind_op_b, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_ind_op_c, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_sel_mov, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_tag_err, Transcript::proof_data); - serialize_to_buffer(avm_mem_m_one_min_inv, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_clk, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_ia, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_ib, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_ic, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_op_add, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_op_sub, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_op_mul, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_op_div, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_op_not, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_op_eq, Transcript::proof_data); serialize_to_buffer(avm_alu_alu_sel, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_ff_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u8_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u32_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u64_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u128_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u8_r0, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u8_r1, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_r0, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_r1, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_r2, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_r3, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_r4, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_r5, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_r6, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u16_r7, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_u64_r0, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_cf, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_op_eq_diff_inv, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_op_id, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_input_a, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_input_b, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_output, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_bin_sel, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_in_tags, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_byte_lengths, Transcript::proof_data); - serialize_to_buffer(avm_binary_bin_clk, Transcript::proof_data); - serialize_to_buffer(avm_binary_bin_sel, Transcript::proof_data); + serialize_to_buffer(avm_alu_cf, Transcript::proof_data); + serialize_to_buffer(avm_alu_clk, Transcript::proof_data); + serialize_to_buffer(avm_alu_ff_tag, Transcript::proof_data); + serialize_to_buffer(avm_alu_ia, Transcript::proof_data); + serialize_to_buffer(avm_alu_ib, Transcript::proof_data); + serialize_to_buffer(avm_alu_ic, Transcript::proof_data); + serialize_to_buffer(avm_alu_in_tag, Transcript::proof_data); + serialize_to_buffer(avm_alu_op_add, Transcript::proof_data); + serialize_to_buffer(avm_alu_op_div, Transcript::proof_data); + serialize_to_buffer(avm_alu_op_eq, Transcript::proof_data); + serialize_to_buffer(avm_alu_op_eq_diff_inv, Transcript::proof_data); + serialize_to_buffer(avm_alu_op_mul, Transcript::proof_data); + serialize_to_buffer(avm_alu_op_not, Transcript::proof_data); + serialize_to_buffer(avm_alu_op_sub, Transcript::proof_data); + serialize_to_buffer(avm_alu_u128_tag, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r0, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r1, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r2, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r3, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r4, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r5, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r6, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r7, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_tag, Transcript::proof_data); + serialize_to_buffer(avm_alu_u32_tag, Transcript::proof_data); + serialize_to_buffer(avm_alu_u64_r0, Transcript::proof_data); + serialize_to_buffer(avm_alu_u64_tag, Transcript::proof_data); + serialize_to_buffer(avm_alu_u8_r0, Transcript::proof_data); + serialize_to_buffer(avm_alu_u8_r1, Transcript::proof_data); + serialize_to_buffer(avm_alu_u8_tag, Transcript::proof_data); serialize_to_buffer(avm_binary_acc_ia, Transcript::proof_data); serialize_to_buffer(avm_binary_acc_ib, Transcript::proof_data); serialize_to_buffer(avm_binary_acc_ic, Transcript::proof_data); - serialize_to_buffer(avm_binary_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_binary_op_id, Transcript::proof_data); + serialize_to_buffer(avm_binary_bin_clk, Transcript::proof_data); serialize_to_buffer(avm_binary_bin_ia_bytes, Transcript::proof_data); serialize_to_buffer(avm_binary_bin_ib_bytes, Transcript::proof_data); serialize_to_buffer(avm_binary_bin_ic_bytes, Transcript::proof_data); - serialize_to_buffer(avm_binary_start, Transcript::proof_data); + serialize_to_buffer(avm_binary_bin_sel, Transcript::proof_data); + serialize_to_buffer(avm_binary_in_tag, Transcript::proof_data); serialize_to_buffer(avm_binary_mem_tag_ctr, Transcript::proof_data); serialize_to_buffer(avm_binary_mem_tag_ctr_inv, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_rng_8, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_rng_16, Transcript::proof_data); - serialize_to_buffer(avm_main_pc, Transcript::proof_data); - serialize_to_buffer(avm_main_internal_return_ptr, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_internal_call, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_internal_return, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_jump, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_halt, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_mov, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_add, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_sub, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_mul, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_div, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_not, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_eq, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_and, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_or, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_xor, Transcript::proof_data); + serialize_to_buffer(avm_binary_op_id, Transcript::proof_data); + serialize_to_buffer(avm_binary_start, Transcript::proof_data); + serialize_to_buffer(avm_byte_lookup_bin_sel, Transcript::proof_data); + serialize_to_buffer(avm_byte_lookup_table_byte_lengths, Transcript::proof_data); + serialize_to_buffer(avm_byte_lookup_table_in_tags, Transcript::proof_data); + serialize_to_buffer(avm_byte_lookup_table_input_a, Transcript::proof_data); + serialize_to_buffer(avm_byte_lookup_table_input_b, Transcript::proof_data); + serialize_to_buffer(avm_byte_lookup_table_op_id, Transcript::proof_data); + serialize_to_buffer(avm_byte_lookup_table_output, Transcript::proof_data); serialize_to_buffer(avm_main_alu_sel, Transcript::proof_data); + serialize_to_buffer(avm_main_bin_op_id, Transcript::proof_data); serialize_to_buffer(avm_main_bin_sel, Transcript::proof_data); - serialize_to_buffer(avm_main_r_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_main_w_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_main_op_err, Transcript::proof_data); - serialize_to_buffer(avm_main_tag_err, Transcript::proof_data); - serialize_to_buffer(avm_main_inv, Transcript::proof_data); serialize_to_buffer(avm_main_ia, Transcript::proof_data); serialize_to_buffer(avm_main_ib, Transcript::proof_data); serialize_to_buffer(avm_main_ic, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_op_a, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_op_b, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_op_c, Transcript::proof_data); - serialize_to_buffer(avm_main_rwa, Transcript::proof_data); - serialize_to_buffer(avm_main_rwb, Transcript::proof_data); - serialize_to_buffer(avm_main_rwc, Transcript::proof_data); serialize_to_buffer(avm_main_ind_a, Transcript::proof_data); serialize_to_buffer(avm_main_ind_b, Transcript::proof_data); serialize_to_buffer(avm_main_ind_c, Transcript::proof_data); serialize_to_buffer(avm_main_ind_op_a, Transcript::proof_data); serialize_to_buffer(avm_main_ind_op_b, Transcript::proof_data); serialize_to_buffer(avm_main_ind_op_c, Transcript::proof_data); + serialize_to_buffer(avm_main_internal_return_ptr, Transcript::proof_data); + serialize_to_buffer(avm_main_inv, Transcript::proof_data); + serialize_to_buffer(avm_main_last, Transcript::proof_data); serialize_to_buffer(avm_main_mem_idx_a, Transcript::proof_data); serialize_to_buffer(avm_main_mem_idx_b, Transcript::proof_data); serialize_to_buffer(avm_main_mem_idx_c, Transcript::proof_data); - serialize_to_buffer(avm_main_last, Transcript::proof_data); - serialize_to_buffer(avm_main_bin_op_id, Transcript::proof_data); + serialize_to_buffer(avm_main_mem_op_a, Transcript::proof_data); + serialize_to_buffer(avm_main_mem_op_b, Transcript::proof_data); + serialize_to_buffer(avm_main_mem_op_c, Transcript::proof_data); + serialize_to_buffer(avm_main_op_err, Transcript::proof_data); + serialize_to_buffer(avm_main_pc, Transcript::proof_data); + serialize_to_buffer(avm_main_r_in_tag, Transcript::proof_data); + serialize_to_buffer(avm_main_rwa, Transcript::proof_data); + serialize_to_buffer(avm_main_rwb, Transcript::proof_data); + serialize_to_buffer(avm_main_rwc, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_halt, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_internal_call, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_internal_return, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_jump, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_mov, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_add, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_and, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_div, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_eq, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_mul, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_not, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_or, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_sub, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_op_xor, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_rng_16, Transcript::proof_data); + serialize_to_buffer(avm_main_sel_rng_8, Transcript::proof_data); + serialize_to_buffer(avm_main_tag_err, Transcript::proof_data); + serialize_to_buffer(avm_main_w_in_tag, Transcript::proof_data); + serialize_to_buffer(avm_mem_addr, Transcript::proof_data); + serialize_to_buffer(avm_mem_clk, Transcript::proof_data); + serialize_to_buffer(avm_mem_ind_op_a, Transcript::proof_data); + serialize_to_buffer(avm_mem_ind_op_b, Transcript::proof_data); + serialize_to_buffer(avm_mem_ind_op_c, Transcript::proof_data); + serialize_to_buffer(avm_mem_last, Transcript::proof_data); + serialize_to_buffer(avm_mem_lastAccess, Transcript::proof_data); + serialize_to_buffer(avm_mem_one_min_inv, Transcript::proof_data); + serialize_to_buffer(avm_mem_op_a, Transcript::proof_data); + serialize_to_buffer(avm_mem_op_b, Transcript::proof_data); + serialize_to_buffer(avm_mem_op_c, Transcript::proof_data); + serialize_to_buffer(avm_mem_r_in_tag, Transcript::proof_data); + serialize_to_buffer(avm_mem_rw, Transcript::proof_data); + serialize_to_buffer(avm_mem_sel_mov, Transcript::proof_data); + serialize_to_buffer(avm_mem_sub_clk, Transcript::proof_data); + serialize_to_buffer(avm_mem_tag, Transcript::proof_data); + serialize_to_buffer(avm_mem_tag_err, Transcript::proof_data); + serialize_to_buffer(avm_mem_val, Transcript::proof_data); + serialize_to_buffer(avm_mem_w_in_tag, 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_mem_a, 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 1d1a647e6f0..d76f8dfa6f4 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp @@ -51,193 +51,92 @@ bool AvmVerifier::verify_proof(const HonkProof& proof) } // Get commitments to VM wires - commitments.avm_mem_m_clk = transcript->template receive_from_prover(commitment_labels.avm_mem_m_clk); - commitments.avm_mem_m_sub_clk = - transcript->template receive_from_prover(commitment_labels.avm_mem_m_sub_clk); - commitments.avm_mem_m_addr = transcript->template receive_from_prover(commitment_labels.avm_mem_m_addr); - commitments.avm_mem_m_tag = transcript->template receive_from_prover(commitment_labels.avm_mem_m_tag); - commitments.avm_mem_m_val = transcript->template receive_from_prover(commitment_labels.avm_mem_m_val); - commitments.avm_mem_m_lastAccess = - transcript->template receive_from_prover(commitment_labels.avm_mem_m_lastAccess); - commitments.avm_mem_m_last = transcript->template receive_from_prover(commitment_labels.avm_mem_m_last); - commitments.avm_mem_m_rw = transcript->template receive_from_prover(commitment_labels.avm_mem_m_rw); - commitments.avm_mem_r_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_mem_r_in_tag); - commitments.avm_mem_w_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_mem_w_in_tag); - commitments.avm_mem_m_op_a = transcript->template receive_from_prover(commitment_labels.avm_mem_m_op_a); - commitments.avm_mem_m_op_b = transcript->template receive_from_prover(commitment_labels.avm_mem_m_op_b); - commitments.avm_mem_m_op_c = transcript->template receive_from_prover(commitment_labels.avm_mem_m_op_c); - commitments.avm_mem_m_ind_op_a = - transcript->template receive_from_prover(commitment_labels.avm_mem_m_ind_op_a); - commitments.avm_mem_m_ind_op_b = - transcript->template receive_from_prover(commitment_labels.avm_mem_m_ind_op_b); - commitments.avm_mem_m_ind_op_c = - transcript->template receive_from_prover(commitment_labels.avm_mem_m_ind_op_c); - commitments.avm_mem_m_sel_mov = - transcript->template receive_from_prover(commitment_labels.avm_mem_m_sel_mov); - commitments.avm_mem_m_tag_err = - transcript->template receive_from_prover(commitment_labels.avm_mem_m_tag_err); - commitments.avm_mem_m_one_min_inv = - transcript->template receive_from_prover(commitment_labels.avm_mem_m_one_min_inv); - commitments.avm_alu_alu_clk = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_clk); - commitments.avm_alu_alu_ia = transcript->template receive_from_prover(commitment_labels.avm_alu_alu_ia); - commitments.avm_alu_alu_ib = transcript->template receive_from_prover(commitment_labels.avm_alu_alu_ib); - commitments.avm_alu_alu_ic = transcript->template receive_from_prover(commitment_labels.avm_alu_alu_ic); - commitments.avm_alu_alu_op_add = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_op_add); - commitments.avm_alu_alu_op_sub = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_op_sub); - commitments.avm_alu_alu_op_mul = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_op_mul); - commitments.avm_alu_alu_op_div = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_op_div); - commitments.avm_alu_alu_op_not = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_op_not); - commitments.avm_alu_alu_op_eq = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_op_eq); commitments.avm_alu_alu_sel = transcript->template receive_from_prover(commitment_labels.avm_alu_alu_sel); - commitments.avm_alu_alu_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_in_tag); - commitments.avm_alu_alu_ff_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_ff_tag); - commitments.avm_alu_alu_u8_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u8_tag); - commitments.avm_alu_alu_u16_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_tag); - commitments.avm_alu_alu_u32_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u32_tag); - commitments.avm_alu_alu_u64_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u64_tag); - commitments.avm_alu_alu_u128_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u128_tag); - commitments.avm_alu_alu_u8_r0 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u8_r0); - commitments.avm_alu_alu_u8_r1 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u8_r1); - commitments.avm_alu_alu_u16_r0 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_r0); - commitments.avm_alu_alu_u16_r1 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_r1); - commitments.avm_alu_alu_u16_r2 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_r2); - commitments.avm_alu_alu_u16_r3 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_r3); - commitments.avm_alu_alu_u16_r4 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_r4); - commitments.avm_alu_alu_u16_r5 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_r5); - commitments.avm_alu_alu_u16_r6 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_r6); - commitments.avm_alu_alu_u16_r7 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u16_r7); - commitments.avm_alu_alu_u64_r0 = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_u64_r0); - commitments.avm_alu_alu_cf = transcript->template receive_from_prover(commitment_labels.avm_alu_alu_cf); - commitments.avm_alu_alu_op_eq_diff_inv = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_op_eq_diff_inv); - commitments.avm_byte_lookup_table_op_id = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_op_id); - commitments.avm_byte_lookup_table_input_a = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_input_a); - commitments.avm_byte_lookup_table_input_b = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_input_b); - commitments.avm_byte_lookup_table_output = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_output); - commitments.avm_byte_lookup_bin_sel = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_bin_sel); - commitments.avm_byte_lookup_table_in_tags = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_in_tags); - commitments.avm_byte_lookup_table_byte_lengths = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_byte_lengths); - commitments.avm_binary_bin_clk = - transcript->template receive_from_prover(commitment_labels.avm_binary_bin_clk); - commitments.avm_binary_bin_sel = - transcript->template receive_from_prover(commitment_labels.avm_binary_bin_sel); + commitments.avm_alu_cf = transcript->template receive_from_prover(commitment_labels.avm_alu_cf); + commitments.avm_alu_clk = transcript->template receive_from_prover(commitment_labels.avm_alu_clk); + commitments.avm_alu_ff_tag = transcript->template receive_from_prover(commitment_labels.avm_alu_ff_tag); + commitments.avm_alu_ia = transcript->template receive_from_prover(commitment_labels.avm_alu_ia); + commitments.avm_alu_ib = transcript->template receive_from_prover(commitment_labels.avm_alu_ib); + commitments.avm_alu_ic = transcript->template receive_from_prover(commitment_labels.avm_alu_ic); + commitments.avm_alu_in_tag = transcript->template receive_from_prover(commitment_labels.avm_alu_in_tag); + commitments.avm_alu_op_add = transcript->template receive_from_prover(commitment_labels.avm_alu_op_add); + commitments.avm_alu_op_div = transcript->template receive_from_prover(commitment_labels.avm_alu_op_div); + commitments.avm_alu_op_eq = transcript->template receive_from_prover(commitment_labels.avm_alu_op_eq); + commitments.avm_alu_op_eq_diff_inv = + transcript->template receive_from_prover(commitment_labels.avm_alu_op_eq_diff_inv); + commitments.avm_alu_op_mul = transcript->template receive_from_prover(commitment_labels.avm_alu_op_mul); + commitments.avm_alu_op_not = transcript->template receive_from_prover(commitment_labels.avm_alu_op_not); + commitments.avm_alu_op_sub = transcript->template receive_from_prover(commitment_labels.avm_alu_op_sub); + commitments.avm_alu_u128_tag = + transcript->template receive_from_prover(commitment_labels.avm_alu_u128_tag); + commitments.avm_alu_u16_r0 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r0); + commitments.avm_alu_u16_r1 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r1); + commitments.avm_alu_u16_r2 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r2); + commitments.avm_alu_u16_r3 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r3); + commitments.avm_alu_u16_r4 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r4); + commitments.avm_alu_u16_r5 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r5); + commitments.avm_alu_u16_r6 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r6); + commitments.avm_alu_u16_r7 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r7); + commitments.avm_alu_u16_tag = + transcript->template receive_from_prover(commitment_labels.avm_alu_u16_tag); + commitments.avm_alu_u32_tag = + transcript->template receive_from_prover(commitment_labels.avm_alu_u32_tag); + commitments.avm_alu_u64_r0 = transcript->template receive_from_prover(commitment_labels.avm_alu_u64_r0); + commitments.avm_alu_u64_tag = + transcript->template receive_from_prover(commitment_labels.avm_alu_u64_tag); + commitments.avm_alu_u8_r0 = transcript->template receive_from_prover(commitment_labels.avm_alu_u8_r0); + commitments.avm_alu_u8_r1 = transcript->template receive_from_prover(commitment_labels.avm_alu_u8_r1); + commitments.avm_alu_u8_tag = transcript->template receive_from_prover(commitment_labels.avm_alu_u8_tag); commitments.avm_binary_acc_ia = transcript->template receive_from_prover(commitment_labels.avm_binary_acc_ia); commitments.avm_binary_acc_ib = transcript->template receive_from_prover(commitment_labels.avm_binary_acc_ib); commitments.avm_binary_acc_ic = transcript->template receive_from_prover(commitment_labels.avm_binary_acc_ic); - commitments.avm_binary_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_binary_in_tag); - commitments.avm_binary_op_id = - transcript->template receive_from_prover(commitment_labels.avm_binary_op_id); + commitments.avm_binary_bin_clk = + transcript->template receive_from_prover(commitment_labels.avm_binary_bin_clk); commitments.avm_binary_bin_ia_bytes = transcript->template receive_from_prover(commitment_labels.avm_binary_bin_ia_bytes); commitments.avm_binary_bin_ib_bytes = transcript->template receive_from_prover(commitment_labels.avm_binary_bin_ib_bytes); commitments.avm_binary_bin_ic_bytes = transcript->template receive_from_prover(commitment_labels.avm_binary_bin_ic_bytes); - commitments.avm_binary_start = - transcript->template receive_from_prover(commitment_labels.avm_binary_start); + commitments.avm_binary_bin_sel = + transcript->template receive_from_prover(commitment_labels.avm_binary_bin_sel); + commitments.avm_binary_in_tag = + transcript->template receive_from_prover(commitment_labels.avm_binary_in_tag); commitments.avm_binary_mem_tag_ctr = transcript->template receive_from_prover(commitment_labels.avm_binary_mem_tag_ctr); commitments.avm_binary_mem_tag_ctr_inv = transcript->template receive_from_prover(commitment_labels.avm_binary_mem_tag_ctr_inv); - commitments.avm_main_sel_rng_8 = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_rng_8); - commitments.avm_main_sel_rng_16 = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_rng_16); - commitments.avm_main_pc = transcript->template receive_from_prover(commitment_labels.avm_main_pc); - commitments.avm_main_internal_return_ptr = - transcript->template receive_from_prover(commitment_labels.avm_main_internal_return_ptr); - commitments.avm_main_sel_internal_call = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_internal_call); - commitments.avm_main_sel_internal_return = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_internal_return); - commitments.avm_main_sel_jump = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_jump); - commitments.avm_main_sel_halt = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_halt); - commitments.avm_main_sel_mov = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_mov); - commitments.avm_main_sel_op_add = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_add); - commitments.avm_main_sel_op_sub = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_sub); - commitments.avm_main_sel_op_mul = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_mul); - commitments.avm_main_sel_op_div = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_div); - commitments.avm_main_sel_op_not = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_not); - commitments.avm_main_sel_op_eq = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_eq); - commitments.avm_main_sel_op_and = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_and); - commitments.avm_main_sel_op_or = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_or); - commitments.avm_main_sel_op_xor = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_xor); + commitments.avm_binary_op_id = + transcript->template receive_from_prover(commitment_labels.avm_binary_op_id); + commitments.avm_binary_start = + transcript->template receive_from_prover(commitment_labels.avm_binary_start); + commitments.avm_byte_lookup_bin_sel = + transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_bin_sel); + commitments.avm_byte_lookup_table_byte_lengths = + transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_byte_lengths); + commitments.avm_byte_lookup_table_in_tags = + transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_in_tags); + commitments.avm_byte_lookup_table_input_a = + transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_input_a); + commitments.avm_byte_lookup_table_input_b = + transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_input_b); + commitments.avm_byte_lookup_table_op_id = + transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_op_id); + commitments.avm_byte_lookup_table_output = + transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_output); commitments.avm_main_alu_sel = transcript->template receive_from_prover(commitment_labels.avm_main_alu_sel); + commitments.avm_main_bin_op_id = + transcript->template receive_from_prover(commitment_labels.avm_main_bin_op_id); commitments.avm_main_bin_sel = transcript->template receive_from_prover(commitment_labels.avm_main_bin_sel); - commitments.avm_main_r_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_main_r_in_tag); - commitments.avm_main_w_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_main_w_in_tag); - commitments.avm_main_op_err = - transcript->template receive_from_prover(commitment_labels.avm_main_op_err); - commitments.avm_main_tag_err = - transcript->template receive_from_prover(commitment_labels.avm_main_tag_err); - commitments.avm_main_inv = transcript->template receive_from_prover(commitment_labels.avm_main_inv); commitments.avm_main_ia = transcript->template receive_from_prover(commitment_labels.avm_main_ia); commitments.avm_main_ib = transcript->template receive_from_prover(commitment_labels.avm_main_ib); commitments.avm_main_ic = transcript->template receive_from_prover(commitment_labels.avm_main_ic); - commitments.avm_main_mem_op_a = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_a); - commitments.avm_main_mem_op_b = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_b); - commitments.avm_main_mem_op_c = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_c); - commitments.avm_main_rwa = transcript->template receive_from_prover(commitment_labels.avm_main_rwa); - commitments.avm_main_rwb = transcript->template receive_from_prover(commitment_labels.avm_main_rwb); - commitments.avm_main_rwc = transcript->template receive_from_prover(commitment_labels.avm_main_rwc); commitments.avm_main_ind_a = transcript->template receive_from_prover(commitment_labels.avm_main_ind_a); commitments.avm_main_ind_b = transcript->template receive_from_prover(commitment_labels.avm_main_ind_b); commitments.avm_main_ind_c = transcript->template receive_from_prover(commitment_labels.avm_main_ind_c); @@ -247,15 +146,95 @@ bool AvmVerifier::verify_proof(const HonkProof& proof) transcript->template receive_from_prover(commitment_labels.avm_main_ind_op_b); commitments.avm_main_ind_op_c = transcript->template receive_from_prover(commitment_labels.avm_main_ind_op_c); + commitments.avm_main_internal_return_ptr = + transcript->template receive_from_prover(commitment_labels.avm_main_internal_return_ptr); + commitments.avm_main_inv = transcript->template receive_from_prover(commitment_labels.avm_main_inv); + commitments.avm_main_last = transcript->template receive_from_prover(commitment_labels.avm_main_last); commitments.avm_main_mem_idx_a = transcript->template receive_from_prover(commitment_labels.avm_main_mem_idx_a); commitments.avm_main_mem_idx_b = transcript->template receive_from_prover(commitment_labels.avm_main_mem_idx_b); commitments.avm_main_mem_idx_c = transcript->template receive_from_prover(commitment_labels.avm_main_mem_idx_c); - commitments.avm_main_last = transcript->template receive_from_prover(commitment_labels.avm_main_last); - commitments.avm_main_bin_op_id = - transcript->template receive_from_prover(commitment_labels.avm_main_bin_op_id); + commitments.avm_main_mem_op_a = + transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_a); + commitments.avm_main_mem_op_b = + transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_b); + commitments.avm_main_mem_op_c = + transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_c); + commitments.avm_main_op_err = + transcript->template receive_from_prover(commitment_labels.avm_main_op_err); + commitments.avm_main_pc = transcript->template receive_from_prover(commitment_labels.avm_main_pc); + commitments.avm_main_r_in_tag = + transcript->template receive_from_prover(commitment_labels.avm_main_r_in_tag); + commitments.avm_main_rwa = transcript->template receive_from_prover(commitment_labels.avm_main_rwa); + commitments.avm_main_rwb = transcript->template receive_from_prover(commitment_labels.avm_main_rwb); + commitments.avm_main_rwc = transcript->template receive_from_prover(commitment_labels.avm_main_rwc); + commitments.avm_main_sel_halt = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_halt); + commitments.avm_main_sel_internal_call = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_internal_call); + commitments.avm_main_sel_internal_return = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_internal_return); + commitments.avm_main_sel_jump = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_jump); + commitments.avm_main_sel_mov = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_mov); + commitments.avm_main_sel_op_add = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_add); + commitments.avm_main_sel_op_and = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_and); + commitments.avm_main_sel_op_div = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_div); + commitments.avm_main_sel_op_eq = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_eq); + commitments.avm_main_sel_op_mul = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_mul); + commitments.avm_main_sel_op_not = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_not); + commitments.avm_main_sel_op_or = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_or); + commitments.avm_main_sel_op_sub = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_sub); + commitments.avm_main_sel_op_xor = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_xor); + commitments.avm_main_sel_rng_16 = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_rng_16); + commitments.avm_main_sel_rng_8 = + transcript->template receive_from_prover(commitment_labels.avm_main_sel_rng_8); + commitments.avm_main_tag_err = + transcript->template receive_from_prover(commitment_labels.avm_main_tag_err); + commitments.avm_main_w_in_tag = + transcript->template receive_from_prover(commitment_labels.avm_main_w_in_tag); + commitments.avm_mem_addr = transcript->template receive_from_prover(commitment_labels.avm_mem_addr); + commitments.avm_mem_clk = transcript->template receive_from_prover(commitment_labels.avm_mem_clk); + commitments.avm_mem_ind_op_a = + transcript->template receive_from_prover(commitment_labels.avm_mem_ind_op_a); + commitments.avm_mem_ind_op_b = + transcript->template receive_from_prover(commitment_labels.avm_mem_ind_op_b); + commitments.avm_mem_ind_op_c = + transcript->template receive_from_prover(commitment_labels.avm_mem_ind_op_c); + commitments.avm_mem_last = transcript->template receive_from_prover(commitment_labels.avm_mem_last); + commitments.avm_mem_lastAccess = + transcript->template receive_from_prover(commitment_labels.avm_mem_lastAccess); + commitments.avm_mem_one_min_inv = + transcript->template receive_from_prover(commitment_labels.avm_mem_one_min_inv); + commitments.avm_mem_op_a = transcript->template receive_from_prover(commitment_labels.avm_mem_op_a); + commitments.avm_mem_op_b = transcript->template receive_from_prover(commitment_labels.avm_mem_op_b); + commitments.avm_mem_op_c = transcript->template receive_from_prover(commitment_labels.avm_mem_op_c); + commitments.avm_mem_r_in_tag = + transcript->template receive_from_prover(commitment_labels.avm_mem_r_in_tag); + commitments.avm_mem_rw = transcript->template receive_from_prover(commitment_labels.avm_mem_rw); + commitments.avm_mem_sel_mov = + transcript->template receive_from_prover(commitment_labels.avm_mem_sel_mov); + commitments.avm_mem_sub_clk = + transcript->template receive_from_prover(commitment_labels.avm_mem_sub_clk); + commitments.avm_mem_tag = transcript->template receive_from_prover(commitment_labels.avm_mem_tag); + commitments.avm_mem_tag_err = + transcript->template receive_from_prover(commitment_labels.avm_mem_tag_err); + commitments.avm_mem_val = transcript->template receive_from_prover(commitment_labels.avm_mem_val); + commitments.avm_mem_w_in_tag = + transcript->template receive_from_prover(commitment_labels.avm_mem_w_in_tag); 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_mem_a = diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp index 7e5dbf7a26c..8dadfd439f2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp @@ -38,9 +38,9 @@ void common_validate_arithmetic_op(Row const& main_row, EXPECT_EQ(main_row.avm_main_r_in_tag, FF(static_cast(tag))); // Check that intermediate registers are correctly copied in Alu trace - EXPECT_EQ(alu_row.avm_alu_alu_ia, a); - EXPECT_EQ(alu_row.avm_alu_alu_ib, b); - EXPECT_EQ(alu_row.avm_alu_alu_ic, c); + EXPECT_EQ(alu_row.avm_alu_ia, a); + EXPECT_EQ(alu_row.avm_alu_ib, b); + EXPECT_EQ(alu_row.avm_alu_ic, c); // Check that no error is raised EXPECT_EQ(main_row.avm_main_tag_err, FF(0)); @@ -61,7 +61,7 @@ Row common_validate_add(std::vector const& trace, // Find the corresponding Alu trace row auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); @@ -72,7 +72,7 @@ Row common_validate_add(std::vector const& trace, // Check that addition selector is set. EXPECT_EQ(row->avm_main_sel_op_add, FF(1)); - EXPECT_EQ(alu_row->avm_alu_alu_op_add, FF(1)); + EXPECT_EQ(alu_row->avm_alu_op_add, FF(1)); return *alu_row; } @@ -91,7 +91,7 @@ Row common_validate_sub(std::vector const& trace, // Find the corresponding Alu trace row auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); @@ -102,7 +102,7 @@ Row common_validate_sub(std::vector const& trace, // Check that subtraction selector is set. EXPECT_EQ(row->avm_main_sel_op_sub, FF(1)); - EXPECT_EQ(alu_row->avm_alu_alu_op_sub, FF(1)); + EXPECT_EQ(alu_row->avm_alu_op_sub, FF(1)); return *alu_row; } @@ -121,7 +121,7 @@ size_t common_validate_mul(std::vector const& trace, // Find the corresponding Alu trace row auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); @@ -132,7 +132,7 @@ size_t common_validate_mul(std::vector const& trace, // Check that multiplication selector is set. EXPECT_EQ(row->avm_main_sel_op_mul, FF(1)); - EXPECT_EQ(alu_row->avm_alu_alu_op_mul, FF(1)); + EXPECT_EQ(alu_row->avm_alu_op_mul, FF(1)); return static_cast(alu_row - trace.begin()); } @@ -151,7 +151,7 @@ size_t common_validate_eq(std::vector const& trace, // Find the corresponding Alu trace row auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); @@ -162,7 +162,7 @@ size_t common_validate_eq(std::vector const& trace, // Check that equality selector is set. EXPECT_EQ(row->avm_main_sel_op_eq, FF(1)); - EXPECT_EQ(alu_row->avm_alu_alu_op_eq, FF(1)); + EXPECT_EQ(alu_row->avm_alu_op_eq, FF(1)); return static_cast(alu_row - trace.begin()); } @@ -258,10 +258,10 @@ std::vector gen_mutated_trace_eq( auto main_trace_row = std::ranges::find_if(trace.begin(), trace.end(), select_row); auto main_clk = main_trace_row->avm_main_clk; auto alu_row = - std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.avm_alu_alu_clk == main_clk; }); + std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.avm_alu_clk == main_clk; }); - main_trace_row->avm_alu_alu_op_eq_diff_inv = mutated_inv_diff; - alu_row->avm_alu_alu_op_eq_diff_inv = mutated_inv_diff; + main_trace_row->avm_alu_op_eq_diff_inv = mutated_inv_diff; + alu_row->avm_alu_op_eq_diff_inv = mutated_inv_diff; return trace; } @@ -330,9 +330,9 @@ TEST_F(AvmArithmeticTestsFF, addition) auto alu_row = common_validate_add(trace, FF(37), FF(4), FF(41), FF(0), FF(1), FF(4), AvmMemoryTag::FF); - EXPECT_EQ(alu_row.avm_alu_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); validate_trace_proof(std::move(trace)); } @@ -349,9 +349,9 @@ TEST_F(AvmArithmeticTestsFF, subtraction) auto alu_row = common_validate_sub(trace, FF(17), FF(8), FF(9), FF(2), FF(0), FF(1), AvmMemoryTag::FF); - EXPECT_EQ(alu_row.avm_alu_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); validate_trace_proof(std::move(trace)); } @@ -369,9 +369,9 @@ TEST_F(AvmArithmeticTestsFF, multiplication) auto alu_row_index = common_validate_mul(trace, FF(20), FF(5), FF(100), FF(2), FF(0), FF(1), AvmMemoryTag::FF); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); validate_trace_proof(std::move(trace)); } @@ -389,9 +389,9 @@ TEST_F(AvmArithmeticTestsFF, multiplicationByZero) auto alu_row_index = common_validate_mul(trace, FF(127), FF(0), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::FF); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); validate_trace_proof(std::move(trace)); } @@ -528,8 +528,8 @@ TEST_F(AvmArithmeticTestsFF, equality) auto alu_row_index = common_validate_eq(trace, elem, elem, FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::FF); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(0)); // Expect 0 as inv of (q-1) - (q-1) + EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); // Expect 0 as inv of (q-1) - (q-1) validate_trace_proof(std::move(trace)); } @@ -545,8 +545,8 @@ TEST_F(AvmArithmeticTestsFF, nonEquality) auto alu_row_index = common_validate_eq(trace, elem, FF(0), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::FF); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(-1).invert()); + EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-1).invert()); validate_trace_proof(std::move(trace)); } @@ -568,9 +568,9 @@ TEST_F(AvmArithmeticTestsU8, addition) auto alu_row = common_validate_add(trace, FF(62), FF(29), FF(91), FF(0), FF(1), FF(2), AvmMemoryTag::U8); - EXPECT_EQ(alu_row.avm_alu_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(91)); + EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(91)); validate_trace_proof(std::move(trace)); } @@ -589,10 +589,10 @@ TEST_F(AvmArithmeticTestsU8, additionCarry) auto alu_row = common_validate_add(trace, FF(159), FF(100), FF(3), FF(0), FF(1), FF(2), AvmMemoryTag::U8); - EXPECT_EQ(alu_row.avm_alu_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(3)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(3)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(1)); validate_trace_proof(std::move(trace)); } @@ -611,9 +611,9 @@ TEST_F(AvmArithmeticTestsU8, subtraction) auto alu_row = common_validate_sub(trace, FF(162), FF(29), FF(133), FF(0), FF(1), FF(2), AvmMemoryTag::U8); - EXPECT_EQ(alu_row.avm_alu_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(133)); + EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(133)); validate_trace_proof(std::move(trace)); } @@ -633,17 +633,17 @@ TEST_F(AvmArithmeticTestsU8, subtractionCarry) auto alu_row = common_validate_sub(trace, FF(5), FF(29), FF(232), FF(0), FF(1), FF(2), AvmMemoryTag::U8); - EXPECT_EQ(alu_row.avm_alu_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(232)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(232)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(UINT8_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); validate_trace_proof(std::move(trace)); } @@ -662,11 +662,11 @@ TEST_F(AvmArithmeticTestsU8, multiplication) auto alu_row_index = common_validate_mul(trace, FF(13), FF(15), FF(195), FF(0), FF(1), FF(2), AvmMemoryTag::U8); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); // Decomposition of integer multiplication in 8-bit registers - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(195)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(195)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); validate_trace_proof(std::move(trace)); } @@ -685,12 +685,12 @@ TEST_F(AvmArithmeticTestsU8, multiplicationOverflow) auto alu_row_index = common_validate_mul(trace, FF(200), FF(170), FF(208), FF(0), FF(1), FF(2), AvmMemoryTag::U8); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); // Decomposition of integer multiplication in 8-bit registers // 34'000 = 208 + 132 * 256 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(208)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(132)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(208)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(132)); validate_trace_proof(std::move(trace)); } @@ -703,8 +703,8 @@ TEST_F(AvmArithmeticTestsU8, equality) auto alu_row_index = common_validate_eq(trace, FF(128), FF(128), FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U8); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); validate_trace_proof(std::move(trace)); } @@ -716,8 +716,8 @@ TEST_F(AvmArithmeticTestsU8, nonEquality) auto alu_row_index = common_validate_eq(trace, 84, 200, FF(0), FF(12), FF(15), FF(28), AvmMemoryTag::U8); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(-116).invert()); + EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-116).invert()); validate_trace_proof(std::move(trace)); } @@ -739,10 +739,10 @@ TEST_F(AvmArithmeticTestsU16, addition) auto alu_row = common_validate_add(trace, FF(33005), FF(1775), FF(34780), FF(546), FF(119), FF(5), AvmMemoryTag::U16); - EXPECT_EQ(alu_row.avm_alu_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0xDC)); // 34780 = 0x87DC - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0x87)); + EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xDC)); // 34780 = 0x87DC + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x87)); validate_trace_proof(std::move(trace)); } @@ -761,10 +761,10 @@ TEST_F(AvmArithmeticTestsU16, additionCarry) auto alu_row = common_validate_add(trace, FF(1000), FF(UINT16_MAX - 982), FF(17), FF(1), FF(0), FF(0), AvmMemoryTag::U16); - EXPECT_EQ(alu_row.avm_alu_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(17)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(17)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); validate_trace_proof(std::move(trace)); } @@ -783,11 +783,11 @@ TEST_F(AvmArithmeticTestsU16, subtraction) auto alu_row = common_validate_sub(trace, FF(33005), FF(1775), FF(31230), FF(546), FF(119), FF(5), AvmMemoryTag::U16); - EXPECT_EQ(alu_row.avm_alu_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0xFE)); // 31230 in Hex: 79FE - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0x79)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xFE)); // 31230 in Hex: 79FE + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x79)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); validate_trace_proof(std::move(trace)); } @@ -807,17 +807,17 @@ TEST_F(AvmArithmeticTestsU16, subtractionCarry) auto alu_row = common_validate_sub(trace, FF(1000), FF(UINT16_MAX - 982), FF(1983), FF(1), FF(0), FF(0), AvmMemoryTag::U16); - EXPECT_EQ(alu_row.avm_alu_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0xBF)); // 1983 = 0x7BF - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(7)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xBF)); // 1983 = 0x7BF + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(7)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); validate_trace_proof(std::move(trace)); } @@ -837,12 +837,12 @@ TEST_F(AvmArithmeticTestsU16, multiplication) common_validate_mul(trace, FF(200), FF(245), FF(49000), FF(0), FF(1), FF(2), AvmMemoryTag::U16); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0x68)); // 49000 = 0xBF68 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0xBF)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x68)); // 49000 = 0xBF68 + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xBF)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); validate_trace_proof(std::move(trace)); } @@ -861,14 +861,14 @@ TEST_F(AvmArithmeticTestsU16, multiplicationOverflow) auto alu_row_index = common_validate_mul(trace, FF(512), FF(1024), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U16); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 512 * 1024 = 0 + 8 * 2^16 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(8)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(8)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); validate_trace_proof(std::move(trace)); } @@ -881,8 +881,8 @@ TEST_F(AvmArithmeticTestsU16, equality) auto alu_row_index = common_validate_eq(trace, FF(35823), FF(35823), FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U16); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); validate_trace_proof(std::move(trace)); } @@ -894,8 +894,8 @@ TEST_F(AvmArithmeticTestsU16, nonEquality) auto alu_row_index = common_validate_eq(trace, 35'823, 50'123, FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U16); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(-14'300).invert()); + EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-14'300).invert()); validate_trace_proof(std::move(trace)); } @@ -917,11 +917,11 @@ TEST_F(AvmArithmeticTestsU32, addition) auto alu_row = common_validate_add( trace, FF(1000000000), FF(1234567891), FF(2234567891LLU), FF(8), FF(9), FF(0), AvmMemoryTag::U32); - EXPECT_EQ(alu_row.avm_alu_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(2234567891LLU & UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF((2234567891LLU >> 8) & UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(2234567891LLU >> 16)); + EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(2234567891LLU & UINT8_MAX)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF((2234567891LLU >> 8) & UINT8_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(2234567891LLU >> 16)); validate_trace_proof(std::move(trace)); } @@ -940,10 +940,10 @@ TEST_F(AvmArithmeticTestsU32, additionCarry) auto alu_row = common_validate_add(trace, FF(UINT32_MAX - 1293), FF(2293), FF(999), FF(8), FF(9), FF(0), AvmMemoryTag::U32); - EXPECT_EQ(alu_row.avm_alu_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(231)); // 999 = 3 * 256 + 231 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(3)); + EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(231)); // 999 = 3 * 256 + 231 + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(3)); validate_trace_proof(std::move(trace)); } @@ -962,14 +962,14 @@ TEST_F(AvmArithmeticTestsU32, subtraction) auto alu_row = common_validate_sub( trace, FF(1345678991), FF(1234567891), FF(111111100), FF(8), FF(9), FF(0), AvmMemoryTag::U32); - EXPECT_EQ(alu_row.avm_alu_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); // 111111100 = 0x69F6BBC - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0xBC)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0x6B)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0x69F)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xBC)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x6B)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x69F)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); validate_trace_proof(std::move(trace)); } @@ -989,19 +989,19 @@ TEST_F(AvmArithmeticTestsU32, subtractionCarry) auto alu_row = common_validate_sub( trace, FF(3210987654LLU), FF(UINT32_MAX - 99), FF(3210987754LLU), FF(9), FF(8), FF(0), AvmMemoryTag::U32); - EXPECT_EQ(alu_row.avm_alu_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); // 3210987754 = 0xBF63C8EA - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0xEA)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0xC8)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0xBF63)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xEA)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xC8)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0xBF63)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); validate_trace_proof(std::move(trace)); } @@ -1021,16 +1021,16 @@ TEST_F(AvmArithmeticTestsU32, multiplication) common_validate_mul(trace, FF(11111), FF(11111), FF(123454321), FF(0), FF(1), FF(2), AvmMemoryTag::U32); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 123454321 = 0x75BC371 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0x71)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0xC3)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0x75B)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x71)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xC3)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x75B)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); validate_trace_proof(std::move(trace)); } @@ -1050,16 +1050,16 @@ TEST_F(AvmArithmeticTestsU32, multiplicationOverflow) common_validate_mul(trace, FF(11 << 25), FF(13 << 22), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U32); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 143 * 2^47 = 0 + 0 * 2^16 + 2^15 * 2^32 + 71 * 2^48 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(32768)); // 2^15 - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(71)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(32768)); // 2^15 + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(71)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); validate_trace_proof(std::move(trace)); } @@ -1073,8 +1073,8 @@ TEST_F(AvmArithmeticTestsU32, equality) common_validate_eq(trace, 0xb435e9c1, 0xb435e9c1, FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U32); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); validate_trace_proof(std::move(trace)); } @@ -1087,8 +1087,8 @@ TEST_F(AvmArithmeticTestsU32, nonEquality) common_validate_eq(trace, 0xb435e9c1, 0xb435e9c0, FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U32); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(1).invert()); + EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(1).invert()); validate_trace_proof(std::move(trace)); } @@ -1113,15 +1113,15 @@ TEST_F(AvmArithmeticTestsU64, addition) auto alu_row = common_validate_add(trace, FF(a), FF(b), FF(c), FF(8), FF(9), FF(9), AvmMemoryTag::U64); - EXPECT_EQ(alu_row.avm_alu_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); // c in HEX: 2436849FE16F1D - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0x1D)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0x6F)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0x9FE1)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0x3684)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0x24)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x1D)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x6F)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x9FE1)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0x3684)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0x24)); validate_trace_proof(std::move(trace)); } @@ -1143,13 +1143,13 @@ TEST_F(AvmArithmeticTestsU64, additionCarry) auto alu_row = common_validate_add(trace, FF(a), FF(b), FF(c), FF(0), FF(1), FF(0), AvmMemoryTag::U64); - EXPECT_EQ(alu_row.avm_alu_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(UINT8_MAX - 201)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(UINT8_MAX - 201)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(UINT8_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); validate_trace_proof(std::move(trace)); } @@ -1171,16 +1171,16 @@ TEST_F(AvmArithmeticTestsU64, subtraction) auto alu_row = common_validate_sub(trace, FF(a), FF(b), FF(c), FF(8), FF(9), FF(9), AvmMemoryTag::U64); - EXPECT_EQ(alu_row.avm_alu_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); // 10000000000000000 = 0x2386F26FC10000 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0X6FC1)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0X86F2)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0X23)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0X6FC1)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0X86F2)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0X23)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); validate_trace_proof(std::move(trace)); } @@ -1203,18 +1203,18 @@ TEST_F(AvmArithmeticTestsU64, subtractionCarry) auto alu_row = common_validate_sub(trace, FF(a), FF(b), FF(c), FF(0), FF(1), FF(0), AvmMemoryTag::U64); - EXPECT_EQ(alu_row.avm_alu_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(1)); - - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(UINT8_MAX - 74)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); + + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(UINT8_MAX - 74)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(UINT8_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); validate_trace_proof(std::move(trace)); } @@ -1233,16 +1233,16 @@ TEST_F(AvmArithmeticTestsU64, multiplication) trace, FF(999888777), FF(555444333), FF(555382554814950741LLU), FF(0), FF(1), FF(2), AvmMemoryTag::U64); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 555,382,554,814,950,741 = 0x 7B5 1D7D B631 AD55 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0x55)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0xAD)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0xB631)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0x1D7D)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0x7B5)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x55)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xAD)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0xB631)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0x1D7D)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0x7B5)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); validate_trace_proof(std::move(trace)); } @@ -1265,19 +1265,19 @@ TEST_F(AvmArithmeticTestsU64, multiplicationOverflow) auto alu_row_index = common_validate_mul(trace, FF(a), FF(b), FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U64); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 2^128 - 2^65 + 1 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(UINT16_MAX - 1)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX - 1)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); validate_trace_proof(std::move(trace)); } @@ -1290,8 +1290,8 @@ TEST_F(AvmArithmeticTestsU64, equality) trace, 0xffffffffffffffe0LLU, 0xffffffffffffffe0LLU, FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U64); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); validate_trace_proof(std::move(trace)); } @@ -1304,8 +1304,8 @@ TEST_F(AvmArithmeticTestsU64, nonEquality) trace, 0xffffffffffffffe0LLU, 0xffffffffffaeffe0LLU, FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U64); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(0x510000).invert()); + EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0x510000).invert()); validate_trace_proof(std::move(trace)); } @@ -1337,17 +1337,17 @@ TEST_F(AvmArithmeticTestsU128, addition) FF(9), AvmMemoryTag::U128); - EXPECT_EQ(alu_row.avm_alu_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0xEE)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0xEE)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0xAAAA)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0xDDDD)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(0x5555)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(0x6666)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(0x4444)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(0x8888)); + EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xEE)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xEE)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0xFFFF)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0xAAAA)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0xDDDD)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0x5555)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(0x6666)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0x4444)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0x8888)); validate_trace_proof(std::move(trace)); } @@ -1377,17 +1377,17 @@ TEST_F(AvmArithmeticTestsU128, additionCarry) FF(9), AvmMemoryTag::U128); - EXPECT_EQ(alu_row.avm_alu_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0x9B)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0xDD)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0xF97E)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(0xFFFF)); + EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x9B)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xDD)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0xF97E)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0xFFFF)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0xFFFF)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0xFFFF)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(0xFFFF)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0xFFFF)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0xFFFF)); validate_trace_proof(std::move(trace)); } @@ -1416,20 +1416,20 @@ TEST_F(AvmArithmeticTestsU128, subtraction) FF(9), AvmMemoryTag::U128); - EXPECT_EQ(alu_row.avm_alu_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); // 36771555 = 23116E3 - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0xE3)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0x16)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0x231)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r7, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xE3)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x16)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x231)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r7, FF(0)); validate_trace_proof(std::move(trace)); } @@ -1458,18 +1458,18 @@ TEST_F(AvmArithmeticTestsU128, subtractionCarry) FF(9), AvmMemoryTag::U128); - EXPECT_EQ(alu_row.avm_alu_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_cf, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r0, FF(0x88)); - EXPECT_EQ(alu_row.avm_alu_alu_u8_r1, FF(0x88)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r0, FF(0x5555)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r1, FF(0x8888)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r2, FF(0x3333)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r3, FF(0x3333)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r4, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r5, FF(0)); - EXPECT_EQ(alu_row.avm_alu_alu_u16_r6, FF(0x2222)); + EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x88)); + EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x88)); + EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x5555)); + EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0x8888)); + EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0x3333)); + EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0x3333)); + EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0x2222)); validate_trace_proof(std::move(trace)); } @@ -1491,20 +1491,20 @@ TEST_F(AvmArithmeticTestsU128, multiplication) trace, FF(0x38D64BF685FFBLLU), FF(555444333222111LLU), c, FF(0), FF(1), FF(2), AvmMemoryTag::U128); auto alu_row_first = trace.at(alu_row_index); - EXPECT_EQ(alu_row_first.avm_alu_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row_first.avm_alu_u128_tag, FF(1)); // Decomposition of the first operand in 16-bit registers - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r0, FF(0x5FFB)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r1, FF(0xBF68)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r2, FF(0x8D64)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r3, FF(0x3)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r0, FF(0x5FFB)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r1, FF(0xBF68)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r2, FF(0x8D64)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r3, FF(0x3)); // Decomposition of the second operand in 16-bit registers auto alu_row_second = trace.at(alu_row_index + 1); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r0, FF(0x98DF)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r1, FF(0x762C)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r2, FF(0xF92C)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r3, FF(0x1)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r0, FF(0x98DF)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r1, FF(0x762C)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r2, FF(0xF92C)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r3, FF(0x1)); validate_trace_proof(std::move(trace)); } @@ -1534,36 +1534,36 @@ TEST_F(AvmArithmeticTestsU128, multiplicationOverflow) AvmMemoryTag::U128); auto alu_row_first = trace.at(alu_row_index); - EXPECT_EQ(alu_row_first.avm_alu_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row_first.avm_alu_u128_tag, FF(1)); // Decomposition of the first operand in 16-bit registers - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r0, FF(0xFFFE)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r6, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_alu_u16_r7, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r0, FF(0xFFFE)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.avm_alu_u16_r7, FF(UINT16_MAX)); // Decomposition of the second operand in 16-bit registers auto alu_row_second = trace.at(alu_row_index + 1); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r0, FF(0xFFFC)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r6, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_alu_u16_r7, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r0, FF(0xFFFC)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.avm_alu_u16_r7, FF(UINT16_MAX)); // Other registers involved in the relevant relations // PIL relation (avm_alu.pil): a * b_l + a_l * b_h * 2^64 = (CF * 2^64 + R') * 2^128 + c // (2^128 - 2) * (2^64 - 4) + (2^64 - 2) * (2^64 - 1) * 2^64 = // 2 * 2^192 + (- 4 - 2 - 1) * 2^128 + (-2 + 2) * 2^64 + 8 = (2^65 - 7) * 2^128 + 8 // Therefore, CF = 1 and R' = 2^64 - 7 - EXPECT_EQ(alu_row_first.avm_alu_alu_u64_r0, FF{ UINT64_MAX - 6 }); // 2^64 - 7 - EXPECT_EQ(alu_row_first.avm_alu_alu_cf, FF(1)); + EXPECT_EQ(alu_row_first.avm_alu_u64_r0, FF{ UINT64_MAX - 6 }); // 2^64 - 7 + EXPECT_EQ(alu_row_first.avm_alu_cf, FF(1)); validate_trace_proof(std::move(trace)); } @@ -1583,8 +1583,8 @@ TEST_F(AvmArithmeticTestsU128, equality) AvmMemoryTag::U128); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); validate_trace_proof(std::move(trace)); } @@ -1605,8 +1605,8 @@ TEST_F(AvmArithmeticTestsU128, nonEquality) AvmMemoryTag::U128); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_alu_op_eq_diff_inv, FF(0xdeadbeefLLU << 32).invert()); + EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0xdeadbeefLLU << 32).invert()); validate_trace_proof(std::move(trace)); } 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 b73ebc729cd..2823545d327 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp @@ -28,7 +28,7 @@ void common_validate_op_not(std::vector const& trace, // Use the row in the main trace to find the same operation in the alu trace. FF clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); @@ -51,13 +51,13 @@ void common_validate_op_not(std::vector const& trace, EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(tag))); // Check that intermediate registers are correctly copied in Alu trace - EXPECT_EQ(alu_row->avm_alu_alu_ia, a); - EXPECT_EQ(alu_row->avm_alu_alu_ib, FF(0)); - EXPECT_EQ(alu_row->avm_alu_alu_ic, c); + EXPECT_EQ(alu_row->avm_alu_ia, a); + EXPECT_EQ(alu_row->avm_alu_ib, FF(0)); + EXPECT_EQ(alu_row->avm_alu_ic, c); // Check that not selector is set. EXPECT_EQ(row->avm_main_sel_op_not, FF(1)); - EXPECT_EQ(alu_row->avm_alu_alu_op_not, FF(1)); + EXPECT_EQ(alu_row->avm_alu_op_not, FF(1)); switch (tag) { // Handle the different mem_tags here since this is part of a // parameterised test @@ -65,19 +65,19 @@ void common_validate_op_not(std::vector const& trace, FAIL() << "Unintialized Mem Tags Disallowed"; break; case AvmMemoryTag::U8: - EXPECT_EQ(alu_row->avm_alu_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row->avm_alu_u8_tag, FF(1)); break; case AvmMemoryTag::U16: - EXPECT_EQ(alu_row->avm_alu_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row->avm_alu_u16_tag, FF(1)); break; case AvmMemoryTag::U32: - EXPECT_EQ(alu_row->avm_alu_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row->avm_alu_u32_tag, FF(1)); break; case AvmMemoryTag::U64: - EXPECT_EQ(alu_row->avm_alu_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row->avm_alu_u64_tag, FF(1)); break; case AvmMemoryTag::U128: - EXPECT_EQ(alu_row->avm_alu_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row->avm_alu_u128_tag, FF(1)); break; case AvmMemoryTag::FF: FAIL() << "FF Mem Tags Disallowed for bitwise"; @@ -544,14 +544,14 @@ TEST_F(AvmBitwiseNegativeTestsFF, UndefinedOverFF) // TODO(ilyas): When the SET opcodes applies relational constraints, this will fail // we will need to look at a new way of doing this test. for (size_t i = 1; i < 4; i++) { - trace.at(i).avm_mem_m_tag = FF(6); + trace.at(i).avm_mem_tag = FF(6); trace.at(i).avm_mem_r_in_tag = FF(6); trace.at(i).avm_mem_w_in_tag = FF(6); - trace.at(i).avm_alu_alu_ff_tag = FF::one(); - trace.at(i).avm_alu_alu_u8_tag = FF::zero(); + trace.at(i).avm_alu_ff_tag = FF::one(); + trace.at(i).avm_alu_u8_tag = FF::zero(); trace.at(i).avm_main_r_in_tag = FF(6); trace.at(i).avm_main_w_in_tag = FF(6); - trace.at(i).avm_alu_alu_in_tag = FF(6); + trace.at(i).avm_alu_in_tag = FF(6); } EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "ALU_FF_NOT_XOR"); 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 0dcaae7b8a7..f2292cf5cac 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 @@ -52,24 +52,24 @@ TEST_F(AvmInterTableTests, tagErrNotCopiedInMain) // Create a valid ALU entry for this equality operation. auto& alu_row = trace.at(1); - alu_row.avm_alu_alu_clk = clk; + alu_row.avm_alu_clk = clk; alu_row.avm_alu_alu_sel = 1; - alu_row.avm_alu_alu_ia = 32; - alu_row.avm_alu_alu_ib = 32; - alu_row.avm_alu_alu_ic = 1; - alu_row.avm_alu_alu_op_eq = 1; - alu_row.avm_alu_alu_in_tag = static_cast(AvmMemoryTag::U128); - alu_row.avm_alu_alu_u128_tag = 1; + alu_row.avm_alu_ia = 32; + alu_row.avm_alu_ib = 32; + alu_row.avm_alu_ic = 1; + alu_row.avm_alu_op_eq = 1; + alu_row.avm_alu_in_tag = static_cast(AvmMemoryTag::U128); + alu_row.avm_alu_u128_tag = 1; // Adjust the output of the computation as it would have been performed without tag check. row->avm_main_ic = 1; // Find the memory row pertaining to write operation from Ic. auto mem_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_STORE_C; + return r.avm_mem_clk == clk && r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_STORE_C; }); // Adjust the output in the memory trace. - mem_row->avm_mem_m_val = 1; + mem_row->avm_mem_val = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "INCL_MAIN_TAG_ERR"); } @@ -105,13 +105,12 @@ class AvmPermMainAluNegativeTests : public AvmInterTableTests { auto clk = row->avm_main_clk; // Find the corresponding Alu trace row - auto alu_row = - std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); ASSERT_TRUE(alu_row != trace.end()); // Find memory trace entry related to storing output (intermediate register Ic) in memory. auto mem_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_op_c == FF(1) && r.avm_mem_m_rw == FF(1); + return r.avm_mem_clk == clk && r.avm_mem_op_c == FF(1) && r.avm_mem_rw == FF(1); }); ASSERT_TRUE(mem_row != trace.end()); @@ -126,7 +125,7 @@ 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_idx).avm_main_ic = 1008; - trace.at(mem_idx).avm_mem_m_val = 1008; + trace.at(mem_idx).avm_mem_val = 1008; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_ALU"); } @@ -134,10 +133,10 @@ TEST_F(AvmPermMainAluNegativeTests, wrongAluOutputCopyInMain) TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIaInput) { // Mutate the input of alu_ia and adapt the output ic accordingly. - trace.at(alu_idx).avm_alu_alu_ia = 20; - trace.at(alu_idx).avm_alu_alu_ic = 1060; // 20 * 53; required to pass the alu mul relation - trace.at(alu_idx).avm_alu_alu_u8_r0 = 36; // 1060 % 256 = 36 - trace.at(alu_idx).avm_alu_alu_u8_r1 = 4; // 4 * 256 = 1024 + trace.at(alu_idx).avm_alu_ia = 20; + trace.at(alu_idx).avm_alu_ic = 1060; // 20 * 53; required to pass the alu mul relation + trace.at(alu_idx).avm_alu_u8_r0 = 36; // 1060 % 256 = 36 + trace.at(alu_idx).avm_alu_u8_r1 = 4; // 4 * 256 = 1024 EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_ALU"); } @@ -145,21 +144,21 @@ TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIaInput) TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIbInput) { // Mutate the input of alu_ia and adapt the output ic accordingly. - trace.at(alu_idx).avm_alu_alu_ib = 10; - trace.at(alu_idx).avm_alu_alu_ic = 190; // 19 * 10; required to pass the alu mul relation - trace.at(alu_idx).avm_alu_alu_u8_r0 = 190; - trace.at(alu_idx).avm_alu_alu_u8_r1 = 0; + trace.at(alu_idx).avm_alu_ib = 10; + trace.at(alu_idx).avm_alu_ic = 190; // 19 * 10; required to pass the alu mul relation + trace.at(alu_idx).avm_alu_u8_r0 = 190; + trace.at(alu_idx).avm_alu_u8_r1 = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_ALU"); } TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluOpSelector) { - trace.at(alu_idx).avm_alu_alu_op_mul = 0; - trace.at(alu_idx).avm_alu_alu_op_add = 1; - trace.at(alu_idx).avm_alu_alu_ic = 72; // 19 + 53 - trace.at(alu_idx).avm_alu_alu_u8_r0 = 72; - trace.at(alu_idx).avm_alu_alu_u8_r1 = 0; + trace.at(alu_idx).avm_alu_op_mul = 0; + trace.at(alu_idx).avm_alu_op_add = 1; + trace.at(alu_idx).avm_alu_ic = 72; // 19 + 53 + trace.at(alu_idx).avm_alu_u8_r0 = 72; + trace.at(alu_idx).avm_alu_u8_r1 = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_ALU"); } @@ -167,7 +166,7 @@ TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluOpSelector) TEST_F(AvmPermMainAluNegativeTests, removeAluSelector) { trace.at(alu_idx).avm_alu_alu_sel = 0; - trace.at(alu_idx).avm_alu_alu_op_mul = 0; + trace.at(alu_idx).avm_alu_op_mul = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_ALU"); } @@ -203,25 +202,24 @@ class AvmPermMainMemNegativeTests : public AvmInterTableTests { auto clk = row->avm_main_clk; // Find the corresponding Alu trace row - auto alu_row = - std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); ASSERT_TRUE(alu_row != trace.end()); // Find memory trace entry related to storing output (intermediate register Ic) in memory. auto mem_row_c = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_op_c == FF(1) && r.avm_mem_m_rw == FF(1); + return r.avm_mem_clk == clk && r.avm_mem_op_c == FF(1) && r.avm_mem_rw == FF(1); }); ASSERT_TRUE(mem_row_c != trace.end()); // Find memory trace entry related to loading first input (intermediate register Ia) in memory. auto mem_row_a = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_op_a == FF(1) && r.avm_mem_m_rw == FF(0); + return r.avm_mem_clk == clk && r.avm_mem_op_a == FF(1) && r.avm_mem_rw == FF(0); }); ASSERT_TRUE(mem_row_a != trace.end()); // Find memory trace entry related to loading second input (intermediate register Ib) in memory. auto mem_row_b = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_op_b == FF(1) && r.avm_mem_m_rw == FF(0); + return r.avm_mem_clk == clk && r.avm_mem_op_b == FF(1) && r.avm_mem_rw == FF(0); }); ASSERT_TRUE(mem_row_b != trace.end()); @@ -236,8 +234,8 @@ class AvmPermMainMemNegativeTests : public AvmInterTableTests { TEST_F(AvmPermMainMemNegativeTests, wrongValueIaInMem) { executeSub(21, 3); - trace.at(mem_idx_a).avm_mem_m_val = 26; // Correct value: 21 - trace.at(mem_idx_a - 1).avm_mem_m_val = 26; // We need to adjust the write operation beforehand (set opcode). + trace.at(mem_idx_a).avm_mem_val = 26; // Correct value: 21 + trace.at(mem_idx_a - 1).avm_mem_val = 26; // We need to adjust the write operation beforehand (set opcode). EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -245,8 +243,8 @@ TEST_F(AvmPermMainMemNegativeTests, wrongValueIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongValueIbInMem) { executeSub(21, 3); - trace.at(mem_idx_b).avm_mem_m_val = 7; // Correct value: 3 - trace.at(mem_idx_b - 1).avm_mem_m_val = 7; // We need to adjust the write operation beforehand (set opcode). + trace.at(mem_idx_b).avm_mem_val = 7; // Correct value: 3 + trace.at(mem_idx_b - 1).avm_mem_val = 7; // We need to adjust the write operation beforehand (set opcode). EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -254,7 +252,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongValueIbInMem) TEST_F(AvmPermMainMemNegativeTests, wrongValueIcInMem) { executeSub(21, 3); - trace.at(mem_idx_c).avm_mem_m_val = 17; // Correct value: 18 = 21 - 3 + trace.at(mem_idx_c).avm_mem_val = 17; // Correct value: 18 = 21 - 3 EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -288,12 +286,12 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIaInMem) executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U32); trace.at(mem_idx_a).avm_mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_idx_a).avm_mem_m_tag = wrong_in_tag; + trace.at(mem_idx_a).avm_mem_tag = wrong_in_tag; // We need to adjust the write operation beforehand (set opcode). trace.at(mem_idx_a - 1).avm_mem_r_in_tag = wrong_in_tag; trace.at(mem_idx_a - 1).avm_mem_w_in_tag = wrong_in_tag; - trace.at(mem_idx_a - 1).avm_mem_m_tag = wrong_in_tag; + trace.at(mem_idx_a - 1).avm_mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -303,12 +301,12 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIbInMem) executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U16); trace.at(mem_idx_b).avm_mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_idx_b).avm_mem_m_tag = wrong_in_tag; + trace.at(mem_idx_b).avm_mem_tag = wrong_in_tag; // We need to adjust the write operation beforehand (set opcode). trace.at(mem_idx_b - 1).avm_mem_r_in_tag = wrong_in_tag; trace.at(mem_idx_b - 1).avm_mem_w_in_tag = wrong_in_tag; - trace.at(mem_idx_b - 1).avm_mem_m_tag = wrong_in_tag; + trace.at(mem_idx_b - 1).avm_mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -318,7 +316,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIcInMem) executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U128); trace.at(mem_idx_c).avm_mem_w_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_idx_c).avm_mem_m_tag = wrong_in_tag; + trace.at(mem_idx_c).avm_mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -326,10 +324,10 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIcInMem) TEST_F(AvmPermMainMemNegativeTests, wrongRwIaInMem) { executeSub(21, 3); - trace.at(mem_idx_a).avm_mem_m_rw = 1; // Write instead of read. + trace.at(mem_idx_a).avm_mem_rw = 1; // Write instead of read. // Adjust sub_clk value - trace.at(mem_idx_a).avm_mem_m_sub_clk = AvmMemTraceBuilder::SUB_CLK_STORE_A; + trace.at(mem_idx_a).avm_mem_sub_clk = AvmMemTraceBuilder::SUB_CLK_STORE_A; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -337,10 +335,10 @@ TEST_F(AvmPermMainMemNegativeTests, wrongRwIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongRwIbInMem) { executeSub(21, 3); - trace.at(mem_idx_b).avm_mem_m_rw = 1; // Write instead of read. + trace.at(mem_idx_b).avm_mem_rw = 1; // Write instead of read. // Adjust sub_clk value - trace.at(mem_idx_b).avm_mem_m_sub_clk = AvmMemTraceBuilder::SUB_CLK_STORE_B; + trace.at(mem_idx_b).avm_mem_sub_clk = AvmMemTraceBuilder::SUB_CLK_STORE_B; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -351,10 +349,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_idx_c).avm_mem_m_rw = 0; // Read instead of write. + trace.at(mem_idx_c).avm_mem_rw = 0; // Read instead of write. // Adjust sub_clk value - trace.at(mem_idx_c).avm_mem_m_sub_clk = AvmMemTraceBuilder::SUB_CLK_LOAD_C; + trace.at(mem_idx_c).avm_mem_sub_clk = AvmMemTraceBuilder::SUB_CLK_LOAD_C; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -362,7 +360,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongRwIcInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIaInMem) { executeSub(87, 23); - trace.at(mem_idx_a).avm_mem_m_clk = 11; + trace.at(mem_idx_a).avm_mem_clk = 11; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -370,7 +368,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongClkIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIbInMem) { executeSub(87, 23); - trace.at(mem_idx_b).avm_mem_m_clk = 21; + trace.at(mem_idx_b).avm_mem_clk = 21; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -378,7 +376,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongClkIbInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIcInMem) { executeSub(87, 23); - trace.at(mem_idx_c).avm_mem_m_clk = 7; + trace.at(mem_idx_c).avm_mem_clk = 7; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(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 5f3d420450a..87c3d66b4da 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 @@ -56,7 +56,7 @@ class AvmMemOpcodeTests : public ::testing::Test { auto clk = row->avm_main_clk; auto gen_matcher = [clk](uint32_t sub_clk) { - return [clk, sub_clk](Row r) { return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == sub_clk; }; + return [clk, sub_clk](Row r) { return r.avm_mem_clk == clk && r.avm_mem_sub_clk == sub_clk; }; }; // Find the memory trace position corresponding to the load sub-operation of register ia. @@ -108,43 +108,43 @@ class AvmMemOpcodeTests : public ::testing::Test { auto const& mem_a_row = trace.at(mem_a_idx); EXPECT_THAT(mem_a_row, - AllOf(Field(&Row::avm_mem_m_tag_err, 0), + AllOf(Field(&Row::avm_mem_tag_err, 0), Field(&Row::avm_mem_r_in_tag, static_cast(tag)), - Field(&Row::avm_mem_m_tag, static_cast(tag)), - Field(&Row::avm_mem_m_sel_mov, 1), - Field(&Row::avm_mem_m_addr, indirect ? dir_src_offset : src_offset), - Field(&Row::avm_mem_m_val, val_ff), - Field(&Row::avm_mem_m_rw, 0), - Field(&Row::avm_mem_m_op_a, 1))); + Field(&Row::avm_mem_tag, static_cast(tag)), + Field(&Row::avm_mem_sel_mov, 1), + Field(&Row::avm_mem_addr, indirect ? dir_src_offset : src_offset), + Field(&Row::avm_mem_val, val_ff), + Field(&Row::avm_mem_rw, 0), + Field(&Row::avm_mem_op_a, 1))); auto const& mem_c_row = trace.at(mem_c_idx); EXPECT_THAT(mem_c_row, - AllOf(Field(&Row::avm_mem_m_tag_err, 0), + AllOf(Field(&Row::avm_mem_tag_err, 0), Field(&Row::avm_mem_w_in_tag, static_cast(tag)), - Field(&Row::avm_mem_m_tag, static_cast(tag)), - Field(&Row::avm_mem_m_addr, indirect ? dir_dst_offset : dst_offset), - Field(&Row::avm_mem_m_val, val_ff), - Field(&Row::avm_mem_m_op_c, 1))); + Field(&Row::avm_mem_tag, static_cast(tag)), + Field(&Row::avm_mem_addr, indirect ? dir_dst_offset : dst_offset), + Field(&Row::avm_mem_val, val_ff), + Field(&Row::avm_mem_op_c, 1))); if (indirect) { auto const& mem_ind_a_row = trace.at(mem_ind_a_idx); EXPECT_THAT(mem_ind_a_row, - AllOf(Field(&Row::avm_mem_m_tag_err, 0), + AllOf(Field(&Row::avm_mem_tag_err, 0), Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_m_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_m_addr, src_offset), - Field(&Row::avm_mem_m_val, dir_src_offset), - Field(&Row::avm_mem_m_ind_op_a, 1))); + Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::avm_mem_addr, src_offset), + Field(&Row::avm_mem_val, dir_src_offset), + Field(&Row::avm_mem_ind_op_a, 1))); auto const& mem_ind_c_row = trace.at(mem_ind_c_idx); EXPECT_THAT(mem_ind_c_row, - AllOf(Field(&Row::avm_mem_m_tag_err, 0), + AllOf(Field(&Row::avm_mem_tag_err, 0), Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_m_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_m_addr, dst_offset), - Field(&Row::avm_mem_m_val, dir_dst_offset), - Field(&Row::avm_mem_m_ind_op_c, 1))); + Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::avm_mem_addr, dst_offset), + Field(&Row::avm_mem_val, dir_dst_offset), + Field(&Row::avm_mem_ind_op_c, 1))); } validate_trace_proof(std::move(trace)); @@ -190,10 +190,10 @@ TEST_F(AvmMemOpcodeTests, indirectMovInvalidAddressTag) EXPECT_EQ(trace.at(main_idx).avm_main_tag_err, 1); EXPECT_THAT(trace.at(mem_ind_c_idx), - AllOf(Field(&Row::avm_mem_m_tag_err, 1), - Field(&Row::avm_mem_m_tag, static_cast(AvmMemoryTag::U128)), + AllOf(Field(&Row::avm_mem_tag_err, 1), + Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U128)), Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_m_ind_op_c, 1))); + Field(&Row::avm_mem_ind_op_c, 1))); validate_trace_proof(std::move(trace)); } @@ -247,9 +247,9 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagLoadIa) auto trace_tmp = trace; trace.at(mem_a_idx).avm_mem_r_in_tag = tag_u64; - trace.at(mem_a_idx).avm_mem_m_tag_err = 1; - trace.at(mem_a_idx).avm_mem_m_one_min_inv = one_min_inverse_diff; - trace.at(mem_c_idx).avm_mem_m_tag = tag_u64; + trace.at(mem_a_idx).avm_mem_tag_err = 1; + trace.at(mem_a_idx).avm_mem_one_min_inv = one_min_inverse_diff; + trace.at(mem_c_idx).avm_mem_tag = tag_u64; trace.at(mem_c_idx).avm_mem_w_in_tag = tag_u64; trace.at(main_idx).avm_main_r_in_tag = tag_u64; trace.at(main_idx).avm_main_w_in_tag = tag_u64; @@ -271,10 +271,10 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagDisabledSelector) trace.at(mem_a_idx).avm_mem_r_in_tag = tag_u64; trace.at(mem_a_idx).avm_mem_w_in_tag = tag_u64; - trace.at(mem_a_idx).avm_mem_m_tag_err = 1; - trace.at(mem_a_idx).avm_mem_m_one_min_inv = one_min_inverse_diff; - trace.at(mem_a_idx).avm_mem_m_sel_mov = 0; - trace.at(mem_c_idx).avm_mem_m_tag = tag_u64; + trace.at(mem_a_idx).avm_mem_tag_err = 1; + trace.at(mem_a_idx).avm_mem_one_min_inv = one_min_inverse_diff; + trace.at(mem_a_idx).avm_mem_sel_mov = 0; + trace.at(mem_c_idx).avm_mem_tag = tag_u64; trace.at(mem_c_idx).avm_mem_r_in_tag = tag_u64; trace.at(mem_c_idx).avm_mem_w_in_tag = tag_u64; trace.at(main_idx).avm_main_r_in_tag = tag_u64; @@ -293,7 +293,7 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagInMainTrace) buildTrace(false, 234, 0, 1, AvmMemoryTag::U8); computeIndices(false); - trace.at(mem_c_idx).avm_mem_m_tag = tag_u64; + trace.at(mem_c_idx).avm_mem_tag = tag_u64; trace.at(mem_c_idx).avm_mem_w_in_tag = tag_u64; trace.at(main_idx).avm_main_w_in_tag = tag_u64; trace.at(main_idx).avm_main_tag_err = 1; @@ -309,7 +309,7 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagMainTraceRead) buildTrace(false, 234, 0, 1, AvmMemoryTag::U8); computeIndices(false); - trace.at(mem_c_idx).avm_mem_m_tag = tag_u64; + trace.at(mem_c_idx).avm_mem_tag = tag_u64; trace.at(mem_c_idx).avm_mem_w_in_tag = tag_u64; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "PERM_MAIN_MEM_C"); 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 7a4fa2bc921..a4f8ae95e1e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp @@ -49,25 +49,25 @@ TEST_F(AvmMemoryTests, mismatchedTagAddOperation) // Find the memory trace position corresponding to the load sub-operation of register ia. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.avm_mem_clk == clk && r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_mem_m_tag_err, FF(1)); // Error is raised + EXPECT_EQ(row->avm_mem_tag_err, FF(1)); // Error is raised EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U8))); - EXPECT_EQ(row->avm_mem_m_tag, FF(static_cast(AvmMemoryTag::FF))); + EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::FF))); // Find the memory trace position corresponding to the add sub-operation of register ib. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_B; + return r.avm_mem_clk == clk && r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_B; }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_mem_m_tag_err, FF(1)); // Error is raised + EXPECT_EQ(row->avm_mem_tag_err, FF(1)); // Error is raised EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U8))); - EXPECT_EQ(row->avm_mem_m_tag, FF(static_cast(AvmMemoryTag::FF))); + EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::FF))); validate_trace_proof(std::move(trace)); } @@ -92,25 +92,25 @@ TEST_F(AvmMemoryTests, mismatchedTagEqOperation) // Find the memory trace position corresponding to the load sub-operation of register ia. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.avm_mem_clk == clk && r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_mem_m_tag_err, FF(0)); // Error is NOT raised + EXPECT_EQ(row->avm_mem_tag_err, FF(0)); // Error is NOT raised EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); - EXPECT_EQ(row->avm_mem_m_tag, FF(static_cast(AvmMemoryTag::U32))); + EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::U32))); // Find the memory trace position corresponding to the load sub-operation of register ib. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_B; + return r.avm_mem_clk == clk && r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_B; }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_mem_m_tag_err, FF(1)); // Error is raised + EXPECT_EQ(row->avm_mem_tag_err, FF(1)); // Error is raised EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); - EXPECT_EQ(row->avm_mem_m_tag, FF(static_cast(AvmMemoryTag::U16))); + EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::U16))); validate_trace_proof(std::move(trace)); } @@ -135,13 +135,13 @@ TEST_F(AvmMemoryTests, mLastAccessViolation) // Find the row for memory trace with last memory entry for address 1 (read for subtraction) row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_addr == FF(1) && - r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.avm_mem_clk == clk && r.avm_mem_addr == FF(1) && + r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - row->avm_mem_m_lastAccess = FF(0); + row->avm_mem_lastAccess = FF(0); EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "MEM_LAST_ACCESS_DELIMITER"); } @@ -166,13 +166,13 @@ TEST_F(AvmMemoryTests, readWriteConsistencyValViolation) // Find the row for memory trace with last memory entry for address 2 (read for multiplication) row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_addr == FF(2) && - r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.avm_mem_clk == clk && r.avm_mem_addr == FF(2) && + r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - row->avm_mem_m_val = FF(35); + row->avm_mem_val = FF(35); EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "MEM_READ_WRITE_VAL_CONSISTENCY"); } @@ -196,13 +196,13 @@ TEST_F(AvmMemoryTests, readWriteConsistencyTagViolation) // Find the row for memory trace with last memory entry for address 2 (read for multiplication) row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_addr == FF(2) && - r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.avm_mem_clk == clk && r.avm_mem_addr == FF(2) && + r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - row->avm_mem_m_tag = static_cast(AvmMemoryTag::U16); + row->avm_mem_tag = static_cast(AvmMemoryTag::U16); EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "MEM_READ_WRITE_TAG_CONSISTENCY"); } @@ -213,7 +213,7 @@ TEST_F(AvmMemoryTests, readUninitializedMemoryViolation) trace_builder.return_op(0, 1, 1); // Return single memory word at position 1 auto trace = trace_builder.finalize(); - trace[1].avm_mem_m_val = 9; + trace[1].avm_mem_val = 9; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "MEM_ZERO_INIT"); } @@ -237,17 +237,17 @@ TEST_F(AvmMemoryTests, mismatchedTagErrorViolation) // Find the memory trace position corresponding to the subtraction sub-operation of register ia. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.avm_mem_clk == clk && r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); - row->avm_mem_m_tag_err = FF(0); + row->avm_mem_tag_err = FF(0); auto index = static_cast(row - trace.begin()); auto trace2 = trace; EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "MEM_IN_TAG_CONSISTENCY_1"); // More sophisticated attempt by adapting witness "on_min_inv" to make pass the above constraint - trace2[index].avm_mem_m_one_min_inv = FF(1); + trace2[index].avm_mem_one_min_inv = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace2)), "MEM_IN_TAG_CONSISTENCY_2"); } @@ -271,10 +271,10 @@ TEST_F(AvmMemoryTests, consistentTagNoErrorViolation) // Find the memory trace position corresponding to the div sub-operation of register ia. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.avm_mem_clk == clk && r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); - row->avm_mem_m_tag_err = FF(1); + row->avm_mem_tag_err = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "MEM_IN_TAG_CONSISTENCY_1"); } @@ -297,11 +297,11 @@ TEST_F(AvmMemoryTests, noErrorTagWriteViolation) // Find the memory trace position corresponding to the div sub-operation of register ic. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_m_clk == clk && r.avm_mem_m_sub_clk == AvmMemTraceBuilder::SUB_CLK_STORE_C; + return r.avm_mem_clk == clk && r.avm_mem_sub_clk == AvmMemTraceBuilder::SUB_CLK_STORE_C; }); ASSERT_TRUE(row != trace.end()); - row->avm_mem_m_tag_err = FF(1); + row->avm_mem_tag_err = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_proof(std::move(trace)), "NO_TAG_ERR_WRITE"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp index 55aca7f4bf3..3e5efaa4efa 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp @@ -51,11 +51,10 @@ void mutate_ic_in_trace(std::vector& trace, std::function&& sele if (alu) { auto const clk = row->avm_main_clk; // Find the relevant alu trace entry. - auto alu_row = - std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); EXPECT_TRUE(alu_row != trace.end()); - alu_row->avm_alu_alu_ic = newValue; + alu_row->avm_alu_ic = newValue; } // Adapt the memory trace to be consistent with the wrong result @@ -64,9 +63,9 @@ void mutate_ic_in_trace(std::vector& trace, std::function&& sele // Find the relevant memory trace entry. auto mem_row = std::ranges::find_if( - trace.begin(), trace.end(), [clk, addr](Row r) { return r.avm_mem_m_clk == clk && r.avm_mem_m_addr == addr; }); + trace.begin(), trace.end(), [clk, addr](Row r) { return r.avm_mem_clk == clk && r.avm_mem_addr == addr; }); EXPECT_TRUE(mem_row != trace.end()); - mem_row->avm_mem_m_val = newValue; + mem_row->avm_mem_val = newValue; }; } // namespace tests_avm From 95ae5e4ba896c0c2c81058949b5c21cc87997349 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 27 Mar 2024 11:27:46 +0000 Subject: [PATCH 2/2] Remove bin_ prefix in some column names --- barretenberg/cpp/pil/avm/avm_binary.pil | 22 +++--- .../relations/generated/avm/avm_binary.hpp | 12 ++-- .../relations/generated/avm/declare_views.hpp | 8 +-- .../generated/avm/lookup_byte_operations.hpp | 12 ++-- .../barretenberg/vm/avm_trace/avm_trace.cpp | 8 +-- .../vm/generated/avm_circuit_builder.hpp | 16 ++--- .../barretenberg/vm/generated/avm_flavor.hpp | 72 +++++++++---------- .../vm/generated/avm_verifier.cpp | 15 ++-- .../vm/tests/avm_bitwise.test.cpp | 15 ++-- 9 files changed, 89 insertions(+), 91 deletions(-) diff --git a/barretenberg/cpp/pil/avm/avm_binary.pil b/barretenberg/cpp/pil/avm/avm_binary.pil index 6ef9c3b4cc4..5385efc982d 100644 --- a/barretenberg/cpp/pil/avm/avm_binary.pil +++ b/barretenberg/cpp/pil/avm/avm_binary.pil @@ -4,7 +4,7 @@ include "avm_main.pil"; namespace avm_binary(256); - pol commit bin_clk; + pol commit clk; // Selector for Binary Operation pol commit bin_sel; @@ -31,9 +31,9 @@ namespace avm_binary(256); // Little Endian bitwise decomposition of accumulators (which are processed top-down), // constrained to be U8 given by the lookup to the avm_byte_lookup - pol commit bin_ia_bytes; - pol commit bin_ib_bytes; - pol commit bin_ic_bytes; + pol commit ia_bytes; + pol commit ib_bytes; + pol commit ic_bytes; pol commit start; // Identifies when we want to capture the output to the main trace. @@ -58,24 +58,24 @@ namespace avm_binary(256); mem_tag_ctr * ((1 - bin_sel) * (1 - mem_tag_ctr_inv) + mem_tag_ctr_inv) - bin_sel = 0; // Forces accumulator to start at zero when mem_tag_ctr == 0 - (1 - bin_sel) * acc_ia = 0; - (1 - bin_sel) * acc_ib = 0; + (1 - bin_sel) * acc_ia = 0; + (1 - bin_sel) * acc_ib = 0; (1 - bin_sel) * acc_ic = 0; #[LOOKUP_BYTE_LENGTHS] - start {in_tag, mem_tag_ctr} + start {in_tag, mem_tag_ctr} in avm_byte_lookup.bin_sel {avm_byte_lookup.table_in_tags, avm_byte_lookup.table_byte_lengths}; #[LOOKUP_BYTE_OPERATIONS] - bin_sel {op_id, bin_ia_bytes, bin_ib_bytes, bin_ic_bytes} + bin_sel {op_id, ia_bytes, ib_bytes, ic_bytes} in avm_byte_lookup.bin_sel {avm_byte_lookup.table_op_id, avm_byte_lookup.table_input_a, avm_byte_lookup.table_input_b, avm_byte_lookup.table_output}; #[ACC_REL_A] - (acc_ia - bin_ia_bytes - 256 * acc_ia') * mem_tag_ctr = 0; + (acc_ia - ia_bytes - 256 * acc_ia') * mem_tag_ctr = 0; #[ACC_REL_B] - (acc_ib - bin_ib_bytes - 256 * acc_ib') * mem_tag_ctr = 0; + (acc_ib - ib_bytes - 256 * acc_ib') * mem_tag_ctr = 0; #[ACC_REL_C] - (acc_ic - bin_ic_bytes - 256 * acc_ic') * mem_tag_ctr = 0; + (acc_ic - ic_bytes - 256 * acc_ic') * mem_tag_ctr = 0; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp index 1cbdaabb96e..e58112cbfd7 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp @@ -13,10 +13,10 @@ template struct Avm_binaryRow { FF avm_binary_acc_ib_shift{}; FF avm_binary_acc_ic{}; FF avm_binary_acc_ic_shift{}; - FF avm_binary_bin_ia_bytes{}; - FF avm_binary_bin_ib_bytes{}; - FF avm_binary_bin_ic_bytes{}; FF avm_binary_bin_sel{}; + FF avm_binary_ia_bytes{}; + FF avm_binary_ib_bytes{}; + FF avm_binary_ic_bytes{}; FF avm_binary_mem_tag_ctr{}; FF avm_binary_mem_tag_ctr_inv{}; FF avm_binary_mem_tag_ctr_shift{}; @@ -126,7 +126,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(7); - auto tmp = (((avm_binary_acc_ia - avm_binary_bin_ia_bytes) - (avm_binary_acc_ia_shift * FF(256))) * + auto tmp = (((avm_binary_acc_ia - avm_binary_ia_bytes) - (avm_binary_acc_ia_shift * FF(256))) * avm_binary_mem_tag_ctr); tmp *= scaling_factor; std::get<7>(evals) += tmp; @@ -135,7 +135,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(8); - auto tmp = (((avm_binary_acc_ib - avm_binary_bin_ib_bytes) - (avm_binary_acc_ib_shift * FF(256))) * + auto tmp = (((avm_binary_acc_ib - avm_binary_ib_bytes) - (avm_binary_acc_ib_shift * FF(256))) * avm_binary_mem_tag_ctr); tmp *= scaling_factor; std::get<8>(evals) += tmp; @@ -144,7 +144,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(9); - auto tmp = (((avm_binary_acc_ic - avm_binary_bin_ic_bytes) - (avm_binary_acc_ic_shift * FF(256))) * + auto tmp = (((avm_binary_acc_ic - avm_binary_ic_bytes) - (avm_binary_acc_ic_shift * FF(256))) * avm_binary_mem_tag_ctr); tmp *= scaling_factor; std::get<9>(evals) += tmp; 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 a9fd7fb4ad7..95232cb09ae 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -38,11 +38,11 @@ [[maybe_unused]] auto avm_binary_acc_ia = View(new_term.avm_binary_acc_ia); \ [[maybe_unused]] auto avm_binary_acc_ib = View(new_term.avm_binary_acc_ib); \ [[maybe_unused]] auto avm_binary_acc_ic = View(new_term.avm_binary_acc_ic); \ - [[maybe_unused]] auto avm_binary_bin_clk = View(new_term.avm_binary_bin_clk); \ - [[maybe_unused]] auto avm_binary_bin_ia_bytes = View(new_term.avm_binary_bin_ia_bytes); \ - [[maybe_unused]] auto avm_binary_bin_ib_bytes = View(new_term.avm_binary_bin_ib_bytes); \ - [[maybe_unused]] auto avm_binary_bin_ic_bytes = View(new_term.avm_binary_bin_ic_bytes); \ [[maybe_unused]] auto avm_binary_bin_sel = View(new_term.avm_binary_bin_sel); \ + [[maybe_unused]] auto avm_binary_clk = View(new_term.avm_binary_clk); \ + [[maybe_unused]] auto avm_binary_ia_bytes = View(new_term.avm_binary_ia_bytes); \ + [[maybe_unused]] auto avm_binary_ib_bytes = View(new_term.avm_binary_ib_bytes); \ + [[maybe_unused]] auto avm_binary_ic_bytes = View(new_term.avm_binary_ic_bytes); \ [[maybe_unused]] auto avm_binary_in_tag = View(new_term.avm_binary_in_tag); \ [[maybe_unused]] auto avm_binary_mem_tag_ctr = View(new_term.avm_binary_mem_tag_ctr); \ [[maybe_unused]] auto avm_binary_mem_tag_ctr_inv = View(new_term.avm_binary_mem_tag_ctr_inv); \ 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 cc9a2fdf891..92874d3d134 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 @@ -138,9 +138,9 @@ class lookup_byte_operations_lookup_settings { in.avm_binary_bin_sel, in.avm_byte_lookup_bin_sel, in.avm_binary_op_id, - in.avm_binary_bin_ia_bytes, - in.avm_binary_bin_ib_bytes, - in.avm_binary_bin_ic_bytes, + in.avm_binary_ia_bytes, + in.avm_binary_ib_bytes, + in.avm_binary_ic_bytes, in.avm_byte_lookup_table_op_id, in.avm_byte_lookup_table_input_a, in.avm_byte_lookup_table_input_b, @@ -162,9 +162,9 @@ class lookup_byte_operations_lookup_settings { in.avm_binary_bin_sel, in.avm_byte_lookup_bin_sel, in.avm_binary_op_id, - in.avm_binary_bin_ia_bytes, - in.avm_binary_bin_ib_bytes, - in.avm_binary_bin_ic_bytes, + in.avm_binary_ia_bytes, + in.avm_binary_ib_bytes, + in.avm_binary_ic_bytes, in.avm_byte_lookup_table_op_id, in.avm_byte_lookup_table_input_a, in.avm_byte_lookup_table_input_b, 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 220904058d2..5999740d1b2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -1275,16 +1275,16 @@ std::vector AvmTraceBuilder::finalize() for (size_t i = 0; i < bin_trace_size; i++) { auto const& src = bin_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_binary_bin_clk = src.binary_clk; + dest.avm_binary_clk = src.binary_clk; dest.avm_binary_bin_sel = static_cast(src.bin_sel); dest.avm_binary_acc_ia = src.acc_ia; dest.avm_binary_acc_ib = src.acc_ib; dest.avm_binary_acc_ic = src.acc_ic; dest.avm_binary_in_tag = src.in_tag; dest.avm_binary_op_id = src.op_id; - dest.avm_binary_bin_ia_bytes = src.bin_ia_bytes; - dest.avm_binary_bin_ib_bytes = src.bin_ib_bytes; - dest.avm_binary_bin_ic_bytes = src.bin_ic_bytes; + dest.avm_binary_ia_bytes = src.bin_ia_bytes; + dest.avm_binary_ib_bytes = src.bin_ib_bytes; + dest.avm_binary_ic_bytes = src.bin_ic_bytes; dest.avm_binary_start = FF(static_cast(src.start)); dest.avm_binary_mem_tag_ctr = src.mem_tag_ctr; dest.avm_binary_mem_tag_ctr_inv = src.mem_tag_ctr_inv; 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 2dab6689df6..6185943efd3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -68,11 +68,11 @@ template struct AvmFullRow { FF avm_binary_acc_ia{}; FF avm_binary_acc_ib{}; FF avm_binary_acc_ic{}; - FF avm_binary_bin_clk{}; - FF avm_binary_bin_ia_bytes{}; - FF avm_binary_bin_ib_bytes{}; - FF avm_binary_bin_ic_bytes{}; FF avm_binary_bin_sel{}; + FF avm_binary_clk{}; + FF avm_binary_ia_bytes{}; + FF avm_binary_ib_bytes{}; + FF avm_binary_ic_bytes{}; FF avm_binary_in_tag{}; FF avm_binary_mem_tag_ctr{}; FF avm_binary_mem_tag_ctr_inv{}; @@ -249,11 +249,11 @@ class AvmCircuitBuilder { polys.avm_binary_acc_ia[i] = rows[i].avm_binary_acc_ia; polys.avm_binary_acc_ib[i] = rows[i].avm_binary_acc_ib; polys.avm_binary_acc_ic[i] = rows[i].avm_binary_acc_ic; - polys.avm_binary_bin_clk[i] = rows[i].avm_binary_bin_clk; - polys.avm_binary_bin_ia_bytes[i] = rows[i].avm_binary_bin_ia_bytes; - polys.avm_binary_bin_ib_bytes[i] = rows[i].avm_binary_bin_ib_bytes; - polys.avm_binary_bin_ic_bytes[i] = rows[i].avm_binary_bin_ic_bytes; polys.avm_binary_bin_sel[i] = rows[i].avm_binary_bin_sel; + polys.avm_binary_clk[i] = rows[i].avm_binary_clk; + polys.avm_binary_ia_bytes[i] = rows[i].avm_binary_ia_bytes; + polys.avm_binary_ib_bytes[i] = rows[i].avm_binary_ib_bytes; + polys.avm_binary_ic_bytes[i] = rows[i].avm_binary_ic_bytes; polys.avm_binary_in_tag[i] = rows[i].avm_binary_in_tag; polys.avm_binary_mem_tag_ctr[i] = rows[i].avm_binary_mem_tag_ctr; polys.avm_binary_mem_tag_ctr_inv[i] = rows[i].avm_binary_mem_tag_ctr_inv; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index b52c474533a..fc6ff4bdb84 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -131,11 +131,11 @@ class AvmFlavor { avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_bin_clk, - avm_binary_bin_ia_bytes, - avm_binary_bin_ib_bytes, - avm_binary_bin_ic_bytes, avm_binary_bin_sel, + avm_binary_clk, + avm_binary_ia_bytes, + avm_binary_ib_bytes, + avm_binary_ic_bytes, avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, @@ -265,11 +265,11 @@ class AvmFlavor { avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_bin_clk, - avm_binary_bin_ia_bytes, - avm_binary_bin_ib_bytes, - avm_binary_bin_ic_bytes, avm_binary_bin_sel, + avm_binary_clk, + avm_binary_ia_bytes, + avm_binary_ib_bytes, + avm_binary_ic_bytes, avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, @@ -405,11 +405,11 @@ class AvmFlavor { avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_bin_clk, - avm_binary_bin_ia_bytes, - avm_binary_bin_ib_bytes, - avm_binary_bin_ic_bytes, avm_binary_bin_sel, + avm_binary_clk, + avm_binary_ia_bytes, + avm_binary_ib_bytes, + avm_binary_ic_bytes, avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, @@ -560,11 +560,11 @@ class AvmFlavor { avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_bin_clk, - avm_binary_bin_ia_bytes, - avm_binary_bin_ib_bytes, - avm_binary_bin_ic_bytes, avm_binary_bin_sel, + avm_binary_clk, + avm_binary_ia_bytes, + avm_binary_ib_bytes, + avm_binary_ic_bytes, avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, @@ -715,11 +715,11 @@ class AvmFlavor { avm_binary_acc_ia, avm_binary_acc_ib, avm_binary_acc_ic, - avm_binary_bin_clk, - avm_binary_bin_ia_bytes, - avm_binary_bin_ib_bytes, - avm_binary_bin_ic_bytes, avm_binary_bin_sel, + avm_binary_clk, + avm_binary_ia_bytes, + avm_binary_ib_bytes, + avm_binary_ic_bytes, avm_binary_in_tag, avm_binary_mem_tag_ctr, avm_binary_mem_tag_ctr_inv, @@ -972,11 +972,11 @@ class AvmFlavor { Base::avm_binary_acc_ia = "AVM_BINARY_ACC_IA"; Base::avm_binary_acc_ib = "AVM_BINARY_ACC_IB"; Base::avm_binary_acc_ic = "AVM_BINARY_ACC_IC"; - Base::avm_binary_bin_clk = "AVM_BINARY_BIN_CLK"; - Base::avm_binary_bin_ia_bytes = "AVM_BINARY_BIN_IA_BYTES"; - Base::avm_binary_bin_ib_bytes = "AVM_BINARY_BIN_IB_BYTES"; - Base::avm_binary_bin_ic_bytes = "AVM_BINARY_BIN_IC_BYTES"; Base::avm_binary_bin_sel = "AVM_BINARY_BIN_SEL"; + Base::avm_binary_clk = "AVM_BINARY_CLK"; + Base::avm_binary_ia_bytes = "AVM_BINARY_IA_BYTES"; + Base::avm_binary_ib_bytes = "AVM_BINARY_IB_BYTES"; + Base::avm_binary_ic_bytes = "AVM_BINARY_IC_BYTES"; Base::avm_binary_in_tag = "AVM_BINARY_IN_TAG"; Base::avm_binary_mem_tag_ctr = "AVM_BINARY_MEM_TAG_CTR"; Base::avm_binary_mem_tag_ctr_inv = "AVM_BINARY_MEM_TAG_CTR_INV"; @@ -1122,11 +1122,11 @@ class AvmFlavor { Commitment avm_binary_acc_ia; Commitment avm_binary_acc_ib; Commitment avm_binary_acc_ic; - Commitment avm_binary_bin_clk; - Commitment avm_binary_bin_ia_bytes; - Commitment avm_binary_bin_ib_bytes; - Commitment avm_binary_bin_ic_bytes; Commitment avm_binary_bin_sel; + Commitment avm_binary_clk; + Commitment avm_binary_ia_bytes; + Commitment avm_binary_ib_bytes; + Commitment avm_binary_ic_bytes; Commitment avm_binary_in_tag; Commitment avm_binary_mem_tag_ctr; Commitment avm_binary_mem_tag_ctr_inv; @@ -1272,11 +1272,11 @@ class AvmFlavor { avm_binary_acc_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_acc_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_acc_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_bin_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_bin_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_bin_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_bin_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_binary_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_mem_tag_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); avm_binary_mem_tag_ctr_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -1427,11 +1427,11 @@ class AvmFlavor { serialize_to_buffer(avm_binary_acc_ia, Transcript::proof_data); serialize_to_buffer(avm_binary_acc_ib, Transcript::proof_data); serialize_to_buffer(avm_binary_acc_ic, Transcript::proof_data); - serialize_to_buffer(avm_binary_bin_clk, Transcript::proof_data); - serialize_to_buffer(avm_binary_bin_ia_bytes, Transcript::proof_data); - serialize_to_buffer(avm_binary_bin_ib_bytes, Transcript::proof_data); - serialize_to_buffer(avm_binary_bin_ic_bytes, Transcript::proof_data); serialize_to_buffer(avm_binary_bin_sel, Transcript::proof_data); + serialize_to_buffer(avm_binary_clk, Transcript::proof_data); + serialize_to_buffer(avm_binary_ia_bytes, Transcript::proof_data); + serialize_to_buffer(avm_binary_ib_bytes, Transcript::proof_data); + serialize_to_buffer(avm_binary_ic_bytes, Transcript::proof_data); serialize_to_buffer(avm_binary_in_tag, Transcript::proof_data); serialize_to_buffer(avm_binary_mem_tag_ctr, Transcript::proof_data); serialize_to_buffer(avm_binary_mem_tag_ctr_inv, 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 d76f8dfa6f4..380a25c6399 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp @@ -94,16 +94,15 @@ bool AvmVerifier::verify_proof(const HonkProof& proof) transcript->template receive_from_prover(commitment_labels.avm_binary_acc_ib); commitments.avm_binary_acc_ic = transcript->template receive_from_prover(commitment_labels.avm_binary_acc_ic); - commitments.avm_binary_bin_clk = - transcript->template receive_from_prover(commitment_labels.avm_binary_bin_clk); - commitments.avm_binary_bin_ia_bytes = - transcript->template receive_from_prover(commitment_labels.avm_binary_bin_ia_bytes); - commitments.avm_binary_bin_ib_bytes = - transcript->template receive_from_prover(commitment_labels.avm_binary_bin_ib_bytes); - commitments.avm_binary_bin_ic_bytes = - transcript->template receive_from_prover(commitment_labels.avm_binary_bin_ic_bytes); commitments.avm_binary_bin_sel = transcript->template receive_from_prover(commitment_labels.avm_binary_bin_sel); + commitments.avm_binary_clk = transcript->template receive_from_prover(commitment_labels.avm_binary_clk); + commitments.avm_binary_ia_bytes = + transcript->template receive_from_prover(commitment_labels.avm_binary_ia_bytes); + commitments.avm_binary_ib_bytes = + transcript->template receive_from_prover(commitment_labels.avm_binary_ib_bytes); + commitments.avm_binary_ic_bytes = + transcript->template receive_from_prover(commitment_labels.avm_binary_ic_bytes); commitments.avm_binary_in_tag = transcript->template receive_from_prover(commitment_labels.avm_binary_in_tag); commitments.avm_binary_mem_tag_ctr = 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 2823545d327..37d10a62712 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp @@ -105,9 +105,8 @@ void common_validate_bit_op(std::vector const& trace, // Use the row in the main trace to find the same operation in the alu trace. FF clk = row->avm_main_clk; - auto bin_row_start = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_binary_bin_clk == clk && r.avm_binary_start == FF(1); - }); + auto bin_row_start = std::ranges::find_if( + trace.begin(), trace.end(), [clk](Row r) { return r.avm_binary_clk == clk && r.avm_binary_start == FF(1); }); // Check that both rows were found ASSERT_TRUE(bin_row_start != trace.end()); @@ -178,17 +177,17 @@ std::vector gen_mutated_trace_bit(std::vector trace, auto main_trace_row = std::ranges::find_if(trace.begin(), trace.end(), select_row); auto main_clk = main_trace_row->avm_main_clk; // The corresponding row in the binary trace as well as the row where start = 1 - auto binary_row = std::ranges::find_if( - trace.begin(), trace.end(), [main_clk](Row r) { return r.avm_binary_bin_clk == main_clk; }); + auto binary_row = + std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.avm_binary_clk == main_clk; }); // The corresponding row in the binary trace where the computation ends. auto last_row = std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { - return r.avm_binary_bin_clk == main_clk && r.avm_binary_mem_tag_ctr == FF(0); + return r.avm_binary_clk == main_clk && r.avm_binary_mem_tag_ctr == FF(0); }); switch (fail_mode) { case BitDecomposition: { // Incrementing the bytes should indicate an incorrect decomposition // The lookups are checked later so this will throw an error about decomposition - binary_row->avm_binary_bin_ic_bytes++; + binary_row->avm_binary_ic_bytes++; break; } case MemTagCtr: { @@ -215,7 +214,7 @@ std::vector gen_mutated_trace_bit(std::vector trace, // update anything there or in the corresponding accumulators. mutate_ic_in_trace(trace, std::move(select_row), c_mutated, false); binary_row->avm_binary_acc_ic = c_mutated; - binary_row->avm_binary_bin_ic_bytes = static_cast(uint128_t{ c_mutated }); + binary_row->avm_binary_ic_bytes = static_cast(uint128_t{ c_mutated }); break; } case ByteLengthError: {