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

Basic structure for storing gate data in a builder. Holds wires, the 7 non-gate selectors present on every block, and a variable-length list of (GateKind, Selector) pairs identifying the gate selectors this block owns. More...

#include <execution_trace_block.hpp>

Public Types

using SelectorType = Selector< FF >
 
using WireType = std::vector< uint32_t >
 
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 &)=default
 
ExecutionTraceBlockoperator= (const ExecutionTraceBlock &)=default
 
 ExecutionTraceBlock (ExecutionTraceBlock &&) noexcept=default
 
ExecutionTraceBlockoperator= (ExecutionTraceBlock &&) noexcept=default
 
 ~ExecutionTraceBlock ()=default
 
void tracy_gate ()
 
uint32_t trace_offset () const
 
size_t trace_end () const
 
bool operator== (const ExecutionTraceBlock &other) const =default
 
size_t size () const
 
SlabVectorSelector< FF > & gate_selector_for (GateKind kind)
 Reference to this block's selector for kind; aborts if the block does not own it. For cross-block reads, use read_gate_selector instead.
 
void set_gate_selector (const FF &value)
 Append a row writing value to every gate-selector this block owns. To activate one specific kind on a multi-kind block, use the kind-explicit overload below.
 
void set_gate_selector (GateKind kind, const FF &value)
 Append a row activating one gate kind. Writes value to the selector for kind and 0 to all other owned-kind selectors, keeping all gate selectors the same length.
 
RefVector< Selector< FF > > get_selectors ()
 All selectors of this block: 7 non-gate followed by the owned gate selectors.
 
void free_data ()
 Release wire and selector memory. Caches block size so size() still works.
 
void populate_wires (const uint32_t &idx_1, const uint32_t &idx_2, const uint32_t &idx_3, const uint32_t &idx_4)
 
auto & w_l ()
 
auto & w_r ()
 
auto & w_o ()
 
auto & w_4 ()
 
Selector< FF > & q_m ()
 
Selector< FF > & q_c ()
 
Selector< FF > & q_1 ()
 
Selector< FF > & q_2 ()
 
Selector< FF > & q_3 ()
 
Selector< FF > & q_4 ()
 
Selector< FF > & q_5 ()
 

Public Attributes

Wires wires
 
size_t cached_size_ = 0
 
bool data_freed_ = false
 
uint32_t trace_offset_ = std::numeric_limits<uint32_t>::max()
 
std::array< SlabVectorSelector< FF >, 7 > non_gate_selectors
 
std::vector< std::pair< GateKind, SlabVectorSelector< FF > > > gate_selectors
 

Static Public Attributes

static constexpr size_t NUM_WIRES = NUM_WIRES_
 

Detailed Description

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

Basic structure for storing gate data in a builder. Holds wires, the 7 non-gate selectors present on every block, and a variable-length list of (GateKind, Selector) pairs identifying the gate selectors this block owns.

Definition at line 184 of file execution_trace_block.hpp.

Member Typedef Documentation

◆ SelectorType

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

Definition at line 188 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 190 of file execution_trace_block.hpp.

◆ WireType

template<typename FF , size_t NUM_WIRES_>
using bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::WireType = std::vector<uint32_t>

Definition at line 189 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 197 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_ > &  )
default

◆ ExecutionTraceBlock() [4/4]

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

◆ ~ExecutionTraceBlock()

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

Member Function Documentation

◆ free_data()

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

Release wire and selector memory. Caches block size so size() still works.

Called after trace data has been copied to prover polynomials.

Definition at line 316 of file execution_trace_block.hpp.

◆ gate_selector_for()

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

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

Definition at line 250 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: 7 non-gate followed by the owned gate selectors.

Definition at line 286 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_ > &  )
default

◆ operator=() [2/2]

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

◆ operator==()

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

◆ populate_wires()

template<typename FF , size_t NUM_WIRES_>
void bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::populate_wires ( const uint32_t &  idx_1,
const uint32_t &  idx_2,
const uint32_t &  idx_3,
const uint32_t &  idx_4 
)
inline

Definition at line 332 of file execution_trace_block.hpp.

◆ q_1()

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

Definition at line 351 of file execution_trace_block.hpp.

◆ q_2()

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

Definition at line 352 of file execution_trace_block.hpp.

◆ q_3()

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

Definition at line 353 of file execution_trace_block.hpp.

◆ q_4()

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

Definition at line 354 of file execution_trace_block.hpp.

◆ q_5()

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

Definition at line 355 of file execution_trace_block.hpp.

◆ q_c()

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

Definition at line 350 of file execution_trace_block.hpp.

◆ q_m()

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

Definition at line 349 of file execution_trace_block.hpp.

◆ set_gate_selector() [1/2]

template<typename FF , size_t NUM_WIRES_>
void bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::set_gate_selector ( const FF value)
inline

Append a row writing value to every gate-selector this block owns. To activate one specific kind on a multi-kind block, use the kind-explicit overload below.

Definition at line 265 of file execution_trace_block.hpp.

◆ set_gate_selector() [2/2]

template<typename FF , size_t NUM_WIRES_>
void bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::set_gate_selector ( GateKind  kind,
const FF value 
)
inline

Append a row activating one gate kind. Writes value to the selector for kind and 0 to all other owned-kind selectors, keeping all gate selectors the same length.

Definition at line 276 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 244 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 240 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 233 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 218 of file execution_trace_block.hpp.

◆ w_4()

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

Definition at line 347 of file execution_trace_block.hpp.

◆ w_l()

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

Definition at line 344 of file execution_trace_block.hpp.

◆ w_o()

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

Definition at line 346 of file execution_trace_block.hpp.

◆ w_r()

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

Definition at line 345 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 229 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 230 of file execution_trace_block.hpp.

◆ gate_selectors

template<typename FF , size_t NUM_WIRES_>
std::vector<std::pair<GateKind, SlabVectorSelector<FF> > > bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::gate_selectors

Definition at line 359 of file execution_trace_block.hpp.

◆ non_gate_selectors

template<typename FF , size_t NUM_WIRES_>
std::array<SlabVectorSelector<FF>, 7> bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::non_gate_selectors

Definition at line 357 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 186 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 231 of file execution_trace_block.hpp.

◆ wires

template<typename FF , size_t NUM_WIRES_>
Wires bb::ExecutionTraceBlock< FF, NUM_WIRES_ >::wires

Definition at line 228 of file execution_trace_block.hpp.


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