Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
relations.bench.cpp
Go to the documentation of this file.
4#include "barretenberg/protogalaxy/protogalaxy_prover_internal.hpp" // just for an alias; should perhaps move to prover
7#include <benchmark/benchmark.h>
8
9namespace {
11}
12
14
15using Fr = bb::fr;
17
18// Generic helper for executing Relation::accumulate for the template specified input type
19template <typename Flavor, typename Relation, typename Input, typename Accumulator>
20void execute_relation(::benchmark::State& state)
21{
22 using FF = typename Flavor::FF;
23
25
26 // Instantiate zero-initialized inputs and accumulator
27 Input input{};
28 Accumulator accumulator;
29
30 for (auto _ : state) {
31 Relation::accumulate(accumulator, input, params, 1);
32 }
33}
34
35// Single execution of relation on values (FF), e.g. Sumcheck verifier / PG perturbator work
36template <typename Flavor, typename Relation> void execute_relation_for_values(::benchmark::State& state)
37{
38 using Input = typename Flavor::AllValues;
39 using Accumulator = typename Relation::SumcheckArrayOfValuesOverSubrelations;
40
41 execute_relation<Flavor, Relation, Input, Accumulator>(state);
42}
43
44// Single execution of relation on Sumcheck univariates, i.e. Sumcheck/Decider prover work
45template <typename Flavor, typename Relation> void execute_relation_for_univariates(::benchmark::State& state)
46{
47 using Input = typename Flavor::ExtendedEdges;
49
50 execute_relation<Flavor, Relation, Input, Accumulator>(state);
51}
52
53// Single execution of relation on PG univariates, i.e. PG combiner work
54template <typename Flavor, typename Relation> void execute_relation_for_pg_univariates(::benchmark::State& state)
55{
56 using DeciderProvingKeys = DeciderProvingKeys_<Flavor>;
58 using Accumulator =
59 typename Relation::template ProtogalaxyTupleOfUnivariatesOverSubrelations<DeciderProvingKeys::NUM>;
60
61 execute_relation<Flavor, Relation, Input, Accumulator>(state);
62}
63
64// Ultra relations (PG prover combiner work)
72
73// Goblin-Ultra only relations (PG prover combiner work)
78
79// Ultra relations (Sumcheck prover work)
87
88// Goblin-Ultra only relations (Sumcheck prover work)
93
94// Ultra relations (verifier work)
102
103// Goblin-Ultra only relations (verifier work)
108
109// Translator VM
116
117// ECCVM
125
126} // namespace bb::benchmark::relations
127
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
Curve::ScalarField FF
ProverUnivariates< MAX_PARTIAL_RELATION_LENGTH > ExtendedEdges
A container for univariates produced during the hot loop in sumcheck.
typename Flavor::template ProverUnivariatesWithOptimisticSkipping< ExtendedUnivariate::LENGTH, DeciderPKs::NUM - 1 > ExtendedUnivariates
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
ArrayOfValues< FF, RelationImpl::SUBRELATION_PARTIAL_LENGTHS > SumcheckArrayOfValuesOverSubrelations
TupleOfUnivariates< FF, RelationImpl::SUBRELATION_PARTIAL_LENGTHS > SumcheckTupleOfUnivariatesOverSubrelations
numeric::RNG & engine
void execute_relation_for_pg_univariates(::benchmark::State &state)
void execute_relation(::benchmark::State &state)
void execute_relation_for_values(::benchmark::State &state)
void execute_relation_for_univariates(::benchmark::State &state)
BENCHMARK(execute_relation_for_pg_univariates< UltraFlavor, UltraArithmeticRelation< Fr > >)
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Definition engine.cpp:190
typename Flavor::FF FF
field< Bn254FrParams > fr
Definition fr.hpp:174
BENCHMARK_MAIN()
static RelationParameters get_random()