51 return static_cast<size_t>(result);
378 return {
"ecc_op",
"busread",
"lookup",
"pub_inputs",
"arithmetic",
"delta_range",
379 "elliptic",
"memory",
"nnf",
"poseidon2_external",
"poseidon2_internal",
"overflow" };
455 block.fixed_size = size;
465 for (
auto& block : this->
get()) {
466 block.trace_offset_ =
offset;
467 offset += block.get_fixed_size(is_structured);
473 info(
"Gate blocks summary: (actual gates / fixed capacity)");
477 info(
"pub inputs :\t",
480 this->pub_inputs.get_fixed_size(),
481 " (populated in decider pk constructor)");
498 for (
const auto& block : this->
get()) {
499 total_size += block.size();
507 for (
const auto& block : this->
get()) {
508 total_size += block.get_fixed_size();
534 .arithmetic = 1 << 14,
539 .poseidon2_external = 2,
540 .poseidon2_internal = 2,
547static constexpr TraceStructure SMALL_TEST_STRUCTURE{ .
ecc_op = 1 << 14,
550 .pub_inputs = 1 << 14,
551 .arithmetic = 1 << 15,
552 .delta_range = 1 << 14,
556 .poseidon2_external = 1 << 14,
557 .poseidon2_internal = 1 << 15,
563static constexpr TraceStructure EXAMPLE_18{ .
ecc_op = 1 << 10,
566 .pub_inputs = 1 << 6,
568 .delta_range = 45000,
572 .poseidon2_external = 2500,
573 .poseidon2_internal = 14000,
579static constexpr TraceStructure EXAMPLE_20{ .
ecc_op = 1 << 11,
582 .pub_inputs = 1 << 8,
583 .arithmetic = 396000,
584 .delta_range = 180000,
588 .poseidon2_external = 5000,
589 .poseidon2_internal = 28000,
595static constexpr TraceStructure AZTEC_TRACE_STRUCTURE{ .
ecc_op = 1000,
600 .delta_range = 15500,
604 .poseidon2_external = 17000,
605 .poseidon2_internal = 96500,
Basic structure for storing gate data in a builder.
static constexpr size_t NUM_WIRES
void compute_offsets(bool is_structured)
bool operator==(const MegaExecutionTraceBlocks &other) const =default
size_t get_total_content_size()
size_t get_structured_size() const
void set_fixed_block_sizes(const TraceSettings &settings)
size_t get_structured_dyadic_size() const
static constexpr size_t NUM_WIRES
Defines the circuit block types for the Mega arithmetization.
MegaExecutionTraceBlocks()=default
void set_gate_selector(const fr &value) override
Default implementation does nothing.
SlabVectorSelector< fr > gate_selector
SelectorType & q_arith() override
virtual SelectorType & q_poseidon2_external()
virtual SelectorType & q_lookup_type()
virtual void set_gate_selector(const fr &value)
Default implementation does nothing.
virtual SelectorType & q_elliptic()
virtual SelectorType & q_delta_range()
RefVector< Selector< fr > > get_selectors() override
virtual const SelectorType & q_delta_range() const
virtual const SelectorType & q_lookup_type() const
virtual const SelectorType & q_poseidon2_internal() const
virtual SelectorType & q_poseidon2_internal()
std::array< ZeroSelector< fr >, 9 > zero_selectors
virtual const SelectorType & q_nnf() const
void resize_additional(size_t new_size)
Resizes all selectors which are not part of the conventional Ultra arithmetization.
RefVector< SelectorType > get_gate_selectors()
virtual const SelectorType & q_arith() const
virtual const SelectorType & q_elliptic() const
void pad_additional()
Add zeros to all selectors which are not part of the conventional Ultra arithmetization.
virtual const SelectorType & q_poseidon2_external() const
virtual SelectorType & q_nnf()
virtual const SelectorType & q_busread() const
virtual SelectorType & q_arith()
virtual const SelectorType & q_memory() const
virtual SelectorType & q_memory()
virtual SelectorType & q_busread()
SlabVectorSelector< fr > gate_selector
void set_gate_selector(const fr &value) override
Default implementation does nothing.
SelectorType & q_busread() override
SelectorType & q_delta_range() override
SlabVectorSelector< fr > gate_selector
void set_gate_selector(const fr &value) override
Default implementation does nothing.
SlabVectorSelector< fr > gate_selector
SelectorType & q_elliptic() override
void set_gate_selector(const fr &value) override
Default implementation does nothing.
SlabVectorSelector< fr > gate_selector
SelectorType & q_lookup_type() override
void set_gate_selector(const fr &value) override
Default implementation does nothing.
SelectorType & q_memory() override
SlabVectorSelector< fr > gate_selector
void set_gate_selector(const fr &value) override
Default implementation does nothing.
void set_gate_selector(const fr &value) override
Default implementation does nothing.
SelectorType & q_nnf() override
SlabVectorSelector< fr > gate_selector
SelectorType & q_nnf() override
SelectorType & q_poseidon2_internal() override
SelectorType & q_arith() override
SelectorType & q_busread() override
SelectorType & q_poseidon2_external() override
std::array< SlabVectorSelector< fr >, 9 > gate_selectors
SelectorType & q_memory() override
SelectorType & q_lookup_type() override
SelectorType & q_elliptic() override
SelectorType & q_delta_range() override
void set_gate_selector(const fr &value) override
Default implementation does nothing.
SelectorType & q_poseidon2_external() override
SlabVectorSelector< fr > gate_selector
SelectorType & q_poseidon2_internal() override
void set_gate_selector(const fr &value) override
Default implementation does nothing.
SlabVectorSelector< fr > gate_selector
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
A template class for a reference vector. Behaves as if std::vector<T&> was possible.
virtual void resize(size_t new_size)=0
Resize the selector.
void emplace_back(const FF &value)
Append a field element to the selector.
Selector backed by a slab allocator vector.
void emplace_back(int i) override
Append an integer value to the selector.
constexpr T get_msb(const T in)
constexpr T round_up_power_2(const T in)
Entry point for Barretenberg command-line interface.
field< Bn254FrParams > fr
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
A container indexed by the types of the blocks in the execution trace.
MegaTraceDeltaRangeBlock delta_range
MegaTraceMemoryBlock memory
MegaTraceNonNativeFieldBlock nnf
MegaTraceArithmeticBlock arithmetic
MegaTracePublicInputBlock pub_inputs
MegaTraceEllipticBlock elliptic
bool operator==(const MegaTraceBlockData &other) const =default
MegaTraceBusReadBlock busread
MegaTracePoseidon2ExternalBlock poseidon2_external
MegaTracePoseidon2InternalBlock poseidon2_internal
std::vector< std::string_view > get_labels() const
MegaTraceLookupBlock lookup
auto get_gate_blocks() const
MegaTraceOverflowBlock overflow
uint32_t overflow_capacity
size_t dyadic_size() const
std::optional< TraceStructure > structure
uint32_t poseidon2_internal
uint32_t poseidon2_external