Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::ExecutionTraceBlock< FF, NUM_WIRES_ > Class Template Reference

Row-major storage for the gates of one execution trace block: one vector of GateRow. Column accessors (wires, q_m..q_5, gate selectors) return persistent views into the rows. More...

#include <execution_trace_block.hpp>

Public Types

using SelectorType = Selector< FF >
 
using Row = GateRow< FF, NUM_WIRES >
 
using Tile = GateTile< FF, NUM_WIRES >
 
using WireType = WireColumn< FF, NUM_WIRES >
 
using Wires = std::array< WireType, NUM_WIRES >
 

Public Member Functions

 ExecutionTraceBlock ()=default
 
 ExecutionTraceBlock (std::initializer_list< GateKind > kinds)
 Construct a block that owns the listed gate kinds.
 
 ExecutionTraceBlock (const ExecutionTraceBlock &other)
 
ExecutionTraceBlockoperator= (const ExecutionTraceBlock &other)
 
 ExecutionTraceBlock (ExecutionTraceBlock &&other) noexcept
 
ExecutionTraceBlockoperator= (ExecutionTraceBlock &&other) noexcept
 
 ~ExecutionTraceBlock ()=default
 
void tracy_gate ()
 
uint32_t trace_offset () const
 
size_t trace_end () const
 
bool operator== (const ExecutionTraceBlock &other) const
 
size_t size () const
 
void append_gate (const Row &row)
 Append one complete gate: wires, non-gate selectors, and the (single) active gate selector.
 
void reserve (size_t num_rows)
 Reserve capacity for num_rows gates.
 
bool owns_gate_kind (GateKind kind) const
 
std::vector< GateKindowned_gate_kinds () const
 
GateSelectorColumn< FF, NUM_WIRES > & gate_selector_for (GateKind kind)
 Reference to this block's selector view for kind; aborts if the block does not own it. For cross-block reads, use read_gate_selector instead.
 
RefVector< Selector< FF > > get_selectors ()
 All selectors of this block: the non-gate selectors followed by the owned gate selectors.
 
void free_data ()
 Release gate memory. Caches block size so size() still works.
 
WireTypew_l ()
 
WireTypew_r ()
 
WireTypew_o ()
 
WireTypew_4 ()
 
SelectorColumn< FF, NUM_WIRES > & q_m ()
 
SelectorColumn< FF, NUM_WIRES > & q_c ()
 
SelectorColumn< FF, NUM_WIRES > & q_1 ()
 
SelectorColumn< FF, NUM_WIRES > & q_2 ()
 
SelectorColumn< FF, NUM_WIRES > & q_3 ()
 
SelectorColumn< FF, NUM_WIRES > & q_4 ()
 
SelectorColumn< FF, NUM_WIRES > & q_5 ()
 

Public Attributes

size_t cached_size_ = 0
 
bool data_freed_ = false
 
uint32_t trace_offset_ = std::numeric_limits<uint32_t>::max()
 
std::vector< Tiletiles
 
size_t num_rows_ = 0
 
Wires wires
 

Static Public Attributes

static constexpr size_t NUM_WIRES = NUM_WIRES_
 
static constexpr size_t NUM_NON_GATE_SELECTORS = NON_GATE_SELECTORS<FF, NUM_WIRES>.size()
 

Private Member Functions

void copy_gate_columns_from (const ExecutionTraceBlock &other)
 
Tiletile_for_append ()
 
template<size_t... Is>
std::array< SelectorColumn< FF, NUM_WIRES >, NUM_NON_GATE_SELECTORSmake_selector_columns (std::index_sequence< Is... >)
 

Private Attributes

std::array< SelectorColumn< FF, NUM_WIRES >, NUM_NON_GATE_SELECTORScolumns_
 
std::vector< GateSelectorColumn< FF, NUM_WIRES > > gate_columns_
 

Detailed Description

template<typename FF, size_t NUM_WIRES_>
class bb::ExecutionTraceBlock< FF, NUM_WIRES_ >

Row-major storage for the gates of one execution trace block: one vector of GateRow. Column accessors (wires, q_m..q_5, gate selectors) return persistent views into the rows.

Definition at line 368 of file execution_trace_block.hpp.

Member Typedef Documentation

◆ Row

template<typename FF , size_t NUM_WIRES_>
using bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::Row = GateRow<FF, NUM_WIRES>

Definition at line 374 of file execution_trace_block.hpp.

◆ SelectorType

template<typename FF , size_t NUM_WIRES_>
using bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::SelectorType = Selector<FF>

Definition at line 373 of file execution_trace_block.hpp.

◆ Tile

template<typename FF , size_t NUM_WIRES_>
using bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::Tile = GateTile<FF, NUM_WIRES>

Definition at line 375 of file execution_trace_block.hpp.

◆ Wires

template<typename FF , size_t NUM_WIRES_>
using bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::Wires = std::array<WireType, NUM_WIRES>

Definition at line 377 of file execution_trace_block.hpp.

◆ WireType

template<typename FF , size_t NUM_WIRES_>
using bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::WireType = WireColumn<FF, NUM_WIRES>

