From a1801df24e916c7a75303b6490bfcb7e11fc6376 Mon Sep 17 00:00:00 2001 From: Rumata888 Date: Wed, 6 Dec 2023 13:47:13 +0000 Subject: [PATCH] Renames --- .../flavor/{avm_template.hpp => toy_avm.hpp} | 8 ++++---- .../toy_avm_circuit_builder.hpp} | 6 ++++-- .../toy_avm_circuit_builder.test.cpp} | 15 ++++----------- .../generic_permutation_relation.cpp | 4 ++-- .../generic_permutation_relation.hpp | 0 .../relation_definer.hpp | 0 6 files changed, 14 insertions(+), 19 deletions(-) rename barretenberg/cpp/src/barretenberg/flavor/{avm_template.hpp => toy_avm.hpp} (99%) rename barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/{avm_templates/avm_template_circuit_builder.hpp => toy_avm/toy_avm_circuit_builder.hpp} (96%) rename barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/{avm_templates/avm_template_circuit_builder.test.cpp => toy_avm/toy_avm_circuit_builder.test.cpp} (80%) rename barretenberg/cpp/src/barretenberg/relations/{avm_templates => toy_avm}/generic_permutation_relation.cpp (95%) rename barretenberg/cpp/src/barretenberg/relations/{avm_templates => toy_avm}/generic_permutation_relation.hpp (100%) rename barretenberg/cpp/src/barretenberg/relations/{avm_templates => toy_avm}/relation_definer.hpp (100%) diff --git a/barretenberg/cpp/src/barretenberg/flavor/avm_template.hpp b/barretenberg/cpp/src/barretenberg/flavor/toy_avm.hpp similarity index 99% rename from barretenberg/cpp/src/barretenberg/flavor/avm_template.hpp rename to barretenberg/cpp/src/barretenberg/flavor/toy_avm.hpp index 54d128e966eb..66d5415e6824 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/avm_template.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/toy_avm.hpp @@ -4,10 +4,10 @@ #include "barretenberg/ecc/curves/bn254/bn254.hpp" #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/polynomials/univariate.hpp" -#include "barretenberg/relations/avm_templates/generic_permutation_relation.hpp" -#include "barretenberg/relations/avm_templates/relation_definer.hpp" #include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/relations/relation_types.hpp" +#include "barretenberg/relations/toy_avm/generic_permutation_relation.hpp" +#include "barretenberg/relations/toy_avm/relation_definer.hpp" #include "relation_definitions_fwd.hpp" #include #include @@ -26,7 +26,7 @@ namespace flavor { * integrating those mechanisms into AVM easier * */ -class AVMTemplate { +class ToyAVM { public: using Curve = curve::BN254; using FF = Curve::ScalarField; @@ -434,7 +434,7 @@ class AVMTemplate { } // namespace flavor namespace sumcheck { -DECLARE_IMPLEMENTATIONS_FOR_ALL_SETTINGS(GenericPermutationRelationImpl, flavor::AVMTemplate) +DECLARE_IMPLEMENTATIONS_FOR_ALL_SETTINGS(GenericPermutationRelationImpl, flavor::ToyAVM) } // namespace sumcheck } // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/avm_templates/avm_template_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/toy_avm/toy_avm_circuit_builder.hpp similarity index 96% rename from barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/avm_templates/avm_template_circuit_builder.hpp rename to barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/toy_avm/toy_avm_circuit_builder.hpp index 4c065fb195aa..26ace2d851a5 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/avm_templates/avm_template_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/toy_avm/toy_avm_circuit_builder.hpp @@ -6,16 +6,18 @@ */ #pragma once +#include "barretenberg/common/constexpr_utils.hpp" #include "barretenberg/ecc/curves/bn254/fr.hpp" -#include "barretenberg/flavor/avm_template.hpp" +#include "barretenberg/flavor/toy_avm.hpp" #include "barretenberg/honk/proof_system/logderivative_library.hpp" #include "barretenberg/relations/relation_parameters.hpp" +#include "barretenberg/relations/toy_avm/generic_permutation_relation.hpp" namespace proof_system { template class ToyAVMCircuitBuilder { public: - using FF = typename Flavor::FF; + using FF = Flavor::FF; using Polynomial = typename Flavor::Polynomial; static constexpr size_t NUM_POLYNOMIALS = Flavor::NUM_ALL_ENTITIES; diff --git a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/avm_templates/avm_template_circuit_builder.test.cpp b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/toy_avm/toy_avm_circuit_builder.test.cpp similarity index 80% rename from barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/avm_templates/avm_template_circuit_builder.test.cpp rename to barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/toy_avm/toy_avm_circuit_builder.test.cpp index 860356851372..62b2e4d83c3b 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/avm_templates/avm_template_circuit_builder.test.cpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/toy_avm/toy_avm_circuit_builder.test.cpp @@ -1,6 +1,5 @@ -#include "avm_template_circuit_builder.hpp" +#include "toy_avm_circuit_builder.hpp" #include "barretenberg/crypto/generators/generator_data.hpp" -#include "barretenberg/crypto/pedersen_commitment/pedersen.hpp" #include using namespace barretenberg; @@ -11,22 +10,16 @@ auto& engine = numeric::random::get_debug_engine(); namespace toy_avm_circuit_builder_tests { -template class ToyAVMCircuitBuilderTests : public ::testing::Test {}; - -using FlavorTypes = ::testing::Types; -TYPED_TEST_SUITE(AVMTemplateCircuitBuilderTests, FlavorTypes); - /** * @brief A test explaining the work of the permutations in Toy AVM * */ -TYPED_TEST(ToyAVMCircuitBuilderTests, BaseCase) +TEST(ToyAVMCircuitBuilder, BaseCase) { - using Flavor = TypeParam; - using FF = typename Flavor::FF; + using FF = proof_system::honk::flavor::ToyAVM::FF; const size_t circuit_size = 16; - proof_system::ToyAVMCircuitBuilder circuit_builder; + proof_system::ToyAVMCircuitBuilder circuit_builder; // Sample 2*16 random elements for the tuple permutation example std::vector column_0; diff --git a/barretenberg/cpp/src/barretenberg/relations/avm_templates/generic_permutation_relation.cpp b/barretenberg/cpp/src/barretenberg/relations/toy_avm/generic_permutation_relation.cpp similarity index 95% rename from barretenberg/cpp/src/barretenberg/relations/avm_templates/generic_permutation_relation.cpp rename to barretenberg/cpp/src/barretenberg/relations/toy_avm/generic_permutation_relation.cpp index efeb6b5336e3..1822c388c4e7 100644 --- a/barretenberg/cpp/src/barretenberg/relations/avm_templates/generic_permutation_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/relations/toy_avm/generic_permutation_relation.cpp @@ -1,6 +1,6 @@ #include "generic_permutation_relation.hpp" -#include "barretenberg/flavor/avm_template.hpp" #include "barretenberg/flavor/relation_definitions_fwd.hpp" +#include "barretenberg/flavor/toy_avm.hpp" #include "barretenberg/honk/proof_system/logderivative_library.hpp" #include "relation_definer.hpp" @@ -30,5 +30,5 @@ void GenericPermutationRelationImpl::accumulate(ContainerOverSubre // using GenericPermutationRelationExampleSettingsImpl = GenericPermutationRelationImpl; DEFINE_SUMCHECK_RELATION_CLASS(GenericPermutationRelationExampleSettingsImpl, flavor::AVMTemplate); -DEFINE_IMPLEMENTATIONS_FOR_ALL_SETTINGS(GenericPermutationRelationImpl, flavor::AVMTemplate); +DEFINE_IMPLEMENTATIONS_FOR_ALL_SETTINGS(GenericPermutationRelationImpl, flavor::ToyAVM); } // namespace proof_system::honk::sumcheck diff --git a/barretenberg/cpp/src/barretenberg/relations/avm_templates/generic_permutation_relation.hpp b/barretenberg/cpp/src/barretenberg/relations/toy_avm/generic_permutation_relation.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/relations/avm_templates/generic_permutation_relation.hpp rename to barretenberg/cpp/src/barretenberg/relations/toy_avm/generic_permutation_relation.hpp diff --git a/barretenberg/cpp/src/barretenberg/relations/avm_templates/relation_definer.hpp b/barretenberg/cpp/src/barretenberg/relations/toy_avm/relation_definer.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/relations/avm_templates/relation_definer.hpp rename to barretenberg/cpp/src/barretenberg/relations/toy_avm/relation_definer.hpp