diff --git a/barretenberg/cpp/src/barretenberg/flavor/avm_template.hpp b/barretenberg/cpp/src/barretenberg/flavor/avm_template.hpp index 28931da3300..75a871ab524 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/avm_template.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/avm_template.hpp @@ -90,9 +90,9 @@ class AVMTemplate { public: DataType permutation_set_column_1; // column 0 DataType permutation_set_column_2; // column 1 - DataType permutation_set_column_3; // column 1 - DataType permutation_set_column_4; // column 1 - DataType permutation_inverses; // column 2 + DataType permutation_set_column_3; // column 2 + DataType permutation_set_column_4; // column 3 + DataType permutation_inverses; // column 4 DEFINE_POINTER_VIEW(NUM_WITNESS_ENTITIES, &permutation_set_column_1, @@ -123,12 +123,12 @@ class AVMTemplate { class AllEntities : public AllEntities_ { public: DataType lagrange_first; // column 0 - DataType enable_set_permutation; // column 0 - DataType permutation_set_column_1; // column 1 - DataType permutation_set_column_2; // column 2 - DataType permutation_set_column_3; // column 2 - DataType permutation_set_column_4; // column 2 - DataType permutation_inverses; // column 3 + DataType enable_set_permutation; // column 1 + DataType permutation_set_column_1; // column 2 + DataType permutation_set_column_2; // column 3 + DataType permutation_set_column_3; // column 4 + DataType permutation_set_column_4; // column 5 + DataType permutation_inverses; // column 6 // defines a method pointer_view that returns the following, with const and non-const variants DEFINE_POINTER_VIEW(NUM_ALL_ENTITIES, @@ -340,7 +340,7 @@ class AVMTemplate { void deserialize_full_transcript() override { - // TODO + // TODO. Codepath is dead for now, becaused there is no composer abort(); // take current proof and put them into the struct size_t num_bytes_read = 0; @@ -370,7 +370,7 @@ class AVMTemplate { void serialize_full_transcript() override { - // TODO + // TODO. Codepath is dead for now, becaused there is no composer abort(); size_t old_proof_length = BaseTranscript::proof_data.size(); BaseTranscript::proof_data.clear(); diff --git a/barretenberg/cpp/src/barretenberg/honk/proof_system/logderivative_library.hpp b/barretenberg/cpp/src/barretenberg/honk/proof_system/logderivative_library.hpp index 1f9307def30..5c37b0884c0 100644 --- a/barretenberg/cpp/src/barretenberg/honk/proof_system/logderivative_library.hpp +++ b/barretenberg/cpp/src/barretenberg/honk/proof_system/logderivative_library.hpp @@ -157,18 +157,20 @@ void accumulate_logderivative_lookup_subrelation_contributions(ContainerOverSubr * @brief Compute generic log-derivative set permutation subrelation accumulation * @details The generic log-derivative lookup relation consistes of two subrelations. The first demonstrates that the * inverse polynomial I, defined via I = 1/[(read_term) * (write_term)], has been computed correctly. The second - * establishes the correctness of the lookups themselves based on the log-derivative lookup argument. Note that the + * establishes the correctness of the permutation itself based on the log-derivative argument. Note that the * latter subrelation is "linearly dependent" in the sense that it establishes that a sum across all rows of the * execution trace is zero, rather than that some expression holds independently at each row. Accordingly, this * subrelation is not multiplied by a scaling factor at each accumulation step. The subrelation expressions are * respectively: * - * I * (read_term) * (write_term) - 1 = 0 + * I * (read_term) * (write_term) - q_{permutation_enabler} = 0 * - * \sum_{i=0}^{n-1} [q_{logderiv_enabler} * I * write_term + I * read_term] = 0 + * \sum_{i=0}^{n-1} [q_{write_enabler} * I * write_term + q_{read_enabler} * I * read_term] = 0 * - * The explicit expressions for read_term and write_term are dependent upon the particular structure of the lookup being - * performed and methods for computing them must be defined in the corresponding relation class. + * The explicit expressions for read_term and write_term are dependent upon the particular structure of the permutation + * being performed and methods for computing them must be defined in the corresponding relation class. The entities + * which are used to determine the use of permutation (is it enabled, is the first "read" set enabled, is the second + * "write" set enabled) must be defined in the relation class. * * @tparam FF * @tparam Relation @@ -188,6 +190,8 @@ void accumulate_logderivative_permutation_subrelation_contributions(ContainerOve { constexpr size_t READ_TERMS = Relation::READ_TERMS; constexpr size_t WRITE_TERMS = Relation::WRITE_TERMS; + + // For now we only do simple permutations over tuples with 1 read and 1 write term static_assert(READ_TERMS == 1); static_assert(WRITE_TERMS == 1); @@ -202,12 +206,12 @@ void accumulate_logderivative_permutation_subrelation_contributions(ContainerOve std::array permutation_terms; std::array denominator_accumulator; - // The lookup relation = \sum_j (1 / read_term[j]) - \sum_k (read_counts[k] / write_term[k]) - // To get the inverses (1 / read_term[i]), (1 / write_term[i]), we have a commitment to the product of all inverses - // i.e. lookup_inverse = \prod_j (1 / read_term[j]) * \prod_k (1 / write_term[k]) - // The purpose of this next section is to derive individual inverse terms using `lookup_inverses` - // i.e. (1 / read_term[i]) = lookup_inverse * \prod_{j /ne i} (read_term[j]) * \prod_k (write_term[k]) - // (1 / write_term[i]) = lookup_inverse * \prod_j (read_term[j]) * \prod_{k ne i} (write_term[k]) + // The permutation relation = 1 / read_term - 1 / write_term + // To get the inverses (1 / read_term), (1 / write_term), we have a commitment to the product ofinver ses + // i.e. permutation_inverses = (1 / read_term) * (1 / write_term) + // The purpose of this next section is to derive individual inverse terms using `permutation_inverses` + // i.e. (1 / read_term) = permutation_inverse * write_term + // (1 / write_term) = permutation_inverse * read_term permutation_terms[0] = permutation_relation.template compute_read_term(in, params); permutation_terms[1] = permutation_relation.template compute_write_term(in, params);