Definition at line 376 of file execution_trace_block.hpp.

Constructor & Destructor Documentation

◆ ExecutionTraceBlock() [1/4]

template<typename FF , size_t NUM_WIRES_>
bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::ExecutionTraceBlock ( )
default

◆ ExecutionTraceBlock() [2/4]

template<typename FF , size_t NUM_WIRES_>
bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::ExecutionTraceBlock ( std::initializer_list< GateKind kinds)
inline

Construct a block that owns the listed gate kinds.

Definition at line 384 of file execution_trace_block.hpp.

◆ ExecutionTraceBlock() [3/4]

template<typename FF , size_t NUM_WIRES_>
bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::ExecutionTraceBlock ( const ExecutionTraceBlock< FF, NUM_WIRES_ > &  other)
inline

Definition at line 393 of file execution_trace_block.hpp.

◆ ExecutionTraceBlock() [4/4]

template<typename FF , size_t NUM_WIRES_>
bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::ExecutionTraceBlock ( ExecutionTraceBlock< FF, NUM_WIRES_ > &&  other)
inlinenoexcept

Definition at line 415 of file execution_trace_block.hpp.

◆ ~ExecutionTraceBlock()

template<typename FF , size_t NUM_WIRES_>
bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::~ExecutionTraceBlock ( )
default

Member Function Documentation

◆ append_gate()

template<typename FF , size_t NUM_WIRES_>
void bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::append_gate ( const Row row)
inline

Append one complete gate: wires, non-gate selectors, and the (single) active gate selector.

Definition at line 478 of file execution_trace_block.hpp.

◆ copy_gate_columns_from()

template<typename FF , size_t NUM_WIRES_>
void bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::copy_gate_columns_from ( const ExecutionTraceBlock< FF, NUM_WIRES_ > &  other)
inlineprivate

Definition at line 605 of file execution_trace_block.hpp.

◆ free_data()

template<typename FF , size_t NUM_WIRES_>
void bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::free_data ( )
inline

Release gate memory. Caches block size so size() still works.

Called after trace data has been copied to prover polynomials.

Definition at line 572 of file execution_trace_block.hpp.

◆ gate_selector_for()

template<typename FF , size_t NUM_WIRES_>
GateSelectorColumn< FF, NUM_WIRES > & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::gate_selector_for ( GateKind  kind)
inline

Reference to this block's selector view for kind; aborts if the block does not own it. For cross-block reads, use read_gate_selector instead.

Definition at line 528 of file execution_trace_block.hpp.

◆ get_selectors()

template<typename FF , size_t NUM_WIRES_>
RefVector< Selector< FF > > bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::get_selectors ( )
inline

All selectors of this block: the non-gate selectors followed by the owned gate selectors.

Definition at line 542 of file execution_trace_block.hpp.

◆ make_selector_columns()

template<typename FF , size_t NUM_WIRES_>
template<size_t... Is>
std::array< SelectorColumn< FF, NUM_WIRES >, NUM_NON_GATE_SELECTORS > bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::make_selector_columns ( std::index_sequence< Is... >  )
inlineprivate

Definition at line 626 of file execution_trace_block.hpp.

◆ operator=() [1/2]

template<typename FF , size_t NUM_WIRES_>
ExecutionTraceBlock & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::operator= ( const ExecutionTraceBlock< FF, NUM_WIRES_ > &  other)
inline

Definition at line 402 of file execution_trace_block.hpp.

◆ operator=() [2/2]

template<typename FF , size_t NUM_WIRES_>
ExecutionTraceBlock & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::operator= ( ExecutionTraceBlock< FF, NUM_WIRES_ > &&  other)
inlinenoexcept

Definition at line 424 of file execution_trace_block.hpp.

◆ operator==()

template<typename FF , size_t NUM_WIRES_>
bool bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::operator== ( const ExecutionTraceBlock< FF, NUM_WIRES_ > &  other) const
inline

Definition at line 466 of file execution_trace_block.hpp.

◆ owned_gate_kinds()

template<typename FF , size_t NUM_WIRES_>
std::vector< GateKind > bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::owned_gate_kinds ( ) const
inline

Definition at line 514 of file execution_trace_block.hpp.

◆ owns_gate_kind()

template<typename FF , size_t NUM_WIRES_>
bool bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::owns_gate_kind ( GateKind  kind) const
inline

Definition at line 504 of file execution_trace_block.hpp.

◆ q_1()

template<typename FF , size_t NUM_WIRES_>
SelectorColumn< FF, NUM_WIRES > & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::q_1 ( )
inline

Definition at line 589 of file execution_trace_block.hpp.

◆ q_2()

template<typename FF , size_t NUM_WIRES_>
SelectorColumn< FF, NUM_WIRES > & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::q_2 ( )
inline

Definition at line 590 of file execution_trace_block.hpp.

◆ q_3()

template<typename FF , size_t NUM_WIRES_>
SelectorColumn< FF, NUM_WIRES > & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::q_3 ( )
inline

Definition at line 591 of file execution_trace_block.hpp.

◆ q_4()

