diff --git a/barretenberg/cpp/pil/avm/avm_alu.pil b/barretenberg/cpp/pil/avm/avm_alu.pil index ccae88eda84..974b4a03871 100644 --- a/barretenberg/cpp/pil/avm/avm_alu.pil +++ b/barretenberg/cpp/pil/avm/avm_alu.pil @@ -43,6 +43,13 @@ namespace avm_alu(256); pol commit u16_r5; pol commit u16_r6; pol commit u16_r7; + pol commit u16_r8; + pol commit u16_r9; + pol commit u16_r10; + pol commit u16_r11; + pol commit u16_r12; + pol commit u16_r13; + pol commit u16_r14; // 64-bit slice register pol commit u64_r0; 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 95232cb09ae..7dc659afa36 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -22,12 +22,19 @@ [[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_r10 = View(new_term.avm_alu_u16_r10); \ + [[maybe_unused]] auto avm_alu_u16_r11 = View(new_term.avm_alu_u16_r11); \ + [[maybe_unused]] auto avm_alu_u16_r12 = View(new_term.avm_alu_u16_r12); \ + [[maybe_unused]] auto avm_alu_u16_r13 = View(new_term.avm_alu_u16_r13); \ + [[maybe_unused]] auto avm_alu_u16_r14 = View(new_term.avm_alu_u16_r14); \ [[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_r8 = View(new_term.avm_alu_u16_r8); \ + [[maybe_unused]] auto avm_alu_u16_r9 = View(new_term.avm_alu_u16_r9); \ [[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); \ diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_alu_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_alu_trace.cpp index 15922db4d75..42668cabb8d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_alu_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_alu_trace.cpp @@ -51,7 +51,7 @@ FF AvmAluTraceBuilder::op_add(FF const& a, FF const& b, AvmMemoryTag in_tag, uin bool carry = false; uint8_t alu_u8_r0 = 0; uint8_t alu_u8_r1 = 0; - std::array alu_u16_reg{}; // Must be zero-initialized (FF tag case) + std::array alu_u16_reg{}; // Must be zero-initialized (FF tag case) uint128_t a_u128{ a }; uint128_t b_u128{ b }; @@ -140,7 +140,7 @@ FF AvmAluTraceBuilder::op_sub(FF const& a, FF const& b, AvmMemoryTag in_tag, uin bool carry = false; uint8_t alu_u8_r0 = 0; uint8_t alu_u8_r1 = 0; - std::array alu_u16_reg{}; // Must be zero-initialized (FF tag case) + std::array alu_u16_reg{}; // Must be zero-initialized (FF tag case) uint128_t a_u128{ a }; uint128_t b_u128{ b }; uint128_t c_u128 = a_u128 - b_u128; @@ -225,7 +225,7 @@ FF AvmAluTraceBuilder::op_mul(FF const& a, FF const& b, AvmMemoryTag in_tag, uin uint8_t alu_u8_r0 = 0; uint8_t alu_u8_r1 = 0; - std::array alu_u16_reg{}; // Must be zero-initialized (FF tag case) + std::array alu_u16_reg{}; // Must be zero-initialized (FF tag case) uint128_t a_u128{ a }; uint128_t b_u128{ b }; @@ -258,8 +258,8 @@ FF AvmAluTraceBuilder::op_mul(FF const& a, FF const& b, AvmMemoryTag in_tag, uin uint128_t c_u128 = a_u128 * b_u128; // Decompose a_u128 and b_u128 over 8 16-bit registers. - std::array alu_u16_reg_a; // Will be initialized in for loop below. - std::array alu_u16_reg_b; // Will be initialized in for loop below. + std::array alu_u16_reg_a; // Will be initialized in for loop below. + std::array alu_u16_reg_b; // Will be initialized in for loop below. uint128_t a_trunc_128 = a_u128; uint128_t b_trunc_128 = b_u128; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_alu_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_alu_trace.hpp index 49691f3faaf..736a1896c1d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_alu_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_alu_trace.hpp @@ -32,7 +32,7 @@ class AvmAluTraceBuilder { uint8_t alu_u8_r0{}; uint8_t alu_u8_r1{}; - std::array alu_u16_reg{}; + std::array alu_u16_reg{}; uint64_t alu_u64_r0{}; 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 5999740d1b2..40eb386432b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -1232,6 +1232,13 @@ std::vector AvmTraceBuilder::finalize() 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_u16_r8 = FF(src.alu_u16_reg.at(8)); + dest.avm_alu_u16_r9 = FF(src.alu_u16_reg.at(9)); + dest.avm_alu_u16_r10 = FF(src.alu_u16_reg.at(10)); + dest.avm_alu_u16_r11 = FF(src.alu_u16_reg.at(11)); + dest.avm_alu_u16_r12 = FF(src.alu_u16_reg.at(12)); + dest.avm_alu_u16_r13 = FF(src.alu_u16_reg.at(13)); + dest.avm_alu_u16_r14 = FF(src.alu_u16_reg.at(14)); dest.avm_alu_u64_r0 = FF(src.alu_u64_r0); dest.avm_alu_op_eq_diff_inv = FF(src.alu_op_eq_diff_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 6185943efd3..2d213345427 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -52,12 +52,19 @@ template struct AvmFullRow { FF avm_alu_u128_tag{}; FF avm_alu_u16_r0{}; FF avm_alu_u16_r1{}; + FF avm_alu_u16_r10{}; + FF avm_alu_u16_r11{}; + FF avm_alu_u16_r12{}; + FF avm_alu_u16_r13{}; + FF avm_alu_u16_r14{}; 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_r8{}; + FF avm_alu_u16_r9{}; FF avm_alu_u16_tag{}; FF avm_alu_u32_tag{}; FF avm_alu_u64_r0{}; @@ -196,8 +203,8 @@ class AvmCircuitBuilder { using Polynomial = Flavor::Polynomial; using ProverPolynomials = Flavor::ProverPolynomials; - static constexpr size_t num_fixed_columns = 152; - static constexpr size_t num_polys = 133; + static constexpr size_t num_fixed_columns = 159; + static constexpr size_t num_polys = 140; std::vector rows; void set_trace(std::vector&& trace) { rows = std::move(trace); } @@ -233,12 +240,19 @@ class AvmCircuitBuilder { 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_r10[i] = rows[i].avm_alu_u16_r10; + polys.avm_alu_u16_r11[i] = rows[i].avm_alu_u16_r11; + polys.avm_alu_u16_r12[i] = rows[i].avm_alu_u16_r12; + polys.avm_alu_u16_r13[i] = rows[i].avm_alu_u16_r13; + polys.avm_alu_u16_r14[i] = rows[i].avm_alu_u16_r14; 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_r8[i] = rows[i].avm_alu_u16_r8; + polys.avm_alu_u16_r9[i] = rows[i].avm_alu_u16_r9; 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; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index fc6ff4bdb84..0c2f9abe7f8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -46,11 +46,11 @@ class AvmFlavor { using RelationSeparator = FF; static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 2; - static constexpr size_t NUM_WITNESS_ENTITIES = 131; + static constexpr size_t NUM_WITNESS_ENTITIES = 138; static constexpr size_t NUM_WIRES = NUM_WITNESS_ENTITIES + NUM_PRECOMPUTED_ENTITIES; // We have two copies of the witness entities, so we subtract the number of fixed ones (they have no shift), one for // the unshifted and one for the shifted - static constexpr size_t NUM_ALL_ENTITIES = 152; + static constexpr size_t NUM_ALL_ENTITIES = 159; using Relations = std::tuple, Avm_vm::avm_binary, @@ -115,12 +115,19 @@ class AvmFlavor { avm_alu_u128_tag, avm_alu_u16_r0, avm_alu_u16_r1, + avm_alu_u16_r10, + avm_alu_u16_r11, + avm_alu_u16_r12, + avm_alu_u16_r13, + avm_alu_u16_r14, 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_r8, + avm_alu_u16_r9, avm_alu_u16_tag, avm_alu_u32_tag, avm_alu_u64_r0, @@ -249,12 +256,19 @@ class AvmFlavor { avm_alu_u128_tag, avm_alu_u16_r0, avm_alu_u16_r1, + avm_alu_u16_r10, + avm_alu_u16_r11, + avm_alu_u16_r12, + avm_alu_u16_r13, + avm_alu_u16_r14, 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_r8, + avm_alu_u16_r9, avm_alu_u16_tag, avm_alu_u32_tag, avm_alu_u64_r0, @@ -389,12 +403,19 @@ class AvmFlavor { avm_alu_u128_tag, avm_alu_u16_r0, avm_alu_u16_r1, + avm_alu_u16_r10, + avm_alu_u16_r11, + avm_alu_u16_r12, + avm_alu_u16_r13, + avm_alu_u16_r14, 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_r8, + avm_alu_u16_r9, avm_alu_u16_tag, avm_alu_u32_tag, avm_alu_u64_r0, @@ -544,12 +565,19 @@ class AvmFlavor { avm_alu_u128_tag, avm_alu_u16_r0, avm_alu_u16_r1, + avm_alu_u16_r10, + avm_alu_u16_r11, + avm_alu_u16_r12, + avm_alu_u16_r13, + avm_alu_u16_r14, 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_r8, + avm_alu_u16_r9, avm_alu_u16_tag, avm_alu_u32_tag, avm_alu_u64_r0, @@ -699,12 +727,19 @@ class AvmFlavor { avm_alu_u128_tag, avm_alu_u16_r0, avm_alu_u16_r1, + avm_alu_u16_r10, + avm_alu_u16_r11, + avm_alu_u16_r12, + avm_alu_u16_r13, + avm_alu_u16_r14, 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_r8, + avm_alu_u16_r9, avm_alu_u16_tag, avm_alu_u32_tag, avm_alu_u64_r0, @@ -956,12 +991,19 @@ class AvmFlavor { 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_r10 = "AVM_ALU_U16_R10"; + Base::avm_alu_u16_r11 = "AVM_ALU_U16_R11"; + Base::avm_alu_u16_r12 = "AVM_ALU_U16_R12"; + Base::avm_alu_u16_r13 = "AVM_ALU_U16_R13"; + Base::avm_alu_u16_r14 = "AVM_ALU_U16_R14"; 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_r8 = "AVM_ALU_U16_R8"; + Base::avm_alu_u16_r9 = "AVM_ALU_U16_R9"; 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"; @@ -1106,12 +1148,19 @@ class AvmFlavor { Commitment avm_alu_u128_tag; Commitment avm_alu_u16_r0; Commitment avm_alu_u16_r1; + Commitment avm_alu_u16_r10; + Commitment avm_alu_u16_r11; + Commitment avm_alu_u16_r12; + Commitment avm_alu_u16_r13; + Commitment avm_alu_u16_r14; 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_r8; + Commitment avm_alu_u16_r9; Commitment avm_alu_u16_tag; Commitment avm_alu_u32_tag; Commitment avm_alu_u64_r0; @@ -1256,12 +1305,19 @@ class AvmFlavor { 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_r10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r14 = 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_r8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + avm_alu_u16_r9 = 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); @@ -1411,12 +1467,19 @@ class AvmFlavor { 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_r10, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r11, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r12, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r13, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r14, 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_r8, Transcript::proof_data); + serialize_to_buffer(avm_alu_u16_r9, 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); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp index 380a25c6399..89676bd4a64 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp @@ -72,12 +72,24 @@ bool AvmVerifier::verify_proof(const HonkProof& proof) 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_r10 = + transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r10); + commitments.avm_alu_u16_r11 = + transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r11); + commitments.avm_alu_u16_r12 = + transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r12); + commitments.avm_alu_u16_r13 = + transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r13); + commitments.avm_alu_u16_r14 = + transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r14); 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_r8 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r8); + commitments.avm_alu_u16_r9 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r9); commitments.avm_alu_u16_tag = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_tag); commitments.avm_alu_u32_tag =