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
6#include <benchmark/benchmark.h>
7
8namespace {
10}
11
13
14using Fr = bb::fr;
16
17// Generic helper for executing Relation::accumulate for the template specified input type
18template <typename Flavor, typename Relation, typename Input, typename Accumulator>
19void execute_relation(::benchmark::State& state)
20{
21 using FF = typename Flavor::FF;
22
24
25 // Instantiate zero-initialized inputs and accumulator
26 Input input{};
27 Accumulator accumulator;
28
29 for (auto _ : state) {
30 Relation::accumulate(accumulator, input, params, 1);
31 }
32}
33
34// Single execution of relation on values (FF), e.g. Sumcheck verifier / PG perturbator work
35template <typename Flavor, typename Relation> void execute_relation_for_values(::benchmark::State& state)
36{
37 using Input = typename Flavor::AllValues;
38 using Accumulator = typename Relation::SumcheckArrayOfValuesOverSubrelations;
39
40 execute_relation<Flavor, Relation, Input, Accumulator>(state);
41}
42
43// Single execution of relation on Sumcheck univariates, i.e. Sumcheck/Decider prover work
44template <typename Flavor, typename Relation> void execute_relation_for_univariates(::benchmark::State& state)
45{
46 using Input = typename Flavor::ExtendedEdges;
48
49 execute_relation<Flavor, Relation, Input, Accumulator>(state);
50}
51
52// Single execution of relation on PG univariates, i.e. PG combiner work
53template <typename Flavor, typename Relation> void execute_relation_for_pg_univariates(::benchmark::State& state)
54{
57 using Accumulator = typename Relation::template ProtogalaxyTupleOfUnivariatesOverSubrelations<NUM_INSTANCES>;
58
59 execute_relation<Flavor, Relation, Input, Accumulator>(state);
60}
61
62// Ultra relations (PG prover combiner work)
70
71// Goblin-Ultra only relations (PG prover combiner work)
76
77// Ultra relations (Sumcheck prover work)
85
86// Goblin-Ultra only relations (Sumcheck prover work)
91
92// Ultra relations (verifier work)
100
101// Goblin-Ultra only relations (verifier work)
106
107// Translator VM
114
115// ECCVM
123
124} // namespace bb::benchmark::relations
125
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, SKIP_COUNT > ExtendedUnivariates
A ProverInstance is normally constructed from a finalized circuit and it contains all the information...
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
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()