template<typename FF , size_t NUM_WIRES_>
SelectorColumn< FF, NUM_WIRES > & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::q_4 ( )
inline

Definition at line 592 of file execution_trace_block.hpp.

◆ q_5()

template<typename FF , size_t NUM_WIRES_>
SelectorColumn< FF, NUM_WIRES > & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::q_5 ( )
inline

Definition at line 593 of file execution_trace_block.hpp.

◆ q_c()

template<typename FF , size_t NUM_WIRES_>
SelectorColumn< FF, NUM_WIRES > & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::q_c ( )
inline

Definition at line 588 of file execution_trace_block.hpp.

◆ q_m()

template<typename FF , size_t NUM_WIRES_>
SelectorColumn< FF, NUM_WIRES > & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::q_m ( )
inline

Definition at line 587 of file execution_trace_block.hpp.

◆ reserve()

template<typename FF , size_t NUM_WIRES_>
void bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::reserve ( size_t  num_rows)
inline

Reserve capacity for num_rows gates.

Definition at line 502 of file execution_trace_block.hpp.

◆ size()

template<typename FF , size_t NUM_WIRES_>
size_t bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::size ( ) const
inline

Definition at line 473 of file execution_trace_block.hpp.

◆ tile_for_append()

template<typename FF , size_t NUM_WIRES_>
Tile & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::tile_for_append ( )
inlineprivate

Definition at line 617 of file execution_trace_block.hpp.

◆ trace_end()

template<typename FF , size_t NUM_WIRES_>
size_t bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::trace_end ( ) const
inline

Definition at line 464 of file execution_trace_block.hpp.

◆ trace_offset()

template<typename FF , size_t NUM_WIRES_>
uint32_t bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::trace_offset ( ) const
inline

Definition at line 457 of file execution_trace_block.hpp.

◆ tracy_gate()

template<typename FF , size_t NUM_WIRES_>
void bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::tracy_gate ( )
inline

Definition at line 443 of file execution_trace_block.hpp.

◆ w_4()

template<typename FF , size_t NUM_WIRES_>
WireType & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::w_4 ( )
inline

Definition at line 584 of file execution_trace_block.hpp.

◆ w_l()

template<typename FF , size_t NUM_WIRES_>
WireType & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::w_l ( )
inline

Definition at line 581 of file execution_trace_block.hpp.

◆ w_o()

template<typename FF , size_t NUM_WIRES_>
WireType & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::w_o ( )
inline

Definition at line 583 of file execution_trace_block.hpp.

◆ w_r()

template<typename FF , size_t NUM_WIRES_>
WireType & bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::w_r ( )
inline

Definition at line 582 of file execution_trace_block.hpp.

Member Data Documentation

◆ cached_size_

template<typename FF , size_t NUM_WIRES_>
size_t bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::cached_size_ = 0

Definition at line 453 of file execution_trace_block.hpp.

◆ columns_

template<typename FF , size_t NUM_WIRES_>
std::array<SelectorColumn<FF, NUM_WIRES>, NUM_NON_GATE_SELECTORS> bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::columns_
private
Initial value:
=
std::array< SelectorColumn< FF, NUM_WIRES >, NUM_NON_GATE_SELECTORS > make_selector_columns(std::index_sequence< Is... >)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13

Definition at line 634 of file execution_trace_block.hpp.

◆ data_freed_

template<typename FF , size_t NUM_WIRES_>
bool bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::data_freed_ = false

Definition at line 454 of file execution_trace_block.hpp.

◆ gate_columns_

template<typename FF , size_t NUM_WIRES_>
std::vector<GateSelectorColumn<FF, NUM_WIRES> > bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::gate_columns_
private

Definition at line 637 of file execution_trace_block.hpp.

◆ NUM_NON_GATE_SELECTORS

template<typename FF , size_t NUM_WIRES_>
constexpr size_t bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::NUM_NON_GATE_SELECTORS = NON_GATE_SELECTORS<FF, NUM_WIRES>.size()
staticconstexpr

Definition at line 371 of file execution_trace_block.hpp.

◆ num_rows_

template<typename FF , size_t NUM_WIRES_>
size_t bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::num_rows_ = 0

Definition at line 596 of file execution_trace_block.hpp.

◆ NUM_WIRES

template<typename FF , size_t NUM_WIRES_>
constexpr size_t bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::NUM_WIRES = NUM_WIRES_
staticconstexpr

Definition at line 370 of file execution_trace_block.hpp.

◆ tiles

template<typename FF , size_t NUM_WIRES_>
std::vector<Tile> bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::tiles

Definition at line 595 of file execution_trace_block.hpp.

◆ trace_offset_

template<typename FF , size_t NUM_WIRES_>
uint32_t bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::trace_offset_ = std::numeric_limits<uint32_t>::max()

Definition at line 455 of file execution_trace_block.hpp.

◆ wires

template<typename FF , size_t NUM_WIRES_>
Wires bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::wires
Initial value:
WireColumn< FF, NUM_WIRES > WireType
Mutable view over one wire column of the row-major gate storage.

Definition at line 599 of file execution_trace_block.hpp.


The documentation for this class was generated from the following file: